Well in short here is my problem, I’m trying to work with the PS/2 protocol but there is a hick up, I need to use an external interrupt on a pin that also handles output and the data sheet even says it’s possible how ever the interrupt also triggers when I use the pin to send data and because of PS/2 protocol I end up in an infinite loop.
Communication works over two pins like this;
(Both are held high on both ends for idle)
Device (keyboard) -> Host (Computer)
Device clock pin sets communication clock pulse, host reads Data pin on falling edge of clock.
Thats pretty straight forward however
Host -> Device
Host lowers clock pin for >100us (priority over any other communication)
Then Device sets clock pulse and device reads on rising clock.
The problem that gives an infinite loop as the interrupt required for the Host communication init of 100us+ also triggers when I use the clock to pulse when sending data.
Hope I’ve made it clear enough for people to understand, so how can I do this? One thought I have is turn off that interrupt when not in idel mode and then too poll the state of the clock pin before every time the device lower it as that span is 30-50us and therefor should catch any 100us low, but is there an easier way that I’m missing? some setting to interrupt that can ignore states set by the MCU itself?