Instruction executed after PSoC 3/5 wakes from Sleep/Hibernate mode

Question: What instruction will be executed first when PSoC 3/5 wakes up from sleep/hibernate mode?

 

Answer:

There are many wakeup sources for the PSoC 3/5 device like PICU, Sleep Timer, RTC etc. Refer to the TRM to know which wakeup sources are applicable for Sleep/Hibernate mode. Depending on whether Interrupts are enabled for these wakeup sources, there are two possible code execution flows when the device wakes from sleep/hibernate mode.

  1.   Wakeup source has interrupt enabled: In this case, when the device comes out of Sleep/Hibernate, the Interrupt service routine (ISR) of the wakeup source will be executed first. After the ISR execution, the CPU will start executing the next  instruction that is after the instruction where the device entered sleep/hibernate mode.
  2.   Wakeup source does not have interrupt enabled:  In this case, the CPU will start executing the next instruction that is after the instruction where the device entered sleep/hibernate mode.

For exact details of the wakeup time, please refer to the device datasheet for Power Modes Wake Up Time.