Hi all,

I'm having trouble in reading data through serialport using QExtSerialPort. Now i'm working for microcontroller - PC communication through serial port.

The case is, if i booted my PC (WinXp) when i tried to read data through serial port using QExtSerialPort it reads junk char's repeatedly, but if i tried to read the same in Hyperterminal (or) SIOW software it reads properly.

After using Hyperterminal or SIOW to read data one time, my program (using same QExtSerialPort code)also reads the data properly (same program).

settings are all same on both ends.

Qt Code:
  1. bool ACR_UARTCOMM::serialPortInit(QString portname)
  2. {
  3. if(Pc_ACR_Commn.isOpen())
  4. {
  5. return true;
  6. }
  7. else
  8. {
  9. Pc_ACR_Commn.setPortName(portname);
  10. Pc_ACR_Commn.setBaudRate(BAUD9600);
  11. Pc_ACR_Commn.setDataBits(DATA_8);
  12. Pc_ACR_Commn.setParity(PAR_NONE);
  13. Pc_ACR_Commn.setStopBits(STOP_1);
  14. Pc_ACR_Commn.setFlowControl(FLOW_OFF);
  15.  
  16. if(Pc_ACR_Commn.open(QIODevice::ReadWrite))
  17. {
  18. return true;
  19. }
  20. else
  21. {
  22. QMessageBox::critical(0, "Error", "Error while opening port " + portname);
  23. return false;
  24. }
  25. }
  26. }
To copy to clipboard, switch view to plain text mode 

Friends help me sort out this problem where im doing wrong.