View Single Post
Old 04-08-2011, 10:13 AM   #32 (permalink)
bobski
EcoModding Apprentice
 
Join Date: Jan 2010
Location: Newark, DE
Posts: 143

'91 CRX - '91 Honda CRX DX
90 day: 34.91 mpg (US)
Thanks: 0
Thanked 14 Times in 14 Posts
I thought of an alternative circuit design for the interrupt expander last night. Each input would have 1 bit of a D-latch and an XOR gate. The data input to the latch would be the signal you want to watch, and the latched output would go to one of the XOR inputs. The other XOR input would be the raw signal. That way, the XOR would go true any time the input doesn't match the data in the latch, which would trigger the interrupt. When the interrupt gets triggered, part of the routine would clock the D-latch which would make the data and input match up again. That would make the XOR go false and clear the interrupt signal until the input changes again. It's still two chips, but those two chips could serve multiple inputs. A 74HC86 quad XOR and a 74HC373 octal D-latch costs about a dollar together and would serve 4 inputs. Add another XOR chip and it would serve eight (if there were enough free pins on the Arduino).
After looking around a bit, I found some IO expanders use this same setup to drive their interrupt outputs. Using a single-chip IO expander would be nice, but they're all serial interfaced which is probably too time consuming for an interrupt routine.
  Reply With Quote