This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] RF430FRL152HEVM:如何使用 MATLAB 通过 TFR7970从 Rf430FRL152HEVM 读取数据

Guru**** 1687510 points
Other Parts Discussed in Thread: RF430FRL152H, TRF7970A
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/wireless-connectivity/other-wireless-group/other-wireless/f/other-wireless-technologies-forum/1401018/rf430frl152hevm-how-to-use-matlab-to-read-data-from-rf430frl152hevm-through-tfr7970

器件型号:RF430FRL152HEVM
主题中讨论的其他器件:RF430FRL152HTRF7970A

工具与软件:

我已经生成了一个 MATLAB 代码来获取存储在 RF430rfl152hevm 中的 Block9中的数据、但它不起作用。 可以帮助我更正该代码吗?

clear all;
clc;
% set serialport
comPort = 'COM3'; 
baudRate = 115200;
s = serialport(comPort, baudRate);

% set port parameters
set(s, 'Timeout', 3); 
configureTerminator(s, "LF"); 

 %Communication begin
 fopen(s);

 % record file for debugging
 %s.RecordName = 'myRecord.txt';
 %record(s);

 %%set up MCU

 % start MCU
 %010A0003041001210000
 startMCU=uint8([0x01, 0x0A, 0x00, 0x03, 0x04, 0x10, 0x01, 0x21, 0x00, 0x00]);
 write(s, startMCU,"uint8");

 % set datarate
 %010C00030410002101020000
 datarate=uint8([0x01, 0x0c, 0x00, 0x03, 0x04, 0x10, 0x00, 0x21, 0x01, 0x02, 0x00, 0x00]);
 write(s, datarate,"uint8");
 
 %set agc toggle
 % 0109000304F0000000
 agcTtoggle=uint8([0x01, 0x09, 0x00, 0x03, 0x04, 0xF0, 0x00, 0x00, 0x00]);
 write(s, agcTtoggle,"uint8");
 %set amp toggle
 % 0109000304F1FF0000
 ampmToggle=uint8([0x01, 0x09, 0x00, 0x03, 0x04, 0xF1, 0xFF, 0x00, 0x00]);
 write(s, ampmToggle,"uint8");
 
 pause(0.5);

 % set up command
 %010B000304180220090000
 readingBlock=uint8([0x01, 0x0B, 0x00, 0x03, 0x04, 0x18, 0x02, 0x20, 0x09, 0x00, 0x00]);
 write(s,readingBlock,"uint8");
 
 % delay to sample
 %pause(0.5);
 response = fgetl(s); 

% 显示响应数据
disp('从TRF7970A读取的数据:');
disp(response);

% 完成后关闭串行端口
% 关闭串口
clear s;