View previous topic :: View next topic |
Author |
Message |
dcecar
Joined: 29 Jan 2009 Posts: 4
|
usb without usb capable PIC |
Posted: Thu Jan 29, 2009 7:34 pm |
|
|
Is it possible to implement USB functionality without a PIC that has USB built in? What is the best way to acomplish this? Note I would like to avoid having to use the FTDI or any other chip that ends up creating a virtual port on the PC.
Also same question for RS232 and I2C. Is it possible without a PIC that has these features in hardware.
If it is possible what is the cost in terms of performance and memory?
Thanks |
|
|
Guest
|
|
Posted: Thu Jan 29, 2009 9:59 pm |
|
|
You need a USB physical interface layer. Without the USB state machine implementation in hardware you cannot get a PIC to keep up with the USB physical requirements. The FTDI solution is just a single chip now (FT232R), no crystal, just a few R's and C's, it works great and the drivers are free! Cheap, simple, all the really nasty hard work is done (i.e. PC driver) - what's not to like, eh?
I2C is pretty low speed compared to USB and it is possible to 'Bit-Bang' this. I've done it in the past, it's no more difficult than 'Bit-Banging' anything else. We have to do it for many parts (like the Sensiron Humidity Sensor) that are sort of I2C, but not fully. So this can be done. It takes hardly any resources.
HTH - Steve H. |
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Fri Jan 30, 2009 12:32 am |
|
|
I've seen USB low speed (1.5 MBit) interfaces realized on a small uC (PIC, AVR) in software. But this has been a horrible assembler coded design. I'm sure, you'll find some references on the internet, if you are motivated to try such a thing. |
|
|
treitmey
Joined: 23 Jan 2004 Posts: 1094 Location: Appleton,WI USA
|
|
Posted: Fri Jan 30, 2009 9:37 am |
|
|
dcecar:
I'm not sure what part of the FTDI option you objected to. Was it the port?
I ask because you can fully talk to the FTDI FT232 and FT245 with the free dll. Not a virtual port at all. AND they now have a full example in C#.
I would even share my example.
lov it! |
|
|
Guest
|
|
Posted: Fri Jan 30, 2009 12:10 pm |
|
|
treitmey has a good point, you don't have to load the virtual com port driver at all with the FTDI devices. You can just set the PID to load only the DLL driver. This is all easily done by modifying the .inf files.
We all should be getting royalties from FTDI or something, but heck the devices are real problem solvers.... And the working PC drivers, well that's worth the price of admission alone.
The DLL is callable from any language that can talk to Windows DLL's (I suppose that they have LINUX support too, but haven't looked)- this includes all the .NET stuff, plus Visual basic Classic, etc...
:-)
Steve H. |
|
|
dcecar
Joined: 29 Jan 2009 Posts: 4
|
|
Posted: Fri Jan 30, 2009 6:25 pm |
|
|
I think I had some misconceptions about FTDI. I thought it was only VCP, I didnt know it could do USB direct driver interface. So I guess I am fine with FTDI, it actually looks pretty cool looking at the latest datasheet.
However, I am still a bit confused about what the difference is between PIC's that have a USB peripheral (like the PIC16C765 or the PIC18F4550 family), and PIC's that dont (one I am using right now is PIC16F687 / PIC16F690)?
If I want to add USB to my application using 16F690 do I need anything else other than FTDI? If on the other hand I use PIC16C765, do I need the FTDI then? If not FTDI will I need a line converter/driver? In either case will the samples from the compiler work?
Thanks! |
|
|
dcecar
Joined: 29 Jan 2009 Posts: 4
|
|
Posted: Fri Jan 30, 2009 6:32 pm |
|
|
I should add my main motivation is reduction of cost at volume of about 10,000 - 100,000 units. |
|
|
treitmey
Joined: 23 Jan 2004 Posts: 1094 Location: Appleton,WI USA
|
|
Posted: Mon Feb 02, 2009 1:21 pm |
|
|
OK, Not sure if I should be the one talking, but I will.
Quote: | reduction of cost at volume of about 10,000 - 100,000 units. |
I normally work with volumes 1k-4k. Cost reduction is sort of an art.
Anyone else please chime in.
I have used the FTDI chips in 4 production boards so far.
You will be balancing added cost for ftdi chip with cost for trouble shooting, and NRE costs.
You add the chip, a few extra parts, and your running.
((think of the ftdi chip as a rs232 chip))
OR
You use a microchip that can do USB. Then YOU have to do the USB protocol. AND ENSURE ITS WORKING PROPERLY.
For me it makes sense to use a drop in chip.
For your volumes, it may not.
also keep in mind the Microchip USB chips are(generally) more powerful. And in addition to the USB you will be able to do more in general, and take care of some feature creep(last minute customer additions).
example circuit FT232R spec. figure 18.
(i don't use cbus0/clock or CTS RTS or pwr_en)
I do use LEDs as in fig19 |
|
|
dcecar
Joined: 29 Jan 2009 Posts: 4
|
|
Posted: Tue Feb 03, 2009 12:32 am |
|
|
So would CCS USB samples work in either case or just one?
Thanks |
|
|
treitmey
Joined: 23 Jan 2004 Posts: 1094 Location: Appleton,WI USA
|
|
Posted: Tue Feb 03, 2009 9:50 am |
|
|
Quote: | So would CCS USB samples work in either case or just one?
|
The CCS USB samples work if you want Microchip PIC to do the USB protocol.
If you want to use the FTDI chip then you just handle it like serial communication. No USB protocol needed.
You would use example C:\Program Files\PICC\Examples\EX_SISR.C |
|
|
|