How do I fault find this SPI issue
Using a PIC18F26K40 to run a NRF24L01 over SPI. Works as expected.
Trying to use PIC16F18326 to run a NRF24L01 over SPI. Doesn't work.
I am using the same code as the 18F. It is generated by MCC. The main differences are the microcontroller, and the pins that are being mapped via PPS. I have tried various things but I have run out of options to fault find it.
RC0PPSbits.RC0PPS = 0x1A; //RC0->MSSP2:SCK2;
RC3PPSbits.RC3PPS = 0x1B; //RC3->MSSP2:SDO2;
SSP2CLKPPSbits.SSP2CLKPPS = 0x10; //RC0->MSSP2:SCK2;
SSP2DATPPSbits.SSP2DATPPS = 0x11; //RC1->MSSP2:SDI2;
I have used a logic analyser on it and it is reading and writing the correct values. It seems that the NRF is not being setup correctly for channel etc. The IRQ line is floating, but tying it high or low makes no difference. However, I can make it work by connecting the IRQ line to the data analyser when it is tied high or tied low. I can then disconnect the analyser and it keeps working correctly. So again it seems the the NRF is not being setup correctly.
Any ideas on how I can find out what is wrong?
post edited by brownt - 2019/03/09 20:35:27