
UPDATE: The issues are now resolved. See this post for updates.
Hello folks. I’ve been trying to develop a new Moteino variant, one based on the ATmega1284P chip. I dubbed it Moteino MEGA since it has significantly more memory, IO and functionality than the 328P. All went well except when trying out with RFM69 radios, I can only transmit but not receive. So I’m writing this post in hope that someone else tried the RFM69 library with an Atmega1284P and has some tips to spare. I’ve been using the maniac-bug 1284p arduino core and from all I can tell the external interrupts are set correctly in this distribution. I used my Node sample sketch with appropriate RFM69 settings. The receiver is a regular Moteino. The Moteino MEGA is calling sendWithRetry(…) which sends the packet 3 times until it gives up. All three packets are received at the gateway, and all 3 ACKs are sent back. I modified the RFM69 lib to attach the interrupt routine to INT2 if it’s a mega1284p. But the interruptHandler() in the library does not trigger on the Moteino MEGA. I pulled the logic analyzer and it looks like the INT2 (D2, wired to RFM9’s DIO0) goes HIGH when it’s expected (and stays HIGH quite long, weird), but the interrupt routine is not called. That’s where I’m stuck. At this point I’m not sure where the issue is but I tried a simple interrupt handler program which seems to trigger just fine:
boolean interrupt = false;
void blink()
{
interrupt = true;
}
void setup()
{
pinMode(LED, OUTPUT); //LED=15
attachInterrupt(2,blink,RISING);
Serial.begin(115200);
}
void loop()
{
if (interrupt)
{
Serial.print("X");
for (byte i=0; i<10; i++)
{
digitalWrite(LED, HIGH);
delay(25);
digitalWrite(LED, LOW);
delay(25);
}
interrupt = false;
}
digitalWrite(LED, HIGH);
delay(500);
digitalWrite(LED, LOW);
delay(500);
}I hope to get past this hurdle and be able to release this new board since some people asked for more memory and IO. I have yet to port DualOptiboot to it but I need to solve this mistery first. Maybe there’s a bug in the 1284P core. Or something I’m omitting, just out of ideas right now. If anyone has an idea why this is happening please let me know. Thanks!
UPDATE: I tried an RFM12B with the atmega1284P and the good news is it works with my RFM12B library. The bad news is that after about 15 minutes of running the sample send sketch it stops working and the atmega1284p appears to be completely nonresponsive, even to the AVR programmer. I’ve tried this with 2 chips, both died after about 10-15 minutes of continuous transmission. So I’m baffled. The power supply is the same as the regular Moteino – 3.3V and nothing heats up, radios wired the same except to INT2 instead of INT0, same 16mhz resonator. Chips were from digikey so I don’t think they are counterfeits. Any hints anyone?