RFM12_arrsi adding atmega 2560
-
@charleshallard
Hello, I am trying to add the atmega 2560 to the libraries RFM12B_arrsi.h and RFM12B_arssi.cpp. What do I need to change or add to get this to work? I have tried adding
#elif defined(AVR_ATmega2560) || defined(AVR_ATmega1280)
#define RFM_DEFAULT_IRQ 2
#define SS_DDR DDRB
#define SS_PORT PORTB
#define SS_BIT 0
#define SPI_SS 53 // PB0, pin 19
#define SPI_MOSI 51 // PB2, pin 21
#define SPI_MISO 50 // PB3, pin 22
#define SPI_SCK 52 // PB1, pin 20to RFM12B_arssi.h and
#elif defined(AVR_ATmega2560) || defined(AVR_ATmega1280)
if (irq_pin==10 || irq_pin==11 || irq_pin==2)
{
// 1st detach the existing one
detachInterrupt(irq_pin==2?2:irq_pin-10);irq_pin = irqPin;
}
else
{
// Set new pin
irq_pin = RFM_DEFAULT_IRQ;
}to the function void RFM12B::SetIRQ(uint6_t irqPin) in RFM12B_ arssi.cpp and
#elif defined(__AVR_ATmega2560__) || defined(__AVR_ATmega1280__) // IRQ authorized are D10 (INT0), D11 (INT1) or D2 (INT4) added by me :) if (irq_pin==10 || irq_pin==11 || irq_pin==2) { if (nodeID != 0) // INT0 or INT1 for pin D10/D11 and INT2 for pin D2 attachInterrupt(irq_pin==2?2:irq_pin-10, RFM12B::InterruptHandler, LOW); else // INT0 or INT1 for pin D10/D11 and INT2 for pin D2 detachInterrupt(irq_pin==2?2:irq_pin-10); }
to RFM12B_arssi.cpp in the function RFM12B:: ConfigureInterrupts(); This does not work and it fails the detection in radio.isPresent. Any help would be greatly appreciated.
-
Hi...the first option is when AVR and ESP are connect over serial 1. In this mode you can't use USB (upload and monitor are unavailable). You must accept this fact and monitor using serial 2, telnet, LCD, TV out .. . To change the sketch you must select other mode with dip switches. Or use ESP firmware with AVR sketch OTA upload over WiFi.