电工基础知识_电工技术-电工最常见电路移动版

电工基础主页 > 电工电子

cc1101低功耗设计方案 CC1101收发驱动程序(2)


  就在关键时刻,芯片原厂火种送炭,送来急需的技术支持资料,一个包含低功耗源代码,赶紧拿过来测试,先研读下代码,使用的是STOP模式,而不是待机模式,使用的是任意外部中断唤醒,功耗低制40uA,这个时候就相当激动啊,赶快下载测试啊,结果功耗确实降了,但还是有1mA,更人家一比多了几十倍啊。。。

  我第一反应是硬件不对,经过测试修改,首先找到第一个原因,读卡芯片RESET管脚上拉电阻又给焊上去了。。.,拆掉后功耗骤降到几百uA,还是不行。。 测试过程中,为了去掉LDO的干扰,整板采用3.3V供电,但是后面经过测试,LDO的功耗其实也只有5uA不到,这LDO功耗值得赞一个;虽然结果还是没达到预期,但是看到了希望,胜利就在眼前啊。

  为此我反复看了技术支持提供的程序,发现他们的STM32的所有管脚都的设置都有所考究:(因为公司保密原则,代码中删除掉了关于该读卡芯片的前缀信息等)

  GPIO_InitTypeDef GPIO_InitStructure;

  /* GPIOA Periph clock enable */

  RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);

  /* GPIOB Periph clock enable */

  RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE);

  /* GPIOC Periph clock enable */

  //RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC, ENABLE);

  RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR, ENABLE);

  RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO, ENABLE);

  //####################################################

  //USART1 Port Set

  //TXD

  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9;

  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;

  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;

  GPIO_Init(GPIOA, &GPIO_InitStructure);

  //RXD

  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10;

  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;

  GPIO_Init(GPIOA, &GPIO_InitStructure);

  //RST output pushpull mode

  GPIO_InitStructure.GPIO_Pin = TRST;

  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;

  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;

  GPIO_Init(PORT1, &GPIO_InitStructure);

  //IRQ input pull-up mode

  GPIO_InitStructure.GPIO_Pin = TIRQ;

  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;

  GPIO_Init(PORT1, &GPIO_InitStructure);

  //MISO input pull-up mode

  GPIO_InitStructure.GPIO_Pin = MISO;

  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;

  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING; (责任编辑:admin)

相关文章