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.

CC2538: How to set up a Pin as a wake up pin and set an interrupt service routine when waking up.

Part Number: CC2538
Other Parts Discussed in Thread: Z-STACK

Hello,

I am working on a project where I need to wake up my MCU when I get an interrupt from a pin and then perform an I2C read from an other MCU.  So far the way it works is that I notify the other processor of what I need to read and when its ready it pull down a pin and I service this interrupt. So far with the sleep timer when I am waiting for a response I keep the chip wake with a while loop in order to service the interrupt. I want though to wake up from the pin interrupt and perform my read in its ISR but so far I have not been able to set it as an interrupt pin and wake pin. I tried setting it up as wake up pin and then added the ISR to that pin but it did not work. I am using Zstack 1.2.2a HomeAutomation.

Thank you for your time 

Nomikos Panagiotis   

  • Hello Nomikos,

    The Z-Stack HA 1.2.2a application examples are capable of using pin interrupts but this feature is disabled by default.  Please see InitBoard from OnBoard.c and change HalKeyConfig( FALSE, NULL); to HalKeyConfig( TRUE, NULL); as well as OnboardKeyIntEnable = HAL_KEY_INTERRUPT_DISABLE; to OnboardKeyIntEnable = HAL_KEY_INTERRUPT_ENABLE; for a start.  Other key configurations are available in hal_key.c/h and hal_board_cfg.h which you can reference in order to create your own pin instances.  You should further debug your project behavior and registers to determine the root cause of issues and resolve them as they appear.

    Regards,
    Ryan