| Author |
Message |
quaternion
Joined: 12 Nov 2006 Posts: 209 Helped: 11 Location: Cairo , Egypt
|
02 Nov 2009 18:52 USB related question |
|
|
|
|
is it possible for a µcontroller such as PIC 16F877 to communicate directly with a USB port without an intermediate stage??
If not why ?
|
|
| Back to top |
|
 |
elrayes
Joined: 03 Jun 2008 Posts: 164 Helped: 8 Location: Egypt
|
02 Nov 2009 19:26 USB related question |
|
|
|
|
I think no because USB needs a stack and specific control algorithm all this defined in a hardware module called Serial Interface Engine or SIE, similar to UART but for USB which is not available in the 16F877, beside line coding of the USB needs a special transceiver.
my advice is to immigrate from 16f877 to 18F4550, nearly the same pin outs but with additional USB interface available.
good luck
|
|
| Back to top |
|
 |
nandhu015
Joined: 11 Feb 2006 Posts: 641 Helped: 46 Location: Tamilnadu, India
|
03 Nov 2009 2:21 USB related question |
|
|
|
|
| No, it is not possible. For AVR that is available, but not for pic
|
|
| Back to top |
|
 |
daviddlc
Joined: 11 Feb 2007 Posts: 196 Helped: 13
|
03 Nov 2009 4:28 Re: USB related question |
|
|
|
|
| PIC can be used for USB communication, as e;rayes mentioned PIC18F4550 will work or any other PIC with USB port.
|
|
| Back to top |
|
 |
quaternion
Joined: 12 Nov 2006 Posts: 209 Helped: 11 Location: Cairo , Egypt
|
03 Nov 2009 12:11 Re: USB related question |
|
|
|
|
Thanks elrayes & daviddlc.
| nandhu015 wrote: |
| No, it is not possible. For AVR that is available, but not for pic |
Do all AVR work well with USB ?
|
|
| Back to top |
|
 |
x3.exe
Joined: 08 Sep 2009 Posts: 25 Location: Bradford
|
03 Nov 2009 14:28 Re: USB communication from PIC 16F877 |
|
|
|
|
You can use FTDI chips to add USB to your microcontroller, there are plenty of breakout boards for these chips which are quite straightforward to use, like for example
http://www.sigma-shop.com/product/1/usb-to-serial-uart-ftdi-interface-board-for-your-atmel-avr-or-microchip-pic-project.html
|
|
| Back to top |
|
 |
user1111
Joined: 24 Mar 2007 Posts: 56 Helped: 4
|
03 Nov 2009 15:35 Re: USB communication from PIC 16F877 |
|
|
|
|
it's not possible until and unless u use intermediate chips.
instead u can use pic with usb support like 18f2550,18f4550
|
|
| Back to top |
|
 |
nandhu015
Joined: 11 Feb 2006 Posts: 641 Helped: 46 Location: Tamilnadu, India
|
03 Nov 2009 17:52 Re: USB related question |
|
|
|
|
| quaternion wrote: |
Thanks elrayes & daviddlc.
| nandhu015 wrote: |
| No, it is not possible. For AVR that is available, but not for pic |
Do all AVR work well with USB ? |
Sorry for not being elaborate
Here is what iam talking about
http://www.obdev.at/products/vusb/index.html
|
|
| Back to top |
|
 |
quaternion
Joined: 12 Nov 2006 Posts: 209 Helped: 11 Location: Cairo , Egypt
|
07 Nov 2009 18:13 Re: USB communication from PIC 16F877 |
|
|
|
|
Thanks nandhu015
But I decided to use 18f4550 insted, & it is the first time I am dealing with the usb communcation, so i want to know what r the points i should concern with?
knowing that this communcation is used to deliver realtime data that are measured using a sensor [sampled & digitized & serialized] that are someway lengthy and should be delivered correctly(no ignored data) and is time ensured
|
|
| Back to top |
|
 |
anandpv2009
Joined: 11 Aug 2009 Posts: 63 Helped: 4 Location: India
|
07 Nov 2009 21:18 Re: USB communication from PIC 16F877 |
|
|
|
|
| You can use HID communication or virtual serial port. You can use softwares such as VC++,VB.net,C# etc. From PC side virtual serial port commn. is same as normal Serial Port.But in the case of HID you can't receive data directly in VB or C# (possible in VC++) so you need a Hid library (easy to get).
|
|
| Back to top |
|
 |
elrayes
Joined: 03 Jun 2008 Posts: 164 Helped: 8 Location: Egypt
|
08 Nov 2009 10:17 USB communication from PIC 16F877 |
|
|
|
|
get "Microchip USB framework" from microchip website, it is ready made USB projects for many types of PIC's, just choose projects related to PIC18F4550 or PICDEM (both are the same), i would recommend you to use CDC -basic demo project cause it will make your PIC appear like a virtual COM port, then you will be easily able to communicate with it using C++ or VB and even in matlab and hyperterminal.
good luck and ask for any help.
|
|
| Back to top |
|
 |
