SlideShare a Scribd company logo
2
Most read
3
Most read
4
Most read
Interfacing RS232
What is RS232 RS means Recommended Standard. RS 232 uses both synchronous and asynchronous communication. In microcontrollers like ATmel 89C51 asynchronous communication is used and it is called as UART – universal asynchronous receiver and transmitter
Interfacing RS232 We need a driver to use the RS232 with microcontroller That driver turned out to be MAX232 It is a16 PIN Ic which is used to interface RS232 with any other devices. The transmission speed in the RS232 is called as baud rate.
Interfacing microcontroller with RS232 standard devices
Setting serial port In microcontroller there are some special function registers which are allocated to control the serial communication The list of registers which is used to control the serial port are  SCON PCON SBUF
Double the baud rate The baud rate standards are  1200 2400 4800 9600 But we can manually increase the baud rate into double the normal baud rate by setting the SMOD bit SMOD bit is located in PCON register.
How to calculate baud rate It is all depend upon the frequency Our frequency is 11.0592MHz Atmel has 12 Tcycles for a machine cycle Every instruction except branch instructions, execute in one machine cycle To obtain the speed of operation we have to use the timers again. Unlike the previous classes, timers will be used to generate speed here.
Speed calculation 11.0592M/12 = 921600 921600/32 = 28800   here 32 is the division factor it can be changed to 16 by setting SMOD bit 28800/?? = speed To get required speed we have to choose the value and store it in timer registers For example: for 9600 the value is 3. in TH1 it will be FD ie., 256-3=253  FD
Normal baud rate and double the normal baud rate SMOD = 0 SMOD = 1 1200 2400 2400 4800 4800 9600 9600 19200
Transmit and Receive Every thing is depends upon the interrupt when it comes to microcontroller, it is true that serial communication is not an exceptional for this. Transmit interrupt(TI) and receive interrupt(RI) are the two interrupt that control that operation of the serial communication
Transmission of data  Data can be store in the BUFFER assigned for serial communication(SBUF) Transmission will be complete when the transmit buffer is empty After acknowledging the transmit interrupt enabled due to empty transmit buffer we can reset the TI and continue the next transmission
Example for transmission Consider a letter A is going to be send through serial communication Then the coding should be SBUF=‘A’; While(TI==0); TI=0;
Receive operation It is reverse of the transmit operation The interrupt for the receive will be enabled when the receive buffer is full After receiving the acknowledgment of the receive complete the value can be read from BUFFER (SBUF)
Example for receive data Consider a ‘A’ is send to microcontroller through the serial port The program logic is  While(RI==0); Read=SBUF; RI=0;
Programming serial It is the same as all the interfacing with microcontroller Functions to solve the problem Since we not only receive or send a character but a lot of characters. Therefore a function will make it easy to get and send all the data we required.
Assignments  Send your name in serial port Get a data from serial port Try work with different baud rate Get a floating point from serial port and manipulate it and print in LCD(round off the floating point data)

More Related Content

What's hot (20)

PPTX
MICROCONTROLLER 8051- Architecture & Pin Configuration
AKHIL MADANKAR
 
PDF
Keypad Interfacing with 8051 Microcontroller
Sudhanshu Janwadkar
 
PPTX
Verilog HDL
Mantra VLSI
 
PPSX
Lect 2 ARM processor architecture
Dr.YNM
 
PPT
Microcontroller-8051.ppt
Dr.YNM
 
PPTX
8051 MICROCONTROLLER ARCHITECTURE.pptx
MemonaMemon1
 
PDF
Serial Communication Interfaces
anishgoel
 
DOCX
Arduino lcd display
Makers of India
 
PPTX
PIC Microcontrollers
Abdullah Saghir Ahmad
 
PPTX
USART
Islam Samir
 
PPT
Memory organization of 8051
Muthu Manickam
 
PPT
8051 instruction set
Andri Prastiyo
 
PPTX
Interrupts in 8051
Sudhanshu Janwadkar
 
PDF
Stepper motor-interfacing
Lecturer
 
PPTX
LCD Interacing with 8051
Sudhanshu Janwadkar
 
DOCX
8096 microcontrollers notes
Dr.YNM
 
