stuck writing code for pic side of usb project

Status
Not open for further replies.

jackson15j

Newbie level 3
Joined
Nov 18, 2004
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
56
Hello everyone, just a quick question. I'm making a project to allow any PIC to link to a USB host controller to a windows pc (2k or xp). At the moment, I'm just testing my windows drivers with the PIC16C745 connected through usb. It enumerates fine, but I 'm having problems trying to figure out how to reprogram the pic to talk over the usb cable.

Can anyone help me or give me any advice on how to write a usb header file (which doesn't use the usbHID driver information), for my pic, so I can move away from this pic and implement my cypress controller.
 

check out 'beyondlogic.org' for info and sample c code for usb.
 

I was looking at this site previously, but have found a few interesting points. The stage I'm at now needs an analyzer to read whats been passed up and down the usb cable between the pic and pc. Is there anywhere that just releases a basic software analyzer, or is this a hardware only solution.

thank you for your help so far btbass
 

Here you will find tools to test your usb device, (it used to be called usbcheck?)
h**p://www.usb.org/developers/developers/tools/
If you search about, I think there is a program called 'snoop' which can capture the usb transfers. Attached is a program to help you write usb descricpters.
 

I've found an analyzer from www.sourcequest.com/, it seems to be working pretty well. I have a hid mouse demo running on the pic at the moment, and have tested it with the analyser. Both with a generic hid driver and my modified host controller driver.

Hopefully, I'll be able to get my cypress controller some time next week to sit between the pic and pc. However, I'm still try to find the information on writing the PIC side. I'll keep working on this altough I'll be away for a while so I apologise if I'm slow to reply. (I'll also try the tools you've told me about)

thanks again for the help btbass [/url]
 

jackson15j said:
Can anyone help me or give me any advice on how to write a usb header file (which doesn't use the usbHID driver information), for my pic, so I can move away from this pic and implement my cypress controller.

Hi,

An ideea... Modify the original code ! There's ASCII character commands, try to add yours... I did, but not burn in silicon... I've changed some pins to have PORTB free, and some others pins to implement some handshake (RD, RW, ALE). I hope that soon I-l test that

Cheers !
 

I did my USB debugging over the serial port. You may meet some problems as the usb port is very much faster than the serial one, but it's generally still doable without an expensive protocol analyzer. I used the USBN9604 btw, with custom written drivers.

Since you managed to get enumeration working, 90% of the job is done, and you should be able to use any of the software usb sniffers then.
 

thanks for all the help everyone. Unfortunately I can only work on this a few times a week, as the pic's are not mine, but I'll keep reading up and hopefully I'll get a little further ahead.
 

USB with Visual Bacic or C#

Hi,
I have a project that needs me to interface between the Visual basic and the USB drive. So I can send to it number of bytes and receive some.
I need to be able to verify my reciption of those bytes and put the in the user inteface like text box.
I did before for the serial port 232 but I need it now urgently for the USB with any language like C++, C#, Vb.Net or VB6 .
Can anybody help me.
Amal Ibrahim
 

USB is nowhere near as simple as interfacing the serial port. All USB devices need drivers. For some devices like mice and thumbdrives, they use generic drivers that come with the OS. Most of the time, usb devices need customised drivers.

Thumbdrives use the Mass Storage Driver. It makes the thumbdrive appear as a virtual drive that you can mount. If you want to change this behaviour, you'll have to write a driver for it, not merely access through an application.

But for your case, why not just do a simple file I/O to a file on the thumbdrive?
 

hi btbass!
beyondlogic got good resources on USB but i couldn't find any C codes. can you help me out!!
-srinivas
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…