【发布时间】:2014-11-24 04:26:19
【问题描述】:
SerPIC = serial('COM10');
set(SerPIC,'BaudRate', 115200, 'DataBits', 8, 'Parity', 'none','StopBits', 1, 'FlowControl', 'software');
fopen(SerPIC); %--open the serial port to the PIC
fprintf(SerPIC, '%s', 'b');
fid = fopen('D:\pipt1.abs');
tline = fgets(fid);
while ischar(tline)
fprintf(SerPIC, '%s',tline )
tline = fgets(fid);
end
fclose(fid);
fclose(SerPIC) %--close the serial port when done
delete(SerPIC)
clear SerPIC
我正在使用 Tms570ls20216 USB。在板上我有引导加载程序。当我将 b 发送到板时,它会在获取 abs 文件后闪烁板。它在超级终端中正常工作,但在 matlab 中运行时不闪烁。我是matlab的新手。我的代码有什么问题吗?我不知道这是否是一个合适的地方问这个问题。如果不是很抱歉。
【问题讨论】:
标签: matlab serial-port