Has anyone here used pin change interrupts successfully?
I've read these links, which are pretty helpful. http://www.arduino.cc/playground/Main/PinChangeInt http://www.arduino.cc/playground/Main/PcInt
and sections 12-13 of the Atmel data sheet for the ATMEGA328.
The reason I am considering using them are-
the Arduino in my project is monitoring 5 digital input lines from the hardware being tested.
These lines are fed into several OR gates on my Arduino breakout board. The output of the last OR gate eventually feeds into INT0 on the Arduino.
Additionally, each of the 5 signals are also fed into separate digital input pins on the Arduino, in order to know which pin caused the interrupt. By design, the hardware being monitored by the Arduino won't assert more than 1 signal at a time.
All of the inputs on the OR gates have been used. In order for the Arduino to monitor more signals, I would need to use more OR gates.
As an alternative to using more OR gates, I thought I'd investigate PCINT. Since all of the signals being monitored will have the same interrupt handler, I just need to know how to find out which pin caused the interrupt. It looks like using the PCINT method, you can only define 3 ISRs.
In my current setup, my ISR disables interrupts, then reads PIND using direct port manipulation, for the fastest response. The signals that the Arduino is monitoring generally last for 10-50ms, so it's unlikely they would be gone by the time the ISR is called.
Looking at the data sheet for the 328, I could not find a register which would tell me which signal caused the PCINT. Is there one, or do I just need to read PINx (where x is C or D)?
I would expect the PCINT lines to be latched and able to be read later.
I'm trying to learn how to use Eagle so that I can draw a schematic. If I had one finished, I would post it to make it easier to see what I'm doing.