I have managed to get a consistent 10 bit conversion using AN512, but there is obviously a trade off with conversion time against resolution. The other issue is detecting multiple keypresses which may be tricky, but may not be important in a lot of applications. Damn, you've got me all interested now. Hmmm...where did I put MPLAB? Regards Mike Rigby-Jones mrjones@nortelnetworks.com P.S. I've been getting 2 bounces for every posting irrespective of where my reply goes, top, bottom or both. > Haven't tried it, but it should be easy enough to set the resistors like > this: > Suppose you have 15 keys. Set the voltages to values like > 18h > 28h > . > . > . > E8h > F8h > > By ignoring the lower 4 bits, tolerance to drift should be quite > reasonable. > I'm not sure about the reliability of the AD conversion in AN512, but > maybe it's > not a problem to use just 3 bits of tolerance, allowing for 31 keys... > 14h,24h,...,1Ch,2Ch,...,E4h,F4h,...,ECh,FCh > > What do you think? > Anyone wants to sort out the resistors? 8) > > Nuno Pedrosa. > > Michael Rigby-Jones wrote: > > > > Neat idea. However, by losing the LM317 and using the keypad and > resitors > > with the single slope converter in AN512 (Microchip App Note), the > method > > could be used on low end parts without an AD converter with just a small > > software overhead. I suspect you wouldn't even need the reference > resistor > > described in the app note, simplifying things even more. > > > > A nice compact routine that chooses the closest value in a lookup table > > would be nice, to allow for drift etc. My asm is not great so I'll > leave > > that to the rest of the gurus on here. > > -- > ---- ~~~~~~~ ------- Nuno Filipe Freitas Pedrosa > -- ~~~~ ~~ ----- SIEMENS S.A. Portugal TEL: +351 1 4242454 > - ~~~~ ~~ ---- mailto:Nuno.Pedrosa@oen.siemens.de > - ~~~~ ~~ ---- "MSWindows - Best run on a SlideShow" > ======================================================================= >