TI中文支持网
TI专业的中文技术问题搜集分享网站

为了降低功耗 需要修改CC1310的引脚初始化配置吗?

我看到一个条这样的描述  “”“前面提到睡眠之前,关闭外部器件,你以为这样就可以了,其实未必。如果某些引脚接了外部上拉电阻,而MCU睡眠时该引脚置低,这样一来,有压差,有电阻,就形成了不必要的功耗。这点容易被忽略,所以各个引脚一定要根据外部电路合理配置。”

也就是芯片IO需要正确的配置才能更省电,我翻阅了代码,在调用PIN_open的时候是执行的更新功能,将之前的所以配置读取出来,然后修改需要修改的部分,再写入进去,PIN_close 则是还原到默认配置 . 其中open调用的是下列函数: 

tatic void PINCC26XX_setIoCfg(PIN_Config updateMask, PIN_Config pinCfg) {uint32_t tmpConfig;PIN_Id pinId = PIN_ID(pinCfg);bool invertChanges;if (pinCfg & PIN_GEN) {// Translate from device-independent to device-specific PIN_Config valuespinCfg ^= PIN_GEN | PIN_BM_INPUT_EN | PIN_BM_PULLING;}// Get existing IOCFG, determine whether inversion changes, mask away what will be updatedtmpConfig = HWREG(IOC_BASE + IOC_O_IOCFG0 + 4 * pinId);invertChanges = (tmpConfig ^ pinCfg) & updateMask & PINCC26XX_INV_INOUT;tmpConfig &= ~updateMask;// Insert what we want to update, possibly revert IRQ edges, write back to IOCFGtmpConfig |= (pinCfg & updateMask & PINCC26XX_BM_IOCFG);if ((updateMask & PINCC26XX_BM_IRQ) == PINCC26XX_BM_IRQ && (tmpConfig & PINCC26XX_INV_INOUT) == 0) {// We're changing IRQ options but inversion will not be enabled -> keep IRQ options} else if ((updateMask & PINCC26XX_BM_IRQ) == 0 && !invertChanges) {// We're not changing IRQ options and inversion remains unchanged -> keep IRQ options} else {// We're updating IRQ options and inversion will be enabled, OR// we're not updating IRQ options but inversion settings change// -> e-onlyswitch (tmpConfig & PINCC26XX_BM_IRQ) {case PINCC26XX_IRQ_POSEDGE:tmpConfig &= ~PINCC26XX_BM_IRQ;tmpConfig |= PINCC26XX_IRQ_NEGEDGE;break;case PINCC26XX_IRQ_NEGEDGE:tmpConfig &= ~PINCC26XX_BM_IRQ;tmpConfig |= PINCC26XX_IRQ_POSEDGE;break;default:break;}}HWREG(IOC_BASE + IOC_O_IOCFG0 + 4 * pinId) = tmpConfig;// Update GPIO output value and enable depending on previous output mode (enabled or disabled){bool outputEnabled = (HWREG(GPIO_BASE + GPIO_O_DOE31_0) & (1 << pinId)) ? true : false;if(!outputEnabled) {if (updateMask & PINCC26XX_BM_GPIO_OUTPUT_VAL) {// Set GPIO output valueHWREGB(GPIO_BASE + GPIO_O_DOUT3_0 + pinId) = (pinCfg & PINCC26XX_BM_GPIO_OUTPUT_VAL) ? 1 : 0;}}if (updateMask & PINCC26XX_BM_GPIO_OUTPUT_EN) {// Set GPIO output enableuint32_t key = HwiP_disable();HWREG(GPIO_BASE + GPIO_O_DOE31_0) =(HWREG(GPIO_BASE + GPIO_O_DOE31_0) & ~(1 << pinId)) |((pinCfg&PINCC26XX_BM_GPIO_OUTPUT_EN) ? (1 << pinId) : 0);HwiP_restore(key);}if(outputEnabled) {if (updateMask & PINCC26XX_BM_GPIO_OUTPUT_VAL) {// Set GPIO output valueHWREGB(GPIO_BASE + GPIO_O_DOUT3_0 + pinId) = (pinCfg & PINCC26XX_BM_GPIO_OUTPUT_VAL) ? 1 : 0;}}}
}

请问,这个芯片的默认引脚配置是最省电的么,如果不是的话,是否需要自己针对每一个引脚来进行电平配置呢? 谢谢

da qin zheng sheng:

进入低功耗模式io口保持原来状态不会改变的!

Viki Shi:

By default, the I/O driver (output) and input buffer (input) are disabled (tri-state mode) at power on or reset, and thus the I/O pin can safely be left unconnected (floating).

If the I/O pin is placed in the tri-state condition and connected to a node with a different voltage potential; there might be a small leakage current going through the pin. The same applies to an I/O pin configured as input, where the pin is connected to a voltage source (for example VDD / 2). The input is then an undefined value of either 0 or 1.

user4820439:

回复 Viki Shi:

请问将空闲引脚配置成这样能够更加省电么?

IOID_2 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW| PIN_NOPULL | PIN_DRVSTR_MIN

赞(0)
未经允许不得转载:TI中文支持网 » 为了降低功耗 需要修改CC1310的引脚初始化配置吗?
分享到: 更多 (0)