Request for HSD/LSD/MSDI Communication Examples for MPC5775B BMS and VCU Reference Design

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

Request for HSD/LSD/MSDI Communication Examples for MPC5775B BMS and VCU Reference Design

Jump to solution
4,565 Views
rsating
Contributor III

Could we get examples showing how to use SPI communication in the MBDT to interface with the LSD, HSD, and MSDI on-board chips for your MPC5775B evaluation board? 

MPC5775B BMS and VCU Reference

It is the high-level communication that really matters. A lot is left to the imagination, and a lot can go wrong, if we only have low-level SPI communication examples to start with. It is not an easy task.

Thanks

0 Kudos
Reply
1 Solution
4,519 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @rsating ,

I've attached an example that might toggle one relay on the board. As I said before I don't have this setup to test on but based on datasheets let's give this a try. I have only explained for the MCZ but for the other SPI devices, the connection is the same.

MCZ33996 requires 24 bits on each SPI frame. To achieve that, we have to use the continuous mode to transfer the bits in one frame. We will keep the frame size to 8 bit. But we are going to feed the SPI send block with an array of 3x uint8_t.

mariuslucianand_0-1608139470827.jpeg

Now, looking on the schematic on your board,  MCZ is connected via the SPIC with the CS on PCSC3.

mariuslucianand_1-1608139470992.jpeg

I don’t have this board, but I’ve selected the same SPI instance, and the same pins on the board I have.

Now, there is another signal used for reset which is connected to the GPIO 456. So we have to use this pin to firstly reset the MCZ, then to start the communication.

I’ve used a simple FlowChart to firstly reset the MCZ (the RESET subsystem) then to send the output state for the pins.

mariuslucianand_2-1608139471024.jpeg

As you can see here, the input is an array of 3 uint8_t.

mariuslucianand_3-1608139471063.jpeg

For the command that we are going to send, the first byte will be 0 and for controlling the relay we are only toggling the bit 1.

mariuslucianand_4-1608139471173.jpeg

Running this on the board will end up with some signals like this:

mariuslucianand_7-1608139656087.png

The Channel 4 is the reset, you can see the moment where the reset is pulled up. On each second you can see the communication signals.

By zooming on the communication frame, you can see the command being send, there is a higher time between each 8 clock bits. You also will see an Initialize custom code block that inserts such time. Should not be necessary but without that custom code, the timing will be too small. Let’s hope this will work.

mariuslucianand_8-1608139685724.png

I have attached the model and a simple FreeMaster project, but probably the LPUART instance has to be changed with the one on your board. 

Let's give this a try and please reply to me with the results.

Hope this helps,

Marius

View solution in original post

0 Kudos
Reply
7 Replies
4,554 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @rsating ,

For now, I don't have access to this board. I will try to test the SPI connection on a similar MCU for the previous thread you have opened related to that GPIO extender.

Regards,

Marius

 

0 Kudos
Reply
4,548 Views
rsating
Contributor III

Thanks in advance for looking into this.  Eagerly awaiting your guidance. 

0 Kudos
Reply
4,520 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @rsating ,

I've attached an example that might toggle one relay on the board. As I said before I don't have this setup to test on but based on datasheets let's give this a try. I have only explained for the MCZ but for the other SPI devices, the connection is the same.

MCZ33996 requires 24 bits on each SPI frame. To achieve that, we have to use the continuous mode to transfer the bits in one frame. We will keep the frame size to 8 bit. But we are going to feed the SPI send block with an array of 3x uint8_t.

mariuslucianand_0-1608139470827.jpeg

Now, looking on the schematic on your board,  MCZ is connected via the SPIC with the CS on PCSC3.

mariuslucianand_1-1608139470992.jpeg

I don’t have this board, but I’ve selected the same SPI instance, and the same pins on the board I have.

Now, there is another signal used for reset which is connected to the GPIO 456. So we have to use this pin to firstly reset the MCZ, then to start the communication.

I’ve used a simple FlowChart to firstly reset the MCZ (the RESET subsystem) then to send the output state for the pins.

mariuslucianand_2-1608139471024.jpeg

As you can see here, the input is an array of 3 uint8_t.

mariuslucianand_3-1608139471063.jpeg

For the command that we are going to send, the first byte will be 0 and for controlling the relay we are only toggling the bit 1.

mariuslucianand_4-1608139471173.jpeg

Running this on the board will end up with some signals like this:

mariuslucianand_7-1608139656087.png

The Channel 4 is the reset, you can see the moment where the reset is pulled up. On each second you can see the communication signals.

By zooming on the communication frame, you can see the command being send, there is a higher time between each 8 clock bits. You also will see an Initialize custom code block that inserts such time. Should not be necessary but without that custom code, the timing will be too small. Let’s hope this will work.

mariuslucianand_8-1608139685724.png

I have attached the model and a simple FreeMaster project, but probably the LPUART instance has to be changed with the one on your board. 

Let's give this a try and please reply to me with the results.

Hope this helps,

Marius

0 Kudos
Reply
2,309 Views
RegulusCheng
Contributor III

Hello, I have tried your solution, It dose works.

However, I found that the LSD pin of the development board does not output exactly according to the given value. When I give three frames of the message all 0, theoretically there should be no pin output, but there are 2 pins will continue to output, do you know why? If you have any further questions about the details, please feel free to contact me. 

0 Kudos
Reply
2,278 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @RegulusCheng,

I have noticed that you have also opened a new thread here https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/2-LSD-pins-can-not-be-controlled/m-p/17... 

Let's please continue the investigation on the new thread.

Regards,

Marius

0 Kudos
Reply
4,497 Views
rsating
Contributor III

Thank you Sir!  It worked on the first try for the LSD chip. 
The attached example was incredibly helpful.

The key points I missed were:
- resetting the chip
- adding time delay between 8-bit messages using the SDK
- using continuous transfer mode for SPI configuration

The answer is especially helpful in showing us we can use the SDK within Simulink. 

For the HSD and MSDI I'm able to send messages successfully to the chips based on the example above, but I'm having trouble getting the reply when one is expected. I'll start a new thread to document that and ask for guidance.

Thanks!

0 Kudos
Reply
4,538 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @rsating ,

I am sorry, I have to delay the investigation by a couple of days due to some urgent work that has to be done with my daily tasks.

I will be back to you in the second half of the next week.

Regards,

Marius

0 Kudos
Reply