Serial Port not writing

7 visualizzazioni (ultimi 30 giorni)
John
John il 7 Ago 2014
Risposto: John il 7 Ago 2014
In Matlab 2014a (on ubuntu 12.04, 64-bit), a serial port that I'm writing to doesn't actually output anything from the FTDI-RS232 cable. As seen by a scope, no bits are being sent, the line remains high. There is no matlab error, and "ValuesSent" increments as it should every time i "transmit". However, TransferStatus remains idle all the time.
I can read data IN to matlab over another serial port just fine, but i'm not trying to write to that one. Thoughts on why a port wouldn't be writing? I have given the appropriate read-write privileges to the port, and if i didn't I'd get a port-open error. No flow control is needed.
s = serial('/dev/ttyUSB2','BaudRate',115200,'DataBits',8, 'StopBits', 1);
fopen(s);
s.FlowControl = 'none';
fprintf(s, '%s', 'asbc');
---------------------
get(s) gives:
ByteOrder = littleEndian
BytesAvailable = 0
BytesAvailableFcn =
BytesAvailableFcnCount = 48
BytesAvailableFcnMode = terminator
BytesToOutput = 0
ErrorFcn =
InputBufferSize = 512
Name = Serial-/dev/ttyUSB2
ObjectVisibility = on
OutputBufferSize = 512
OutputEmptyFcn =
RecordDetail = compact
RecordMode = overwrite
RecordName = record.txt
RecordStatus = off
Status = open
Tag =
Timeout = 1
TimerFcn =
TimerPeriod = 1
TransferStatus = idle
Type = serial
UserData = []
ValuesReceived = 0
ValuesSent = 260
SERIAL specific properties:
BaudRate = 115200
BreakInterruptFcn =
DataBits = 8
DataTerminalReady = on
FlowControl = none
Parity = none
PinStatus = [1x1 struct]
PinStatusFcn =
Port = /dev/ttyUSB2
ReadAsyncMode = continuous
RequestToSend = on
StopBits = 1
Terminator = CR/LF

Risposte (2)

John
John il 7 Ago 2014
Huh, turns out it was a bad usb to serial cable. Lost hours on this, but it does work now.

alican kara
alican kara il 14 Lug 2020

Categorie

Scopri di più su Visualization and Data Export in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by