Ttelmah
Joined: 11 Mar 2010 Posts: 19513
|
|
Posted: Tue Oct 30, 2012 8:31 am |
|
|
Not actually a simple question.
The key is to understand that USB is a transport medium, rather than a particular interface. It has a whole 'suite' of different 'hats' it can wear, and which one is needed depends on what you are connecting, what expects to 'use' this, how fast data needs to travel, how quick responses must be, etc. etc..
It is the presence of these different 'hats', which is why you can have devices as different as a hard disk, and a joystick, both on this same medium.
Now probably the interface most likely to be a starting point, assuming you don't want the final target to transfer lots of data, or to be for specific tasks (like keyboard, mouse, joystick etc..), is the 'cdc class'. In it's simplest form, it be seen by the PC, just like a serial port, and existing serial monitor programs, and software used to talk to these ports, can be used.
EX_USB_SERIAL.C
EX_USB_SERIAL2.C
These both use the installation file cdc_NTXPVista.inf, which is in a sub directory of the drivers folder, to install.
The former is a basic 'hello world' application, the latter allows you to read the chip's EEPROM, and set a location in this, using the USB.
Both can be 'driven' from the standard serial driver programs (Hyperterm, Siow, and Teraterm for example).
This is the simplest interface to get working, but if you need (for instance) to transfer very large amounts of data quickly, then one of the other 'hats' will be needed.
Best Wishes |
|