Pin designations on different boards....

I have been creating with Arduino boards for about two years now and having a blast. It’s been mostly the Uno, and a couple of smaller, REAL ARDUINO boards, and everything has been great.

I ordered some (non-true-Arduino) Pro Micros (ATMEGE32U4). They work great for my purposes, HOWEVER…

Trying to implement some RF24L01 radio boards into this project has now become… “challenging”.

They work PERFECTLY on the Unos (surprisingly easy). However… the connections on these little Micro boards…

According to the documentation/pin labeling… the SCK/MISO/MOSI pins on these little boards are 16/14/15 (see attached).

But according to all of the tutorials and help I have read, these radios “MUST” be connected to pins 13/12/11 which are the SCK/MISO/MOSI pins.

First of all, there are no 13/12/11 pins indicated on these boards.

I… confused… what?.. over-thinking?.. over-complicating?

Ouch. My brain.

SPI pins Pro Micro

But according to all of the tutorials and help I have read, these radios "MUST" be connected to pins 13/12/11 which are the SCK/MISO/MOSI pins.

It’s simple. The tutorials were done for atMega328 chip rather than the atMega32U4. Change the chip, the physical pins change, it’s the function of those pins that does not change.

The only MUST that matters is that the radios be connected to the hardware SPI pins for the actual processor you’re using. Confusion is optional.

BTW, there is a photo type pinout, like the one Larryd posted, for just about every Arduino board ever made. If you look at the pro mini pinout, which uses the atMega328, you can see where the hardware SPI pins are located.

One last thought: Don’t confuse physical processor pin numbers with Arduino pin numbers, they are different. Pin numbers, like the SPI function pins, are always the Arduino pin numbers, the numbers you would use in a function call to read or set the state of a pin.

Okie dokie. Thanks!

Yeah... so I went into the rf24_config file and changed those pins to the designation I needed.


(this reflects the changes which I made to match the pinout diagram that I posted previously. original pin numbers here were 9, 8, 7)

// change these pins to your liking
#define SOFT_SPI_MISO_PIN 14

#define SOFT_SPI_MOSI_PIN 16

#define SOFT_SPI_SCK_PIN 15

So, my question was/is: is it possible to set these functions to these or any other pins in my sketch, without digging into places where I should not go.

In none of the NRF24L01 examples/tutorials does it give examples of this, and these little radios will not communicate without using these particular pins on these China-made Pro Micro Boards (they do work fantastically, otherwise).

They are communicating perfectly now.

Now that I have totally overcomplicated it, I need a cup of coffee.

You’re using hardware based SPI. That means you cannot change those pins. If for some reason, you could not or did not want to use hardware SPI, you can use any pins you want by using software based SPI (bit-banging).

But, while you can, don’t, unless you have no other option. Yes, software based SPI (and I2C and other protocols) works but it consumes resources (program space, processor time) and will never reach hardware based speeds.

      #ifndef SOFT_SPI_MISO_PIN

#define SOFT_SPI_MISO_PIN 14

I'm somewhat concerned that this is not the correct change to make, if you want to use the Hardware SPI capability of the Pro Micro. (You might have set up "software SPI" on the pins that are capable of hardware SPI...)
Which RF24 library are you using?