send and receive data between F28379d and simulink

2 visualizzazioni (ultimi 30 giorni)
hiii
i bulid target file on F28379d and go the host file to recevie date but the result find zero
please do the blok is true?
are there work in setting in my Pc to work the host ?

Risposte (1)

Anudeep Kumar
Anudeep Kumar il 14 Mag 2025
Hey reham,
I reviewed your model and encountered the same issue you described. After investigating further, I identified a few areas that needed adjustment, which I’ve detailed below.
  • In the host model ‘Serial Receive’, ‘Serial Send’ and ‘Serial configuration’ blocks were used. For host-side serial communication, it is recommended to use ‘Host Serial Receive’, ‘Host Serial Transmit’ and ‘Host Serial Setup’ blocks. This is because ‘Host Serial’ blocks are specifically designed for configuring the host-side serial interface, whereas the ‘Serial Receive’ and related blocks are typically used for receiving binary data
  • In the target model, the package header was set to ‘S’ and the terminator to ‘E’. However, in the ‘Serial Receive’ and ‘Serial Send’ blocks, the header and terminator were set as ‘[83 83]’ and ‘[69 69]’ respectively. Updating these values to ‘S’ and ‘E’ in the ‘Host Serial Transmit’ and ‘Host Serial Receive’ blocks resolved the issue.
  • The Data size was set to [2 250] in the ‘Serial Receive’, changing it to 1 resolved the issue. The Data Size parameter determines the output size or the number of values read at each time step. Setting it to [2 250] expects a 2x250 matrix, but since we were transmitting a sine wave (as per your requirement) via the ‘Host Serial Transmit’ block, a size of 1 is appropriate.
  • The sample time in all the blocks used should be the same.
The one above is recieved signal which has an amplitude 10 times the transmitted one:
I have attached the updated model with the changes made.
You can refer the documentation of an example on Serial Communication Using SCI Blocks, for further info.
You can also refer to the documentation of ‘Host Serial Receive’, ‘Host Serial Transmit’ and ‘Host Serial Setup’ blocks:
I hope this helps!

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by