View previous topic :: View next topic |
Author |
Message |
tpm
Joined: 01 Feb 2005 Posts: 2
|
Intro to USB |
Posted: Tue Feb 01, 2005 8:52 am |
|
|
I'm interested in developing a simple PIC based device that measures a couple of time intervals and an analog voltage. This will replace an existing device that communicates via an standard serial port. I want to use USB since it is the only thing available on some newer laptops, etc.
Any recommendation on a good USB software/hardware tutorial? I've started studying the examples that come with the CCS compiler.
Thanks,
Tim |
|
|
libor
Joined: 14 Dec 2004 Posts: 288 Location: Hungary
|
|
Posted: Tue Feb 01, 2005 9:08 am |
|
|
Website: USB Central
Book: USB Complete
HW tutorial: PICDEM Full Speed USB demonstration board from Microchip
Application Notes, etc: Microchip
USB protocol analyzer: Ellisys USB Tracker |
|
|
CharlieGill
Joined: 29 Nov 2004 Posts: 15 Location: northeast georgia
|
|
Posted: Tue Feb 01, 2005 11:09 am |
|
|
I would suggest the FT232BM from FTDI (www.ftdichip.com). It will allow you to immplement a USB interface to your PC while maintaining a simple serial (UART) interface to you embedded project.
You will not have to write ANY new code. The USB drivers from FTDI will emulate a COM port so your existing PC software and your existing embedded code will work without any changes.
I've seen this chip in quite a few products, lately in the Freescale ZigBee development kit as their USB interface.
FTDI has a great designer's guide.
You can buy the chips at www.saelig.com here in the US.
Charlie |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Tue Feb 01, 2005 2:26 pm |
|
|
CharlieGill wrote: | I would suggest the FT232BM from FTDI (www.ftdichip.com). It will allow you to immplement a USB interface to your PC while maintaining a simple serial (UART) interface to you embedded project.
You will not have to write ANY new code. The USB drivers from FTDI will emulate a COM port so your existing PC software and your existing embedded code will work without any changes.
I've seen this chip in quite a few products, lately in the Freescale ZigBee development kit as their USB interface.
FTDI has a great designer's guide.
You can buy the chips at www.saelig.com here in the US.
Charlie |
No need to buy the FTDI chip. You can do it with just a PIC. Microchip even has the driver:
http://ww1.microchip.com/downloads/en/AppNotes/00956b.pdf |
|
|
CharlieGill
Joined: 29 Nov 2004 Posts: 15 Location: northeast georgia
|
|
Posted: Tue Feb 01, 2005 3:07 pm |
|
|
Well Mark...I stand by my recomendation for general use. Yes, if you plan to use one of the 18F processors with the built-in USB and if you can afford to give up 3K plus some RAM, then the solution you propose is fine. I haven't priced the USB PIC's relative to the non-USB versions, but I assume you are paying something for the embedded USB controller.
Now if you are (heaven forbid) using a non-PIC or an older PIC or smaller PIC or just don't want to mess with integrating the MChip USB code, then the FTDI chip is for you.
I've taken old instruments with a RS232 interface, removed the MAX232 and associated caps, and droped in the FTDI chip, crystal and a few discreets and a bit of solder, and gotten it working just fine on USB. Neither the PC or the embedded processor had a clue as to what had been done to it.
If you need or want all the goodies that USB provides, go for it. If you just need a simple interface to a PC for configuration, monitoring, engineering test etc, use a packaged solution such as the FTDI chip. Since the USB protocol provices the error checking all you do at the embedded end is shovel data out the UART and it appears at the emulated COM port error free. No overhead at all in the embedded application.
Charlie |
|
|
CharlieGill
Joined: 29 Nov 2004 Posts: 15 Location: northeast georgia
|
|
Posted: Wed Feb 02, 2005 9:36 am |
|
|
Mark,
I probably haven't convinced you of the superiority of my approach but I finally got around to reading my November issue of EDN this morning and ran across another USB to Serial bridge.
Silicon Laboratories (silabs.com) CP2102. It seems to do everything the FTDI device will do and includes the oscillator and several of the required discretes. All you need are 2 small caps and TVS ESD supressors on the USB lines. 5x5mm package!
I'm only going by the data sheet but I have used processors from SiLabs and have been quite pleased.
Charlie |
|
|
Yashu
Joined: 08 Oct 2003 Posts: 26
|
|
Posted: Wed Feb 02, 2005 8:48 pm |
|
|
CharlieGill wrote: | I would suggest the FT232BM from FTDI (www.ftdichip.com). It will allow you to immplement a USB interface to your PC while maintaining a simple serial (UART) interface to you embedded project.
You will not have to write ANY new code. The USB drivers from FTDI will emulate a COM port so your existing PC software and your existing embedded code will work without any changes.
I've seen this chip in quite a few products, lately in the Freescale ZigBee development kit as their USB interface.
FTDI has a great designer's guide.
You can buy the chips at www.saelig.com here in the US.
Charlie |
The truth about FTDI.
Just launched a product incorp the FT245BM. Works OK after the latest driver update that FTDI did in Nov. Sold about 600 so far.
However, they only do annual updates on their drivers and I wasted MANY MANY days (oh thats right.... months) trying to track down intermittent disconnects caused by their driver.
And to freakin boot, they new about the problem back in March of 2004 and didn't even consider telling me about the issue or offering me an interim driver update. They kept insisting it was my hardware layout. Well guess what.... NOT.
Also, any small spikes (typically bigger than 1.5V P-P @ about 500ns) appearing on the USB shield with respect to signal ground will also cause their driver to intermittently de-enumerate.
I advise against the use of these FTDI chips and have prioritized superceding them with some form of replacement. If you do decide to use them, be wary of any shield noise on the USB cable... isolate the damn thing. |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Wed Feb 02, 2005 9:16 pm |
|
|
CharlieGill wrote: | Mark,
I probably haven't convinced you of the superiority of my approach but I finally got around to reading my November issue of EDN this morning and ran across another USB to Serial bridge.
Silicon Laboratories (silabs.com) CP2102. It seems to do everything the FTDI device will do and includes the oscillator and several of the required discretes. All you need are 2 small caps and TVS ESD supressors on the USB lines. 5x5mm package!
I'm only going by the data sheet but I have used processors from SiLabs and have been quite pleased.
Charlie |
Yeah, and we could use allen bradley plc's instead of pic for many things too. All depends on the design as to which way one should go. A 1up device it is probably easier to use the FTDI chip. At 100K units a year, ain't no way I'm going to waste all that money when I don't need to. |
|
|
|