Open kbastronomics opened 1 year ago
Is this a breaking bug that prevent the AMPCD from working at all, or is it an enhancement to reduce overhead on the AMPCD?
This prevents it from working as designed. It can be coded around.
The intent of the IRQ pin was to prevent the need to use polling of the buttons and instead the IRQ pins would let you know a button was pressed then you go check for which one.
Instead we'll have to POLL which means constantly checking for a button press and if found update DCS-BIOS
Perfect, thank you. I'll save this one for the next major revision of the PCB in the future then. :)
The current code's work around is to set IRQ pinmode to OUTPUT, which allows users to connect the IRQ pin according to the interconnect. An alternative workaround is to disconnect the IRQ pin connection on the controller PCB, then one could set the IRQ pinmode to INPUT.
Either way IRQ logic cannot be used until the hardware is updated. Though in practice DDI/AMPCDs do not appear to suffer any slowness / unresponsiveness caused by polling the 20 softkeys each loop.
Need to identify why this happens and I suspect it's a issue on the DDI/AMPCD keyboard side not the controller side. even if the pin is connected, we should not need to change to output so there is a hardware issue not just the IRQ pin on the controller side needs to be on a IRQ capable pin.
IRQ's are about responding to events vs polling and either we do it everywhere or do it no-where
We should not use them in some places and not in others, this is a code consistency item.
The UFC for example does not show this same symptom. even with the AP Keypad attached.
Aside from the UFC using an ESP32, the sample code from scuba also attaches the IRQ pin to use interrupt logic.
Summary:
The AMPCD Controller board is designed to use the IRQ pin of the TCA9554PWR to let us know when a switch is pressed, the PIN on the PRO-Micro though it's connected to is not IRQ Capable.
Expected Results/How It Should Work:
IRQ routine would be written so that when the any button is pressed a Interrupt is triggered and the software can read the TCA9554 to see which one it was.
Actual Results/How It Does Work:
Since the D6/A7 Pin is not IRQ capable you can not use a interrupt route and must poll the switches. Swapping PINS D6 with D8 would resolve this issue which also allows use of Pin Change Capture IRQ there would be no impact functionality but is a board change
Screenshots:
From the AMPCD COntroller showing the IRQ Pin.
From the PIN OUT of the PRO-Micro show that D6/A7 is not a IRQ capable pin
And from the datasheet
More Information
Category:
Check one or more items.
Type:
Check one item.
Applicable End Item:
Check one item.
Associated Filename(s):
ddi_ampcd_controller