chipKIT® Development Platform

Inspired by Arduino™

unsigned char Serial.Interrupt(void)

Created Mon, 04 Aug 2014 17:53:05 +0000 by dferasmus


dferasmus

Mon, 04 Aug 2014 17:53:05 +0000

Good day

I am implementing a data logger and have used majenko's RTCC library for timing with sleep for battery operation;

[url]http://www.chipkit.net/forum/viewtopic.php?f=6&t=2989[/url]

I would like to add serial functionality for data retrieval... However it appears that Serial is not interrupt driven? So communication on the serial port does not wake the processor from sleep.

Am I able to attachInterrupt(0, UARTISR, RX); ? And then leave the interrupt function empty?

Or do I need to write it on a lower level? I would like to use built in / supported functions and libraries.

Thanks dferasmus


majenko

Mon, 04 Aug 2014 18:11:46 +0000

Serial reception is interrupt driven.

However, the serial peripheral itself may be disabled while you are asleep. If you are in full sleep mode then the main oscillator won't be running, which means the serial baud rate generator won't be running, which means the UART won't be able to receive any data.


dferasmus

Mon, 04 Aug 2014 18:43:40 +0000

majenko

Ouch. Ok, thanks, that makes sense.

Ill have a look at what I can do to get around this: connection to a PC serial port seems to reset the unit (RTS / DTS ? ) so I might implement a delay before sleep that will allow serial communication for a short while after connection to a PC.

Thanks dferasmus