Page 1 of 1

Getting events from a pin change interrupt

Posted: Wed Feb 02, 2011 12:44 pm
by JetForMe
The AVR has support for pin-change interrupts. My GPS has a 1-pulse per second signal I'd like to see if I can connect to a pin, and then get an event in my app code every time that pulse occurs.

I realize I need to write an interrupt handler. I guess inside that I need to generate the event, but I need to create some kind of source, too, right?

Re: Getting events from a pin change interrupt

Posted: Wed Feb 02, 2011 12:48 pm
by Giovanni
You may use as example the serial driver interrupt handlers. In ChibiOS/RT the interrupt handlers are written in the same way on all architectures, learn once use everywhere. There is also an "how to" in the documentation that may help you.

Giovanni

Re: Getting events from a pin change interrupt

Posted: Fri Nov 14, 2014 7:28 am
by wicky
I realize I need to write an interrupt handler. I guess inside that I need to generate the event, but I need to create some kind of source, too, right?


__________________
dhoom

Re: Getting events from a pin change interrupt

Posted: Fri Nov 14, 2014 9:09 am
by Giovanni
wicky wrote:I realize I need to write an interrupt handler. I guess inside that I need to generate the event, but I need to create some kind of source, too, right?
dhoom


The object is called EventSource, you just have to initialize it and then broadcast events using it.

Giovanni