读不到电池容量
你好,ti工程师
我根据论坛的电量检测帖子,做如下处理:
//我是P0_0检测
P0SEL = 0x01;
P0DIR = 0xFD;
P1 = 0;
.........
if ( events & KFD_BATTERY_CHECK_EVT )
{
HCI_EXT_MapPmIoPortCmd( HCI_EXT_PM_IO_PORT_NONE, HCI_EXT_PM_IO_PORT_PIN0 );//我是P0_0检测
//Set P0.0 to low
P0 &= 0xFE;
#endif
// Restart timer
if ( BATTERY_CHECK_PERIOD )
{
osal_start_timerEx( keyfobapp_TaskID, KFD_BATTERY_CHECK_EVT, BATTERY_CHECK_PERIOD );
}
// perform battery level check
level = battMeasure();
//Set P0.0 to high
P0 |= 0x01;
// Enable stack to toggle bypass control on TPS62730 (DC/DC converter)
HCI_EXT_MapPmIoPortCmd( HCI_EXT_PM_IO_PORT_P0, HCI_EXT_PM_IO_PORT_PIN0 );//我是P0_0检测
return (events ^ KFD_BATTERY_CHECK_EVT);
}
外部电阻分压!是用2m,3m欧姆,
P0_0电压测量1.1v
level = battMeasure();测试不到电量
谢谢!
lincoln