Use Packet Input Block Read Serial Port, Get Incorrect Result After Certain Time

2 visualizaciones (últimos 30 días)
Use Packet Input block( serial port ) read sine waveform data(50Hz) from TI F28377S Launchpad
Baud rate: 12e6
Block Sample time = 0.0001;
Packet Input block gives incorrect value after Use 6.5795 seconds. Run simulation several time, problem occurs at the exact same time. Communication seems to be normal, because half of the result is correct. This looks like a software problem.
block.jpg
packet_input.jpg
"Data Read Port" and "Data Error Port" show result should be right.(Data Read =>1, Data Error=>0)
Changing baud rate slower does not solve the problem.
Use longer Packet Input block sample time, larger frame size( use buffer block, unbuffer block, change "Packet Input" - "Block output data types" to '10*uint16' ), does not help either.
Otherwise, the speed of FTDI FT2232H chip is fast enough for this kind of transmission( uint16, 10k points/sec => only 160kbps ). Simulink Desktop Realtime should support 20kHz model samping rate by help document.
Attachment packet_input.zip include Simulink Data Imspector Session( Waveform )
Thanks for your help.

Respuestas (0)

Productos


Versión

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by