你好
我正在做一些介绍来了解 MSP430的通信方式、我需要使用 MATLAB。
因此、该程序是一个具有电位器的简单 ADC 转换器。 在 CCS 中一切正常、我可以将正确的位传递给 UCA0TXBUF、但在 Matlab 中、我接收到的结果是不同的。
删除(instrfind)%删除打开的端口
清除
关闭
CLC
%%%%%%%%%%%%%% 串行特定属性%%%%%%%%%%%%%%%%%%%%%%%%%%
Dados =串行('COM7');% define serial port object
Dados。InputBufferSize = 2;
Dados。baudrate = 9600;
Dados。DataBits = 8;
Dados。StopBit = 1;
Dados。Timeout = 10;
Pause (0.1)
fopen (Dados)%将串行端口对象连接到器件
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
对于 I = 1:1:1000
、而 Dados.BytesAvailable < Dados.InputBufferSize
结束
价目表= fread (Dados);从器件读取二进制数据的百分比(数值)
暂停(0.001)
%read (obj、Nintdata、'uint16');
aux (1、I)= typecast ([uint8 (valores (1、1))))、uint8 (valores (2、1)]、'uint16
(aux);disp);
%teste = cast (aux (1、i)、'uint16');
disp (aux);
end
delete (instrfind)
我有具有交叉跳接连接器的 REV 1..4