필터 지우기
필터 지우기

binary text file transfer via serial port to FPGA

조회 수: 2 (최근 30일)
Anjani Chaudhary
Anjani Chaudhary 2020년 2월 1일
답변: Nikhil Sonavane 2020년 2월 4일
I am trying to transfer binary text file via virtual serial port to FPGA and receive the result after being processed in FPGA. I am using below code to do it.
a=serial('COM5','BaudRate',115200);
fopen(a)
fid = fopen('testfile.txt');
txdata = fread(fid,inf,'uint8','ieee-be');
%%uint8 = 8bit ieee-be = big endian
fwrite(a,txdata,'uint8');
fclose(a);
But I am getting error: unsuccessful write to comp port. Testfile contains binary matrix value. When I display txdata, it is giving some random value.
Please help!
Anji

답변 (1개)

Nikhil Sonavane
Nikhil Sonavane 2020년 2월 4일
You may refer to this existing MATLAB Answer for help.

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by