interfacing IBM keyboard with sam7x512??

Thread Starter

hassan_fastian

Joined Jan 31, 2010
4
Hi All,

I want to interface a general IBM PC keyboard with at91sam7x512 which has ARM7TDMI within it...
i have read the keyboard protocol and the problem now is:

how keyboard data and keyboard clock pins are going to be connected with at91sam7x512???
data sent by keyboard is 11 bit long including 8 data bits, while registers in at91sam7x512 are 32 bits long...how will i access them in order to run my program in sam7x512???

keyboard protocol link:
http://www.beyondlogic.org/keyboard/keybrd.htm
 

n9352527

Joined Oct 14, 2005
1,198
Connect them each to an I/O pin. Then you have to read them one by one in time. It would be a lot easier if the pins can be connected to an interrupt or interrupt on change pins. Then the program doesn't have to poll the pin constantly. Remember, the pins have to be floating when high, otherwise it won't work.

This has nothing to do with the size of register. The program doesn't read a whole port at once, but instead one bit at a time, and the results can be stored in a register, also the parity bit in an extra flag. Other bits are not necessary, they just needed to transfer the data.
 

Thread Starter

hassan_fastian

Joined Jan 31, 2010
4
i didnt get the point, what this means:
" Remember, the pins have to be floating when high, otherwise it won't work."

And i am unable to handle inturrept pins or inturrept on change pins using C...what compiler should i use??and what library i have to include???
 

n9352527

Joined Oct 14, 2005
1,198
The keyboard clock and data lines are like I2C lines, they have pull-up resistors. To set a line low, the pin has to pull it down to the ground. However to set it to high, the pin has to be in high impedance (floating) and let the pull-up bring that line high. Otherwise there would be conflict when the pin at the other end trying to pull the line low at the same time.

Aside from using interrupt, you can poll the pin. But that would be a waste of processing cycles. Especially if you are also doing a lot of other tasks, which you must do, otherwise you'd not use an AT91SAM. I have never use an AT91SAM, but I'd thought that there must be a way to handle external interrupts with that controller.
 
Last edited:
Top