PIC18LF26K42 - problem with SPI

Thread Starter

Sergio Fernandez Diz

Joined Sep 13, 2022
4
Hi i'm making a circuit for couting an display EADOG with SPI protocol.
I made the SPI configuration but when i try to send a bit, i dont see any signal output from the SDO and the CLK doesn't start. I dont really now the problem, it could be in configurations bits or SPI function/setup or in the PPS because i have the SDO in RC4 and the CLK in RC5.
 

Attachments

geekoftheweek

Joined Oct 6, 2013
1,214
After a quick look through your files I did notice you did not set SPI1BAUD. While it's probably not required to make it work I would slow it down a bit until you get things at least working. Your system clock should be slow enough to be able to see a change on the pins already.

The SPI registers are quite different than what I have normally worked with on PICs so far, but after looking through everything the baud was the only thing I saw.

I have had issues with PPS registers before on a couple chips. It does seem for some reason even though there was a default setting they did need to be set in order to make things work. It may be worth a try to set them just to make sure.

Everything else looks right as far as I can tell. Can you blink and LED or something to check the chip is actually doing something and you aren't stuck in reset for some reason?
 
Top