View Single Post
Old 09-05-2013, 03:49 PM   #44 (permalink)
t vago
MPGuino Supporter
 
t vago's Avatar
 
Join Date: Oct 2010
Location: Hungary
Posts: 1,807

iNXS - '10 Opel Zafira 111 Anniversary

Suzi - '02 Suzuki Swift GL
Thanks: 830
Thanked 708 Times in 456 Posts
Quote:
Originally Posted by nickdigger View Post
The voltage levels would be stored in a PROGMEM array. After the VoltageLevel-to-ButtonBit conversion has happened, the rest of the button code should work as is. Eh, except for using the PINC interrupt as a trigger. We would simply read the voltage level at every timer2-overflow ISR, to detect a level change. I guess that would nullify your Sleep Mode thing, unless it's possible to use the Analog Comparator as a trigger. This is new to me.
Well, my code really doesn't have a sleep mode, as such. The code just tells the main program when the activity timeout occurs, so that the main program displays the system clock instead of whavever screen happened to be displayed before the activity timeout occurred.

But, yah, you could position the analog read inside the master timer (timer2 overflow) interrupt. That's what my code already does, anyway, with button debouncing. The PINC interrupt says that pins changed, and the master timer handles the debouncing and long-press detection.

Quote:
Originally Posted by nickdigger View Post
Too bad this wasn't suggested and implemented from the beginning. Understandably, analog inputs and other hardware expansion were not on anyone's mind, when getting the basic Injector-Capture system working was a huge achievement in itself.
Yah, tell me about it. A few times, I wanted to mention the same thing, particularly with the LCD hardware choices that were made. Would have been nice to have stuck all of the LCD data bits onto one port, for instance; or to be able to read from the LCD hardware in addition to writing to it.
  Reply With Quote