Matlab serial communication

Thread Starter

shaby

Joined Oct 11, 2012
2
hello every1..!!

can any one tell me that how i can do serial communication in matlab???
through usb port... i want a high and low bit at the output.... usb port have 4pins... how i get the output?? please anyone help me
 
Last edited by a moderator:

panic mode

Joined Oct 10, 2011
2,754
you didn't provide much info about what exactly you want to accomplish.

according to it's name, USB is a serial bus, but to many word 'serial' usually means RS232 (although there are many more...). USB has 4 pins, two of them are power and reamining two are data lines. to get actual output at very least you would need a USB to RS232 converter.
 

Stuntman

Joined Mar 28, 2011
222
Serial ports in MATLAB are not too bad. The help manual within the software will be your best friend. I would include some source code of previous uses, but I don't have access at the moment.

Going from memory:

First, find where your USB device is "docking" (com0, com1...).
Open the serial port to MATLAB. Can't remember command.
Next, you may have to declare the buffer.
Now read from the buffer in commanded number of bytes.

panic... you are thinking low level serial. A PC interprets USB data and can be piped to MATLAB.
 

MrChips

Joined Oct 2, 2009
30,821
USB is a serial bus. Two wires are power and ground. Other two wires are differential data.
You cannot use USB as a single bit output port as you would with a LPT port.
 
Top