Loading

Kategory:

Serial Communication between microcontroller and PC

Bookmark and Share
 9 Serial Communication
The Serial Port is harder to interface than the Parallel Port. In most cases, any device you connect to the serial port will need the serial transmission converted back to parallel so that it can be used. This can be done using a UART. On the software side of things, there are many more registers that you have to attend to than on a Standard Parallel Port. (SPP) .So what are the advantages of using serial data transfer rather than parallel? com port to microprocessor
9.1 Advantages of Serial Communication.
1. Serial Cables can be longer than Parallel cables. The serial port transmits a '1' as -3 to -25 volts and a '0' as +3 to +25 volts where as a parallel port transmits a '0' as 0v and a '1' as 5v. Therefore the serial port can have a maximum swing of 50V compared to the parallel port which has a maximum swing of 5 Volts. Therefore cable loss is not going to be as much of a problem for serial cables as they are for parallel.
2. You don't need as many wires as parallel transmission. If your device needs to be mounted a far distance away from the computer then 3 core cable (Null Modem Configuration) is going to be a lot cheaper that running 19 or 25 core cable. However you must take into account the cost of the interfacing at each end.
3. Infra Red devices have proven quite popular recently. You may have seen many electronic diaries and palmtop computers, which have infrared capabilities, build in. However could you imagine transmitting 8 bits of data at the one time across the room and being able to (from the devices point of view) decipher which bits are which? Therefore serial transmission is used where one bit is sent at a time. IrDA-1 (The first infra red specifications) was capable of 115.2k baud and was interfaced into a UART. The pulse length however was cut down to 3/16th of a RS232 bit length to conserve power considering these devices are mainly used on diaries, laptops and palmtops.
 4. Micro controllers have also proven to be quite popular recently. Many of these have in built SCI (Serial Communications Interfaces), which can be used to talk to the outside world. Serial Communication reduces the pin count of these MPU's.Only two pins are commonly used, Transmit Data (TXD) and Receive Data (RXD) compared with at least 8 pins if you use a 8 bit Parallel method (You may also require a Strobe).
 9.2 RS-232 Waveforms.

So far we have introduced RS-232 Communications in relation to the PC. RS-232 communication is asynchronous. That is a clock signal is not sent with the data. Each word is synchronized using its start bit, and an internal clock on each side, keeps tabs on the timing.
The diagram above shows the expected waveform from the UART when using the common 8N1 format. 8N1 signifies 8 Data bits, No Parity and 1 Stop Bit. The RS-232 line, when idle is in the Mark State (Logic 1). A transmission starts with a start bit which is (Logic 0). Then each bit is sent down the line, one at a time. The LSB (Least Significant Bit) is sent first. A Stop Bit (Logic 1) is then appended to the signal to make up the transmission. The diagram shows the next bit after the Stop Bit to be Logic 0. This must mean another word is following, and this is its Start Bit. If there is no more data coming then the receive line will stay in its idle state (logic 1). We have encountered something called a "Break" Signal. This is when the data line is held in a Logic 0 state for a time long enough to send an entire word. Therefore if you don't put the line back into an idle state, then the receiving end will interpret this as a break signal. The data sent using this method, is said to be framed. That is the data is framed between a Start and Stop Bit. Should the Stop Bit be received as Logic 0, and then a framing error will occur. This is common, when both sides are communicating at different speeds. The above diagram is only relevant for the signal immediately at the UART. RS-232 logic levels uses +3 to +25 volts to signify a "Space" (Logic 0) and -3 to -25 volts for a "Mark" (logic 1). Any voltage in between these regions (i.e. between +3 and -3 Volts) is undefined. Therefore this signal is put through a "RS-232 Level Converter".
9.3 RS-232 Level Converters
Almost all digital devices that we use require either TTL or CMOS logic levels. Therefore the first step to connecting a device to the RS-232 port is to transform the RS-232 levels back into 0 and 5 Volts. As we have already covered, this is done by RS-232.Two common RS-232 Level Converters are the 1488 RS-232 Driver and the 1489 RS-232 Receiver. Each package contains 4 inverters of the one type, either Drivers or Receivers. The driver requires two supply rails, +7.5 to +15v and -7.5 to -15v. As you could imagine this may pose a problem in many instances where only a single supply of +5V is present. 
Tags:- RS232 serial communication,com port to microprocessor serial communication between microcontroller and PC, mode of serial communication, RS485 serial communication, hyperterminal program for serial port, how to use hyperterminal, pc based device control using at89s52 microcontroller and hyper terminal, PC control through microcontroller 8051 with serial port, RS232 to RS485, RS-485 to RS232 converter, what is difference between rs232 and rs485, what is level of signals in rs232, what is difference between TTL and rs232, RS232 circuit diagram, serial port circuit disgram, digital function generator using 89c51 circuit diagram,c code for 89c51 and ds1307,circuit of a heartbeat to display data on a 3-7segment,keybord moving messege display circuits and hex files,optocoupler interfacing with microcontroller,8051 program for data acquisition system,automatic car parking indicator using microcontroller,how to write mcu-51 programs for pulse positions,ir sensor interfacing with 8051 using adc,2 channel temperature controller with 8051,lm35 applicaties,analog temperature sensor LM335,motion sensor interfacing with microcontroller 8051,15v to 8051 interface circuit,speed measurement by using microcontrollers,io pin of microcontroller schmitt trigger sensor,heart beat monitoring system using microcontroller,use of serial port in 8051 project, serial data transfer, serial conversion, serial bit stream, rs232 bit patern
Thanks for reading: Serial Communication between microcontroller and PC
Related Posts Plugin for WordPress, Blogger...