-->
Page 1 of 1

Enabling interrupt pins for use with RCSWITCH.

PostPosted: Sat Jul 23, 2016 6:13 pm
by CLG
I'm working on a project that records data transmitted from a number of transmitters and records the data on a SD card. Everything works fine if I use GPIO4 as an interrupt pin for the receiver using RCSWITCH. However, I would like to add a I2C clock and possibly a LCD in the future and I will need GPIO4 and GPIO5 available for this to be possible.

Is it possible to have any one of GPIO 0, 1, 2, or 3 pins enabled to work as interrupts for RCSWITCH? If so, how? The specs claim that GPIO 0 - 15 can be used as interrupt pins but I can't for the life of me get it to work in the Arduino IDE.

I am using a Wemos D1 Mini.

Re: Enabling interrupt pins for use with RCSWITCH.

PostPosted: Sun Jul 24, 2016 10:41 am
by martinayotte
For I2C bus, you are not forced to use the default GPIO4/GPIO5 pins, you can use GPIO0/GPIO2 easily for this I2C bus, especially that you already have pullups on those pins for boot mode, it fill the needs required for the bus too. This will free up your GPIO4 which you had it working for interrupt.

Re: Enabling interrupt pins for use with RCSWITCH.

PostPosted: Sun Jul 24, 2016 11:11 am
by CLG
Thank you for your reply. I've enjoyed reading through your past posts. Very knowledgeable.

I am aware that those sets of pins can be swapped. Unfortunately, I'm using GPIO0 to trigger an on board transmitter. GPIO 12, 13, 14, and 16 are being used for SPI (SD card) and 15 is being used to trigger a passive buzzer.

That really only leaves me with GPIO 1 - 3 free. Ideally, I would like to use 2 for the external interrupt pin with pin 1 as my second choice.

I guess my real question is, how come only certain pins seem to work for interrupts and others do not? Is it possible to turn these pins on for interrupts? I've tried pinMode (pin, FUNCTION_3) but no luck.