Wednesday, 17 April 2019

embedded - Wake up MCU on UART RX data


I have several MCU's of which I cannot use the deep-sleep modes, because they cannot wake up on UART data coming in. Are there any components for sale which can solve this? I can imagine something that delays the RX line for a fraction and toggles an GPIO on data arrival, which I can use the wake up the MCU.



Answer



Any MPU with pin change interrupts should allow this. Some (MSP430 at least) can wake in a microsecond and start timing the start pulse right away. But even if your micro can't wake up fast enough, can you transmit an extra character at the start of the message to wake it up?


If you give us a clue which MCU you mean, someone might have a more appropriate suggestion.



The datasheet for the LPC11U1x says


(page 2)



Up to 8 GPIO pins can be selected as edge and level sensitive interrupt sources.



(page 14)



USART
RXD ... PIO0_18 ...




so the UART RX pin is also a GPIO pin (PIO0_18 on some packages)


(page 18)



Any GPIO pin providing a digital function can be programmed to generate an interrupt on a level, a rising or falling edge, or both.



(page 26)



The LPC11U1x can wake up from Deep-sleep mode via reset, selected GPIO pins, a watchdog timer interrupt, or an interrupt generating USB port activity.



The User Manual says (page 35)




3.5.33 Pin interrupt select registers Each of these 8 registers selects one GPIO pin from all GPIO pins on both ports as the source of a pin interrupt. To select a pin for any of the eight pin interrupts, write the pin number as 0 to 23 for pins PIO0_0 to PIO0_23



(page 38)



3.5.37 Interrupt wake-up enable register 1 This register selects which interrupts will wake the LPC11Uxx from deep-sleep and power-down modes. Interrupts selected by a one in these registers must be enabled in the NVIC (Table 58) in order to successfully wake the LPC11Uxx from deep-sleep or power-down mode



So it looks feasible. One remaining question is how fast you can get out of deep sleep in the interrupt handler and restart the UART. I'll take a wild guess and say fast enough.


No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...