Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

general SPI troubleshooting

Status
Not open for further replies.

brownt

Member level 3
Joined
Sep 25, 2017
Messages
63
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Activity points
597
Hi,
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 pretty much 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.

The 16F code works ok with a digital pot MCP4341, and I believe the NRF24L01 has the same CKE and CKP requirements. I have used a logic analyser and it looks like the correct values are being written via MOSI, but what is being read back doesn't seem right. I am writing to the status register of the NRF and there should be data coming back saying there is data in the RX buffer. but all i get back is 0E, which means buffer empty.

What can i do to try and work out what is happening?
 

Attachments

  • Logic Analyser.png
    Logic Analyser.png
    228.6 KB · Views: 122

Maybe the buffer IS Empty? How do you know it’s not? Is it a different PCB from the 18? Maybe there’s some other hardware issue?
 

Maybe the buffer IS Empty? How do you know it’s not? Is it a different PCB from the 18? Maybe there’s some other hardware issue?

Yes, it might be a hardware issue. yes its a different pcb.

I am sure now that the logic analyser 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. There is probably a clue there, but I don't know enough to work it out.
 

Attachments

  • nrf schematic.png
    nrf schematic.png
    50.6 KB · Views: 106

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top