SPI communication in Simulink / Embedded Target TI C2000

조회 수: 7(최근 30일)
Klaas
Klaas 2011년 11월 2일
답변: Venkatachala Sarma 2016년 6월 3일
Hi everybody, I am working on a SPI communication between a TI28335 microcontroller and an AMIC A25L40PU flash memory. My hardware connections are good and so far I am able to send and receive data. Though, there is a problem: I can only send fixed-size commands via the SPI Transmit block but I need to send variable-size commands. For instance, my initialization command is 8bit and all others are at least 16bit or even longer. I've already tried to split my longer commands into pieces of 8bit each. The result was that the SPI chip select as well as the SPI clock went inactive between each of those pieces. Or in other words: Every 8bit piece was handled as an independent SPI transmission instead of sending one big stream. Is there a way in Simulink to avoid this problem and put all 8bit pieces into one single SPI communication stream?
Thanks in advance, Klaas

답변(1개)

Venkatachala Sarma
Venkatachala Sarma 2016년 6월 3일
You will be able to change the Data bits setting of SPI communication only during compile time in Simulink. SPI Communication happens during run-time in the target and changing settings like Data bits are not provided in any of the support package blocks directly. However you can use the custom code blocks in Simulink Coder and directly write the registers to change such settings. Please see the following link to understand how to write the registers directly.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by