AnsweredAssumed Answered

Having trouble reading data in SSP0_MISO in a LPC1857 part

Question asked by Alejandro Celery on Oct 17, 2017
Latest reply on Oct 26, 2017 by Kerry Zhou

Hi!

I'm having trouble reading an SPI peripheral (an SC16IS740) using a LPC1857.

The problem is that when I read the DR register, it ALWAYS returns 0xFF.

I am using pin P3_7 in function 2 with the following configuration:

#define PIN_MODE_MXSX_FUNC(n)    (SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | ((SCU_MODE_FUNC0)+n))

 

I read data using:

uint8_t r;

Chip_SSP_ReadFrames_Blocking( LPC_SSP0, &r, 1 );

 

When I debug my code the Chip_SSP_ReadFrames_Blocking call I see the proper execution flow:

Chip_SSP_GetStatus(pSSP, SSP_STAT_RNE) returns true before I read the received frame and I see the status RNE status flag go to 0 after the read.

I have checked with a scope that the P3_7 line has the correct reply from the device when there is no data: 0x60.

 

I have tried the exact same code on SSP1 and it works perfectly.

 

It seems like I am making a mistake when configuring the SSP0 device or that there is something missing in the documentation. Perhaps an interaction with the boot procedure (since SSP0 is a possible boot code source)? I checked everything that I could think of, please help me with these problem.

 

Best regards,

Alex

Outcomes