Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Strange behavior qtserialport on linux with custom baud rate

    General and Desktop
    2
    3
    681
    Loading More Posts
    • 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.
    • B
      Brian_l last edited by Brian_l

      Have an app that communicates through serial interface at 8192 baud rate. When setting baud rate in the app I get this error:
      Baud rate of serial port /dev/ttyUSB0 is set to 8193 instead of 8192: divisor 2929.687500 unsupported

      even though 8193 is well within the range that would be acceptable for communicating with device.
      If I set the baud rate to 8193 in the app, I still get the error:
      Baud rate of serial port /dev/ttyUSB0 is set to 8193 instead of 8193: divisor 2929.329834 unsupported

      It works flawlessly under windows.

      The base baud is 24000000 and the divisor should be 2929, but it's setting the divisor as a float. Not sure what's going on here, or why it's failing this check. Any input would be appreciated

      Version of QT is 5.5
      serial device is ftdi

      1 Reply Last reply Reply Quote 0
      • K
        kuzulis Qt Champions 2020 last edited by kuzulis

        The base baud is 24000000 and the divisor should be 2929

        No,

        24000000 / 8192 = 2929.6875
        24000000 / 8193 = 2929.3299157817649212742585133651

        Warning about there is no integer divider for the desired speed, and the near divider will be set (2929). So, speed will be 24000000 / 2929 = 8193.9228405599180607715944008194 baud.

        1 Reply Last reply Reply Quote 0
        • B
          Brian_l last edited by Brian_l

          thanks, that was really helpful

          1 Reply Last reply Reply Quote 0
          • First post
            Last post