Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

key pad interfacing with microcontroller

Status
Not open for further replies.

l_hui

Newbie level 4
Joined
May 19, 2010
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
My World
Activity points
1,339
microcontroller

help help..
i m nw doing a project to connect a keypad to microcontroller..
the keypad need to pass the input to microcontroller and then output the signal to a memory control unit(MCU)..So tat MCU can knw wat to do and display a message on LCD..
Bt i dunno which microcontroller is suitable to use wwif a 4X4 keypad..
Can anybody tell me?
 

Re: microcontroller

4x4 keyboard can be connected to any controller as given by amk1971.

but why do you want to connect the output of controller
to memorycontrolunit(MCU)?

where does MCU gets interfaced?

srizbf
19thmay2010
 

Re: microcontroller

izit either a PIC16F877, AVR or 8051 suitable oso?
Wat r their difference n advantages?
 

Re: microcontroller

l_hui said:
izit either a PIC16F877, AVR or 8051 suitable oso?
Wat r their difference n advantages?

You can use any of them...
 

Re: microcontroller

l_hui said:
izit either a PIC16F877, AVR or 8051 suitable oso?
Wat r their difference n advantages?

The choice of microcontroller depends on several factor but usually one factor dominates the other and it is the availability of Tools / Compilers / Chips / help / know-how etc.
 

Re: microcontroller

I will suggest u to use the P89V51Rd2...
because it has bootloader in it so u can program it through serial port..
Considering your application it is not going beyond 4K... (i hope so)
so u can download keil demo version and use it for free for educational purpose...
This IC is also very popular and easily available in all local market...
and it is not that much expensive..
you can interface your 4X4 keypad to one port and you can use other ports to display purpose....
 

microcontroller

Pics tend to be the most popular with lots of free/demo tools, athough pretty much any current mcu will suffice. If you use any of the smaller chips, both a keyboard and display can share the same port. You can google for circuits and code examples, lots around. If you use Pics and C, then https://www.ccsinfo.com/forum/ has examples. You could also use basic, which may be easier if you are a beginner, several compilers around. Not sure if you can get demo programs like Proteus or other simulator packages. If so then you could experiment just on the PC, without actually buying anything yet.
 

I have done a program of hex keypad (4x4) for nxp 2378 ARM7 tdmi
I m sure by taking the reference of this program you can program 8051 or any mc to use this key pad



unsigned char key[4][4] = {'0','1','2','3',
'4','5','6','7',
'8','9','A','B',
'C','D','E','F'};


void delay_20ms(void)
{
unsigned int j;

for(j=0;j<=1000;j++);

}

void delay_450ms(void)
{
unsigned int i,j;

for(i=0;i<=5;i++)
for(j=0;j<=65000;j++);

}



int main()
{
unsigned char col_loc,row_loc;
//key press detectio starts
init();




while(1)
{
do
{
row =0x00000000;
col_loc=col;
col_loc &=0x0000000f;

}while(col_loc!=0x0000000f); //wait until key are released


do
{

do
{
delay_20ms();
col_loc=col;
col_loc &=0x0000000f;

}while(col_loc ==0x0000000f); //keep checking valid key press

delay_20ms();
col_loc=col;
col_loc &=0x0000000f;

}while(col_loc ==0x0000000f); //debounce chk &valid key press chk

//key identification starts

while(1)
{
row=0x0000000fe; //row 0
col_loc=col;
col_loc&=0x0000000f;

if(col_loc!=0x0000000f)

{
row_loc=0;
break;
}


row=0x000000fd; //row 1
col_loc=col;
col_loc&=0x0000000f;

if(col_loc!=0x0000000f)

{
row_loc=1;
break;
}

row=0x000000fb; //row 2
col_loc=col;
col_loc&=0x0000000f;

if(col_loc!=0x0000000f)

{
row_loc=2;
break;
}

row=0x000000f7; //row 3
col_loc=col;
col_loc&=0x000000f;

if(col_loc!=0x0000000f)

{
row_loc=3;
break;
}

}

//locate and display key scan code


if(col_loc==0x0000000e)

output=key[row_loc][0];

else if(col_loc==0x0000000d)

output=key[row_loc][1];

else if(col_loc==0x0000000b)

output=key[row_loc][2];

else

output=key[row_loc][3];

}

}
 

Are you planning to use microcontroller for only keypad interfacing?
If you have some other stuff with microcontroller just find out and than select the microcontroller.
If u want only keypad interfacing with microcontroller you can go any 20 to 28 pin microcontroller which will good.


Regards
Chanchal
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top