I intended to use a pair of LM393 based iR sensors via interrupts. So far I haven’t had the sensor work on any of them, but I’ve more testing yet before I eliminate the module itself.
attachInterrupt(digitalPinToInterrupt(binZeroSensor), binZeroTrigger, RISING); // LM393...
attachInterrupt(digitalPinToInterrupt(binDistanceSensor), distanceCount, RISING); // LM393 based iR speed sensor with 20-slot disc
What I’ve found is I get an error “pin GPIO n is not used as GPIO func” for many of the addressable Arduino pins. This error occurs if I try GPIOs 1, 2, 14, 15, 22, 24, or 27. I don’t see the message for GPIOs 19, 20, 21, 25, or 26
I’ve confirmed the value output from digitalPinToInterrupt(n) is n, for every Arduino GPIO (ie that full list above). That should mean they’re all allowable.
Are these the 5 we can use for attachInterrupt()? Has anyone come across this error before, and is there further documentation on what causes it?
Thanks again for calling this out. The documentation for the Arduino intro should probably link to that page, or at least say these can be changed (for anyone upgrading from ATmega/ATtiny at least )
This starts off making sense, pins 1 & 2 are UART1 and 14/15 (GP10/11) are I2C. But GPIO22, 24 & 27 (GP17, 18 & 21) all are configured as GP’s but still get the above error.
Should all pins set as GP be able to be used for external interrupts? Or is there more config required. I haven’t found anything in the datasheet that talks about external interrupts at all
As 1&2 are UART1 on Duo256M should they be shown like GP4&5 which are UART3 and not given GPIO numbers in the pin resource table ?
Similarly is the table wrong for GP10 & 11 which are I2C by default, like GP6-9 which have no GPIO assignment?
I got myself the hardware, yet I don’t have much time to get my hands on it myself, unfortunately. (And I hope I won’t ever try the harduino thing, lol.)
The manual isn’t very clear about assigning interrupts, since it’s not perfectly translated to date; and I didn’t try them interrupts myself.
Moreover, I’m sure each core has its own watchdogs and timers, but only the big core has full access to everything shared, little core and 8051 core are limited in that sense.
Further on this, these pins do not respond from Arduino as Serial1.
Arduino Serial does appear on UART3 as documented here and Serial3 also uses those pins too, as you’d expect.
Perhaps more will be revealed/sorted in the next Arduino release?