You Are Here: Home » AVR ATmega Projects » Interfacing(USB - RS232 - I2c -ISP) Projects » How to interface keypad with AVR microcontroller (ATmega16)

How to interface keypad with AVR microcontroller (ATmega16)

Keypad is most widely used input device to provide input from the outside world to the microcontroller. The keypad makes an application more users interactive.  The concept of interfacing a keypad with the ATmega16 is similar to interfacing it with any other microcontroller. The article of Interfacing keypad with 8051 can be referred for detailed description of the methodology used here. This article explains the interfacing of a 4×3 keypad with AVR microcontroller (ATmega16) and displaying the output on a LCD.

How to interface keypad with AVR microcontroller (ATmega16)

The algorithm and detailed explanation for keypad interfacing is given in above mentioned article. The brief steps to interface the keypad with AVR are written below:
1.                  Configure the row pins or column pins.
2.                  Make all output pins to low and input pins to high.
3.                  Keep monitoring the port value, where the key pad is connected.
How to interface keypad with AVR microcontroller (ATmega16) schematic
PORTD=0xF0; //set all the input to one
value=PIND; //get the PORTD value in variable “value”
if(value!=0xf0) //if any key is pressed value changed

Leave a Comment

You must be logged in to post a comment.

Read previous post:
New data provides scholars insight into foreign-policy changes during leadership transition

A new dataset from researchers at Rice University and the University of California-Berkeley will allow international relations scholars to study...

Scroll to top