Saturday, October 3, 2015

Cross Platform USB I/O Board With PWM in Qt5 , I/O Board V2

Quite a some time ago i published a USB I/O board PIC18F4550 which has total 16 I/O line and 5 analog input. The interface was written with Microsoft .net framework. Of course of being in .net we were bound to with windows only. so after many requests now here it is the next version of the good old USB I/O board.

The new version has complete change in the hardware. the are few feature addition like now it is possible to set the direction of individual I/O line instead in ground 8 I/O line each. the new Hardware has capability to generate PWM output with frequency range of 3Khz to 200 Khz with duty cycle from 0% to near 100 %. 

   The this version of hardware is based on PIC18F14K50 which is a 20 pin device. With this small microcontroller we now have Total 8 I/O lines , 3 Analog input , 1 PWM output. now the update rate of the interface is way much faster and and analog reading will automatically updated with the whole display.

  The USB interface is  still Standard Raw USB HID , you can sniffer the data with any host application of you choice or any programming library which support Raw HID. with help of some library you can interface the I/O Board with all sorts of automated testing and scientific calculation software like Matlab  or eve LABVIEW. almost all the these type application support raw USB HID.

The Hardware 

















Schematic 



   The schematic has nothing much but the MCU it self PIC18F14K50 with 12Mhz Crystal an RGB led , actually the hardware was build for some other purpose but due some error the silk screen there was few spare PCB left over with me so it get integrated the PCB into this project. the silk screen in the eagle file is fine and ready to use.

    The ADC reference voltage set to USB bus voltage which is not going to be very accurate so it will lead to error in the ADC reading . if the accuracy of the analog readout matter to you then it is better to power the board with more stable source and now it is possible to set the ADC reference voltage in the GUI application itself.

The PCB 

     the PCB is designed with Free version of  Eagle CAD. PCB source can be downloaded from git repo.


The Qt5 Application

 Now new Application to access the board is the major change which happened. Instead off going with Microsoft .net we have chosen to work with a better solution Qt. Qt give many advantages over the .net , it is completely opensource and the most importantly it is absolutely cross plate from. which mean same application is going to run across all the OS we wanted to target. the Current Application is tested with Microsoft Windows 7 and Ubuntu 14.04 , i don't have any mac machine but i am very sure it will work on mac osx with little or no changes at all.




We have written the application in C++ with Qt creator ,Qt Creator 3.1.2 (opensource) Based on Qt 5.3.1.  
as you can see we have total 8 I/O individually select able , 3 Analog readout with Adjustable Vref for calibration Default set to 5000 mV assuming USB bus voltage to be 5.0V. now you have new option to generate square wave output from 3Khz to 200 Khz and adjustable Duty cycle 0 to ~100% . 

Linux test  , setting PWM to 80 % at 6Khz and 80% at 200Khz, there was a little permission issue with Raw HID USB device so i have to launch the application as sudo otherwise application was got getting permission to access USB hence was showing no device found. Linux uses libusb.

Ubuntu 14.04 Test Qt5

PWM Frequency 6Khz 80% Duty





Download Source Code of the Qt application ,the Firmware and all executable files

 All the source code is available at github repo ,
 https://github.com/circuitvalley/USB-IO-Control-Board

the github repo contains executable build with required dll file for windows , dll file are very high in size.

when building qt application from source you may need to disable shadow build.

Buy one Assembled board , Free shipping any where in the world*


USB I/O Board V2


1 comment:

  1. If I run USB_IOB_V2.exe it complains that libgcc_s_dwz-1.dll cannot be found.
    It is not on
    https://github.com/circuitvalley/USB-IO-Control-Board/tree/master/USB%20IO%20Board%20V2.0%20with%20PWM/Application_Qt5/executable%20builds/windows

    ReplyDelete