SPI receive - TI LAUNCHXL-F28379D

4 ビュー (過去 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

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeEmbedded Coder Supported Hardware についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by