The program sets an internal pull-down resistor on the EXT0 pin, so you should normally get 0 volts, and 3.2 volts only when the reed switch is connected and you bring magnet next to it.
I tried to make a version that uses other pins as input but strangely it didn’t work. The pull-down resistors seem to be activated correctly but my program receives no interrupts from pins other than EXT0.
To verify the hardware, it would be best to have a simple program that sets a pin to input mode with pulldown and then polls it continually and outputs its state to the display. You could do this for more than one, or all, the PEX inputs at the same time.
Here is a program to test EXT0-17 pins in the PEX header. It enables pull-down resistors and attaches interrupt handler to all EXT pins. The program displays total number of detected interrupts and shows pin states by highlighting pins with ‘high’ state.
8.11 Pin interrupt/pattern match engine
The pin interrupt block configures up to eight pins from all digital pins for providing eight
external interrupts connected to the NVIC.
The pattern match engine can be used, in conjunction with software, to create complex
state machines based on pin inputs.
Any digital pin except pins PIO2_8 and PIO2_23 can be configured through the SYSCON
block as input to the pin interrupt or pattern match engine. The registers that control the
pin interrupt or pattern match engine are on the IO+ bus for fast single-cycle access.
If I understand well, that means you might not receive interrupts for more than 8 pins - which seems consistent about why EXT_8-17 aren’t receiving IRQ.
I tested the bin, I got the same input issue about EXT1 and EXT2, but also EXT16. Everything else behave as intended.
tried it with a switch and it didn’t register any interrupts with the magnet passed over it, I took it apart and cleaned it and checked the pins they are kinda rough but solid so that shouldn’t be the issue,
Only three pins functioning as inputs? At least EXT0 is among those three, so to my understanding the cyclometer should work.
I now tested also my newer Pokitto and it is not getting input from EXT16, although it worked on the old one.
You are right. If I skip EXT0-7 and enable the rest, then I get interrupts from EXT8-15.
I wonder why the cyclometer seemed to be receiving interrupts only from EXT0? It handles both rising and falling edge, so I guess it’s using 2 (of the 8 available) IRQs per pin. Probably I first added EXT1 and EXT2, then maybe EXT16 and EXT17 from the other end. Thats already wasting all remaining 6 IRQs on pins (EXT1, EXT2, EXT16) from which I didn’t get input anyway.
D’oh! I actually had PROJ_BUTTONS_POLLING_ONLY in an earlier unpublished version, but it got lost when cleaning up / rewriting the code. Thanks for bringing that up.