SPI receive - TI LAUNCHXL-F28379D

조회 수: 7(최근 30일)
Oleg Tilishevsky
Oleg Tilishevsky 2018년 5월 3일
댓글: Zak Campbell 2020년 4월 30일
Hi Friends,
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?
Thank you,
Fares Marjieh Control Engineer

답변(1개)

Aditya Padmanabha
Aditya Padmanabha 2018년 5월 25일
Hi Oleg,
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.
Thanks,
Aditya
  댓글 수: 1
Zak Campbell
Zak Campbell 2020년 4월 30일
Hello fellow C2000 users. I am wondering if the last comment made on this topic still stands as of April 2020. I am using embedded coder support for th C2000 version 19.2.2. I am in need of fixing the 3 wire communications issue I have, where, similar to the problem statement above, I am getting all zeros read out of the peripheral when I am seeing pretty clear data being read out on the o-scope.
Thanks,
Zak

댓글을 달려면 로그인하십시오.

범주

Find more on Embedded Coder 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!

Translated by