I'm trying to use SPI communication using C2000, how to control the slave select pin ,what settings should be selected in hardware implementation? ?
15 次查看(过去 30 天)
显示 更早的评论
1) there are 3 SPI related blocks in library for C2000 ,SPI master transfer, SPI transmit & SPI receive . i want to communicate over one SPI channel only, so
a) which of these three blocks should i use for this?
b) there are two options to select slave select pin( provided by SPI peripheral & explicit GPIO pin select) , i tried using both options but i m getting different behavior on CS pin, in first case(spi peripheral) pin remains high in idle state ,at the start of transmission,it gets low but as soon as transmission is done it gets pulled up again.since i m expecting reply from slave also just after transmission , what should be the behavior of the CS pin , if it is required to remain low ,how do i control this pin, so that it remains low till full reply from slave is received?
when selecting second option(gpio pin), it gets low at start of transmission,and remains low till i send next command. is this the expected behavior or i m missng some setting for this PIN?
2)If using two SPI channels, what settings should be there for SPI blocks(in hardware implementation or in the specific blocks).
3)when communicating between two channels(using MBD) in same TI-launchpad, i m just sending data from one channel(MASTER)and trying to receive on second channel(SLAVE) through SPI, i m using SPI transmit block for first channel(MASTER) and SPI receive block for the second channel(SLAVE) , why i m getting data on MISO pin if i m not sending anything from SLAVE.?
4)please share some example model(MBD), where communication over SPI one channel is done , using two different dimension commands sending back to back in an interval of 1ms.
0 个评论
回答(1 个)
Aditya Padmanabha
2021-9-22
Hi Jyoti,
Please check the FAQ on this topic What are the use case scenarios for SPI (Master Transfer/Transmit/Receive) blocks when developing a Simulink Application for ... - MATLAB Answers - MATLAB Central (mathworks.com)
Thanks,
Aditya
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Run on Target Hardware 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!