Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

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


barry

Advanced Member level 5
Joined
Mar 31, 2005
Messages
4,860
Helped
1,068
Reputation
2,146
Reaction score
1,053
Trophy points
1,393
Location
California, USA
Activity points
26,527
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?
 

brownt

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


Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top