PDF
ARM CORTEX M3 PPT
Gaurav Verma
 
PPTX
UVM Driver sequencer handshaking
HARINATH REDDY
 
PPT
8051 microcontroller lecture ppt by Tarun Khaneja ( 9034406598 )
Tarun Khaneja
 
PPTX
I2C Protocol
Sudhanshu Janwadkar
 
MICROCONTROLLER 8051- Architecture & Pin Configuration
AKHIL MADANKAR
 
Keypad Interfacing with 8051 Microcontroller
Sudhanshu Janwadkar
 
Verilog HDL
Mantra VLSI
 
Lect 2 ARM processor architecture
Dr.YNM
 
Microcontroller-8051.ppt
Dr.YNM
 
8051 MICROCONTROLLER ARCHITECTURE.pptx
MemonaMemon1
 
Serial Communication Interfaces
anishgoel
 
Arduino lcd display
Makers of India
 
PIC Microcontrollers
Abdullah Saghir Ahmad
 
Memory organization of 8051
Muthu Manickam
 
8051 instruction set
Andri Prastiyo
 
Interrupts in 8051
Sudhanshu Janwadkar
 
Stepper motor-interfacing
Lecturer
 
LCD Interacing with 8051
Sudhanshu Janwadkar
 
8096 microcontrollers notes
Dr.YNM
 
ARM CORTEX M3 PPT
Gaurav Verma
 
UVM Driver sequencer handshaking
HARINATH REDDY
 
8051 microcontroller lecture ppt by Tarun Khaneja ( 9034406598 )
Tarun Khaneja
 
I2C Protocol
Sudhanshu Janwadkar
 

Viewers also liked (17)

PPT
Data transferschemes
Ankush Srivastava
 
PDF
Synchronous and asynchronous clock
Nallapati Anindra
 
PPTX
Data transfer scheme
rockymani
 
PPTX
RS 232
Sandeep Kamath
 
PPTX
Communication protocols
Piyush Bhardwaj
 
PDF
Communication protocol presentation
Gopi A
 
PDF
mourad 2eme
Mo Ur Ad Es-se
 
PPTX
Emi cathode ray oscilloscope
yssb91
 
PDF
16f84a datasheet
Cesar Figueroa
 
PDF
Communication protocols - Embedded Systems
Emertxe Information Technologies Pvt Ltd
 
PDF
Synchronous and asynchronous reset
Nallapati Anindra
 
PPTX
Communication protocols
Pantech ProLabs India Pvt Ltd
 
PPT
Synchronous and asynchronous (1)
Akero pranpriya Sekcet
 
PPT
Serial Communication
Rashmi
 
PPS
Synchronous and-asynchronous-data-transfer
Anuj Modi
 
PPTX
Asynchronous and synchronous
Akhil .B
 
PPTX
communication-protocols
Ali Kamil
 
Data transferschemes
Ankush Srivastava
 
Synchronous and asynchronous clock
Nallapati Anindra
 
Data transfer scheme
rockymani
 
Communication protocols
Piyush Bhardwaj
 
Communication protocol presentation
Gopi A
 
mourad 2eme
Mo Ur Ad Es-se
 
Emi cathode ray oscilloscope
yssb91
 
16f84a datasheet
Cesar Figueroa
 
Communication protocols - Embedded Systems
Emertxe Information Technologies Pvt Ltd
 
Synchronous and asynchronous reset
Nallapati Anindra
 
Communication protocols
Pantech ProLabs India Pvt Ltd
 
Synchronous and asynchronous (1)
Akero pranpriya Sekcet
 
Serial Communication
Rashmi
 
Synchronous and-asynchronous-data-transfer
Anuj Modi
 
Asynchronous and synchronous
Akhil .B
 
communication-protocols
Ali Kamil
 
Ad

Similar to Interfacing rs232 (20)

PPTX
Micro c lab8(serial communication)
Mashood
 
PDF
EC8691 - UNIT 5.pdf
SPonmalar1
 
PPTX
8051 serial communication1
vijaydeepakg
 
PPT
Chap10
manishappin
 
PPT
Chapter5 dek3133
Hattori Sidek
 