quaternion
Joined: 12 Nov 2006 Posts: 209 Helped: 11 Location: Cairo , Egypt
|
08 Nov 2009 12:35 Re: USB communication from PIC 16F877 |
|
|
|
|
| elrayes wrote: |
get "Microchip USB framework" from microchip website, it is ready made USB projects for many types of PIC's, just choose projects related to PIC18F4550 or PICDEM (both are the same), i would recommend you to use CDC -basic demo project cause it will make your PIC appear like a virtual COM port, then you will be easily able to communicate with it using C++ or VB and even in matlab and hyperterminal.
good luck and ask for any help. |
It appears good idea , but if I emulate a virtual com port can i make the usb work at full speed (or there is no relation between this & that)
|
|
| Back to top |
|
 |
anandpv2009
Joined: 11 Aug 2009 Posts: 63 Helped: 4 Location: India
|
08 Nov 2009 12:58 Re: USB communication from PIC 16F877 |
|
|
|
|
| Virtual serial port is much faster than serial ports but i don't know the correct maximum speed (but above 1 Mbps). The reason is that in virtual serial port there is no hardware limitations.
|
|
| Back to top |
|
 |
elrayes
Joined: 03 Jun 2008 Posts: 164 Helped: 8 Location: Egypt
|
08 Nov 2009 13:06 USB communication from PIC 16F877 |
|
|
|
|
| actually for microchip viryual COM port project it was mentioned in an application note its maximum speed 80 KBps, what do you think?
|
|
| Back to top |
|
 |
Google AdSense

|
08 Nov 2009 13:06 Ads |
|
|
|
|
|
|
| Back to top |
|
 |
quaternion
Joined: 12 Nov 2006 Posts: 209 Helped: 11 Location: Cairo , Egypt
|
08 Nov 2009 13:36 Re: USB communication from PIC 16F877 |
|
|
|
|
| this means that if i need to work at full speed ,i shouldn't use a virtual port either serial or COM or .. ?
|
|
| Back to top |
|
 |
elrayes
Joined: 03 Jun 2008 Posts: 164 Helped: 8 Location: Egypt
|
08 Nov 2009 13:38 USB communication from PIC 16F877 |
|
|
|
|
it depends on your application, do want just a data logging device for a temperature or light sensor or do you need a streaming for audio or video applications.
for data data logging 80 KBps will be so good.
|
|
| Back to top |
|
 |
quaternion
Joined: 12 Nov 2006 Posts: 209 Helped: 11 Location: Cairo , Egypt
|
08 Nov 2009 15:40 Re: USB communication from PIC 16F877 |
|
|
|
|
| the problem is that the data are sampled very fast in order to get accurate measurment in addition to changing from parallel to serial make the speed 8 times faster!
|
|
| Back to top |
|
 |
elrayes
Joined: 03 Jun 2008 Posts: 164 Helped: 8 Location: Egypt
|
08 Nov 2009 17:18 USB communication from PIC 16F877 |
|
|
|
|
| how fast they are sampled, PIC18F4550 has an internal A/D of 102 KSps, would need higher sampling rate then use external A/D or what, i can't get where is the problem.
|
|
| Back to top |
|
 |
quaternion
Joined: 12 Nov 2006 Posts: 209 Helped: 11 Location: Cairo , Egypt
|
08 Nov 2009 19:16 Re: USB communication from PIC 16F877 |
|
|
|
|
ok an external ADC to be used.
well the sampling rate is quite higer than this and so i want to use the full speed i am not sure i can buffer the data without the use of external memory [which i dont want to use]!
|
|
| Back to top |
|
 |
elrayes
Joined: 03 Jun 2008 Posts: 164 Helped: 8 Location: Egypt
|
09 Nov 2009 9:30 USB communication from PIC 16F877 |
|
|
|
|
| you have projects other than CDC basic demo, you have custom class and mass storage class projects for the same microcontroller, you can use any of them but remember you will have to deal from the PC side in a more difficult way than CDC, I think you will need some knowledge in C# or Java to deal with them, there is a demo project you will find with these projects in C#, you can modify in it and use it, also I think you can find ready made sources on the internet, USB isn't easy and I think you will spend some time searching for some tools to help you.
|
|
| Back to top |
|
 |
quaternion
Joined: 12 Nov 2006 Posts: 209 Helped: 11 Location: Cairo , Egypt
|
16 Nov 2009 17:45 Re: USB communication from PIC 16F877 |
|
|
|
|
| what about using usb video class!
|
|
| Back to top |
|
 |
elrayes
Joined: 03 Jun 2008 Posts: 164 Helped: 8 Location: Egypt
|
16 Nov 2009 22:18 USB communication from PIC 16F877 |
|
|
|
|
| I don't think it will be a good idea with PC18F4550, beside I didn't hear about a USB video class firmware for PIC18F4550, i would recommend you to check TI DSP products or another DSP based solutions.
|
|
| Back to top |
|
 |