Communication between a USB/serial device and an AVR (atmega/Arduino) microcontroller
I have a device which provides a USB port. If I attach it to a Windows PC it is recognized as a “CP2103 USB to UART Bridge Controller”. According to the device documentation, it should communicate in serial format at 38400bps.I have to talk to this device with a atmega microcontroller.
Since the USB pinout is different from the serial UART of the uC, firstly I thought I would need a circuit to convert the signals. I found the AVR-CDC project and put on a CDC-232 in order to convert USB (
VCC) to RS232 (
To make it I used another atmega328 as uC, flashed with the specific hex, with a 16Mhz crystal instead of the 12Mhz one specified into the diagram.
Then I built another piece of circuit to convert the RS232 signal to TTL:
So the signal conversion should be USB -> RS232 -> TTL.I programmed my uC to send some data to the device and I can follow the signal with the oscilloscope until it enter into the CDC-232, then I lose it. I have no output on pins 4 and 5 of the CDC-232 uC, where I should have a USB signal.
Is my overall approach right? Sould I go on debugging the CDC-232 part or there is something wrong elsewhere?
EasyEDA: Ideas for Circuit Design, Innovation for Electronics Access
Free Circuit Design: Schematic – Simulation – PCB Layout – Gerber Viewer
Cheapest PCB Prototype: Only $2 for 10pcs 10×10cm PCBs, 24 hours Quick Turn, DHL Delivery in 3 Days
This Post / Project can also be found using search terms:
- bluetooth smart home project by atmega8 project