Unable to Read Registers of MSDI chip CD1030 over SPI on MPC5775B EVB

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

Unable to Read Registers of MSDI chip CD1030 over SPI on MPC5775B EVB

1,100 Views
rsating
Contributor III

We are creating an example model using the NXP Model-Based Design Toolbox (MBDT) Version 3.2.0 for MPC57xx Series processors to create an example interfacing with the MSDI chip CD1030 over SPI bus from the MPC5777C processor, see the attached model. 

We are able to send the 32-bit "SPI Check" message [0x00 0x00 0x00 0x00] as uint8(4) and get the expected response 0x00123456 from the "SPI Master Transfer" block.
 
However, when we try to read the switch status SP or SG registers using messages [ 0x3C 0x00 0x00 0x00 ] and [ 0x3E 0x00 0x00 0x00 ] respectively, we a response 0x3fbadbad. Seeing "bad" plainly visible repeated twice in the response (as Hexspeak) suggests something is terribly wrong. 
 
dspi_test_mpc577c_MSDI_minimal_query.png
 
By comparison, the response from the SPI Check message is as expected:
 
dspi_test_mpc577c_MSDI_minimal_SPI-test.png
 
The simplified top-level model:
 
dspi_test_mpc577c_MSDI_system.png
 
And the state chart that passes messages to the CD1030 MSDI chip:
 
dspi_test_mpc577c_MSDI_minimal_chart.png
 
The SPI Config Block used Continuous Transfer and Frame Size 8:
 
dspi_test_mpc577c_MSDI_minimal_spi-config.png
 
The above configuration was set based on an answer to a previous question:
 
Request for HSD/LSD/MSDI Communication Examples for MPC5775B BMS and VCU Reference Design
 
The above was extremely helpful, but going forward brings us to a new challenge.
 
Further guidance would be greatly appreciated.  Thanks.
 
0 Kudos
Reply
1 Reply

1,089 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @rsating ,

Unfortunately, I don't have access to the CD1030 so it is very hard to help you with this.

Since you still get something from the CD1030 I think the communication settings are fine so this is most likely a register logic issue. Maybe there are some initialization commands that have to be sent before accessing those registers.

On this page I've found an Interface Software Driving for Multiple Switch Detection which may help you with some extra information. https://www.nxp.com/products/interfaces/signal-conditioners/33-channel-multiple-switch-detection-int... 

mariuslucianand_0-1608731169794.png

 

Another interesting aspect that may be taken into account is the possibility of integrating custom code. For example, the driver above can be integrated into your MBDT project in a similar way described here https://community.nxp.com/t5/NXP-Model-Based-Design-Tools/How-to-use-your-own-C-code-in-our-Toolbox-...

Of course, there are some extra steps required like: You have to implement wrappers over some functions from the Driver which can be directly called by an S-Function. You have to write yourself the MSDI_TransferSpi function to access the SPI driver used in the MBDT function but you already have an example in the archive that contains the MSDI Driver. This is for S32K but the SPI driver looks very much with the one used by the MPC 

At least you can have a look at the commands sent by the driver to see if there are some other registers written in the initialization. Or how the registers you are interested in can be accessed.

Hope this helps,

Marius

0 Kudos
Reply