April 2, 2012

Interfacing a Microcontroller With a Pc Using Rs232 and the Pc Serial Port

Serial Communication

Serial communication is a technique of transmitting data between two pieces of hardware. The smallest piece of data that is transmitted is the byte. A byte is made up of 8 bits. When data is transmitted between two pieces of hardware, the bits are sent one at a time. The hardware sends these bits by sending varying voltages over the wires connecting the devices. The sender and the receiver agree on how often a bit (or voltage level) will be sent.

How often a bit will be sent is referred to as baud rate or bits per second (bps). Then with the help of very accurate clocks they can send a series of voltage levels between each other and then reassmble these voltage levels into bytes.




The question Communicating between a Pc and a Microcontroller

The Rs232 serial port on a Pc uses +3 to +25 volts to signify a logic level of 0, and -3 to -25 volts to signify a logic level of 1.

Most microcontrollers use Ttl / Cmos logic levels which use 0 to some threshold voltage to signify a logic level of 0, and some threshold voltage to 5 volts to signify a logic level of 1.

In order for the Pc and a microcontroller to successfully review some logic level translation is necessary.

Using a Ttl / Cmos To Rs232 Converter

There are many associates that originate modules that take care of the required logic level translation. The Ttl / Cmos To Rs232 Converter is one such module. Typically, these modules associate to the Rs232 port on the Pc and associate to the microcontroller's send and receive pins. supply 5 volts and ground and you are ready to communicate.

Applications Ideas

Once you have your microcontroller communicating with your Pc it opens up all kinds of potential applications fluctuating from data loggers, pc based oscilloscopes, controlling your pc from your microcontroller, controlling your microcontroller from your pc, etc.

Interfacing a Microcontroller With a Pc Using Rs232 and the Pc Serial Port

Homemade Chocolate Cupcake Recipe