PDA

View Full Version : USB communication between VB and an 18Fxx31 device



AndrewC
- 10th March 2010, 09:17
I've been using an 18Fxx31 PIC for motion control making use of the built in quadrature decoder. Works fine as a stand alone controller. So to make life harder for myself I want to run the motion control out of a VB program. That will mean passing a 32bit "long" word from VB to the PIC. For simplicity I would like to use a USB connector to do this. Can one of you gurus point me at an easy way to learn how to do this ?

The idea is to simply pass the desired position from a VB program to a controller which will run its own code to drive a linear drive to the new position and then send back an indication that the drive has arrived.

thanks, Andrew

HenrikOlsson
- 10th March 2010, 10:00
Hi,
Well, the 18Fxx31 series doesn't have USB on-board (like the '2550 etc) so you'll have to use an external USB chip. Something from FTDI, like the FT232R (http://www.ftdichip.com/Products/FT232R.htm) is probably a good option. It's nothing I've played with personally but it's being done 'all the time'....

AndrewC
- 10th March 2010, 11:56
Or perhaps something as simple as:

http://www.pololu.com/catalog/product/391

Gets around having to solder SMD chips :)

HenrikOlsson
- 10th March 2010, 13:41
Sure, if you're building one or a few units or for experimenting it's definitely a good approach. If building several units then the cost compared to buying the IC, connector and supporting components adds up. Sparkfun also has several similar products, based on various IC's.