Organize and Share your Electronics the way you want. Sign-Up for a free account now. It takes only 30 seconds!

Basic USB Communication RS-232 Emulation Method

Basic USB Communication RS-232 Emulation Method

With the continuous decrease in the use of COM Port devices and COM Ports itselt, the need to migrate to the USB has become increasingly important. Just take a look at the laptop PCs nowadays, it is a miracle if you can even find just 1 COM Port on it.
But the good news is… we have got a simple (very simple in fact) way of migrating from the old RS232 to USB, that is via RS232 Emulation method. This method alone has got quite a number of ways to implement, e.g. using USB Convertor ICs, like the FTDI232BM (this is UART-USB conversion), the Philips PDIUSBD11 (this is I2C conversion to USB) and many more. Sometime last year, Microchip released the USB 2.0 compatible microcontrollers, i.e. PIC18F4550, 18F2550 and etc. Presented here, is the example of using the CDC firmware provided by Microchip to emulate a COM Port when the device is connected to the USB Port.

When the device is connected to the computer, a Virtual COM Port (VCP) will be created. This is shown at the Device Manager Window under Ports(COM & LPT). In this case, COM5 was created when the PIC18F4550 was attached to the USB Port. It may be interesting to note that if you plug in your PIC in different USB ports, the VCP created will be different.

Here, I modified the CDC firmware provided by Microchip and wrote a Visual Basic programme to communicate with the device. An important thing to note when using the firmware and this schematics is that… to PLACE REMARKS ON THE FOLLOWING 2 LINES AT USBCFG.H like this…

//#define USE_SELF_POWER_SENSE_IO //#define USE_USB_BUS_SENSE_IO

if not the when you attach the PIC to the USB Port, it will disconnect itself immediately soon after.

Visit Here for more.







 

More Articles to Read

An Arduino-controlled automated whiskey distillery
An Arduino-controlled automated whiskey distillery
The Rex800 looks like a dinosaur Terminator
The Rex800 looks like a dinosaur Terminator
Home Environment Monitor
Home Environment Monitor
Understanding the Operation of the Frequency Synthesizer in Maxim’s RF Transceivers
Understanding the Operation of the Frequency Synthesizer in Maxim’s RF Transceivers
App note: EPIC: Electro-Pyrotechnic Initiator Chip Resistor
App note: EPIC: Electro-Pyrotechnic Initiator Chip Resistor
App note: Noise analysis for high-speed op amps
App note: Noise analysis for high-speed op amps
Skill Sunday: Arrays
Skill Sunday: Arrays
App note: Infrared remote control implementation with MSP430FR4xx
App note: Infrared remote control implementation with MSP430FR4xx
Gesture Controlled Smart Home
Gesture Controlled Smart Home
Design for a Wideband, Differential Transimpedance DAC Output
Design for a Wideband, Differential Transimpedance DAC Output
Wrist thrusters let you fly through the water effortlessly
Wrist thrusters let you fly through the water effortlessly
Bertan/Spellman 225-20R HV power supply teardown
Bertan/Spellman 225-20R HV power supply teardown
Blinking Christmas Lights
Blinking Christmas Lights
Adjusting clock with alarm, hygrometer & thermometer on 1.8″ ST7735 display
Adjusting clock with alarm, hygrometer & thermometer on 1.8″ ST7735 display
Adding an “extra sense” with rangefinders
Adding an “extra sense” with rangefinders
This wireless game controller looks like a rug
This wireless game controller looks like a rug
How to run your ESP8266 for years on a battery
How to run your ESP8266 for years on a battery
Calibration of a 3-Phase Energy Meter Board on the ADE7754
Calibration of a 3-Phase Energy Meter Board on the ADE7754
Making beats on a tiny Arduino DJ controller
Making beats on a tiny Arduino DJ controller
Qinsi-QS5100 Sn63Pb37 solder profile
Qinsi-QS5100 Sn63Pb37 solder profile

Top


Shares