Friday, February 12, 2010

Homemade USB interface board using a PIC

Hello folks,

Here's what I've been working on for the last couple of weeks:





This is a USB interface board I've built around a PIC 18f4550 microcontroller from Microchip. As many of you probably know, I've used my computer's parallel port to connect many things to my computer. However, most laptops don't have parallel ports these days, so I needed a way to connect things without a parallel port. This board does exactly that (and actually much, much more). I found a really nice tutorial on building this board here - http://eegeek.net/content/view/13/32/






You can make your C#, VB, C++ programs communicate with the chip using the open-source MCHPFSUSB Framework from Microchip, or the Window's HID drivers. The framework comes with lots of samples to get you started.


I've put a bootloader on the chip for the sake of convenience. With a bootloader, you don't have to take the chip off the board and put it in a separate programmer for programming. I have to sometimes re-program the chip every 10-15 minutes during development (especially when there's a hard to find bug), and the bootloader really makes it easy.

No project is compete until you record a video! So here's one:




Please excuse the background noise in the video. There was some construction work going on while I was recording this. Anyway, I'm using the board to control some LEDs, a servo, and reading the value of a potentiometer. Controlling the servo was the trickiest part because servo's are sensitive to timing. They expect to receive a pulse every 20 ms, and the duration of the pulse determines how much they will turn. The length of the pulse usually varies between 1-2 ms. Setting up the timers on the chip to work properly was a bit challenging, but I finally got it working. This sound card based oscilloscope really helped! - http://www.zeitnitz.de/Christian/scope_en.

Hope you enjoyed this post. I will be using this board in future projects. Keep checking!

28 comments:

Spiffy said...

probably one of your best projects .... other than the laser mouse

Unknown said...

ashish strikes again :-)

Unknown said...

Nice work:) What are you studying/studied?

Unknown said...

Hi dude which software did u use to control potentiometer from ur PC?

Joomla Website Design said...

Hey its a great invention keep it up. All the time you are coming up with great discoveries. Keep updating with more new technologies.

Anonymous said...

hi
i really liked your project...
can you please send me the compiled project?

Obstacle detector using webcam and laser pointer http://ashishrd.blogspot.com/2006/11/obstacle-detector-using-webcam-and.html

Unknown said...

well done !! i was wondering if this was possible. looks like i have to start reading about chips again!!

Unknown said...

we are having project on data aqusition syatem using usb port n we r intrsted to use PIC18F4550 microcontroller to fed digital inputs to usb port...

so, plz inform us the cost of microcontroller

refer :-
bansal.arpit23gmail.com
bansal.arpit23rediffmail.com

syano said...

hope some new addition is there soon

buoy said...

I dint quite the grasp the full potential of this project...so plz can u walk me thru it?
i hav a few questions...
1. does this pic PCB act like a parallel port?
2. ive also tried ur stepper motor project using d actual parallel port on WinXp on my PC..nw my question here is...whether i can interface the stepper motor with my laptop using this project? i mean can i interface a 5/6 wire stepper motor to my laptop and control it lik i cud on my PC?
3. Any furthur application which might help m understand d true potential of this project will be appreciated.

Thankin in anticipation!
P.S : i am a comp student so i am a tyro wen it comes to electrical components and their properties!

Alpha male said...

very simply explained. It is indeed an art to read & stop new visitors with your attractive writing style. I am really impress from your posted information. Thanks for sharing.

bad credit student loan said...

yes...this post has been quite impressive so far

Ron3Y said...

help


please provide some more detials abut the pcb.

is it possible to provide a more detail.circuit diagram.

i want to know how many more motors can be controlled and how, to be precise..which pins?

Anonymous said...

Which pins are used for input and output from PIC ?

Jhon Davis said...

thats the spirit for new inventions, "USB is much more important then rockets"


- John Devis
Magento Themes

Thesis writing said...

I have been visiting various blogs for my research work. I have found your blog to be quite useful. Keep updating your blog with valuable information... Regards

dr said...

im following your blog..

where u get ur refence?

Anonymous said...

is the boot loader with usb works as a parallel port or it act as parallel port?

Rakesh Mondal Ron said...

REALLY GOOD.THIS IS REALLY A NICE PROJECT WORK USING PIC . I AM MAKING A SIMILAR PROJECT USING A FLOPPY DRIVE (HYBRID)STEPPER MOTOR, AND SOME SERVOS. THE CONTROL IS GOOD. HERE IS SOMETHING I AM WORKING ON.
TAKE CARE

http://www.electro-tech-online.com/attachments/avr/26672d1235812340-circuit-control-step-motor-using-avr-controller-stepper_motor_control_paper.pdf

Anonymous said...

Great work. Saw this link on your blog http://eegeek.net/content/view/13/32/
There is slightly different with yours.Lack of component SV1,IC1 and MA02-1.what is the use of the component anyway?

Anonymous said...

how much did all your components cost for the board? can you give hints on how to write programs to interact with different devices on the board, such as motors, servos, etc and how to get readings from instruments?

Anonymous said...

I see that you are not very eager to publish the actual programming involved in your projects; is it secret, or you just thing it wouldn't be appreciated? ;)

Magento Templates said...

Wow, a great effort for sure, really enjoyed watching the as how an interface for a USB board can be made.....

Maggeentoi

Unknown said...

hi man! may you can help me :) i'm starting to learn the pic18f4550 and the usb, i can use it as a normal pic, sice 3 month i try to connect this pic to my laptop by usb... but i fail everytime! i made your schematic and loaded the microchip's bootloader picdemfsusb.hex... when i load the hex on the pic, i plug the circuit in the usb, so i press the boot button between the reset button but NOTHING happens! the pc should show a popup that says that a new device were found... but it don't happen :( do you know where i fall?

Anonymous said...

There is slightly different with yours.Lack of component SV1,IC1 and MA02-1 from the eagle document.what is the use of the component anyway?

Rodrigo Ortega said...

hey dude, love your work, i´m trying to do something similar, would you mind giving me a hint on the potenciometer readint?? r.ortegadominguez@gmail.com

tks.

Mukesh Harsh said...

i viewed your pan tilt controller on you tube. how much it costs,the total cost of pan tilt controller. instead of mouse can we have joystick ?

هوا كدة! said...

how can i contact you?? i wanna ask you about something if you don't mind, by the way i watched your project on youtube and i admired your way of thinking ;).
please contact me as soon as possible.
or reply this comment.