rf24 and analogue pins

I have hooked up an nrf24l01 board to a mega2560.

The pins of the rf board do not align nicely with the arduino pins so I have fabricated an interface board (see atachment). The necessity to use MOSI, MISO and SCLK prompted me to make a board that plugs nicely in the corner of the mega module.

I have used A12 and A15 for CE and CSN.
I have a link to pin 18 for the interrupt.
I have a link to 3.3V for power.
Ground is a small link to the corner ground pins.

I understand any analogue pins can be used as a digital pins.
For the rf24 interface my code is

RF24 radio(A15, A12);

pinMode(interruptPin, INPUT_PULLUP);
attachInterrupt(digitalPinToInterrupt(interruptPin), check_radio, FALLING);

My module is all working fine but I want to be sure about my declaration for RF24 and use of analogue pins.

Question: Is my declaration correct or if not, how to use the analogue pins with the rf24 declaration.

Mega rf24 adapter.png

It looks OK but you don't need pinMode(interruptPin, INPUT_PULLUP); the irq pin its not floating, its high or low.

For better performance on the nrf maybe add 0.1uf and 100uf+ caps, the 3v3 on mega are not that good.

swe-dude:
For better performance on the nrf maybe add 0.1uf and 100uf+ caps, the 3v3 on mega are not that good.

A separate 3.3V regulator and some caps would even be better and is necessary for high power modules.

Thank you for your reply.

Yes I had found out about that a capacitor was required on the module. Very strange behaviour without it. Inconsistent transmit and receive. After fitting one everything was fine. The 3.3V supply is working fine for me at the moment but if anything plays up I will bear it in mind. The other end is a pro mini and it has a separate supply.

Nice little module which I have found better than the 433mhz modules. Particularly with the small antenna and I still get the range I need.

gy5000:
I have a link to pin 18 for the interrupt.

Why do you want to loose Serial1?

Pin 18 is the nearest interrupt available pin on the mega2560 to the corner. In my application I am not using it for anything. I would have preferred to use the a closer pin and used the pin change interrupt but it does not support "FALLING" as easily and since the pin was free I chose it. It could of course be moved.

The SPI bus is also connected to the ICSP header, as well as 5V and GND, are you aware of that?

Yes I was aware of that. I am aware there are other possibilities which all would work well. The physical installation in my application made the corner the best option.

Using the ICSP connector, a separate 3.3V regulator and low numbered pins for CE/CSN/IRQ
your board would work on Megas, Unos, Leonardos, ...

This board was my first attempt to get everything working. In my application, the board is fitted in a box and remote. I wanted to check communication would be successful. I also liked the rigidity the corner offers. Using the ICSP header is an option. I can see there are more options which would all work well.

If you want to have more flexibility in the placement of the NRF module you could use the mini modules
with wires attached via standard connectors.
DSCI23581.png