In case anyone is struggling with SPI Bus sharing between NRF24 and MAX7219

Just spent most of the day trying to get two SPI devices to work on the same bus. They are the nRF24l01 module and MAX7219 multiplexer. I got them to work separately but when I tried to use both in the same sketch the nRF24 would not allow the MAX7219 to use the bus anymore. SCK MOSI and MISO are connected to the same pins, both modules have their own CS/SS pins. I am not using a level converter for the nRF24 although it does need its own 3.3V supply. Here is the code that finally made it work:

    radio.setRetries(3,5); //Delay, NumberOfRetries

    bool TXResult;
    TXResult = radio.write(&Message, sizeof(Message));
    Serial.print("Sent: "); Serial.print(Message);
    if (TXResult){Serial.println("\tSuccessfully");}
    else {Serial.println("\tUNsuccessfully");}


//MAX7219 code goes outside above code

The last three lines are the essential ones that finally solved my struggle. You cannot leave any one of these out. Might not be the best way but it works. Hope this can be a blessing to someone.

Did you try using SPI.beginTransaction() and SPI.endTransaction() ?

Oh yes I tried everything. The NRF24 just did not seem to want to let the clock line go. Anyway, I've got a solution now.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.