background preloader

AVR CDC

Facebook Twitter

USB to Serial Converter using AVR microcontrollers ~ Embedded Projects Blog. AVR-CDC converts USB and RS-232C signals using the AVR micro- controller which has no on-chip USB interface.

USB to Serial Converter using AVR microcontrollers ~ Embedded Projects Blog

This technology is based on Object Deveopment's V-USB (Software-USB on AVR), and the CDC (Communication Device Class) protocol was extended over it. AVR-CDC enables PC to communicate with the USB device through virtual COM port. The basic idea of using CDC protocol over Low-speed USB is based on Kyosuke Ishikawa's experiment in 2005. To make it stable and practical, Christian Starkjohann in Object Development helped me modifying his V-USB stack. Since three endpoints and the bulk transfer on low-speed device violates the USB standard, I added a tiny patch driver on Windows' USB stack. Although this technology is quite experimental, it may be useful to interface your original system to PC easily.

The back door to the low-speed bulk transfer is gradually closing on the newer OS. CDC-232 creates a virtual COM port on PC that doesn't have real RS- 232C port. Usage. AVR ATtiny USB Tutorial Part 4. All right.

AVR ATtiny USB Tutorial Part 4

Now that we got the basic USB code working in part 3, it’s time to wrap things up in this tutorial series. This fourth section will explain how to send data from your device to PC and also the other way around. I may later do a fifth part on how to make a USB HID device like a keyboard or mouse, so if you haven’t already, I’d recommend subscribing to the RSS feed to get updates. Sending data from device to PC If you look carefully at our command-line client code, you probably noticed that the control messages sent to toggle the led are of type USB_ENDPOINT_IN and we have a 256-byte buffer in place to receive any data the device sends.

Set the global pointer usbMsgPtr to a (static RAM) memory block and return the length of data from the functionDefine usbFunctionRead() function to do it yourself We will be using the first method. #define USB_DATA_OUT 2 static uchar replyBuf[16] = "Hello, USB! " Then we add a new case to usbFunctionSetup() to return the contents of that buffer: HID-class USB Serial Communication for AVRs using V-USB « RAYSHOBBY.NET. A month with no new post?

HID-class USB Serial Communication for AVRs using V-USB « RAYSHOBBY.NET

That’s unacceptable. Since my last trip to Shenzhen, I actually have quite a few new ideas and projects to post about. The thing is there are so many of them that I don’t know which one to start with! Anyways, I’ve decided to put a stop to this. In this blog post, I will describe some work I did a little while back about implementing HID-class serial communication for AVR microcontrollers using the V-USB library.

Introduction First, let me explain what I am trying to do. What do I need the USB for? The second reason to have USB is for serial communication — the ability to transfer data (e.g. strings) in and out between the device and a host computer through the USB port. Circuit Design and V-USB Now I’ve explained the motivation, let’s see how to go about implementing it. To adapt it to mega328, I first made a circuit based on USnoobie. It’s a pretty standard V-USB setup. The next step is to modify the source code. Next, modify main.c. Learning HID Source Code.

Uart - ATtiny V-USB with 115200bps? DIP only. AVR-CDC.