:   Remember me     or  register yourself!
Advertisement
Home  arrow  Circuits  arrow  Microcontrollers  arrow  AVR 2x16 LCD and 4x4 keypad driver
AVR 2x16 LCD and 4x4 keypad driver

Description
A very simple circuit to experiment with AT90S2313, 2x16 LCD display and 4x4 keypad. The clock based on 4 MHz crystal, but you can use anyone crystal between 1-4 MHz. The keys with the name "A", "B" ... "F" are typed to the LCD with numbers 10-16.

Because the AVR have only 15 I/O pins we are working the LCD display with 4-bit databus. The 4 resistors (10K) are to protect the AVR from the shortcuts as the coloumn of the keypad is change.

I make the source code with a simple form, that its mean I don't make any economy to the memory, to understand the beginner how does the circuit its working.

How this is works

The AVR configure the PortB as PB0-PB3 inputs and PB4-PB7 outputs. At the firt, the AVR put the pin PB4 at logic '0' to enable the column1 (the first 4 keys) and reading the state of the keys. If we have pressed any of the 4 firt keys then the AVR send the number of the key to the LCD display. If we have not pressed any of 4 first keys, theAVR put the PB4 at logic '1' and PB5 at logic '0' to enable the 2th column. Reading the state of the keys and display the resault to LCD, etc, until to read the 16th key. After that, the circuit start again to read from the 1st key (1st column) .

The schematic, hex and source code can be found in lcd&keys.zip

Copyright Serasidis Vasilis (http://www.serasidis.gr/)

Partlist
1 x AT90S2313
1 x 2x16 LCD display
1 x 4x4 keypad
4 x 10kOhm resitor
1 x 4Mhz Crystal
2 x 22 pF condensator

Files
Posted by Jospfh at Feb 28 2006 23:35
Leave a comment
If you have a question please go to the Forum and post your question there.

Name
Required
Mail
Required but not shown
Code

Please enter the code
  code
Comment
Please enter your comment.