Results 1 to 14 of 14

Thread: QT and USB

  1. #1
    Join Date
    Apr 2010
    Location
    Italia
    Posts
    149
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QT and USB

    Hello everyone!
    I have a device controlled by a microcontroller PIC18F4550 that has USB and I can manage it via a GUI made ​​with Qt 4.8.2.
    How can I write a GUI program with Qt to read and write bytes vattraverso USB ?

  2. #2
    Join Date
    Jan 2009
    Location
    Russia
    Posts
    309
    Thanks
    2
    Thanked 43 Times in 42 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QT and USB

    In Qt, there are no classes to support USB. Plug and use libusb.

  3. #3
    Join Date
    Apr 2010
    Location
    Italia
    Posts
    149
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QT and USB

    kuzulis, the code written in "Windows USB example" of gavagai is a viable alternative?

  4. #4
    Join Date
    Jan 2009
    Location
    Russia
    Posts
    309
    Thanks
    2
    Thanked 43 Times in 42 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QT and USB

    Perhaps, but on condition that your USB device is well-defined system, ie has installed the driver.

  5. #5
    Join Date
    Apr 2010
    Location
    Italia
    Posts
    149
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QT and USB

    Yes kuzulis, I should have the driver, I use the Microchip PIC18F4550 which provides the framework IDE for the C18.

  6. #6
    Join Date
    Apr 2010
    Location
    Italia
    Posts
    149
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QT and USB

    I do not know where to start
    I have several circuits with the Microchip PIC18F4550 found on the internet, but are incomplete because of missing firmware for the PIC or how to write the code under Windows XP using Qt interface via USB to PIC.
    Can anyone give me a help to build a simple example ?
    I can provide circuit diagrams with PIC (PIC as a compiler from the use Microchip C18). On the PC I have Windows XP and how to use Qt Creator IDE 2.5.0

  7. #7
    Join Date
    Mar 2011
    Location
    Italy
    Posts
    5
    Thanks
    1
    Thanked 6 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QT and USB

    - Download the Microchip application libraries from Microchip site. There you find a lot of USB firmwares examples for PIC18
    - Set the firmware to work like HID device
    - Use my "Windows USB example" to interface to Qt libraries.

  8. The following user says thank you to gavagai for this useful post:

    baetaekwon (19th February 2013)

  9. #8
    Join Date
    Apr 2010
    Location
    Italia
    Posts
    149
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QT and USB

    Hello,
    So I partially solved using the framework as you said Microchip Microchip Solutions v2012-04-03 and then I followed what had been written using this site Building_a_PIC18F_USB_device.htm its firmware for the PIC18F4550. This site, however, use is made dell'mbiente Visual Studio 2010 Express using C #. Then I thought of using your code, or the one written by SteveH Source.zip you replied in your post "Windows USB example".
    In your opinion which is better than Qt Software?

  10. #9
    Join Date
    Apr 2010
    Location
    Italia
    Posts
    149
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default [RESOLVED] Re: QT and USB

    Ok guys I solved everything by using the project:
    C:\Microchip Solutions v2012-07-18\USB\Device - HID - Custom Demos\Firmware\MPLAB.X
    in addition to the firmware of PIC18F4550 (which I have set myself) platform PICDEM FSUSB, I also found the project environment for Qt in C:\Microchip Solutions v2012-07-18\USB\Device - HID - Custom Demos\PnP Demo - Cross Platform Software\HID_PnP_Demo.

  11. #10
    Join Date
    Oct 2012
    Posts
    6
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QT and USB

    Hi!
    I found this thread googling. I have a problem which is similar but not exactly the same.

    I have a PIC18F14K50 which has an attached USB Controller. The USB Controller gets Data from an EEPROM and has to send 64 byte packages to a PC using a USB Cable. The Device is supposed to be recognized as a COM Device. So here I dont need a HID driver but a CDC driver. Luckily, the USB Controller is already programmed and is fully functional. It waits for a certain signal and then sends its data.

    There is already an existing GUI made with Java which works but isnt as stable as it should be and I want to reprogram the whole thing in C++ using Qt.
    For the Java GUI they used the library called RXTX-2.2pre2

    Im searching the same thing but for C/C++.
    I never did something like this before, so I dont really know what I need to get access to the USB Controller. I need functions like send(...), receive(...), open(), close().
    I downloaded the whole Microchip application libraries and browsed them for anything useful. I was hoping for some headers and .cpp's that include the functionality that I need. That might have been a bit naive... I know...

    Does anyone know how to find classes that implement the functions I need?

    Thanks for reading!
    shs

  12. #11
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,536
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QT and USB

    Since the device is seen as a COM not think of it as a USB but the RS-232 and use RS-232 library ie. qextserialport/

  13. #12
    Join Date
    Oct 2012
    Posts
    6
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QT and USB

    Thanks!
    That might be the thing I was looking for, I just have to check if the communication is going to work.
    So, I will update this thread asap.

  14. #13
    Join Date
    Oct 2012
    Posts
    6
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QT and USB

    So, Im currently trying to get QextSerialPort to run. I am really confident that this is the right thing.
    The problem thread is here. Maybe someone has a solution.

  15. #14
    Join Date
    Jan 2013
    Posts
    21
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QT and USB

    I am doing a similar thing——a DAQ system using STM32. I use the CDC driver provided by ST which simulate the USB port as a serial port, So I can recognize the device as if it is connected to serial port. I am programming for the PC GUI which responsible for displaying wave,doing FFT, etc using QT4.8.6+QWT6.0.2 on Windows.I did not find any useful code on the web. I am using the QSerialPort library which can communicate with the device, but I still confuse with the way to retrieve data and plot wave in real time. If someone know a better solution or some useful resource, please recommend it to me. Thank you very much.

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.