协议栈:mesh1.0
芯片:CC2530
热释电传感器输出脚通过10k电阻接P06(检测到有人输出高电平,无人低电平),P06在hal_key.c中进行设置,开启中断。
现发现低功耗时,热释电传感器输出低电平功耗160uA,高电平功耗18ua。一直在来回转换。
目前我们的需求是,一分钟内检测到中断产生,便关闭中断,避免频繁的唤醒带来功耗增加。
可是现在关闭中断,也会发生上述的情况。
请问该如何做才能避免热释电传感器高低电平的变化而带来功耗异常。
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
协议栈:mesh1.0
芯片:CC2530
热释电传感器输出脚通过10k电阻接P06(检测到有人输出高电平,无人低电平),P06在hal_key.c中进行设置,开启中断。
现发现低功耗时,热释电传感器输出低电平功耗160uA,高电平功耗18ua。一直在来回转换。
目前我们的需求是,一分钟内检测到中断产生,便关闭中断,避免频繁的唤醒带来功耗增加。
可是现在关闭中断,也会发生上述的情况。
请问该如何做才能避免热释电传感器高低电平的变化而带来功耗异常。
在hal_key中,你的传感器只需要给我们的中断一个电平去触发中断并作相应的处理。
你应该做一个自己逻辑处理程序。去做定时器任务。
/**************************************************************************************************
* @fn HalKeyConfig
*
* @brief Configure the Key serivce
*
* @param interruptEnable - TRUE/FALSE, enable/disable interrupt
* cback - pointer to the CallBack function
*
* @return None
**************************************************************************************************/
void HalKeyConfig (bool interruptEnable, halKeyCBack_t cback)
此外这不是异常功耗,你触发中断当然会处理中断。
是这么设置的
hal_key.c
#define HAL_KEY_SW_7_PORT P0
#define HAL_KEY_SW_7_BIT BV(6)
#define HAL_KEY_SW_7_SEL P0SEL
#define HAL_KEY_SW_7_DIR P0DIR
/* edge interrupt */
#define HAL_KEY_SW_7_EDGEBIT BV(0)
#define HAL_KEY_SW_7_EDGE HAL_KEY_RISING_EDGE
/* SW_7 interrupts */
#define HAL_KEY_SW_7_IEN IEN1 /* CPU interrupt mask register */
#define HAL_KEY_SW_7_IENBIT BV(5) /* Mask bit for all of Port_0 */
#define HAL_KEY_SW_7_ICTL P0IEN /* Port Interrupt Control register */
#define HAL_KEY_SW_7_ICTLBIT BV(6) /* P0IEN - P0.6 enable/disable bit */
#define HAL_KEY_SW_7_PXIFG P0IFG /* Interrupt flag at source */
hal_board_cfg.h
#define PUSH3_BV BV(6)
#define PUSH3_SBIT P0_6
#define PUSH3_POLARITY ACTIVE_HIGH
还有请问您一下。如果设置为普通IO,输入,该选择三态还是上下拉。