SPI communication issue

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SPI communication issue

992 Views
RuturajKhandare
Contributor I

Hi Team,

We are using MPC5746R microcontroller .We are using single SPI channel to communicate with 3 different devices in synchronous mode. As per our observation when we check single device at a time we are getting correct response ,but when we are trying to get data sequentially from all devices that time we are getting "0" in response from all devices.

For one device HW engine we used for chip selection and remaining two devices we are using different GPIO pins.

Kindly help us with this query.

Regards,

Ruturaj.

 

Tags (1)
0 Kudos
3 Replies

981 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Ho, could you clarify how you have connected all 3 slaves? Also how you are accessing them.

According your description I guess first is CS driven and other GPIO. Doesn't it mean you always selecting first device (plus second or third) causing erroneous data on the bus?

0 Kudos

977 Views
RuturajKhandare
Contributor I

Hi David,

At a time we are selecting only one device for communication.

Chip device configuration :

Device 1 SpiEnableCs = TRUE

Device 2 SpiEnableCs = FALSE

Device 3 SpiEnableCs = FALSE

We are using MPC5xxx uC and configured single SPI channel for 3 different devices.

One of the device is EEPROM (M95256-DRE) and SPI channel is configured as 'Synchronous' mode.

 

Issue :

 

Before configuring the SPI channel for EEPROM, the two devices were able to successfully get the transmit / receive the data via SPI channel.

We tried testing the EEPROM independently and we were able to read / write the data from / to EEPROM successfully (Here the other two devices functionality was disabled).

 

 

When all the 3 devices functionality is enabled, we observed the below issue :

 

Scneario 1 : When EEPROM alone is requested to transmit the data we are able to receive the data from EEPROM.

Scneario 2 : Sequentially we are utilizing the SPI channel to get the data from EEPROM and other devices in below mentioned sequence.

 

Step 1 : Send command to get the data from EEPROM. Here we are getting correct data.

Step 2 : Send command to get the data from other devices. Here we are getting correct data.

Step 3 : Send command to get the data from EEPROM . Here we are getting zero value from EEPROM but the request is transmitted successfully.

 

From the above observation we have a query that whether EEPROM needs a dedicated SPI channel.

Regards,

Ruturaj.

0 Kudos

942 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Why you don't use for every device separete chip select line as it is usual? Every DSPI module offers 6 CS lines, there is no need to use GPIO lines as it brigns useless SW overhead.

To your sequence, I suppose between steps 1 and 2, you are asserting GPIO line (set to low) and between step 2 and 3, you are negating GPIO line (set to high). In the meanwhile you are sending command without any CS line asserted. is this the procedure?

0 Kudos