Results 1 to 7 of 7

Thread: qextserialport BAUDRATE problem

  1. #1
    Join Date
    Mar 2008
    Posts
    46
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default qextserialport BAUDRATE problem

    Hi friends i am working on a serial communication project in Qt. I am using qextserialport for the serial communication.I am trying to send some data from one computer to another computer and receive it and view it in Hyperterminal. But there seems to be a small problem the data is received on the HyperTerminal only with some BaudRates like (9600,38400,115200.... etc) and when i change the BAUDRATE in the program the BAUDRATE does't change, i think it is taking some default value. I confirmed it by checking the output waveform in the CRO with different BAUD RATES but i get the same waveform for all the different BAUDRATES i have tried. What do you think the problem is, How can i solve my problem so that the BAUDRATE actually changes when i change in the program.

    This is the code i am using.
    Qt Code:
    1. void frame:: framegeneration()
    2. {
    3. static const char mydata[] = {0x0c, 0x14, 0x03, 0x84, 0x78, 0x9c, 0x3b, 0x76,
    4. 0xec, 0x18, 0xc3, 0x31, 0x0a, 0xf1};
    5. QByteArray data = QByteArray::fromRawData(mydata, sizeof(mydata));
    6. char i1 = port->write(data.toHex(),data.length());
    7. textEdit->append(data.toHex());
    8. }
    To copy to clipboard, switch view to plain text mode 

    These are the settings for the port in the constructor.
    Qt Code:
    1. setupUi(this);
    2. port = new QextSerialPort("COM1");
    3. port->setBaudRate(BAUD19200);
    4. port->setFlowControl(FLOW_OFF);
    5. port->setParity(PAR_NONE);
    6. port->setDataBits(DATA_8);
    7. port->setStopBits(STOP_2);
    8. port->open(QIODevice::ReadWrite | QIODevice::Unbuffered);
    To copy to clipboard, switch view to plain text mode 

    Thank You

  2. #2
    Join Date
    Jul 2008
    Posts
    6
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: qextserialport BAUDRATE problem

    hi...
    i hav worked on same type of project...i think the problem is in the receving terminal...since in hyperterminal u can receive bytes only on standard baudrates that are available...suppose u set the hyperterminal to receive bytes on baud 2400 and ur program is sending the data at baud 2500;so it wil not display the data...

    it's better to write program for receiving end to read the data at the baud u want..

    thanks...
    awanish_jmi@yahoo.com

  3. #3
    Join Date
    Mar 2008
    Posts
    46
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: qextserialport BAUDRATE problem

    Hey thanks for the reply, Actually i will be connecting the RS-232 cable to a target board and then from the the target board it will connected to another computer to check out in its Huperterminal. So i really don't think i can write a program to receive and display on other computer. Actually the test program written in Qt with qextserialport works perfectly fine i can receive and display it on the other computer but i get the problem when i try to view it on the HyperTerminal. It is not consistent i can receive and view the data at times and all of a sudden it stops working. I cross checked all the hardware connections replaced the RS232 cables also but no luck. I think its because of the Baud and other serial comm configuration. The configuration which i have given in the program is not setting at all i think the program is taking some default values on it own. !!


    Thank You

  4. #4
    Join Date
    Mar 2008
    Posts
    46
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: qextserialport BAUDRATE problem

    Hello

    Has any one sucessfully done a program in Qt using qextserialport to send some data or any thing to another computer using RS232 and receive it on the other computers Hyperterminal. I am having serious problems with qextserialport in communicating with the Hyperterminal. I am able to send data using the same program and the same settings to another computer to a program written in Qt to receive from comm port. I downloaded a windows program and tested it in which i can view every thing i send on the other computers Hyperterminal. But no luck with qextserialport. Any body have some idea regarding this problem.


    Thank You

  5. #5
    Join Date
    Jun 2006
    Posts
    64
    Thanks
    10
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: qextserialport BAUDRATE problem

    G'Day,

    I have played with qextserialport a little bit and found that I had to close the serial port then change the baud rate and reopen the serial port again. I also found hyperterminal to be flakey. I used minicom under Linux and Telex under windows when testing my apps.

    Hope this helps...

    B1.

  6. #6
    Join Date
    Mar 2008
    Posts
    46
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: qextserialport BAUDRATE problem

    Hey i have a small problem there. Actually i have to communicate with a ATMELTarget board to its Hyperterminal, So if i see the data pass through the systems hyperterminal it will be the same for Target Board. Thats the reason i have to use Hyperminal program to test my program before i cud actually use it on the target board. ??!!


    Thank You

  7. #7

    Default Re: qextserialport BAUDRATE problem

    Quote Originally Posted by b1 View Post
    I have played with qextserialport a little bit and found that I had to close the serial port then change the baud rate and reopen the serial port again. I also found hyperterminal to be flakey. I used minicom under Linux and Telex under windows when testing my apps.
    I know - this is an old thread, but maybee this helps others.

    Under Linux, I also had to to close the serial port then change the baud rate and reopen the serial port again.

    Under Window - this didn't work. I had to do it the other way arround. First open the port, and than set the baud rate. Strange - but that's how it works for me.

    Frank

Similar Threads

  1. Steps in solving a programming problem?
    By triperzonak in forum General Programming
    Replies: 8
    Last Post: 5th August 2008, 08:47
  2. Problem in QExtserialport program.
    By dheeraj in forum Qt Programming
    Replies: 5
    Last Post: 31st May 2008, 10:24
  3. Replies: 16
    Last Post: 7th March 2006, 15:57

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.