I have a working USART2 that sends 16 bytes, and waits for the buffer to be empty, which triggers an interrupt, and I continue sending bytes, on an LPC4337.
It seems to work just fine when the processor is busy, but the transmission stops as soon as it enters a sleep state, and it only continues when other interrupts wake up the processor. Is there any way to make the THRE interrupt wake up the processor?
Maybe something with the event router? I was not able to find anything on the User Manual. I tried changing the interrupt priority without luck.
Thanks in advance
Unfortunately in this MCU, this is not possible, in section 10.4 Event router inputs mention the possible interruptions that can be used but the USART is not one of them.
What you could do is to notify the MCU to wake up with one of the four wake up pins.
Sorry for the inconvenience this may cause you.
Thank you for the reply. It confused me a lot because section 7.8 Event Router of the datasheet for parts LPC435x/3x/2x/1x it says:
Remark: Any interrupt can wake up the ARM Cortex-M4 from sleep mode if enabled in the NVIC.
This is the datasheet I'm referring to:
Is the datasheet incorrect?
Thank you very much.
Trying these different ways I couldn't wake up the MCU with only the UART interruption but what you could do is connect the RX line to one of the wake-up pins.
This way would be possible to wake the MCU even in the lowest power modes, but the first byte would not be reliable.
sadly, I can't rely on something like that. What I ended up doing was to prevent going into sleep mode when there are pending USART transactions (either send or receive).
Thank you for your time,