View Single Post
Old 04-02-2011, 01:56 AM   #29 (permalink)
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
Originally Posted by msc View Post
My thought on using one interrupt to capture an injector pulse is as follows. A pair of one shots are configured to trigger one on the rising edge and one on the falling edge of the injector pulse. The outputs of the two one shots feed an OR gate producing a signal that has a pulse on both edges of the injector pulse. This signal is feed to an interrupt input. The raw injector pulse is also fed into another digital input. The interrupt service routine is called for each rising and falling edge of the injector pulse and simply needs to check the state of the raw injector signal on the other input to determine what edge called the routine. This approach still requires two inputs to monitor an injector but only one interrupt per injector.
I wasn't quite following before, but I get what you're saying now. Use the interrupt as a "hey, something changed" input, then have the ISR check the various inputs to see which one it is. From there I guess it would take appropriate action, then set a variable or just a bit so it can figure out what's changed next time it's called.
For every injector (or other pulsed input) you would have a pair of one-shots outputting to that one interrupt line, and run the injector signal itself to a dedicated general purpose digital input so the ISR can check it.
  Reply With Quote