virtualdave
Well-known member
Hi all,
Interrupts have always been one of those things I wished I paid more attention to, and looks like I have a project where I need a bit of guidance.
Quick run down...reading a ~120 byte ascii stream on Serial1 @961200 baud. After reading the data the micro does a bit of processing of the data (mostly gesture analysis). All in all it takes about 5ms to read the data and process the gestures. At the same time I'm "waiting" for a message on Serial2 from a remote system asking for an update on the state of each of the gestures. When this message comes in, I need to stop whatever it is I'm doing and read/respond to the incoming message, then resume whatever it was I was doing. Sounds like a job for an interrupt, eh? Only I'm very much in the dark on how to do this, especially in the realm of a teensy3.
I would be grateful for any pointers on where to read/learn more. I've been reading as much as I can on interrupts, but not sure what's AVR specific or might/might not be applicable to an input on a hardware serial port.
Thank you in advance for any pointers!
All the best,
David
Interrupts have always been one of those things I wished I paid more attention to, and looks like I have a project where I need a bit of guidance.
Quick run down...reading a ~120 byte ascii stream on Serial1 @961200 baud. After reading the data the micro does a bit of processing of the data (mostly gesture analysis). All in all it takes about 5ms to read the data and process the gestures. At the same time I'm "waiting" for a message on Serial2 from a remote system asking for an update on the state of each of the gestures. When this message comes in, I need to stop whatever it is I'm doing and read/respond to the incoming message, then resume whatever it was I was doing. Sounds like a job for an interrupt, eh? Only I'm very much in the dark on how to do this, especially in the realm of a teensy3.
I would be grateful for any pointers on where to read/learn more. I've been reading as much as I can on interrupts, but not sure what's AVR specific or might/might not be applicable to an input on a hardware serial port.
Thank you in advance for any pointers!
All the best,
David