Serial com port and break signal
-
wrote on 25 Jul 2016, 15:33 last edited by
Hi everybody. Is there a way to send a break signal for 0.5 ms on Linux?
This feature seems to be available only on Windows but on Linux the break signal, send with the function
tcsendbreak,
requires at least 250 ms. -
wrote on 25 Jul 2016, 22:39 last edited by
Hi @mrdebug,
I know nothing about this topic, but its an interesting question :)
on Linux the break signal, send with the function tcsendbreak, requires at least 250 ms.
Why do you say it requires at least 250ms?
The man page says:
If duration is not zero, it sends zero-valued bits for some implementation-defined length of time.
So it's going to be platform-dependant, but since you're specifically asking about Linux, the same man page goes on to say:
The effect of a nonzero duration with tcsendbreak() varies ... Linux, AIX, DU, Tru64 send a break of duration milliseconds.
It does mention that SunOS has a 250ms minimum limit, but suggests that does not apply to Linux.
Have you tried it? :)
Cheers.
-
wrote on 26 Jul 2016, 06:37 last edited by
After have verified with an oscilloscope the function, if it is different from 0, seems to be defined in seconds and not in milliseconds. I need a break signal for only one millisecond.
-
wrote on 26 Jul 2016, 21:57 last edited by
@mrdebug said:
verified with an oscilloscope the function, if it is different from 0, seems to be defined in seconds and not in milliseconds.
So, for example, if you do:
tcsendbreak(fd, 60);
Will it spend 60 seconds doing a break, or just 1 second? The former would indicate that the documentation is wrong for your platform (assuming it's Linux based), the latter that your platform has some minimum.
What platform (hardware + software) are you using?
-
wrote on 27 Jul 2016, 07:24 last edited by
Linux, now on an intel machine, in the future on a beaglebone board.
tcsendbreak(SerialPort.handle(), 0); means 250 ms
tcsendbreak(SerialPort.handle(), 1); means 100 ms
tcsendbreak(SerialPort.handle(), 10); means 100 ms
tcsendbreak(SerialPort.handle(), 60); still 100 msthe sequence
SerialPort.setBreakEnabled(true);
SerialPort.setBreakEnabled(false);
requires 10 ms, 5 up, 5 down.I need only 1 ms.
-
I need only 1 ms.
It is impossible then.
-
wrote on 27 Jul 2016, 22:35 last edited by
It does sounds like your platform (driver or hardware) is imposing a minimum of 100ms.
What baud rate did you open the serial port with?
1/7