LAUNCHXL-F28379D: Simulanting SPI with 2 Slaves, using 'TI C2000 target library' for PLECS

8 views (last 30 days)
Hi,
I was trying to simulate/configure SPI interface with 2 slaves... I used SPI Master & Slave components from the TI C2000 target available under the PLECS library.
For now I just want to send data from Master to 2 Slaves.
E.g. I would like to send 1,2,3,4,5,6,7,8 from the master and receive 1,3,5,7 at slave1 & 2,4,6,8 at slave2
But what I see on both slaves is the copies of the master.
i.e, Master is sending 1,2,3,4,5,6,7,8 ....Slave1 & Slave2 and receiving 1,2,3,4,5,6,7,8

Answers (1)

Animesh
Animesh on 11 May 2023
Hi Pradeep,
I understand that you are trying to simulate a SPI between a master and 2 slaves using TI C2000 target.
The configuration seems to be a problem here. Please consider having a look at the following documentations and shipping examples for the right use of components according to your use-case:
  1. Use case scenarios for SPI (Master Transfer/Transmit/Receive) blocks when developing a Simulink Application for TI C2000: https://in.mathworks.com/matlabcentral/answers/770813-what-are-the-use-case-scenarios-for-spi-master-transfer-transmit-receive-blocks-when-developing-a
  2. Write data to and read data from SPI peripheral device: https://in.mathworks.com/help/ti-c2000/ref/c28xspicontrollertransfer.html
  3. To receive data through Serial Peripheral Interface (SPI) on target: https://in.mathworks.com/help/ti-c2000/ref/c28xspireceive.html?searchHighlight=SPI%20for%20c2000&s_tid=srchtitle_SPI%20for%20c2000_9
  4. To transmit data through Serial Peripheral Interface (SPI) on target: https://in.mathworks.com/help/ti-c2000/ref/c28xspitransmit.html?searchHighlight=SPI%20for%20c2000&s_tid=srchtitle_SPI%20for%20c2000_10
I hope this helps.

Categories

Find more on Code Generation for ARM Cortex-M and ARM Cortex-A Processors in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!