PPT
Modem synchronization and control
sirish2chandraa
 
PPSX
USART - 8251 / usart-8251A Pallav Shukla
Pallav Shukla
 
PPT
12 mt06ped019
vijaydeepakg
 
PPTX
Serial Communication
UshaRani289
 
PDF
Assembler4
Omar Sanchez
 
DOCX
project report on embedded system
ram avtar
 
DOCX
Peripheral 8245,16550&8237 dma controller
মেহরাব শুভ
 
DOCX
Training Report on embedded Systems and Robotics
NIT Raipur
 
PPTX
Sereial com. ppt
gaurav5345
 
PDF
Serial1
anishgoel
 
DOCX
Tutorial
ROBOTZLABZ
 
PPTX
Vlsi implementation ofdm
Manas Verma
 
PPTX
APB2SPI.pptx
SandeepkumarRangala
 
PPTX
Serial communication in 8051 microcontroller .pptx
tamil arasan
 
DOC
Pin 8085
Ankush Srivastava
 
Micro c lab8(serial communication)
Mashood
 
EC8691 - UNIT 5.pdf
SPonmalar1
 
8051 serial communication1
vijaydeepakg
 
Chap10
manishappin
 
Chapter5 dek3133
Hattori Sidek
 
Modem synchronization and control
sirish2chandraa
 
USART - 8251 / usart-8251A Pallav Shukla
Pallav Shukla
 
12 mt06ped019
vijaydeepakg
 
Serial Communication
UshaRani289
 
Assembler4
Omar Sanchez
 
project report on embedded system
ram avtar
 
Peripheral 8245,16550&8237 dma controller
মেহরাব শুভ
 
Training Report on embedded Systems and Robotics
NIT Raipur
 
Sereial com. ppt
gaurav5345
 
Serial1
anishgoel
 
Tutorial
ROBOTZLABZ
 
Vlsi implementation ofdm
Manas Verma
 
APB2SPI.pptx
SandeepkumarRangala
 
Serial communication in 8051 microcontroller .pptx
tamil arasan
 
Ad

More from PRADEEP (20)

PPT
Unit 3 tables and data structures
PRADEEP
 
PPT
Unit 2 software partitioning
PRADEEP
 
PPT
Unit 1 introduction
PRADEEP
 
PPT
Unit 5 multi-board system
PRADEEP
 
PDF
16f877
PRADEEP
 
PDF
Mp lab
PRADEEP
 
PDF
19199406 embedded-c-tutorial-8051
PRADEEP
 
PDF
13986149 c-pgming-for-embedded-systems
PRADEEP
 
PDF
22323006 embedded-c-tutorial-8051
PRADEEP
 
PDF
14157565 embedded-programming
PRADEEP
 
PPT
Rtos 3 & 4
PRADEEP
 
DOCX
Introduction to pic
PRADEEP
 
PPT
Interrupts
PRADEEP
 
PPTX
Chapter 3
PRADEEP
 
PPT
Leadership lessons-from-obama-
PRADEEP
 
PPT
Programming timers
PRADEEP
 
PPT
Interfacing stepper motor
PRADEEP
 
PPT
Interfacing keypad
PRADEEP
 
PPT
Interfacing adc
PRADEEP
 
PPT
EMBEDDED SYSTEMS 6
PRADEEP
 
Unit 3 tables and data structures
PRADEEP
 
Unit 2 software partitioning
PRADEEP
 
Unit 1 introduction
PRADEEP
 
Unit 5 multi-board system
PRADEEP
 
16f877
PRADEEP
 
Mp lab
PRADEEP
 
19199406 embedded-c-tutorial-8051
PRADEEP
 
13986149 c-pgming-for-embedded-systems
PRADEEP
 
22323006 embedded-c-tutorial-8051
PRADEEP
 
14157565 embedded-programming
PRADEEP
 
Rtos 3 & 4
PRADEEP
 
Introduction to pic
PRADEEP
 
Interrupts
PRADEEP
 
Chapter 3
PRADEEP
 
Leadership lessons-from-obama-
PRADEEP
 
Programming timers
PRADEEP
 
Interfacing stepper motor
PRADEEP
 
