 Hello, Myself Pravindra Chauhan, Assistant Professor, Department of Electronics Engineering, Walsh and the Institute of Technology, Solaapur. So in this session, we will discuss how to interface the RS-232 with the microcontroller 8051. So the outcome from this session is that the students will be able to apply the concept of the RS-232 interfacing to develop the controller-based system. So outline of the sessions are first, we will see the signals defined in the RS-232, then the converter max-232 and interfacing of RS-232 with the microcontroller 8051. Now what is this RS-232? The RS stands for the recommended standard. So this RS-232 standard is an interfacing standard and mainly it is used for the serial input-output interfacing and RS-232 standard was set by the Electronics Industries Association EIA in 1960 and this RS-232 standard is defined for the uniformity. And that's why this RS-232 standard is nowadays widely used as a serial input-output interfacing standard. Now in RS-232 standard actually the logic 1 and the logic 0 is represented by the certain voltage range. So the logic 1 is represented by minus 3 to minus 25 volt and logic 0 is plus 3 to plus 25 volt. Now in this standard minus 3 to plus 3 volt is undefined. So the RS-230 standard it is mainly comes in the two types of connectors. One is called the DB-25 and second one is called the DB-9. It is the D-type connector with the pin 25 and the 9, but widely used connector is the DB-9. So most of the times DB-9 connector is preferred where only 9 signals are defined. Now in the serial input-output interfacing the two turns are widely used. One is the DTE and another one is the DCE. So DTE actually stands for the data terminal equipment and this is refers to the terminal and computers that send and receive the data such as your laptop PC. So the DTE is actually the source of your data which generates the data and the DCE is called the data communication equipments and this DCE term is used for the communication equipment and widely used communication equipment is the modem. So modem is used whenever there is need to transfer the data over long distance. So modem is actually placed between your transmission media and the DTE that is the PC or laptop. Now coming to the RS-232 DB-9 connection, one of the pin defined as a DTR which is the pin number 4. So DTR stands for data terminal ready. So whenever the data terminal means our source of the data that is the PC or laptop is turned on then it sends the out signal DTR to indicate that it is ready for the communication. Whenever the PC is ready for the data transmission it sends the high signal on pin DTR. Then DSR that is called the data set ready. Now when data communication equipment that is the modem is turned on then it asserts the DSR signal to indicate that it is ready to communicate. So when DTR and DSR is active it means that both the DTE and DCE that is the PC and the communication equipments now are ready for the communication. Then RTS request to send. So when the data terminal equipment is ready to transmit it sends the RTS signal to the modem. So RTS signal is generated by the PC and received by the modem. So when modem is receiving the RTS signal so modem will understood that the PC or the DTE is now ready for the data transmission. Then to response this the modem is sending the signal called CTS that is clear to stand and it is received by the data terminal equipment to indicate that the modem is ready to receive the data. Now with this acknowledgement signals to each other then actually the data communication will start. Now DCD data carrier detect. So the modem is actually connected to the transmission media and when the carrier is detected the modem is generating the signal called DCD that is the data carrier detected. Then RI which is defined to the pin number 1 called ring indicator. So an output from the modem and input to a PC indicates that the telephone is ringing and it goes on and off in synchronous with the ringing sound. And mainly the pin number 2 and pin number 3 are actually involved for the data transmission. So RXD means RS232 receiving the 1 bit of information serially through the RXDP. And the RS232 transmits the 1 bit of information serially through pin number 3 which is defined as TXD. So RXD for to receive the 1 bit and TXD used to transmit the 1 bit serially. And for the to complete the circuit or to close the circuit the ground signal is defined to the pin number 5. Most of the laptop or PC is having the serial port with the standard RS232. Now when it is required to interface the any processor or the microcontroller like 8051 with the laptop or the PC then the max 232 line driver is required. Because whatever the signals defined in RS232 for logic 1 and logic 0 are different than the TTL levels defined for the 8051 controller or any other processor. So for conversion of this the max 232 line driver is required. So the logic 0 in RS232 is defined with plus 3 whole to plus 15 whole. Then same logic 0 in max 232 is defined with 0 to 0.8 whole. And the minus 3 whole to minus 15 for logic 1 and 2 to 5 whole for max 232. So whatever the levels defined in max 232 these are compatible to the TTL devices like the 8051. Say this is the max 232 pinout. So this is transmit 1 and its corresponding out T1 out. Then this is receive 1 and receive out. So 2 inputs are there for transmission and receive. Now see how we can interface our PC and the 8051. So this is our computer serial port with RS232 standard pin number 2 for receiving, pin number 3 for transmission. This is the 8051 TXD transmit pin. This is the P3.0 receive pin. So when 8051 sends the data to the PC first it will go to the max 232. So this TTL level will be gets converted into the RS232 which is compatible for the PC serial port. Similarly the serial data coming out from the PC through TXD that will be converted into the TTL level by this max 232 and then the 8051 receiving through the pin RXD. Now to allow the data transfer between the PC and 8051 system without any error we must make sure that the board rate of 8051 system matches the board rate of PC serial port. So the board rate for both at the 8051 and the PC must be saved and by most of the times the board rate referred is 9600. And now the hyper terminal is one of the tool which we can be used to transfer the data between the PC and the 8051. Now you pause the video and just recall what are the special function registers associating with the serial communication in 8051. So these are the two special function registers Sbuff to store the transmit and receive the data whenever we are keeping any character in the Sbuff register the transmission will start and to configure the serial communication of the 8051 the Sconn register is used and this is used mainly to select the mode of operation. So the references thank you.