Results 1 to 7 of 7

Thread: Need to set up a connection between my microcontroller and my Qt application (R/W)

  1. #1
    Join Date
    Feb 2013
    Posts
    6
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default Need to set up a connection between my microcontroller and my Qt application (R/W)

    I am trying to make communication between my micro-controller and my Qt application...

    what i want to do is to read the data sent in from the micro-controller(connected via USB cable) and to sent data back to it as well..

    i understand i need to make a serial communication which is done through the RX & TX pins of the uC and there would be a converter which then gives the signal to the D+ & D- of the USB cable...

    Pls correct me if i am wrong...

    I did search some sites and found that i need "QtextSerialPort" library... but is this the same thing that i need even when i am using the USB cable..
    also if i need this library file... i dont know how to add them...

    Please help me out in this one...its urgent...

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Need to set up a connection between my microcontroller and my Qt application (R/W

    Isn't there a forum for your uC where you can ask hardware-related questions? That has nothing to do with Qt.

    That forum should also have information about serial port drivers. Almost certainly if your uC is a common one such as Arduino, there are drivers available for most operating systems. Get one, install it, and read the documentation on how your read and write to the driver. Someone may have already written a Qt app to do this.

    This sounds a little bit like a homework problem to me, so if it is, don't expect that someone here (or on the uC forum) is going to give you detailed information on how to do this.

  3. #3
    Join Date
    Feb 2013
    Posts
    6
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Need to set up a connection between my microcontroller and my Qt application (R/W

    Isn't there a forum for your uC where you can ask hardware-related questions? That has nothing to do with Qt.

    i have done my homework on the hardware part and i know how to sent and receive data from the uC but as u see that's not the part where i am having the trouble..
    I need to come up with a Qt application, so for that i am not familiar with the serial communication coding part of the Qt application...

    And i tried to search the net for some help... but i was not much of a success in that..

    Someone may have already written a Qt app to do this
    can anyone atleast show me to that... so that i may learn fron its source code...
    Pls help me start up with the serial communication coding in Qt Creator.. That's where i need the help and not the hardware part

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Need to set up a connection between my microcontroller and my Qt application (R/W

    Ok, but what exactly is the question?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Feb 2013
    Posts
    6
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Need to set up a connection between my microcontroller and my Qt application (R/W

    Quote Originally Posted by wysota View Post
    Ok, but what exactly is the question?
    I want to write a Qt application from which i can communicate to my micro-controller...
    i want to read the data that the uC sends and to display it in the application
    Similarly i want to sent data to the uC..

  6. #6
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Need to set up a connection between my microcontroller and my Qt application (R/W

    So, it sounds like the steps you need to take are:

    1 - Learn how to identify the serial port used by your device (QextSerialEnumerator)
    2 - Connect to the port (QextSerialPort:: open())
    3 - Read from it (using QIODevice)
    4 - Write to it (using QIODevice)

    If you Google hard enough, you can find some source code for a Qt terminal emulator you might be able to adapt.

    You can connect a slot to the QIODevice:: readyRead() signal, which will tell you when the device has bytes available to read. You can connect to other signals to tell you if writing was successful and when the device is being closed, etc.

  7. The following user says thank you to d_stranz for this useful post:

    alfie.max15 (22nd February 2013)

  8. #7
    Join Date
    Feb 2013
    Posts
    6
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Need to set up a connection between my microcontroller and my Qt application (R/W

    Will get back with this post after i work out that much of it... thank you for your help...

Similar Threads

  1. Can QT application detect which type of connection is used?
    By satya@sipl in forum Qt Programming
    Replies: 1
    Last Post: 1st December 2012, 13:16
  2. No internet connection when deploying application
    By n1ghtly in forum Qt Programming
    Replies: 4
    Last Post: 9th August 2012, 13:00
  3. Qt application connection to microsoft SQL database 2008
    By user_mail07 in forum Qt Programming
    Replies: 3
    Last Post: 11th May 2011, 13:57
  4. RDesktop connection application
    By bhaskar in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 4th June 2010, 13:01
  5. Replies: 0
    Last Post: 7th September 2009, 06:03

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.