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. QSerialPort max. custom BaudRate

QSerialPort max. custom BaudRate

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 5 Posters 2.4k Views
  • 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
    MB_1
    wrote on last edited by
    #1

    Hey Guys,
    I am currently trying to read hardware with 3,000,000 baud. Unfortunately QTSerialPort only offers rates up to 115200 baud. I have seen that it is also possible to enter your own baud rates (see: https://forum.qt.io/topic/38332/qserialport-custom-baudrate) This also works for me. Unfortunately, only baud rates up to 600,000 are possible. The packets sent do not arrive completely at higher baud rates. I hope someone can help me quickly.
    Thanks 😊

    KroMignonK Gojir4G 2 Replies Last reply
    0
    • M MB_1

      Hey Guys,
      I am currently trying to read hardware with 3,000,000 baud. Unfortunately QTSerialPort only offers rates up to 115200 baud. I have seen that it is also possible to enter your own baud rates (see: https://forum.qt.io/topic/38332/qserialport-custom-baudrate) This also works for me. Unfortunately, only baud rates up to 600,000 are possible. The packets sent do not arrive completely at higher baud rates. I hope someone can help me quickly.
      Thanks 😊

      KroMignonK Offline
      KroMignonK Offline
      KroMignon
      wrote on last edited by
      #2

      @MB_1 Hi and welcome to the forum. First which version of Qt you are using? What is the size of your packets?
      On some Qt Version, there are known issues with QSerialPort (Qt 5.12.5 and Qt 5.13.1).
      How do you read data from QSerialPort?

      It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

      1 Reply Last reply
      0
      • M Offline
        M Offline
        MB_1
        wrote on last edited by MB_1
        #3

        Hello @KroMignon , thanks for the quick reply. I am currently using QT 5.12.4 on a Windows 10 system. I am currently trying some things with an Arduino DUE, there the packet size I send is 4Byte. The actual hardware I want to connect is a sensor where the packet size is approximately 2600 bytes. But first I want to try using the Arduino at a higher baud rate. I know the Arduino cannot transmit at 3,000,000 baud, but 1,000,000 should be possible. However, as written above, I am currently only up to 600,000 baud. The call looks like this:

        if(arduino_is_available){
               qDebug() << "Found the arduino port...\n";
               arduino->setPortName(arduino_due_port_name);
               arduino->open(QSerialPort::ReadOnly);
               //arduino->setBaudRate(QSerialPort::Baud115200);
               arduino->setBaudRate(600000);
               arduino->setDataBits(QSerialPort::Data8);
               arduino->setFlowControl(QSerialPort::NoFlowControl);
               arduino->setParity(QSerialPort::NoParity);
               arduino->setStopBits(QSerialPort::OneStop);
              
               QObject::connect(arduino, SIGNAL(readyRead()), this, SLOT(readSerial2()));
               
               
        
        
           }else{.....
        
        KroMignonK 1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi and welcome to devnet,

          One maybe silly question but do you have another application on your machine that is able to communicate at such high speeds ?

          You could be hitting a limit of your computer and not of your device.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          3
          • M Offline
            M Offline
            MB_1
            wrote on last edited by
            #5

            Yes, I have software that can read the data of the sensor with the high baud rate. However, this software uses the manufacturer's drivers and the functions of the driver's .dll file are used.

            1 Reply Last reply
            0
            • M MB_1

              Hello @KroMignon , thanks for the quick reply. I am currently using QT 5.12.4 on a Windows 10 system. I am currently trying some things with an Arduino DUE, there the packet size I send is 4Byte. The actual hardware I want to connect is a sensor where the packet size is approximately 2600 bytes. But first I want to try using the Arduino at a higher baud rate. I know the Arduino cannot transmit at 3,000,000 baud, but 1,000,000 should be possible. However, as written above, I am currently only up to 600,000 baud. The call looks like this:

              if(arduino_is_available){
                     qDebug() << "Found the arduino port...\n";
                     arduino->setPortName(arduino_due_port_name);
                     arduino->open(QSerialPort::ReadOnly);
                     //arduino->setBaudRate(QSerialPort::Baud115200);
                     arduino->setBaudRate(600000);
                     arduino->setDataBits(QSerialPort::Data8);
                     arduino->setFlowControl(QSerialPort::NoFlowControl);
                     arduino->setParity(QSerialPort::NoParity);
                     arduino->setStopBits(QSerialPort::OneStop);
                    
                     QObject::connect(arduino, SIGNAL(readyRead()), this, SLOT(readSerial2()));
                     
                     
              
              
                 }else{.....
              
              KroMignonK Offline
              KroMignonK Offline
              KroMignon
              wrote on last edited by
              #6

              @MB_1 I think the hardware layer is USB? As @SGaist suggest you, I would first try it out with a serial terminal to verify that you don't hit hardware limit of your PC.
              You can use something like Realterm to verify it.

              It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

              1 Reply Last reply
              2
              • M MB_1

                Hey Guys,
                I am currently trying to read hardware with 3,000,000 baud. Unfortunately QTSerialPort only offers rates up to 115200 baud. I have seen that it is also possible to enter your own baud rates (see: https://forum.qt.io/topic/38332/qserialport-custom-baudrate) This also works for me. Unfortunately, only baud rates up to 600,000 are possible. The packets sent do not arrive completely at higher baud rates. I hope someone can help me quickly.
                Thanks 😊

                Gojir4G Offline
                Gojir4G Offline
                Gojir4
                wrote on last edited by
                #7

                @MB_1 Hi,
                Are your sure you hardware is able to reach this baud rate ?

                I successfully reached baud rate of 6'300'000 using QSerialPort with FTDI (C32HM-DDHSL-0) device when using this tool:
                https://github.com/hydrabus/hydratool

                I'm on Windows 10 and I used Qt 5.13

                1 Reply Last reply
                3
                • A Offline
                  A Offline
                  artem_pisarenko
                  wrote on last edited by artem_pisarenko
                  #8

                  Most likely it's a problem with specific version of drivers of specific device on specific OS. I've got into similar trouble. Communication via "CP2102 USB to UART" device with 1,5MBaud works under Linux but doesn't work under Windows 10 (with official drivers installed). And HTerm fails to open port too (saying "Error in OpenPort::Baudrate: Value of '1500000' not supported"), so it seems to be not Qt fault.

                  1 Reply Last reply
                  0

                  • Login

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