MATLAB serial communication with Prop
Anyone here achieved serial communication between their Prop and MATLAB? I'm attempting to use FullDuplexSerialPlus along with the MATLAB commands specified in the help docs. I'm struggling to get the devices to even connect on the COM port.
Thanks for any help.
Thanks for any help.
Comments
As in the Parallax Serial Terminal window? Done. It's not what I'm trying to send that I'm stuck on, it's simply connecting the Prop and MATLAB to the COM port that I'm stuck.
(Note: Sending me links to the MATLAB help files will not assist me further at the moment, I'm already looking through those).
CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 DAT message byte "Hello World",0 OBJ serial : "FullDuplexSerial" PUB main serial.Start(31, 30, 0, 115200) repeat serial.str(@message) serial.tx(13) waitcnt(cnt + clkfreq/2)
Matlab
function SerialTest() % Set the port paramenter s=serial('COM5', 'BaudRate', 115200, 'Parity', 'none', 'DataBits', 8, 'StopBits', 1); s.terminator = 'CR'; % open the port fopen(s); % display the com port resources com = instrfind; disp(com); % Expecting x bytes out=fread(s,11); % Display the byte disp(out); % Clean up fclose(s); delete(s); clear s; end
I don't have Matlab so I don't know how useful this information would be for you.
Jeff T.