PIC18F47Q10 SPI Trouble SOLVED

Thread Starter

odm4286

Joined Sep 20, 2009
265
Hello,

Can anyone help me understand why my firmware hangs here? I may have other W5500 issues but I know, at least at this moment, I cannot communicate with the chip over SPI. For some reason, SSP1IF never goes high. Also, I tried the same code using SPI2 and still have the same behavior. The code is MCC generated.

Help is appreciated this is driving me crazy.


SPI Write block routine:
void SPI2_ExchangeBlock(void *block, size_t blockSize)

{

    uint8_t *data = block;

    while(blockSize--)

    {

        SSP2BUF = *data;

        while(!PIR3bits.SSP2IF);

        PIR3bits.SSP2IF = 0;

        *data++ = SSP2BUF;

    }

}

Capture.PNG
 
Top