PL-RL
PL-RL

Reputation: 455

Send TTL signal through serial port in Matlab

I am trying to send a TTL signal through a serial port using Matlab. I just need to send 1 value to the device so it should be a really simple procedure. My problem is that I don't know if I am not doing this correctly or if the device is not processing the signal. My code is this:

mysignal = serial('com1');
fopen(mysignal);
fwrite(mysignal,1);

Upvotes: 4

Views: 3679

Answers (1)

achase90
achase90

Reputation: 236

I don't think you can output TTL using the actual serial port, as that is RS-232, not TTL logic levels. If you're using the serial port, you'll need a converter, like this. If you're using an FTDI driver/USB cable, that already outputs TTL logic levels, and the code looks good to me, which means the bug is probably on the device end.

Upvotes: 11

Related Questions