CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

PIC18F4550 USB

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
magestik



Joined: 16 Oct 2008
Posts: 59

View user's profile Send private message

PIC18F4550 USB
PostPosted: Wed Dec 24, 2008 7:42 am     Reply with quote

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 Razz.
Ttelmah
Guest







PostPosted: Wed Dec 24, 2008 8:14 am     Reply with quote

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
magestik



Joined: 16 Oct 2008
Posts: 59

View user's profile Send private message

PostPosted: Wed Dec 24, 2008 8:28 am     Reply with quote

So i can't implement any pic between the line ? i would need to do this in hardware, not software Crying or Very sad Crying or Very sad

Isn't there any way of watching the USB line with a pic ?
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Wed Dec 24, 2008 10:02 am     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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