Sonsivri

Electronics => Projects => Topic started by: vbcoder on December 17, 2009, 12:26:52 12:26



Title: LABVIEW USB Interfacing with PIC 18F4550 using HID
Post by: vbcoder on December 17, 2009, 12:26:52 12:26
Hi,
I created this poll as I surfed the internet for an HID VIs for communicating with PIC USB Slave controllers using NI LABVIEW. So far, all users depend on NI VISA which requires creation of a driver for your device.

The benefit of this project is that your interfacing card will be used as a  "plug and play device" which utilizes the HID communication protocol (like USB Keyboard or Mouse). This requires no additional driver to be installed (it is rational as you don't expect to find a driver to run your keyboard or mouse). It relies on Hid.dll found in system32 directory.

I'm in the middle of the project and so far everything is pretty good. I'll wait for the members of our forums to participate in the poll to see if this project is worthy to be published.

Cheers


Title: Re: LABVIEW USB Interfacing with PIC 18F4550 using HID
Post by: Alienbeing on December 17, 2009, 01:22:50 13:22
I have used the USB to UART FT232RL from FTDI which works very well when interfacing with applications I've written for windows. Specifically I write programs in Delphi but see no reason why they wouldn't work with labview also. I program with labview also, but have not used labview with any PIC USB devices. Eventually I will need to work on writing something in labview that does interface to a microcontroller for an up coming job. But for now the FTDI chips are the best solution for me requiring simple serial programming on any PIC that supports serial communications.

Alienbeing


Title: Re: LABVIEW USB Interfacing with PIC 18F4550 using HID
Post by: vbcoder on December 17, 2009, 03:15:31 15:15
I used FT245 FIFO from FTDI in the past. I created 2 projects under Microsoft Visual Basic 2005. However, the complexity of the circuit was my motivation to migrate to USB enabled PIC devices. The simplicity of PCB is drastic using the latter.

If you use FT232, the FTDI provides a LABVIEW examples with a VI library to carryout the read, write operation.


Title: Re: LABVIEW USB Interfacing with PIC 18F4550 using HID
Post by: pickit2 on December 17, 2009, 03:27:47 15:27
How about using 18F4550 Usb demo board (from my bookmaked pages of stuff I marked for "must do this soon")

http://eegeek.net/content/view/13/32/

http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=2651&param=en534494


Title: Re: LABVIEW USB Interfacing with PIC 18F4550 using HID
Post by: vbcoder on December 17, 2009, 04:00:36 16:00
It sounds very good. If I may only propose minor modification:

  • We may add rosettes connected to all free pins of the microcontroller, this way, it would be easy to integrate it with any external module (if you recall my posted project, I implemented this idea in the serial interfacing with LABVIEW
  • I already test the design using our favorite proteus 7.6. Thus I do need help in creating the PCB based on ARES since I only do such a work on Eagle. This way the project will be enriched as anyone will be able to simulate most of his job without even leaving his disk

What do you think?


Title: Re: LABVIEW USB Interfacing with PIC 18F4550 using HID
Post by: pickit2 on December 17, 2009, 06:49:45 18:49
first how about having this topic moved to Projects.
Quote
•We may add rosettes connected to all free pins of the microcontroller, this way, it would be easy to integrate it with any external module (if you recall my posted project, I implemented this idea in the serial interfacing with LABVIEW
•I already test the design using our favorite proteus 7.6. Thus I do need help in creating the PCB based on ARES since I only do such a work on Eagle. This way the project will be enriched as anyone will be able to simulate most of his job without even leaving his disk
The project I had in my to do list(was going to be VBasic front end, would also have the buck converter from the pickit2 (including the power on & voltage ajust from the pickit2 gui)
and a lcd port (in 4 bit mode so only use 1 port of the pic).


Title: Re: LABVIEW USB Interfacing with PIC 18F4550 using HID
Post by: bbarney on December 17, 2009, 07:25:36 19:25
Moved  & stickyed

Have you looked at the Bitwacker

http://www.schmalzhaus.com/UBW/


Title: Re: LABVIEW USB Interfacing with PIC 18F4550 using HID
Post by: pickit2 on December 17, 2009, 08:04:37 20:04
Have you looked at the Bitwacker

http://www.schmalzhaus.com/UBW/
we could start with this for the 18F2550 and mod it to 18F4550
http://www.sparkfun.com/datasheets/DevTools/PIC/UBW-PTH-Kit-Schematic.pdf


Title: Re: LABVIEW USB Interfacing with PIC 18F4550 using HID
Post by: fonak on December 17, 2009, 08:17:40 20:17
HI look at this. It's simlpe LV apps, CCS source code and microchip MCHPUSB Driver.


Title: Re: LABVIEW USB Interfacing with PIC 18F4550 using HID
Post by: bbarney on December 17, 2009, 08:35:37 20:35
we could start with this for the 18F2550 and mod it to 18F4550
http://www.sparkfun.com/datasheets/DevTools/PIC/UBW-PTH-Kit-Schematic.pdf

The site I posted is the author of the one for sale at Sparkfun and there is a couple different boards using 5 different chips on that site along with software in liberty basic and bootloader's and a whole lot of stuff really  ;D  so there has to be something there for everyone :D


Title: Re: LABVIEW USB Interfacing with PIC 18F4550 using HID
Post by: vbcoder on December 18, 2009, 01:39:20 01:39
HI look at this. It's simlpe LV apps, CCS source code and microchip MCHPUSB Driver.

This is no different from the traditional method used by NI VISA. The HID transfer protocol offers the capability of  "not using a driver" with your installed software. We only try to learn something new.

first how about having this topic moved to Projects.The project I had in my to do list(was going to be VBasic front end, would also have the buck converter from the pickit2 (including the power on & voltage ajust from the pickit2 gui)
and a lcd port (in 4 bit mode so only use 1 port of the pic).

I started with this idea and did a complete class for using it with custom enumerated commands with proteus. I thought it would be better to play with LABVIEW especially that none up to the best of my knowledge provided an easy way to do so.

Well, my flames are getting higher by this constructive and valuable opinions. More ideas would certainly put this project in the right direction.


Title: Re: LABVIEW USB Interfacing with PIC 18F4550 using HID
Post by: burhanmz on July 15, 2010, 04:20:16 04:20
I am interested in this project.
I can not believe I'd find some like this so soon. Its one of the reasons i joined.
I am trying to interface a camera and wireless RF transceiver connected to PIC18F4550 at end 'A'. And on the other end 'B' just a PIC18F4550 with another transceiver. Then try to make an API in LabView and send a command to PIC to get take pictures and transmit it to end 'B' and view/save it on PC.

camera that I bought
http://www.sparkfun.com/commerce/product_info.php?products_id=9334 (http://www.sparkfun.com/commerce/product_info.php?products_id=9334)

Transceiver
http://www.sparkfun.com/commerce/product_info.php?products_id=151 (http://www.sparkfun.com/commerce/product_info.php?products_id=151)

So far I'm hung over using Bootloader from UBW (bit whacker) which is a great find, in LabView.


Title: Re: LABVIEW USB Interfacing with PIC 18F4550 using HID
Post by: MisterX on August 01, 2010, 02:00:27 02:00
Hi vbcoder, did you managed to communoicate with an HID device in LabView using the Call Library Function pointing hid.dll ?

I try to do this since some time without success. It seems like NI don't want people to know much about that, they prefer selling their hardware!!!

My main problem is that I don't know how the hid.dll library is working.

If you have any usefull information it will be very appreciate. Thank you.


Title: Re: LABVIEW USB Interfacing with PIC 18F4550 using HID
Post by: nin82 on September 22, 2010, 09:58:04 21:58
such an interesting project shouldnt be dead... is it?? :(


Title: Re: LABVIEW USB Interfacing with PIC 18F4550 using HID
Post by: Rey Mafia on November 05, 2010, 01:37:24 01:37
Are there any news?


Title: Re: LABVIEW USB Interfacing with PIC 18F4550 using HID
Post by: koseyel on April 08, 2011, 09:16:53 21:16
Are there any news?

Here is  an interesting discussion on using hid.ll or Microchip custom driver:
http://forums.ni.com/t5/Instrument-Control-GPIB-Serial/Sending-and-receiving-data-from-PIC18F4550/m-p/1046826?requireLogin=False

Regards


Title: Re: LABVIEW USB Interfacing with PIC 18F4550 using HID
Post by: motox on June 11, 2012, 11:39:19 23:39
In the last year I made an acquisition board with the PIC18F4550. The PC software was made in LabVIEW using the WinUSB driver. Since I only use MS OS, this driver is more than good for my applications.

I made the USB driver using the NI-VISA Driver Development Wizard version 4.1. It is very simple to use.
The HID class has a serious disadvantage, you cannot use bulk pipes. With WinUSB you can use bulk pipes for large amount of data transfer.

The USB auto-detect is very easy to implement. There is no need for user interaction for the board to be detected and the program starts to work immediately (e.g. send commands, receive sampling data, etc…).

In attachment you can see a picture of the user interface.


Title: Re: LABVIEW USB Interfacing with PIC 18F4550 using HID
Post by: koky on June 12, 2012, 01:41:22 13:41
dear motox can you post your code of Pic e labview  ?

thank you

koky


Title: Re: LABVIEW USB Interfacing with PIC 18F4550 using HID
Post by: motox on June 12, 2012, 07:58:43 19:58
dear motox can you post your code of Pic e labview  ?

thank you

koky
Dear koky, I made this program for my employer. So I cannot give the complete project. But I can guide you and give the essential parts needed to start your own project.


Title: Re: LABVIEW USB Interfacing with PIC 18F4550 using HID
Post by: koky on June 13, 2012, 07:05:23 07:05
Dear koky, I made this program for my employer. So I cannot give the complete project. But I can guide you and give the essential parts needed to start your own project.
is good if you can share a semplified example llike "hello word or one led " were is possible understand mechanism PIC - HID - labview that use usb port


Title: Re: LABVIEW USB Interfacing with PIC 18F4550 using HID
Post by: motox on June 13, 2012, 10:15:54 22:15
is good if you can share a semplified example llike "hello word or one led " were is possible understand mechanism PIC - HID - labview that use usb port
Realize that I will have to spend at least one hour or more doing it. So if this is not really important to you, please say it. But if is important, then I will be glad to help you.

I will try to set/clear one LED and get one button status using the Microchip’s PICDEM Full Speed USB hardware platform (PIC18F4550) and LabVIEW version 9.0.1. Is this ok for you?


Title: Re: LABVIEW USB Interfacing with PIC 18F4550 using HID
Post by: koky on June 14, 2012, 06:03:42 06:03
Realize that I will have to spend at least one hour or more doing it. So if this is not really important to you, please say it. But if is important, then I will be glad to help you.

I will try to set/clear one LED and get one button status using the Microchip’s PICDEM Full Speed USB hardware platform (PIC18F4550) and LabVIEW version 9.0.1. Is this ok for you?
Realize that I will have to spend at least one hour or more doing it. So if this is not really important to you, please say it. But if is important, then I will be glad to help you.

I will try to set/clear one LED and get one button status using the Microchip’s PICDEM Full Speed USB hardware platform (PIC18F4550) and LabVIEW version 9.0.1. Is this ok for you?

yes can be very useful for undertand all process, but when you have time for this
many thanks koky


Title: Re: LABVIEW USB Interfacing with PIC 18F4550 using HID
Post by: motox on June 16, 2012, 06:30:07 18:30
LABVIEW USB Interfacing with PIC18F4550 using WinUSB

I made this program because user ‘koky’ has requested it but anyone can use it for educational purposes.

The LabVIEW program communicates with the PIC18F4550 through USB using WinUSB driver. The firmware is compatible with Microchip's PICDEM Full Speed USB Demonstration Board.


Title: Re: LABVIEW USB Interfacing with PIC 18F4550 using HID
Post by: famos on May 24, 2014, 10:00:38 22:00

(http://s21.postimg.org/ttj5cubh3/eyeball.jpg)

Hello,

has anyone used WinUSB or libusb with Labview? I'm looking for examples!

Thanks


Title: Re: LABVIEW USB Interfacing with PIC 18F4550 using HID
Post by: pickit2 on May 24, 2014, 11:07:02 23:07
Hello,

has anyone used WinUSB or libusb with Labview? I'm looking for examples!

Thanks
did you even read the topic?
you ask "has anyone used WinUSB..." FFS...
never mind the whole topic, read the post before yours #22


Title: Re: LABVIEW USB Interfacing with PIC 18F4550 using HID
Post by: CocaCola on May 25, 2014, 06:32:34 18:32
The topic fits. I'm interfacing a PIC 18F4550 to LabView. The PIC side is solved but for LabView I'm  locking for a solution.

Hmm, as suggested multiple times now, did you bother reading the post above your inital post, I suspect not since it has EVERYTHING you are asking for!!!

http://www.sonsivri.to/forum/index.php?topic=26537.msg133404#msg133404

(http://www.quickmeme.com/img/75/75b17cf793d6240880604c9877d2cd8a18284053bc59bace1334c3294780f3cb.jpg)




Title: Re: LABVIEW USB Interfacing with PIC 18F4550 using HID
Post by: CocaCola on May 25, 2014, 08:35:50 20:35
I'm again, post #22 uses NI Visa with the disadvantage that everything stops working when the port is changed.

Labview uses NI-Visa by default to communicate it's kind of a package deal, and since NI-Visa is pretty much the de-facto industry standard it's not a bad thing...


Title: Re: LABVIEW USB Interfacing with PIC 18F4550 using HID
Post by: bbarney on May 25, 2014, 08:49:28 20:49
I don't know if I should laugh or cry , but my mute finger is getting awful itchy  :o


Title: Re: LABVIEW USB Interfacing with PIC 18F4550 using HID
Post by: biomed12 on November 19, 2016, 11:22:26 23:22
I wonder, what is the better side of HID over CDC? It is very simple to communicate with labview via serial protocol. I have one project like that. It is about real time chart plotting. Its costumization is not perfect but the protocol works properly.


Title: Re: LABVIEW USB Interfacing with PIC 18F4550 using HID
Post by: motox on November 20, 2016, 12:07:37 00:07
I wonder, what is the better side of HID over CDC? It is very simple to communicate with labview via serial protocol. I have one project like that. It is about real time chart plotting. Its costumization is not perfect but the protocol works properly.
With HID it is much easier to do auto-detect and to auto-run a program or a subprogram when the device is connected.
Forcing the user to open the Device Danager to see the port number, insert that number in a box and click on the ‘open port’ button is not very professional. Imagine that for a ‘normal’ Windows user that doesn’t even know what Device Manager is…


Title: Re: LABVIEW USB Interfacing with PIC 18F4550 using HID
Post by: Gallymimu on November 20, 2016, 06:25:26 06:25
With HID it is much easier to do auto-detect and to auto-run a program or a subprogram when the device is connected.
Forcing the user to open the Device Danager to see the port number, insert that number in a box and click on the ‘open port’ button is not very professional. Imagine that for a ‘normal’ Windows user that doesn’t even know what Device Manager is…

For a "professional" option you can simply detect your serial port automagically.  It's not that hard.  See 3.6 below for an example with FTDI
http://www.ftdichip.com/Support/Documents/AppNotes/AN_123_How%20COM%20Ports_Are%20Allocated%20on%20Driver_Installation.pdf


Title: Re: LABVIEW USB Interfacing with PIC 18F4550 using HID
Post by: motox on November 20, 2016, 10:29:28 10:29
For a "professional" option you can simply detect your serial port automagically.  It's not that hard.  See 3.6 below for an example with FTDI
http://www.ftdichip.com/Support/Documents/AppNotes/AN_123_How%20COM%20Ports_Are%20Allocated%20on%20Driver_Installation.pdf
How do you implement that in LabVIEW without using FTDI chips?

I don't have any doubts about its possibility, but I think it is much easier with HID, WinUSB or a custom driver.


Title: Re: LABVIEW USB Interfacing with PIC 18F4550 using HID
Post by: Martin Miranda on February 15, 2020, 11:49:36 11:49
Moved  & stickyed

Have you looked at the Bitwacker

http://www.schmalzhaus.com/UBW/

THANKS! i think i still have some few 18f2550's around.

Posted on: February 15, 2020, 05:47:49 05:47 - Automerged

With HID it is much easier to do auto-detect and to auto-run a program or a subprogram when the device is connected.
Forcing the user to open the Device Danager to see the port number, insert that number in a box and click on the ‘open port’ button is not very professional. Imagine that for a ‘normal’ Windows user that doesn’t even know what Device Manager is…

i concur.