logo elektroda
logo elektroda
X
logo elektroda

Wemos + OLED 0.66 + RFM69: How to change the DIO0-IRQ pin?

pier 1656 18
Best answers

How can I move the RFM69 DIO0 IRQ to another pin on a Wemos D1 mini so it does not conflict with the OLED/I2C pins?

Pass the desired GPIO as the `interruptPin` in the `RFM69_ATC` constructor; you do not need to edit `RFM69.h` if you provide your own pin number [#18645179] On the D1 mini with the OLED shield, `D0` (GPIO16) cannot be used for external interrupts, and `D3`/`D4` can prevent boot if the RFM69 holds the line low at power-up [#18645344][#18645989] If you must use `D3` or `D4`, add an inverter/NPN transistor between RFM69 DIO0 and the ESP input so the boot state is safe, and be ready to adjust the interrupt edge handling in `RFM69.cpp` because the library uses rising-edge interrupts [#18645499] The thread also notes that the radio and display cannot simply share one pin [#18645499] Another possible option mentioned was `D8`, which can take interrupts but has an internal pull-down resistor [#18645989] In the end, the original poster got it working by swapping the radio’s IRQ and NSS wiring and moving NSS to `D3` [#18646084]
Generated by the language model.
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 18644023
    pier
    Level 24  
    Posts: 2444
    Help: 40
    Rate: 1891
    Welcome.

    I want to make a gateway on a Wemos board + a dedicated 0.66 oled display.
    The problem is that the RFM69 radio occupies one pin of the I2C bus for me.
    The question is how to change this pin to another pin in the program or library. Specifically, the pin in question is the RFM's DIO0-IRQ pin.
    I have tried several ways but either the radio doesn't work or the ESP doesn't start.


    Code: C / C++
    Log in, to see the code
    .

    Program don't comment I know it's a mess, for now it's just testing. The program itself works fine.
  • ADVERTISEMENT
  • Helpful post
    #2 18644353
    Anonymous
    Level 1  
  • ADVERTISEMENT
  • #3 18644527
    pier
    Level 24  
    Posts: 2444
    Help: 40
    Rate: 1891
    khoam wrote:
    pier wrote:
    Problem is that the RFM69 radio occupies one pin of the I2C bus for me. The question is how in the program or library to change this pin to another.
    .
    On the ESP8266 this is relatively simple:
    Code: C / C++
    Log in, to see the code
    The default pins for I2C are D2 (SDA) and D1 (SCL). I don't see in the code that you use Wire anywhere. However, in:
    Code: C / C++
    Log in, to see the code
    you are already using the default pin for SDA.
    .

    Khoam a bit off the mark.
    I wrote that I would like to use Wemos and a dedicated Oled. I don't have the ability to physically change the pins for the display and they have to be D1 D2 pins.
    The problem is that I have the IRQ pin of the radio hanging on one of these pins. I can't change this pin to another pin because either the radio doesn't work or the esp doesn't start.
  • #4 18644798
    Anonymous
    Level 1  
  • #5 18645108
    pier
    Level 24  
    Posts: 2444
    Help: 40
    Rate: 1891
    I have tried every free one.
    Wemos is a D1 MINI:
    Wemos + OLED 0.66 + RFM69: How to change the DIO0-IRQ pin? .
    And the display:
    Wemos + OLED 0.66 + RFM69: How to change the DIO0-IRQ pin? .
    I'm probably typing the new pin wrong or in the wrong place.

    From what I understand I am changing in this line:
    Code: C / C++
    Log in, to see the code
    .

    And in the RFM69.h file this line:
    Code: C / C++
    Log in, to see the code
    .

    Am I thinking right?
  • ADVERTISEMENT
  • #6 18645179
    Anonymous
    Level 1  
  • #7 18645323
    pier
    Level 24  
    Posts: 2444
    Help: 40
    Rate: 1891
    Khoam D7 is, after all, the MOSI pin of the radio.
    The pins I can use are D0, D3 or D4.

    I don't know what you mean by the OLED schematic.
  • #8 18645344
    Anonymous
    Level 1  
  • ADVERTISEMENT
  • #9 18645420
    pier
    Level 24  
    Posts: 2444
    Help: 40
    Rate: 1891
    Well, now I know why all this was not working out for me.
    So it's not possible to connect the Wemos with this display and radio to make them work?
    Is there any way to make the display and radio share a common pin?
  • #10 18645499
    Anonymous
    Level 1  
  • #11 18645856
    pier
    Level 24  
    Posts: 2444
    Help: 40
    Rate: 1891
    Khoam I got a bit caught up with this IRQ pin and forgot that you can still combine with the NSS pin of the radio.
    How do you think maybe this pin is suitable for connection under D3 or D4?
  • #12 18645866
    Anonymous
    Level 1  
  • #13 18645972
    pier
    Level 24  
    Posts: 2444
    Help: 40
    Rate: 1891
    And the IRQ can be plugged into D8?
  • #14 18645989
    Anonymous
    Level 1  
  • #15 18646084
    pier
    Level 24  
    Posts: 2444
    Help: 40
    Rate: 1891
    Success.
    I swapped the IRQ and NSS pins of the radio and then NSS flipped to D3 and it worked.

    Khoam would you help me with one more?

    Why is the compiler throwing an error in this case:
    Wemos + OLED 0.66 + RFM69: How to change the DIO0-IRQ pin? .

    As if it doesn't see the "Blink" function. If I give "Blink" somewhere in front then the compiler doesn't see the problem but the diode doesn't glow.
    I have an almost identical program running and in it the compiler does not see the problem.
  • #16 18646109
    Anonymous
    Level 1  
  • #17 18646127
    pier
    Level 24  
    Posts: 2444
    Help: 40
    Rate: 1891
    I placed void Blink(byte PIN, int DELAY_MS); at the beginning.
    The error has disappeared but the led does not blink when receiving data.
  • #18 18646149
    Anonymous
    Level 1  
  • #19 18646169
    pier
    Level 24  
    Posts: 2444
    Help: 40
    Rate: 1891
    Thanks to Khoam, everything is now working.

Topic summary

✨ The discussion revolves around configuring a Wemos D1 Mini board with a 0.66 OLED display and an RFM69 radio module, specifically addressing the issue of the DIO0-IRQ pin occupying a necessary I2C bus pin. The user seeks to change the IRQ pin to another GPIO without causing the ESP8266 to fail to start. Various suggestions are made, including using different GPIO pins (D3, D4, D0) and the possibility of using an inverter to manage the IRQ pin state. Ultimately, the user successfully swaps the IRQ and NSS pins, allowing the system to function correctly. Additional troubleshooting is provided for a separate issue regarding a "Blink" function in the code.
Generated by the language model.

FAQ

TL;DR: Only 1 safe external-interrupt pin (D7) remains with the 0.66" OLED shield; “the ESP will not start” if D3/D4 are low. Use the RFM69_ATC constructor to move DIO0 off D2 and keep I2C on D1/D2. [Elektroda, khoam, post #18645179]

Why it matters: This helps Wemos D1 mini builders fix IRQ/I2C pin conflicts when pairing an RFM69 with the 0.66" OLED shield.

For: ESP8266/Wemos D1 mini users integrating an RFM69 transceiver and the 0.66" I2C OLED who need to reassign pins cleanly.

Quick Facts

How do I change the RFM69 DIO0-IRQ pin on a Wemos D1 mini?

Pass your chosen pins into the RFM69_ATC constructor instead of editing headers. Example: RFM69_ATC radio(SS_pin, IRQ_pin, false). Pick a GPIO that supports external interrupts and does not interfere with boot. Keep the OLED on D1/D2 and move DIO0 off D2. “You do not need to change anything in the RFM69.h file.” [Elektroda, khoam, post #18645179]

Which pin is safest for RFM69 IRQ with the 0.66" OLED shield attached?

Use D7 (GPIO13) if available. On the 0.66" OLED shield, D7 is the only header pin left that supports external interrupts without affecting I2C. Avoid D3 and D4 for IRQ, because low level at boot can block startup. Keep the I2C display on D1/D2. [Elektroda, khoam, post #18645179]

Why does my ESP8266 fail to boot when IRQ is on D3 or D4?

D3 (GPIO0) and D4 (GPIO2) are bootstrapping pins. If either is held low at power-up, normal boot fails. An RFM69 wired to these can pull them low and stop the chip from starting. As the expert noted, “the ESP will not start” if those pins read low at boot. Move IRQ away from D3/D4. [Elektroda, khoam, post #18645179]

Can I use D8 (GPIO15) for the RFM69 DIO0-IRQ?

Yes, you generally can route RFM69 DIO0 to D8. Note that D8 has an internal pulldown to GND on ESP8266 boards. Ensure your wiring and module states won’t conflict with the boot mode that requires GPIO15 low. Test with clean power cycles after wiring. [Elektroda, khoam, post #18645989]

Is D0 (GPIO16) suitable for RFM69 IRQ?

No. D0 (GPIO16) does not support external interrupts on ESP8266. It cannot trigger the RFM69 receive interrupt line. Use a different GPIO that supports external interrupts, such as D7 or D8, depending on your wiring constraints. This pin has 0 usable external interrupts. [Elektroda, khoam, post #18645344]

Can the OLED and RFM69 share any pins (I2C or IRQ)?

No. Do not share the I2C pins with RFM69 IRQ or other signals. The IRQ line must be dedicated, and the OLED needs SDA/SCL to remain on their bus. Sharing would cause bus contention or spurious interrupts. Keep IRQ separate and leave D1/D2 for the display. [Elektroda, khoam, post #18645499]

How do I move the RFM69 NSS/CS pin to avoid conflicts?

NSS (CS) is an input on the RFM69, so you can move it to a different GPIO. Select a pin that does not affect boot. Then pass the new SS pin as the first argument to the RFM69_ATC constructor. Verify SPI wiring after changes. [Elektroda, khoam, post #18645866]

What wiring and code combo has been proven to work with this setup?

A reported fix: swap RFM69 IRQ and NSS, then put NSS on D3 and IRQ on D8. Update code to: RFM69_ATC radio(D3, D8, false). How-To: 1. Move RFM69 DIO0 to D8 and NSS to D3. 2. Change the constructor pins accordingly. 3. Power-cycle and test radio receive/ACK. This freed D1/D2 for the OLED and booted cleanly. [Elektroda, pier, post #18646084]

How do I reassign I2C SDA/SCL in code if I’m not using the shield defaults?

Call Wire.begin with your chosen pins. Example: Wire.begin(SDA_pin, SCL_pin). The default mapping on ESP8266 is SDA=D2 and SCL=D1 when called without arguments. Reassign only if your hardware wiring supports it. [Elektroda, khoam, post #18644353]

I must use D3 or D4 for IRQ—any workaround?

Insert an NPN-transistor inverter between RFM69 DIO0 and the ESP input so the ESP sees high at boot. The library sets interrupts on rising edge; if inverted, you may need to switch to falling edge in RFM69.cpp. Quote: “set interrupts on the rising edge.” Validate with scope if possible. [Elektroda, khoam, post #18645499]

What is the RFM69_ATC constructor signature and parameter order?

RFM69_ATC(uint8_t slaveSelectPin, uint8_t interruptPin, bool isRFM69HW=false, uint8_t interruptNum=0). Pass your chosen NSS (CS) pin first, then the IRQ pin. If you omit arguments, it uses library defaults defined for the platform. Prefer setting pins explicitly to avoid conflicts. [Elektroda, khoam, post #18645179]

Why does my sketch say ‘Blink’ not declared, and how do I fix it?

Add a forward declaration at the top of your sketch: void Blink(byte PIN, int DELAY_MS); This tells the compiler about the function before use. Then keep the definition later in the file. Recompile to confirm the error is gone. [Elektroda, khoam, post #18646109]

LED doesn’t blink on receive—what should I check on the D1 mini?

Set pinMode for the LED once in setup(), not every call. LED_BUILTIN maps to D4 (GPIO2) on the D1 mini. Ensure you are not simultaneously using D4 for another function like boot-strapping or IRQ. Then toggle the pin to test visually. [Elektroda, khoam, post #18646149]
Generated by the language model.
ADVERTISEMENT