LPC11U24: Interrupts to wake up processor from sleeping state

31 Dec 2018

Hello everyone

I mostly work with 16-bit Microchip MCUs and have worked with the TIVA Launchpad - which if I remember correctly uses an M3 Cortex MCU, but I have never worked with an Mbed development board. I am working with the Mbed LPC11U24.

I want the processor to stay in a sleeping/power-down state and wake up on the triggering of an i2C interrupt, set off by receipt of a message from an external device. I was hoping there was a way to set up this feature exactly as I want just using the API. As I understand it, I can wake the processor up from sleep/power-down with an interrupt. But I don't see where I can configure and enable/disable i2C interrupts. Is there something I am missing?

Also, if I am forced to not use the API for setup, I am struggling to figure out which document has the details of the appropriate registers and which bits within that I need to manipulate in order to set this up.

Regards

Josh

01 Oct 2019

Hi Josh,

There are two sleeping modes: Sleep and Deep Sleep. I recommended to start Sleep because it allows more ways to wake up and it has faster wake up time. If you can't use extra line for wake up interrupt then you could modify the board so that your I2C SDA line is wired also to another pin which have interrupt (p28 pin to p29). Then set the pin p29 to be fall interrupt line and enable it before sleeping. Then when the SDA line goes down ( when something is coming from I2C) interrupt will wake up the device and disable the interrupt. Some links to documents: https://os.mbed.com/docs/mbed-os/v5.14/apis/interruptin.html#interruptin-hello-world https://os.mbed.com/docs/mbed-os/v5.14/apis/i2cslave.html

Regards, Pekka