Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

interfacing keyboard to pic-16f877a

Status
Not open for further replies.

laxmid

New Member
how to interfacing keyboard to pic-16f877a?

n do u have any idea about 2-uart microcontroller?


Thanx.
 

Number17

New Member
how to interfacing keyboard to pic-16f877a?

A keyboard uses a PS2 interface. Look at microC's library. They have a built in PS2 library to use.

Look at this page for lots more info:
Interfacing the PC's Keyboard.

n do u have any idea about 2-uart microcontroller?

Instead of buying a new pic. Use software UART
 

laxmid

New Member
How read the data from keyboard?

i wrote the code this is not wotking fine. plz check n let me know

N i have PS2_key_data to RC2
n PS2_key_clock to RC3

unsigned char readkey()
{


PS2_key_clock =1; //by default when idle state
PS2_key_data = 1; //by default when idle state

while((PS2_key_clock == 1)); ///ideal state

for(i = 0; i <9; i++) /// For Key Press
{
while(PS2_key_clock == 0); //leave start bit
while(PS2_key_clock == 1); //data change

if(i < 8)
{

val|=PS2_key_data;
if(i < 7)
{
val = (val << 1);
}
}
}


return val;
}


Scan code for '1' is 0x16. But i am getting value as 0x68.

Thanx.
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top