Forgive me if this is a dumb question - I’m pretty new to this newfangled hardware trickery.
I’m trying to get a PS/2 keyboard working with my Panda II. Originally I was using interrupts in C# but it appears they’re too slow, so I’m now developing an RLP module for it.
PS/2 uses a “packet” size of 11 bits - so I should see 11 interrupts with the following whenever I press down on a key (and then multiples of 11 on releasing the key etc):
Weird thing is, I seem to get exactly 6 interrupts per packet. I’ve tried with two keyboards and it does exactly the same thing - 6 interrupts per packet. (I made the ISR simply increase a counter and added a function to retrieve the counter value.)
Start simple, enable a pin with interrupt edge low and then your ISR will only contain variable++
Then there is another RLP to read “variable”
If it doesn’t work then do this:
enable interrupt on the clock pin
once inside the ISR, stay there to read all 11 bits
exit ISR
Note that you are reading a clock that is changing every about 30 microsoceonds so you should read the pin directly instead of using RLP extensions. Make a pin input and ready inside C# but then read the pin directly from the processor.
my_pin = (IOxPIN&(1<<pin)>0);// x is the port and pin is the pin on that port. You need the schematics to determine the port/pin that is related to the NETMF IO you are using.
==================
Another option?
Open SPI in 11 bit more in RLP and let the hardware take care of everything.
=================
Another option?
You will have to buy me a beer first
Unfortunately, even if I just have the ISR do a variable++ and read it out in the code, I only appear to be getting 6 IRQs. I tried reading all 11 bits inside the ISR but I think I don’t understand enough about what I’m doing yet; this is my first foray into the world of hardware programming (I’m a C# web applications developer by trade). I will continue to read and poke and hopefully not burn myself with solder too much until I get it. If nothing else, it’s good fun, and I’m learning things I never knew about microprocessors!
Thanks again for all your help, it’s much appreciated - if I lived close enough, I would definitely be buying you beer!