We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I'm trying to write an usb cdc driver program. its cummunicate between pc and arduino due.actually my aim is reciveing the data form arduino and I read in visual c++ (command prompt).how to suppose i read the data in vc++. I don't the flow(sequence of the process) of cdc driver porgram . please explain me ?...........
You could look at HID application examples that Keil provides. Or it might be easier to communicate using RS232 program. Since there are several windows Visual C++ examples of that type of communication program.
I have decided to look into CDC programs also. So far it looks like ATMEL provides demos of ARM/AVR CDC programs. And PIC from Microchip has examples.
Found some code for PC and for a TI Board. processors.wiki.ti.com/.../USB_CDC_Benchmarking
I found out that the MCB2300 Board has a USBCDC program. Started looking at it. The way it looks is that the USBCDC is a virtual com port and requires a terminal program like teraterm to communicate with the port.
The test on the MCB2300 board uses two ports one is a uart port which is to pass characters to the Virtual com port it the uart receives characters. and the other way around.
I have not gotten it to work yet. Not sure about the actual baud rate of which UART Com port should be used.
Thank u for your continued support Mrs.Gary , Actually I have one doubt "Which one is easiest and most efficient way to create a USB CDC driver program , 'C++' or 'C#' ? "
Not really.
CDC is the USB Communications Device Class; Windows presents it (or part of it) to applications as a Virtual COM Port (VCP).
en.wikipedia.org/.../USB_communications_device_class
http://www.keil.com/pack/doc/mw/USB/html/_c_d_c.html
"requires a terminal program"
It doesn't specifically require a terminal program - though that's a good way to start experimenting
... 'C++' or 'C#' ?
Well, C# is a Microsoft language - only applicable to their .Net platforms.
So, presumably, this means that you're talking about the PC Host end - not the microcontroller end?
In which case, you don't need to create a Driver - because that is already provided by the Operating System.
Hi Andrew , still i'm confusing between USB CDC host and device program . Because i'm trying to send the ADC data from MCU(Arduino due) to pc . So i'm choosing USB CDC host program. because my MCU has a host.....so my question Why can't i choose USB CDC device program ?
If your MCU has a USB host it means it can communicate with USB devices.
But a PC is already a USB host in which case I can't understand why you want to try to run the embedded device as a host too - you think you can get two USB hosts to communicate?
Then you need to take some time to study the basics of USB!
USB always works with a Host (or "master") controlling a number of Devices (or "slaves").
The PC will be a Host.
You can't connect two Hosts directly together - that's why you can't directly connect two PCs with a simple USB cable!
http://janaxelson.com/usb.htm
en.wikipedia.org/.../USB
http://www.keil.com/books/usbbooks.asp
electronics.stackexchange.com/.../what-exactly-are-the-difference-between-a-usb-host-and-device
www.computer-solutions.co.uk/.../usb_tutorial.htm
Finally got the MCB2300 Demo working. I had to use the driver stuff that comes with the DEMO so that it would start working. I loaded the program into flash. It took me a few days to get it working. But really not sure why I could not get it working right away. The first time I loaded the driver it gave an error. But the error went away the next time I powered the PC up.
Today I took a good look in Device manager and saw that not the COM Ports of my USB to RS232 adapter AND the USB VCOM port were set to 9600. I brought up Tera Term twice one instance for each port. Then I would type characters into one Tera Term window and see the characters go to the other Tera Term window. There was no echo occurring in the Tera Term window I was typing in. Also the program worked in both directions.