![](templates/subSilver/images/CCSLogo.jpg) |
![CCS C Software and Maintenance Offers](templates/subSilver/images/forumAd6.jpg) |
View previous topic :: View next topic |
Author |
Message |
magestik
Joined: 16 Oct 2008 Posts: 59
|
PIC18F4550 USB |
Posted: Wed Dec 24, 2008 7:42 am |
|
|
Hello,
I have a question, i intend to use the PIC18F4550 for reading USB data.
Lets say i plug my PIC18F4550 (D+ and D-) between the computer and a USB peripheral (lets say the keyboard), if i don't use all the USB protocols (i don't want it to be recognised as a USB peripheral, otherwise, it will be in conflict with the keyboard), and i just use functions such as "usb_get_packet" just to read what is going through the USB port, am i in a good direction ?
I hope i am clear enough, just to sum up, i just need to read USB data between two devices.
Thank you for pointing me in the right direction . |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah Guest
|
|
Posted: Wed Dec 24, 2008 8:14 am |
|
|
No.
You can't monitor USB transmissions like this.
USB, is a _point to point_ interface. Just one device talking to another device (normally the host or hub talking to the peripheral). The bus changes direction during parts of the transfer. If you added a PIC on the lines, it would cause confusion, even before a transfer started.
The PIC, won't work as a USB 'receiver', till it is enumerated, and once enumerated, it'll be responding to the host.
If you want to monitor what is going on on a USB bus, then add a 'packet sniffer' program at the host. There are dozens of free ones on the web.
Best Wishes |
|
![](templates/subSilver/images/spacer.gif) |
magestik
Joined: 16 Oct 2008 Posts: 59
|
|
Posted: Wed Dec 24, 2008 8:28 am |
|
|
So i can't implement any pic between the line ? i would need to do this in hardware, not software
Isn't there any way of watching the USB line with a pic ? |
|
![](templates/subSilver/images/spacer.gif) |
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Wed Dec 24, 2008 10:02 am |
|
|
Most details of USB communication can be visualized with the said USB sniffers. Some aspects, particularly related to hardware protocol and timing errors, can be seen by hardware monitors only. You can build your own one, but you need a hardware protocol decoder. It can be realized e. g. in a CPLD or FPGA, some knowledge of the USB protocol is required, of course.
Best regards and Merry Christmas,
Frank
P.S.: An USB keyboard generally uses low speed (1.5 MBps). I've seen software based low speed USB interfaces with microprocessors, it may be realized with a fast PIC. But it's gonna be hard stuff assembler programming. |
|
![](templates/subSilver/images/spacer.gif) |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|