Interfacing keypad
PRADEEP
 
Interfacing adc
PRADEEP
 
EMBEDDED SYSTEMS 6
PRADEEP
 

Recently uploaded (20)

PDF
Per Axbom: The spectacular lies of maps
Nexer Digital
 
PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
PPTX
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
PPTX
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PDF
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PDF
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
PDF
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PPTX
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
PDF
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
PDF
Researching The Best Chat SDK Providers in 2025
Ray Fields
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PDF
Generative AI vs Predictive AI-The Ultimate Comparison Guide
Lily Clark
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PPTX
Introduction to Flutter by Ayush Desai.pptx
ayushdesai204
 
PDF
introduction to computer hardware and sofeware
chauhanshraddha2007
 
Per Axbom: The spectacular lies of maps
Nexer Digital
 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
Researching The Best Chat SDK Providers in 2025
Ray Fields
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
Generative AI vs Predictive AI-The Ultimate Comparison Guide
Lily Clark
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
Introduction to Flutter by Ayush Desai.pptx
ayushdesai204
 
introduction to computer hardware and sofeware
chauhanshraddha2007
 

Interfacing rs232

  • 2. What is RS232 RS means Recommended Standard. RS 232 uses both synchronous and asynchronous communication. In microcontrollers like ATmel 89C51 asynchronous communication is used and it is called as UART – universal asynchronous receiver and transmitter
  • 3. Interfacing RS232 We need a driver to use the RS232 with microcontroller That driver turned out to be MAX232 It is a16 PIN Ic which is used to interface RS232 with any other devices. The transmission speed in the RS232 is called as baud rate.
  • 4. Interfacing microcontroller with RS232 standard devices
  • 5. Setting serial port In microcontroller there are some special function registers which are allocated to control the serial communication The list of registers which is used to control the serial port are SCON PCON SBUF
  • 6. Double the baud rate The baud rate standards are 1200 2400 4800 9600 But we can manually increase the baud rate into double the normal baud rate by setting the SMOD bit SMOD bit is located in PCON register.
  • 7. How to calculate baud rate It is all depend upon the frequency Our frequency is 11.0592MHz Atmel has 12 Tcycles for a machine cycle Every instruction except branch instructions, execute in one machine cycle To obtain the speed of operation we have to use the timers again. Unlike the previous classes, timers will be used to generate speed here.
  • 8. Speed calculation 11.0592M/12 = 921600 921600/32 = 28800  here 32 is the division factor it can be changed to 16 by setting SMOD bit 28800/?? = speed To get required speed we have to choose the value and store it in timer registers For example: for 9600 the value is 3. in TH1 it will be FD ie., 256-3=253  FD
  • 9. Normal baud rate and double the normal baud rate SMOD = 0 SMOD = 1 1200 2400 2400 4800 4800 9600 9600 19200
  • 10. Transmit and Receive Every thing is depends upon the interrupt when it comes to microcontroller, it is true that serial communication is not an exceptional for this. Transmit interrupt(TI) and receive interrupt(RI) are the two interrupt that control that operation of the serial communication
  • 11. Transmission of data Data can be store in the BUFFER assigned for serial communication(SBUF) Transmission will be complete when the transmit buffer is empty After acknowledging the transmit interrupt enabled due to empty transmit buffer we can reset the TI and continue the next transmission
  • 12. Example for transmission Consider a letter A is going to be send through serial communication Then the coding should be SBUF=‘A’; While(TI==0); TI=0;
  • 13. Receive operation It is reverse of the transmit operation The interrupt for the receive will be enabled when the receive buffer is full After receiving the acknowledgment of the receive complete the value can be read from BUFFER (SBUF)
  • 14. Example for receive data Consider a ‘A’ is send to microcontroller through the serial port The program logic is While(RI==0); Read=SBUF; RI=0;
  • 15. Programming serial It is the same as all the interfacing with microcontroller Functions to solve the problem Since we not only receive or send a character but a lot of characters. Therefore a function will make it easy to get and send all the data we required.
  • 16. Assignments Send your name in serial port Get a data from serial port Try work with different baud rate Get a floating point from serial port and manipulate it and print in LCD(round off the floating point data)