Hi all, I have a project wherein I need to program the usb port of my board (MCB9B500). I was hoping that I could just do a uart to usb kind of thing, but my project outlines that I must use USB protocol. I haven't had to work with usb before, so I'm a bit unfamiliar. I've been reading up on usb protocol, and it's starting to make sense, but I'm having a hard time tracking down resources on actually programming a microcontroller to act as a usb device. If anyone could point me to some really nifty resources that would be great! thanks for any help.
Lorenzo; Search on the name of Tsuneo Chinzei on this forum. Tsuneo has a virtual USB tutorial in the many posts he has answered on this forum. There are a number of USB HID examples in the Keil examples folders. I am not at all familiar with your NCB9B500 eval board so I cannot direct you to a specific example. Check also, your vendor application examples.
First and foremost understand – truly understand – the purpose of each entry in the descriptor files. It will save you a lot of debug time.
Also, do a detail review of your device USB engine.I worked several days attempting to debug some USB software only to find the USB engine had different size FIFO for each different end point supported on that specific device (the CC2531).
A good place to start is with “USB Complete” ISBN 1-931448-02-7 by Jan Axelson. You can review the book and get HID test code from her web site http://www.lvr.com. Axelson has a test USB HID Ckient for download.
Remember there are two ends to USB communication. Windows on the PC supports USB HID drivers but you must have an application to interface to the USB drivers. Kiel’s USB examples support an HID Client application. Two good tools to have on your computer are Device Monitoring Studio and USBView. The Device Monitoring Studio is a great snooper tool to intercept and display the invisible data stream between the USB Device and The USB Host.
I suggest that you start with a simple interrupt end point with a single fixed 64 byte packet. After you get that functional then you can start with larger data blocks with multiple packets, etc.
Good luck and come back when you have more specific questions.
Bradford
Wow, thanks for such an in depth reply. I will definitely look over the things you mentioned and come back here.
Before I go off though, perhaps I should mention that I will need to interface with Labview in the end, might this help in any way?
I personally don't know Labview applications but on a past project a fellow team member ran the Labview interface and he seemed to be able to interface Labview to a data aqusition with a built-in Labview application.
So I suggest that you review applications on the Labview website.