PS2 Scan codes with 16F877

Status
Not open for further replies.

tiwari.sachin

New Member
Hello

I am trying to interface PS2 keyboard to 16F877. I am a bit confused with the scan code of PS2.

I have attached the file of the scan codes i have used.
This seems to work fine.

But when i searched through net for scan code, the standard scan codes seem to be different. for 'a' scan code is 0x1C but i have used 0x38. for 'b scan code is 0x32 but i have used 0x4C and so on... The scan code i have used has also been found on net.

I am confused. which one is correct format. I have this thing working but the scan codes are different.

I have also attached the code. Kindly let me know what is it that i am doing wrong. I am using a keyboard from TechCom. Are the scan codes that i am using correct.
 

Attachments

  • ps2keyboard.c
    1.3 KB · Views: 231
  • main.c
    574 bytes · Views: 211
  • ps2keyboard.h
    915 bytes · Views: 241
PS2 Scan code 2 is the standard.
Ex:
For Character "A" make code = 1C break code = F0,IC

In your code you did Keyboard to host communication?
Or Host to Keyboard communication?
 
Last edited:
Gayan Soyza.

I know there is a standard code. The table that i have was also downloaded. I will check again and see whats wrong.

As of now i am doing keyboard to host communication




PS2 Scan code 2 is the standard.
Ex:
For Character "A" make code = 1C break code = F0,IC

In your code you did Keyboard to host communication?
Or Host to Keyboard communication?
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…