Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Serial com port and break signal
Forum Updated to NodeBB v4.3 + New Features

Serial com port and break signal

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 3 Posters 2.4k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mrdebug
    wrote on 25 Jul 2016, 15:33 last edited by
    #1

    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.

    Need programmers to hire?
    www.labcsp.com
    www.denisgottardello.it
    GMT+1
    Skype: mrdebug

    1 Reply Last reply
    0
    • P Offline
      P Offline
      Paul Colby
      wrote on 25 Jul 2016, 22:39 last edited by
      #2

      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.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mrdebug
        wrote on 26 Jul 2016, 06:37 last edited by
        #3

        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.

        Need programmers to hire?
        www.labcsp.com
        www.denisgottardello.it
        GMT+1
        Skype: mrdebug

        1 Reply Last reply
        0
        • P Offline
          P Offline
          Paul Colby
          wrote on 26 Jul 2016, 21:57 last edited by
          #4

          @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?

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mrdebug
            wrote on 27 Jul 2016, 07:24 last edited by
            #5

            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 ms

            the sequence
            SerialPort.setBreakEnabled(true);
            SerialPort.setBreakEnabled(false);
            requires 10 ms, 5 up, 5 down.

            I need only 1 ms.

            Need programmers to hire?
            www.labcsp.com
            www.denisgottardello.it
            GMT+1
            Skype: mrdebug

            1 Reply Last reply
            0
            • K Offline
              K Offline
              kuzulis
              Qt Champions 2020
              wrote on 27 Jul 2016, 08:43 last edited by
              #6

              I need only 1 ms.

              It is impossible then.

              1 Reply Last reply
              0
              • P Offline
                P Offline
                Paul Colby
                wrote on 27 Jul 2016, 22:35 last edited by
                #7

                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 Reply Last reply
                0

                1/7

                25 Jul 2016, 15:33

                • Login

                • Login or register to search.
                1 out of 7
                • First post
                  1/7
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved