Issues with Serial Communication of TMS320F28379D using SCI with Matlab Simulink

9 views (last 30 days)
Hi there,
I coded the F28379D, to generate 20 ms sinewave using Matlab simulink as shown below.
Case 1:
Sine Sample time: 5e-3
Sine Samples Per Second: 4
Rate transition of trasmitter: 5e-3
sample time of receiver: 5e-3
->The result at receiver end of Matlab was as expected as shown below,
Case 2:
->To improve the resolution of the sine wave, the data is modified as,
Sine Sample time: 1e-3
Sine Samples Per Second: 20
Rate transition of trasmitter: 1e-3
sample time of receiver: 1e-3
->The received data is having the unexpected high values after 3 secs. Before 3 secs data was fine.
What is the reason for such behaviour?. Is a rate transition value of 5e-3, the lowest I can use for the transmitter for this board? How can I find the lowest supported rate transition for error free operation?.
The hardware settings are as shown below,
The SCI transmitter Header and Terminator are set to null i., ''.
Mathworks Version: 2020a
CCS Version:8.3.1
Thanks.

Answers (1)

Aabha
Aabha on 26 Mar 2025
I tried to reproduce the issue that you are facing by creating a similar model, but I was not able to. The model is working fine for me, and I was able to obtain the expected output. The model seems to work fine at my end for the rate transition value of 1e-3 as well. However, when dealing with microcontrollers, several factors can affect the behaviour of your system. Here are some options you can try, for troubleshooting the setup:
  1. Ensure that the SCI Channel being used for communication (in this case, SCI A) is not being used by any other task running on the device. Try changing the channel to SCI B or SCI C to identify if that is the problem.
  2. Ensure that the baud rate is same in both the target and the host model, and it is correctly configured to configure the amount of data that you want to send. While implementing two-model data logging in MATLAB, there is a limit on the amount of data that can be sent depending on the baud rate of the device, and transmission frequency. The number of signals that can be logged depends on the baud rate and the rate at which the data is transferred.
For example, consider that we need to transfer 10 bytes of data at 20kHz.
  • 10 bytes * 20,000Hz = 200,000 bytes/s
  • 200,000 bytes/s * 10 bits/byte = 2,000,000 bits/s (baud rate) i.e. 2e6.
The desired baud rate in this case is 2e6 i.e, 2 Mbps.
You can refer to the following documentation for more details about the maximum number of signals that can be sent using SCI:
Additionally, I noticed that you are using the ‘Rate Transition’ block in the model, between the ‘Sine Wave’ input and the ‘SCI Transmit’ block. The ‘Rate Transition block is usually used when we wish to transfer data from the output of a block operating at one rate to the input of a block operating at a different rate. Since in this case, both the blocks have equal sample time, the ‘Rate Transition block is not necessary.
I hope this is helpful to you.

Products


Release

R2020a

Community Treasure Hunt

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

Start Hunting!