Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

how to program our microcontroller as a RS232 to USB converter.

Status
Not open for further replies.

dinesh401

Advanced Member level 4
Joined
Aug 21, 2010
Messages
104
Helped
3
Reputation
4
Reaction score
2
Trophy points
1,298
Location
BANGALORE
Activity points
2,077
The question which i am asking looks somewhat bad......

Can we program our AT89C51 microcontroller as an RS232 to USB converter. i.e., it receives the data from another controller or by the controller itself internally and has to send the data to the USB data pins D0+ and D0- . In which the PC has to receive the data serially.

Actually RS232 to USB converter are available in the market in which it will send and receive the data. All the programming like device driver for USB protocal is written internally for transferring data.

Is there any possiblility to write those sort of programs in our AT89C51 microcontroller....?
 

While the USB interface is 'simply' a serial interface, it has quite a complex protocol, is bidirectional and fast. The AT89C51 (and any other small MCU) is simply not capable of handling the interface without additional hardware/firmware. The MCU is not nearly fast enough to be able to bit-bang the interface like you might do for a simpler serial interface like SPI, even if you had additional circuitry to handle the differential signal and bidirectional nature.

As erwin yudha stated, and you have mentioned, you need to use an external USB UART. These convert the USB interface to a simple serial interface like RS232 or SPI. The additional benefit over an MCU with built-in USB is you do not need to write any USB software. If you used an MCU with a built-in USB interface you would need to write the software to control the interface, and that is not trivial except for experts.
 

Software implementation of USB as you want, has been done and you can see how many limitations and how complex it can be, here:
**broken link removed**
Microchip offers uControllers with embebded USB and support libraries that make easier to implement a specific protocol.
Unless your application cannot use a serial port emulation on the PC side. Using an adapter is much more easier and you will not have to reinvent the wheel.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top