On Thu, 4 Jul 2002, Ruben J=F6nsson wrote: >I am sharing LCD I/O pins with inputs from key switches on an SX >chip. The keys can only pull down an input through diodes when >it's common connection is set low by an output (key enable) and >the internal clamping resistors are used to pull the line high >when the switch is open. > >One problem I had with this was that it sems that the LCD I/O >pins has a pretty high capacitance. If I read the keys right >after I had written a zero to the LCD input and the key switch >on the same line is open, the clamping resistors was sometimes >too weak to pull the (now input) line high quick enough. This >resulted in that the switch would sometimes be read as closed >even though it was open. The solution was simple though - write >a one to the I/O line for a short time, just before the keys are >read. It took a while to debug since LCD updates (writes) is not >synchronized with key switch reads. ;-) the 8051 does this in hardware on each IO pin in certain ports. You have to limit the current though, or you can glitch the power supply of the CPU on high output capability chips like PICs. The 8051 does not have this problem (sources only a few mA per output). Peter -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads