When I use the MPC57XX MBD toolbox to configure SPI and communicate with power chip, the data structure required by the power chip is 16-bit, as shown in the figure below, but only the 8-bit data transmission can be configured in the toolbox. Is there any way to solve it?
解決済! 解決策の投稿を見る。
Hello lijiantaowy@163.com,
For the SPI master transfer, in order to send more than one byte at once, you need to provide as input an array of uint8_t data type, as bigger as your frame should be.
For example if you want to send 16 bits, you need to declare the send variable as 1-d uint_t vector array of size 2.
Hope this helps,
Marius
That frames should be 16 clock cycles that why spi communication should be long as that
Hello lijiantaowy@163.com,
For the SPI master transfer, in order to send more than one byte at once, you need to provide as input an array of uint8_t data type, as bigger as your frame should be.
For example if you want to send 16 bits, you need to declare the send variable as 1-d uint_t vector array of size 2.
Hope this helps,
Marius
Thanks a lot, according to what you said, I have solved this problem.
Hello lijiantaowy@163.com,
Just wanted to add that if you want to send more than 16b, you should enable continuous transfer. The only thing you should pay attention to is that the size of the transfer buffer must be a multiple of the frame size. Let's take an example: you want to send 32b on MPC5744p. The framesize on this chip is from 4b to 16b maximum (hardware support). You could select 8b frame size, enable continuous transfer and enter as input to the block a vector of 4 elements of type uint8.
Hope this helps,
Razvan.