- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We have to develop PS/2 keyboard using PSOC 4 controller. In that can we use SPI or UART block to communicate to PC PS/2 port.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Since this is the data frame format of PS/2,
A data frame is made of 11 or 12 bits (depending on data direction):
- a start bit (always low)
- 8 data bits, LSB first
- a odd parity bit
- a stop bit (always high)
- an acknowledge bit (the device pulls the data line low when transmitting from host to device)
Using SPI or UART would not be compatible.
The easiest way to read data sent from a PS/2 keyboard is to use external interrupts. All microcontrollers allow to trigger an interrupt when a specific event occurs on an external pin and most of them have a dedicated external interrupt controller. During device to host communication the host samples the data line when the clock is low, so it’s easy to set up a trigger when the pin connected to the clock line goes low and read the scan code from the keyboard.
Regards
Alakananda
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Since this is the data frame format of PS/2,
A data frame is made of 11 or 12 bits (depending on data direction):
- a start bit (always low)
- 8 data bits, LSB first
- a odd parity bit
- a stop bit (always high)
- an acknowledge bit (the device pulls the data line low when transmitting from host to device)
Using SPI or UART would not be compatible.
The easiest way to read data sent from a PS/2 keyboard is to use external interrupts. All microcontrollers allow to trigger an interrupt when a specific event occurs on an external pin and most of them have a dedicated external interrupt controller. During device to host communication the host samples the data line when the clock is low, so it’s easy to set up a trigger when the pin connected to the clock line goes low and read the scan code from the keyboard.
Regards
Alakananda