hithesh123
Full Member level 6
- Joined
- Nov 21, 2009
- Messages
- 324
- Helped
- 1
- Reputation
- 2
- Reaction score
- 1
- Trophy points
- 1,298
- Location
- lax
- Activity points
- 3,548
Need some help. I am trying to emulate PS2 keyboard protocol.
I am using open-drain pins with external pull ups to drive clock and data lines. Since the ports are open drain, when I write '1', they can become inputs.
I need a way to check when the host(PC) tries to send data to the device(keyboard). The host drives the clk low for ~100usecs, then data low and the clk high.
According to the protocol, the device has to check every 10ms(or lesser) for host request.
I was think of using timer interrupt. It's a bit tricky. I am driving both clock and data lines.
or do I check every time I drive clk high?
The Mcu is c8051F120
I am using open-drain pins with external pull ups to drive clock and data lines. Since the ports are open drain, when I write '1', they can become inputs.
I need a way to check when the host(PC) tries to send data to the device(keyboard). The host drives the clk low for ~100usecs, then data low and the clk high.
According to the protocol, the device has to check every 10ms(or lesser) for host request.
I was think of using timer interrupt. It's a bit tricky. I am driving both clock and data lines.
or do I check every time I drive clk high?
The Mcu is c8051F120