I would use as many interrupt ports as possible, then you don’t need to do polling.
Depending what else is connected to your cobra, there might be 20 interrupt capable pins.
Reacting within 0,5 sec, should not be a problem then, even without RLP.
@ Larry1 -
I would consider a button matrix 4x5 so you can use 4 output and 5 input with a loop that can be done in .NET, I don’t think you will need RLP.
I also think that a normal managed loop should be able to do it.
20 inputs in 500 ms means 25ms per button. That should be more than enough.
Just do all memory allocations in advance and store everything in static fields. By this GC does not interrupt you.
dobova’s idea is the best solution. You can use 4 interrupt inputs and set the 5 outputs so that when a button is pressed, it generates an interrupt and then you simple do a scan to find the button.
Fast and efficient and no polling required.
This can also detect multiple presses at the same time.