PIC 16F877 Keypad and 7 Segment Display Help

Status
Not open for further replies.

jus7ic3

New Member
Hello. I want to write a code in assembly or C. I will use PIC16F877 and it has 4x3 keypad. Also we will just activate 3 of 4 displays on 7-Segment Display.

For example : If I press number '4' , the number will be shown on display. Then if I press number '5', the number will be shown and the number '4' will be kept and passed to left display. Then if I press number '3', the number will be shown and the number '5' will be kept and passed left. The number '4' will be passed again to the left. At the end if we want to look 7 segment display, we will see the numbers like this '4 5 3'. The process will be go like this. Every number will be shown and the before kept number will be pass to left.

Anyone help?
 
Last edited:
Nigel's or my tutorials.... Check my signature... Nigel's are asm mine are C... If my tutorials ( tutorial 11 ) do not download, let me know... After the crash I may need to re-upload.
 
also some reading of microchips app. DS01146B "tips and tricks" has some useful reading including 7segments and keypads.
 
You map each of your 7 segment digits to a GPR variable in RAM. Have the display routine display what is in the GPR on the appropriate digit.

Have your keypad routine handle the shifting of the digits. So each time u enter a new debounced keypress the code shifts all digits 'left' and adds the new one into the rightmost digit's mapped GPR byte.
You should have a keypress 'clear' all the digits as well.

If your are familiar with coding, perhaps an hour or two with debugging.
 
I built my own keypad and my own keypad library. I suppose a good way to start with your project is learn how to use one or two switches (Let's say S1 and S2), and use the GPIO to simply make the PIC turn on a few red LEDs if you switch S1 on, and turn on a few green LEDs if you press S2.

Have you already understood the displays as well? Can you display 1-9 using a counter or something?

Cheers.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…