How do I Transmit to Multiple SPI Devices on the Same Module in Simulink on a C2000?
2 次查看(过去 30 天)
显示 更早的评论
MathWorks Support Team
2024-7-31
回答: MathWorks Support Team
2024-8-30
I have a Simulink model that I will be deploying to a TI C2000 board. One of the board's SPI modules (also known as controllers) will be connected to two or more external SPI sub devices (also known as peripherals). I am sending data using the SPI Transmit block.
The appropriate device is chosen by the chip select pin (CS) option in Block Parameters, which must change depending on which device I would like to communicate with. While I can assign the chip select pin to a variable, when I change the variable's value, the block does not update to use the new value.
How do I select which SPI device to transmit data to?
采纳的回答
MathWorks Support Team
2024-7-31
Each SPI Transmit block is only for use with one peripheral device. Not being able to change the chip select pin during use is intentional. You will need one SPI Transmit block for each peripheral SPI device. Note that multiple SPI Transmit blocks can share a single SPI module.
To control when to send data, you can place an SPI Transmit block inside an enabled subsystem. Whenever the subsystem is disabled, no new data will be queued for transmission.
We have detailed documentation available for enabled subsystems, with examples:
For more information about the SPI Transmit block, please reference this page:
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 C2000 Microcontroller Blockset 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!