Jinx wrote... >> David Harris wrote... > >>CHALLENGE: can you scan a keyboard, and run an LCD >> display with only 8 pins/bits =3D 1 port -- without extra active >> hardware? > >Yes, with a 4-bit LCD (7 i/o lines needed) and a k/b matrix >of 4 rows as o/p (ie driven) and 4 columns as i/p. Flip between >port as o/p for the LCD and port as mixed i/o for the k/b. If the >4 row drivers are also the LCD data lines, the s/w should be >able to avoid any unwanted writes to the LCD because of >unwanted conditions on RS, R/W and E caused by key presses. >Might take a little work to idiot-proof but I'm sure it could be done I briefly considered an arrangement like this on one of my projects but rejected it because of three problems which appeared insoluble: =46irst is the possibility of LCD data corruption if a key happens to get pressed while an LCD write operation is in progress. =20 Second, under the same circumstances two PIC output pins will end up getting shorted together (by the depressed key) while they're both outputs, and if they are in opposite states a large I/O pin current will flow. While this probably won't damage the PIC it will cause a high drain on the power supply, which isn't acceptable in my applications. =20 The third problem is that the LCD E line can end up getting toggled during keypad scanning, leading to a false LCD write. There seemed no way to absolutely, positively prevent these three problems from occurring, so I gave up on this approach. Dave -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body