SPI receive - TI LAUNCHXL-F28379D
조회 수: 7(최근 30일)
I'm working in a control project using LAUNCHXL-F28379D. I have installed all the third-party software "TI ControlSuite 3.4.2 / TI CCS 8 / TI C2000ware 1.00.04" and the Simulink Embedded coder support package "Embedded Coder Support Package for Texas Instruments C2000 Processors - version 18.1.0".
I want to receive data from other controller using SPI communication.
To simulate the receiving data, I implemented a loop-back with physical connections: I used SPI-A as master mode to transmit data and SPI-B as slave mode to receive the data. See picture below
Also, see SPI config
The problem is: I always receive data 0 and the status is 0 !!!
what did I do wrong?
Fares Marjieh Control Engineer
Aditya Padmanabha 2018년 5월 25일
Please use the latest update of the support package - "18.1.2" (in the MATLAB main window go to Add-Ons --> Check for Updates --> Hardware Support Packages) as we made recent changes to the SPI module.
In the above settings, looks like you are trying to use SPI in tri-wire mode. In tri-wire mode, we need to set TALK bit to 1 for transmitting the data and set TALK to 0 for receiving the data. But in our code, we are setting the TALK bit to 1 by default causing SPI to be in transmit mode always.
We are currently tracking this issue internally. I apologize for the inconvenience caused, we will work on this issue and fix it as soon as possible in the future support package updates.
I have a workaround to unblock you in the meantime. You can use the custom code with the SPI Transmit and Receive block to set the TALK bit to 1 or 0 before Transmit and Receive block. I have attached one example model for your reference.