Become a subscriber (Free)

Join 29,000 other subscribers to receive subscriber sale discounts and other free resources.
:
:
Don't worry -- your e-mail address is totally secure. I promise to use it only to send you MicroZine.

USB Serial Port: How to Setup an RS232 serial link through a USB port.

USB Serial Port: How to setup and use an RS232 serial port when you only have USB interfaces available. There are two types of digital interface to consider...

I use a USB serial port for RS232 communications all the time on my projects RS232 since it is a very useful standard communication module which can be found built-into PICs and most other microcontrollers.

Computers used to come with RS232 and parallel port built-in as standard, but not any more as new computers have USB ports instead.

There are three useful features about RS232:

  1. It is found in internal hardware modules of microcontrollers.
  2. It has minimal connection requirements (minimum is three wires).
  3. It has robust communication over fairly long wires i.e. noise tolerant.
The way to get it working is to use a very cheap USBadaptor unit that you can easily buy on ebay:

There are two types that do a similar job

  1. A digital serial to USB adaptor
  2. An RS232 to USB adaptor

USB Serial Port: Digital Serial

The digital serial unit does away with all RS232 comms (and cables) and outputs only digital signals. This is the generates the same as the signals that you get at the microcontroller, after they are decoded at the MAX232 chip. Using this unit means that you can plug the signals directly to the microcontroller  RX TX pins (connect digital serial Rx to uC TX and digital serial Rx to uC Rx to communicate correctly) and you do not even need a MAX232. The disadvantage is that you do not get noise immunity over long distance which the the RS232 interface does provide, but this is not a problem when working directly beside the units as I do. I use the digital serial all the time.

Digital Serial to USB on ebay :

This is the one I use - if you move the connectors a lot you can buy new duponts to replace them - it also as a low power 5V and 3V output for very simple circuits and it installs without a disk! It also has a couple of LEDs on board shown when comms is active - sometimes useful.

PL2303HX USB To RS232 TTL Auto Converter Adapter Module For arduino W/ Cables

Search for above text on ebay. There are bound to be others available if you can not see that exact one.

This USB serial port unit looks like this:
Digital Serial Interface RS232

RS232 to USB on ebay

The RS232 unit provides all RS232 signals (between +-3V to +/-12V) and will plug into the MAX232 device. Since RS232 voltage levels are generated it will allow operation over long cables. For this method you will need the MAX232 chip (or equivalent) connected as shown in the circuits to decode/encode the RS232 signal levels for the PIC's digital i/o.

USB 2.0 TO RS232 SERIAL DB9 9 PIN ADAPTER CABLE GPS PDA Adapter Converter Cable

Search for above text on ebay. There are bound to be others available if you can not see that exact one..

This RS232 USB Serual port unit looks like this:

usb to rs232 serial interface

I have tested this on the on-site project "serial LCD" and it works as expected.

Either of the above USB serial interfaces will do the job.

Note: The RS232 version means more work in wiring up a level translator chip e.g. MAX232 and you won't see much benefit other than operation over longer distance, for normal use. The desktop advantage can be seen in that the uint will generate all signals (not just TX and RX) so you can observe the signals DTR and RING and these can be made to power a small device (with a few diodes) or provide hardware handshake operation.

Terminal

To progress, next you need a terminal program running on your PC so that you can send data to, and receive data from the microcontroller. A suitable program is "Tera Term" which is a free.

All you do is plug your chosen USB to serial interface into the USB port and connect to the development board and then start The terminal program.


Then all you do is select the serial interface that has appeared as a result of plugging in the serial to USB interface and everything works the same as if you had a built in serial link. (Tera Term menu Setup-->Serial Port...) - click the "Port" drop down and select the new Serial com port (depends on which USB port you plug into - mine is COM11)

New! Comments

Have your say about what you just read! Leave me a comment in the box below.



Claim Your: Useful

"Arduino Software Guide"

   Right Now...





Privacy Policy | Contact | About Me

Site Map | Terms of Use



Visit our Facebook Page:

   Click Here



Sign up for MicroZine
''The'' Microcontroller Newsletter

Enter your first Name and primary email address in the form below:


And receive absolutely FREE a full project for:

"Measuring Analogue Voltages
Without An ADC"

(Using only one pin).

Instant Download:
You Can
Get It Right Now

Warning: This project could be  Removed 
at any time.  

It will  NOT be 
available indefinitely SO
To avoid 
disappointment  get it:

Now



:
:
Don't worry -- your e-mail address is totally secure. I promise to use it only to send you MicroZine
Remember this is a project with full description and fully debugged C Source code - and it's not available from the main website.

You can only get it through this newsletter.

To get exclusive access Enter your first name Name and primary email address Now in the form above.:



But wait !

There's more...

You'll receive more
free and exclusive reports as well as site information and site product updates


Scroll up to the form above and sign up NOW. Don't forget it's FREE and if you don't like it, you can unsubscribe at any time.

Click Here Now to use the form above to get your Valuable information absolutely free.



Readers Comments

"I wanted to thank
you so so so much
for all the information
you have provided in
your site it's

SUPERB and FANTASTIC."

- Ranish Pottath

"This site really is
the best and my favorite.
I find here many useful
projects and tips."

- Milan

bursach<at>gmail.com<

"Awesome site,
very, very easy and nice
to navigate!"


- Matt
matt_tr<at>
wolf359.cjb.net


Learn Microcontrollers

"Interested in
Microcontrollers?"

Sign up for The
Free 7 day guide:

FREE GUIDE : CLICK HERE


"I am a newbie to PIC
and I wanted to say
 how great your
site has been for me."


- Dave

de_scott<at>bellsouth.net

"Your site is a great
and perfect work.
congratulations."


- Suresh

integratredinfosys<at>
yahoo.com

"I couldn't find the correct
words to define
yourweb site.

Very useful, uncovered,
honest and clear.

Thanks so much for
your time and works.
Regards."


- Anon

Recent Articles

  1. How to use the DHT22 (or DHT11) with an Arduino; full code and description. Also including a comparison of the DHT11 vs DHT22.

    The Essential Guide to the DHT22/11 humidity sensor including a library code guide for the Arduino. Learn how to determine Humidity, Dew point and Heat Index.

    Read more

  2. How to Use the MAX7219 to drive an 8x8 LED display Matrix on the Arduino.

    The Essential Guide to the MAX7219; What it is and how you can easily use one in any of your projects.

    Read more

  3. How to use a DS18B20 (single or multiple on one wire) for temperature measurement using the Arduino Uno.

    How to Easily Use the DS18B20 Maxim One-Wire thermometer with Arduino example code showing external or parasitic power modes.

    Read more