Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

USB to RS232 conversion

Status
Not open for further replies.

chintan_jagani

New Member
As a part of my project I want to build a USB to RS232 converter. Can anybody help me out? I want to use a microcontroller, preferably PIC to carry out the conversion (not using any readymade product meant for this purpose).
Please suggest me the size of the buffer, signal conversion schematic,etc. needed for this conversion or info about such conversion ckt. using PIC. Thanks in advance.
 
USB to anything is a fairly tall order. In addition to some substantial dollars for the spec I think it is unlikely to be a successful project without some specialized hardware. I think the consensus around here is that it is not worth anyone's time or treasure so there is probably a lack of experience to boot.
 
Last edited:
Yes, it's pretty pointless wanting to do this - when you can buy FT232 chips that already do the exact job, and come with the required PC drivers.

As such you're unlikely to find a ready built project (because it's a waste of effort), but any of the 18F USB enabled PIC's should be able to cope wiht such a project, you just need to design it, and write the software (not forgetting the PC drivers as well!).

Presumably this is yet another college project?, but at least you've come up with your own idea - even if you don't have any clue how to implement it!.
 
Thank you very much.
Actually I want to implement other conversions using the same microcontroller. Using a seperate IC for each conversion will increase my hardware. Will u please elaborate the idea of USB enabled PICs? Do they help in enumeration process? PLease specify the difficulties in the project using PIC.
 
On several of the 18F PIC series are the hardware(ram and interface) for doing USB at LOW and FULL speed. However, they handle the hardware part only. User still has to write the code to implement endpoint buffers from the RAM and provide/retrieve data from these end point buffers in order to do something useful. In a word, user has to write code for the data part of the USB implementation, including enumeration and high level exchange.

The following link points to a Microchip page that includes free firmware for HID/CDC or mass storage class implementation on the PIC. I have only tried the CDC example. Simply said, if a PIC is loaded with the CDC firmware, it will be detected by the computer and enumerated as a virtual COM port. Other Window softwares like Hyperterm can then communicate with the virtual COM port.

The codes are very involved and in C language, in which you would need the C18 compiler(also available for download as free student version) to compile it. I suggest you download and "install"(it just expands all the files to a directory) the CDC firmware to have a look.

**broken link removed**

The difficulty of the project lies in the functioning of the USB interface part as data exchange is fast even with PIC running on 48MHz with a FULL speed implementation. Therefore, the USB code is done via polling instead of interrupt and consumes basically all the MCU power with nothing much left for user to do extra work.

As mentioned by others in the above posts, it is not worth the effort to build anything serious while dedicated chips are available and function much better. Its great fun to experiment though.
 
Actually I want to implement other conversions using the same IC such as USB<=>P/S2 ,RS232<=>P/S2 as my project is to combine the three conversions (USB ,RS232, P/S2 ), both way (only one conversion at a time ). So,will I have to use another microcontroller for other conversions? Atleast can I implement RS232 to USB using this IC. I am unable to start my project, at what point should I start? Pleasehelp me out.
 
chintan_jagani said:
Actually I want to implement other conversions using the same IC such as USB<=>P/S2 ,RS232<=>P/S2 as my project is to combine the three conversions (USB ,RS232, P/S2 ), both way (only one conversion at a time ). So,will I have to use another microcontroller for other conversions?

No, I think one PIC is sufficient.

The only limitation here is the code memory space(32K for 18F4550, so plenty) of the PIC you are using. USB<>RS232 does not take up all the code memory space so you can implement other protocol translation using the remaining space, as you only need to do a pair at a time.

There are many examples of how to communicate with a P/S2 device using PIC so it not difficult at all. Once you get the data from the P/S2 port, then you can send them out to RS232.

On the PIC, you can select which piece of code to run based on the status of some dip switches at startup or detecting activities on PIC input pins.
 
Thank you very much for ur valuable suggestions.
Actually I think there is some problem on microchip's website.I am unable to download the datasheet of PIC 18F4550 which is causing delay for me to start.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top