Timeline for Matlab and Arduino Serial communication
Current License: CC BY-SA 3.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Nov 13, 2015 at 18:17 | comment | added | slash-dev | DTR is probably not the culprit. On the PC side, you must go out of your way to enable DTR handshaking. On the Arduino side, there's nothing in the HardwareSerial class that does hardware handshaking. I don't know which Arduino you're using, so I don't know what's handling the USB interface. If it's using an FTDI chip, it can do DTR/DSR handshaking. More likely, it's just waiting a little bit to gather serial data to send to the PC in a packet. Below some threshold (64 bytes?), it will wait to see if more data is coming. | |
Nov 12, 2015 at 16:35 | history | edited | slash-dev | CC BY-SA 3.0 |
grammar
|
Nov 11, 2015 at 22:27 | comment | added | the_parzival | Yes, i agree, it might be one of the reason. Do you think the (DTR - Data Terminal Ready) of the arduino might be the culprit here? I have obeserved some scenarios arduino taking some time to print to serial monitor. | |
Nov 11, 2015 at 14:48 | comment | added | slash-dev |
Because MATLAB runs on so many OS's, it will exhibit slight differences between platforms. In this case, the resolution of the timers used by MATLAB is only 1 second: pausing (0,1] could be no pause, pausing (1,2] is <= 1s, etc. Because there are so many things going on in the background in Windows, and it's not a Real Time OS, the MATLAB developers may have simply said, "Windows Update might be running... Close enough!" :P I have found MATLAB examples that use pause(1) , so sub-second resolution isn't something you should count on. Answered? :)
|
|
Nov 11, 2015 at 12:15 | comment | added | the_parzival |
Yes i thought of it and tried it yesterday, but with pause(2) . It works perfectly when i put a pause of 2 seconds in MATLAB, but i couldn't come up with the reason. Since you just said that it(pause) might be the reason, would you care to explain why i have to extend the pause time when i am connecting it to Arduino. I tried with pause(1) but not fruitful, the thought is killing me from yesterday why pause(2) ??
|
|
Nov 10, 2015 at 22:24 | review | First posts | |||
Nov 24, 2015 at 19:53 | |||||
Nov 10, 2015 at 22:23 | history | answered | slash-dev | CC BY-SA 3.0 |