Hello my name is Chris and i have a problem interfacing a 16 digit keypad with AT89C51AC2 and a 2*16 LCD.
Here's the thing:
I want to appear on the LCD the message "alarm off" and if i press the " * " button to appear on LCD the message " ENTER NEW PASS1 " and if i press the " # " button to appear the message " ENTER NEW PASS2 " .
i have made 3 .a51 files and added the to my project. I attach the assembly code i used and the schematic diagram to connect the lcd with 8051. The 16 digit keypad is connected to P2 port withoun any pull down or up resistors.
I use the AT89C51AC2 microcontroller and the Archimedes μVision2 compiler. The 16 digit keypad is the same with the one on this picture
http://images.quickblogcast.com/0/7/...adbd_small.JPG
I connected the keypad to P2 port as in the attached screenshot.
If no key is pressed the reading of Px.0 to Px.3 gives 1, due to the pull up resistors that are connected internally to Vcc in all ports except P0. If we give 1 to columns Px.4 to Px.7, the reading of the lines will give 1 either the keys are pressed or not. But we can scan the keys of a column by reading the lines (rows), if we send 0 to that column and 1 to theo other columns. From the junction of the column that we have send 0 with the row that it has been scanned the 0, we can locate the pressed key.
The programm appears on the lcd the text "ALARM OFF" and does nothing when i press any buton of the keypad.
I believe that it is a problem either in the keypad scan routine or the main program.
I' d also like to ask if we connect the 17-32 pins of the LCD as we would connect the pin 1-16, what will happen. What are there for these pins since we need only 1-16 to interface lcd with a microcontroller?
Can anyone help?
Here's the thing:
I want to appear on the LCD the message "alarm off" and if i press the " * " button to appear on LCD the message " ENTER NEW PASS1 " and if i press the " # " button to appear the message " ENTER NEW PASS2 " .
i have made 3 .a51 files and added the to my project. I attach the assembly code i used and the schematic diagram to connect the lcd with 8051. The 16 digit keypad is connected to P2 port withoun any pull down or up resistors.
I use the AT89C51AC2 microcontroller and the Archimedes μVision2 compiler. The 16 digit keypad is the same with the one on this picture
http://images.quickblogcast.com/0/7/...adbd_small.JPG
I connected the keypad to P2 port as in the attached screenshot.
If no key is pressed the reading of Px.0 to Px.3 gives 1, due to the pull up resistors that are connected internally to Vcc in all ports except P0. If we give 1 to columns Px.4 to Px.7, the reading of the lines will give 1 either the keys are pressed or not. But we can scan the keys of a column by reading the lines (rows), if we send 0 to that column and 1 to theo other columns. From the junction of the column that we have send 0 with the row that it has been scanned the 0, we can locate the pressed key.
The programm appears on the lcd the text "ALARM OFF" and does nothing when i press any buton of the keypad.
I believe that it is a problem either in the keypad scan routine or the main program.
I' d also like to ask if we connect the 17-32 pins of the LCD as we would connect the pin 1-16, what will happen. What are there for these pins since we need only 1-16 to interface lcd with a microcontroller?
Can anyone help?
Attachments
-
171.7 KB Views: 51
-
173.9 KB Views: 57
-
9.9 KB Views: 40