8051 based project That can save up to 60 codes with max of 6 combination of numbers
Wed Nov 24 2010, 11:55 am
void save (unsigned char c) { if(c=='*') { if(a!=0) a--; return; } if(a==5 && c=='#') { a=0; compare(); if(t==1) { if(true==1) // if match ok { correct=0; t=2; for(d=0; d<7; d++) // on and after 10 sec off nw keypad can't get data DelayMs(1000); // max delay u can get is DelayMs(65535) otherwise need looping for big delay correct=1; z=0; a=0; // start agian from 0 location of array } } else if(t==2) { doorclose=0; t=1; for(d=0; d<5; d++) DelayMs(1000); doorclose=1; } void save (unsigned char c) { if(c=='*') { if(a!=0) a--; return; } if(a==5 && c=='#') { a=0; compare(); if(t==1) { if(true==1) // if match ok { DelayMs(800); correct=0; t=2; for(d=0; d<7; d++) // on and after 10 sec off nw keypad can't get data DelayMs(1000); // max delay u can get is DelayMs(65535) otherwise need looping for big delay correct=1; z=0; a=0; // start agian from 0 location of array } else if(true==0) goto error; }
Thus goto error above is just an additional feature?
Wed Nov 24 2010, 12:03 pm
hi onyot.josephian
u want to say monitor the pin status of 8051 to check which key is press
in normal case rows pins is 0 and columns r 1 when any key press corresponding column goes low then we high a row once at a time and see is column is low or high to check that is key press in this row or next rows
it mean code is 12345
yes keypad is connected directly to pin of controller it is ok
in this project romel use 7 seg u can use lcd too
7 seg is connected to port 3 of controller using a decoder ic
any decoder ic can be used 74ls74,74ls48 or 4511
7-seg can be directly connected to port pins without using decoder ic
in my project what is best to monitor, especially using a keypad? is it high or low?
u want to say monitor the pin status of 8051 to check which key is press
in normal case rows pins is 0 and columns r 1 when any key press corresponding column goes low then we high a row once at a time and see is column is low or high to check that is key press in this row or next rows
unsigned char code password[5]= "12345";
it mean code is 12345
Is it okay to connect my keypad directly to the pins of 8051?
yes keypad is connected directly to pin of controller it is ok
What type of display is it? seven segment or lcd?
in this project romel use 7 seg u can use lcd too
7 seg is connected to port 3 of controller using a decoder ic
any decoder ic can be used 74ls74,74ls48 or 4511
7-seg can be directly connected to port pins without using decoder ic
Wed Nov 24 2010, 12:20 pm
Ok...
Is it okay also to connect all the a,b,c,d,e,f,g,dot to 6 seven segment? (a is to a, b is to b, and so on)
And what part of the program I've posted is the 7segment initialization... It looks like, it only check the password and not displaying it, or it looks like, it is using a decoder..
Is it okay also to connect all the a,b,c,d,e,f,g,dot to 6 seven segment? (a is to a, b is to b, and so on)
And what part of the program I've posted is the 7segment initialization... It looks like, it only check the password and not displaying it, or it looks like, it is using a decoder..
[ Edited Wed Nov 24 2010, 12:23 pm ]
Wed Nov 24 2010, 12:23 pm
yes if u want to do multiplexing then connect a to a, b to b ..........g to g
leave common pin of 7-seg
in multiplexing common pin is controlled by the controller using transistors
leave common pin of 7-seg
in multiplexing common pin is controlled by the controller using transistors
Wed Nov 24 2010, 12:24 pm
how I can put a picture here? I dunno how....
[ Edited Wed Nov 24 2010, 12:25 pm ]
Wed Nov 24 2010, 12:35 pm
save pic in jpg formate
click on preview at the bottom of page
then browse to picture and then click on reply to thread
this line display on 7-seg which key press
click on preview at the bottom of page
then browse to picture and then click on reply to thread
this line display on 7-seg which key press
display=((display & 0xf0) | (displayb[rowloc][0])); // display to 7 seg
[ Edited Wed Nov 24 2010, 12:37 pm ]
Wed Nov 24 2010, 12:40 pm
Wed Nov 24 2010, 12:47 pm
I just wanna ask again, in the program, it declare the P3 as the display, then it declare P3^5 as correct, P3^4 as wrong and P3^7 as key, so where does the 7 segment be pinned?
I'm confused with this initialization....
I'm confused with this initialization....
Wed Nov 24 2010, 12:54 pm
is there anybody here that knows, a program that will automatically detect the code that I've input from keypad. example, I press 12345, then it will automatically detected by the program inside the 8051, and next is it will prompt that I should enter the number of products being produced.
Powered by e107 Forum System