I have an Arduino Duemilanove with the atmega328 and the library for the NRF2401 transceiver from the Arduino playground. It works perfectly and I've been using it for a long time.
Now I need to use it for a bigger project and I decided to use the Arduino Mega. For testing I loaded the example code for the NRF2401 from the playground to the Duemilanove and it works fine. I pull the header from it and plug it to the Arduino Mega exactly the same, change the board in the Arduino IDE, recompile and upload the code and it doesn't work.
The pins used are 2 to 6. It seems like there's some incompatibility between them. Any suggestions?
Well... figured it out. The library uses port registers and port D for interfacing. I just changed everything to port A and used pins 24-28 on the Arduino Mega and it works now.
OK, everything works fine by just moving to PORTA and pins 24-28 on the Arduino Mega, but the transceiver library places the data received pin on Arduino pin 2 so you can use an interrupt, however the interrupts on the Mega are different and to use it the same way would need lots of changes on the code, not just switching to another port.
Since I have a lot of pins of control, I don't care much about wasting one or two, so I was wondering if it's ok to just connect the data received pin to two inputs, the one used by the library and another one just to use an interrupt.
The transceiver works in 3.3v and I'm using mosfets as level translators, so it seems it would be ok.