SlideShare a Scribd company logo
1 of 28
Dr. Vikas Dongre
HOD Electronics
Government Polytechnic Washim
dongrevj1@gmail.com
High Resolution
Objectives
• Types of communication
• Baud rate setting
• Various SFRs used for serial communication
• Various modes of serial communication
• Programs for transmission and reception with
demonstration
UART
UART Universal Asynchronous Receiver Transmitter
Basics of serial communication
Parallel: expensive - short distance ( Within parts of a system) – fast
Serial :cheaper– long distance(Few Mtr. to many KM by modem)-slow
Basics of serial communication
Start and stop bits
When there is no transfer the signal is high Transmission
begins with a start (low) bit LSB first
Finally 1 stop bit (high) Data transfer rate (baud rate) is stated in
bps bps: bit per second
Framing ASCII “A” (41H)
Serial Port Block Diagram
In RS232, a 1 is represented
by -3 ~ -25 V, while a 0 bit is
+3 ~ +25 V, making -3 to +3
undefined
Micro
contol
ler 1
Max 232
Micro
contol
ler 2
Max 232
Tx
TxRx
Rx
How to communicate 8051 to PC
 Connect TXD to RXD and RXD to TXD from pc to 8051
 Use max232 to transform signal from TTL level to RS232 level
 The baud rate of the transmitting 8051 must matched the baud
rate of the receiving 8051 or pc
 PC standard baud rate
 2400-4800-9600-14400-19200-28800-33600-57600
 Timer 1 in mode 2 ( auto reload) is used for baud rate generation
 The 8051 UART divides the machine cycle frequency by 32
 Machine cycle is 1/12 XTAL frequency
TH1=FF+1- required Count
RxD and TxD pins in the 8051
• TxD pin 11 of the 8051 (P3.1)
• RxD pin 10 of the 8051 (P3.0)
SBUF register
MOV SBUF, #’D’ ;load SBUF=44H, ASCII for ‘D’
MOV SBUF, A ;copy accumulator into SBUF
MOV A, SBUF ;copy SBUF into accumulator
SFRs used
SBUF, SCON, PCON for actual communication
TCON,TMOD,TH1, TL1 for Baud Rate generation
Serial control (SCON) Register
Modes of operation
SM0 SM1 MODE operation transmit rate
0 0 0 shift register fixed (xtal/12)
0 1 1 8 bit UART variable (timer1)
1 0 2 9 bit UART fixed (xtal/32 or xtal/64)
1 1 3 9 bit UART variable (timer1)
Modes of operation
• Mode 0 :
• Serial data enters and exits through RxD
• TxD outputs the shift clock.
• 8 bits are transmitted/received(LSB first)
• The baud rate is fixed a 1/12 the oscillator frequency.
• Application
• Port expansion
8051
TXD
RXD Shift register
clk
data
Modes of operation
• Mode 1
• Ten bits are transmitted (through TxD) or received (through RxD)
• A start bit (0), 8 data bits (LSB first), and a stop bit (1)
• On receive, the stop bit goes into RB8 in SCON
• the baud rate is determined by the Timer 1 overflow rate.
• Transmission is initiated by any instruction that uses SBUF as a
destination register.
Modes of operation
Power control register
 Bit 7 of PCON register
 If SMOD=1 double baud rate
 PCON is not bit addressable
 How to set SMOD
Mov a, pcon
Setb acc.7
Mov pcon,a
• Mode 2 :
• Eleven bits are transmitted (through TxD), received (through RxD)
• A start bit (0)
• 8 data bits (LSB first)
• A programmable 9th data bit
• and a stop bit (1)
• On transmit, the 9th bit (TB8) can be assigned 0 or 1.
• On receive, the 9th data bit goes into RB8 in SCON.
• the 9th can be parity bit
• The baud rate is programmable to 1/32 or 1/64 the oscillator frequency in
Mode 2 by SMOD bit in PCON register
• Mode 3
• Same as mode 2
• But may have a variable baud rate generated from Timer 1.
Modes of operation
Steps for Serial Transmission programming
1. Set communication mode using SCON SFR
2. Set Baud rate using TMOD , TH1 SFR
3. Start timer to generate baud rate
4. Move data in SBUF which you wish to transmit
5. Wait till the data byte is transmitted by monitoring the
setting of TI flag
6. Clear TI flag
7. Repeat step 4 to 6 again and again to transmit more
bytes
Note: Serial transmission and serial reception should run on both transmitting
and receiving controllers at the same time , that too with same baud rate
Serial Transmit(1)
ORG 0000
MOV TMOD ,#20H ; set timer 1 in mode 2
MOV TH1, #-3 ; set baud rate as 9600
MOV SCON, #50H ; set communication in mode 1 with receive enable
SETB TR1 ; start timer to generate baud rate
AGAIN:
MOV SBUF, #Y’ ;Transmit Y
back: JNB TI, back
CLR TI
MOV SBUF, #'E‘ ;Transmit E
JNB TI,$
CLR TI
MOV SBUF, #'S‘ ; Transmit S
JNB TI,$
CLR TI
MOV SBUF, #' ‘ : Transmit space
JNB TI,$
CLR TI
SJMP AGAIN
END
ORG 0000
MOV TMOD ,#20H
MOV TH1, #-3
MOV SCON, #50H
SETB TR1
AGAIN:
MOV SBUF, #"M"
CALL TRANSMIT
MOV SBUF, #'S'
CALL TRANSMIT
MOV SBUF, #'B'
CALL TRANSMIT
MOV SBUF, #'T'
CALL TRANSMIT
MOV SBUF, #'E'
CALL TRANSMIT
MOV SBUF, #' '
CALL TRANSMIT
SJMP AGAIN
TRANSMIT: JNB TI, $
CLR TI
RET
Serial Transmit(2)
ORG 0000
MOV TMOD ,#20H
MOV TH1, #-3
MOV SCON, #50H
SETB TR1
SETB TI
AGAIN: MOV R0,#10
MOV DPTR,#100H
BACK: MOV A,#00H
MOVC A, @A+DPTR
MOV SBUF,A
CALL TRANSMIT
INC DPTR
DJNZ R0, BACK
SJMP AGAIN
TRANSMIT: JNB TI,$
CLR TI
RET
ORG 100H
DB 'G','P',' ', 'W', 'A', 'S', 'H', 'I', 'M',' '
END
Serial Transmit(3)
Steps for Serial Reception programming
1. Set communication mode using SCON SFR
2. Set Baud rate using TMOD , TH1 SFR
3. Start timer to generate baud rate
4. Wait till the data byte is transmitted by monitoring the
setting of RI flag
5. Move data received in SBUF to other place like
memory or use on any port
6. Clear RI flag
7. Repeat step 4 to 6 again and again to transmit more
bytes
;PROGRAM FOR RECEIVING DATA SERIALY
ORG 0000
MOV TMOD ,#20H ;SET TIMER 1 IN MODE 2
MOV TH1, #-3 ; SET BAUD AS 9600
MOV SCON, #50H ; ENABLE RECRIVE
SETB TR1 ; START TIMER
BACK: JNB RI, $ ; CHECK IF BUFFER FULL
MOV A,SBUF ; IF YES READ THE SBUFFER
MOV P1,A ; SEND RECEIVED DATA TO PORT 1
CLR RI ; CLEAR RECEIVE FLAG
SJMP BACK
END
Serial Receive
Summery
• Concept of Serial and Parallel communication
• Asynchronous communication
• Concept of Start and Stop bits
• SCON, SMOD SFRs used for serial communication
• Various modes of serial communication
• Programs for transmission and reception with Keil Simulation
Thank you !!!
Dr. Vikas Dongre
HOD Electronics
Government Polytechnic Washim
dongrevj1@gmail.com

More Related Content

What's hot

Serial communication in LPC2148
Serial communication in LPC2148Serial communication in LPC2148
Serial communication in LPC2148sravannunna24
 
Fun and Easy UART - How the UART Protocol Works
Fun and Easy UART - How the UART Protocol WorksFun and Easy UART - How the UART Protocol Works
Fun and Easy UART - How the UART Protocol WorksRitesh Kanjee
 
Llpc2148 sci
Llpc2148 sciLlpc2148 sci
Llpc2148 scianishgoel
 
Imx53 uart- GUIDE BOOK
Imx53 uart- GUIDE BOOKImx53 uart- GUIDE BOOK
Imx53 uart- GUIDE BOOKShahrukh Javed
 
FPGA IMPLIMENTATION OF UART CONTTROLLER
FPGA IMPLIMENTATION OF UART CONTTROLLERFPGA IMPLIMENTATION OF UART CONTTROLLER
FPGA IMPLIMENTATION OF UART CONTTROLLERVarun Kambrath
 
Universal synchronous asynchronous receiver transmitter(usart) and AtoD Coverter
Universal synchronous asynchronous receiver transmitter(usart) and AtoD CoverterUniversal synchronous asynchronous receiver transmitter(usart) and AtoD Coverter
Universal synchronous asynchronous receiver transmitter(usart) and AtoD CoverterTejas Shetye
 
Design and implementation of uart on soc
Design and implementation of uart on socDesign and implementation of uart on soc
Design and implementation of uart on socIjrdt Journal
 
Mridul_Verma_Intern_Tech_Adityaa_UART
Mridul_Verma_Intern_Tech_Adityaa_UARTMridul_Verma_Intern_Tech_Adityaa_UART
Mridul_Verma_Intern_Tech_Adityaa_UARTMridul Verma
 
Serial Communication Part-16
Serial Communication Part-16Serial Communication Part-16
Serial Communication Part-16Techvilla
 
Universal asynchronous receiver-transmitter UART Dsa project report
Universal asynchronous receiver-transmitter UART Dsa project reportUniversal asynchronous receiver-transmitter UART Dsa project report
Universal asynchronous receiver-transmitter UART Dsa project reportShahrukh Javed
 
Verification of uart ip core using uvm
Verification of uart ip core using uvmVerification of uart ip core using uvm
Verification of uart ip core using uvmeSAT Publishing House
 

What's hot (20)

UART
UARTUART
UART
 
Serial communication in LPC2148
Serial communication in LPC2148Serial communication in LPC2148
Serial communication in LPC2148
 
12 mt06ped019
12 mt06ped019 12 mt06ped019
12 mt06ped019
 
Serial Communication in 8051
Serial Communication in 8051Serial Communication in 8051
Serial Communication in 8051
 
Fun and Easy UART - How the UART Protocol Works
Fun and Easy UART - How the UART Protocol WorksFun and Easy UART - How the UART Protocol Works
Fun and Easy UART - How the UART Protocol Works
 
Llpc2148 sci
Llpc2148 sciLlpc2148 sci
Llpc2148 sci
 
Imx53 uart- GUIDE BOOK
Imx53 uart- GUIDE BOOKImx53 uart- GUIDE BOOK
Imx53 uart- GUIDE BOOK
 
SPI Bus Protocol
SPI Bus ProtocolSPI Bus Protocol
SPI Bus Protocol
 
Uart
UartUart
Uart
 
NAVEEN UART BATCH 43
NAVEEN UART BATCH 43NAVEEN UART BATCH 43
NAVEEN UART BATCH 43
 
FPGA IMPLIMENTATION OF UART CONTTROLLER
FPGA IMPLIMENTATION OF UART CONTTROLLERFPGA IMPLIMENTATION OF UART CONTTROLLER
FPGA IMPLIMENTATION OF UART CONTTROLLER
 
Universal synchronous asynchronous receiver transmitter(usart) and AtoD Coverter
Universal synchronous asynchronous receiver transmitter(usart) and AtoD CoverterUniversal synchronous asynchronous receiver transmitter(usart) and AtoD Coverter
Universal synchronous asynchronous receiver transmitter(usart) and AtoD Coverter
 
Design and implementation of uart on soc
Design and implementation of uart on socDesign and implementation of uart on soc
Design and implementation of uart on soc
 
Mridul_Verma_Intern_Tech_Adityaa_UART
Mridul_Verma_Intern_Tech_Adityaa_UARTMridul_Verma_Intern_Tech_Adityaa_UART
Mridul_Verma_Intern_Tech_Adityaa_UART
 
Naveen UART BATCH 43
Naveen UART BATCH 43Naveen UART BATCH 43
Naveen UART BATCH 43
 
Serial Communication Part-16
Serial Communication Part-16Serial Communication Part-16
Serial Communication Part-16
 
UART
UARTUART
UART
 
Universal asynchronous receiver-transmitter UART Dsa project report
Universal asynchronous receiver-transmitter UART Dsa project reportUniversal asynchronous receiver-transmitter UART Dsa project report
Universal asynchronous receiver-transmitter UART Dsa project report
 
Verification of uart ip core using uvm
Verification of uart ip core using uvmVerification of uart ip core using uvm
Verification of uart ip core using uvm
 
Serial communication of microcontroller 8051
Serial communication of microcontroller 8051Serial communication of microcontroller 8051
Serial communication of microcontroller 8051
 

Similar to Serial communication

Sereial com. ppt
Sereial com. pptSereial com. ppt
Sereial com. pptgaurav5345
 
EC8691 - UNIT 5.pdf
EC8691 - UNIT 5.pdfEC8691 - UNIT 5.pdf
EC8691 - UNIT 5.pdfSPonmalar1
 
Microcontrollers and microprocessors in electrical communication engineering....
Microcontrollers and microprocessors in electrical communication engineering....Microcontrollers and microprocessors in electrical communication engineering....
Microcontrollers and microprocessors in electrical communication engineering....ANKUSH445845
 
8051 SERIAL PORTS.pptx
8051 SERIAL PORTS.pptx8051 SERIAL PORTS.pptx
8051 SERIAL PORTS.pptxmaheswariM7
 
Addressing mode and instruction set using 8051
Addressing mode and instruction set using 8051Addressing mode and instruction set using 8051
Addressing mode and instruction set using 8051logesh waran
 
8051 serial communication1
8051 serial communication1 8051 serial communication1
8051 serial communication1 vijaydeepakg
 
8051 microcontroller notes continuous
8051 microcontroller notes continuous 8051 microcontroller notes continuous
8051 microcontroller notes continuous THANDAIAH PRABU
 
Library Book Locator
Library Book LocatorLibrary Book Locator
Library Book LocatorArun Joseph
 
8051 TIMER COUNTER SERIAL COMM. INTERUPT PROGRAMMING.pdf
8051 TIMER COUNTER SERIAL COMM. INTERUPT PROGRAMMING.pdf8051 TIMER COUNTER SERIAL COMM. INTERUPT PROGRAMMING.pdf
8051 TIMER COUNTER SERIAL COMM. INTERUPT PROGRAMMING.pdfShashiKiran664181
 
8051 serial communication
8051 serial communication8051 serial communication
8051 serial communicationcanh phan
 
The presentation is about USART and serial communication
The presentation is about USART and serial communicationThe presentation is about USART and serial communication
The presentation is about USART and serial communicationsinaankhalil
 
Modem synchronization and control
Modem synchronization and controlModem synchronization and control
Modem synchronization and controlsirish2chandraa
 
Analog Transmission
Analog TransmissionAnalog Transmission
Analog TransmissionShiraz316
 
Lecture 2 encoding
Lecture 2 encoding Lecture 2 encoding
Lecture 2 encoding Josh Street
 
Lecture 2 encoding
Lecture 2 encodingLecture 2 encoding
Lecture 2 encodingJosh Street
 

Similar to Serial communication (20)

Sereial com. ppt
Sereial com. pptSereial com. ppt
Sereial com. ppt
 
EC8691 - UNIT 5.pdf
EC8691 - UNIT 5.pdfEC8691 - UNIT 5.pdf
EC8691 - UNIT 5.pdf
 
Microcontrollers and microprocessors in electrical communication engineering....
Microcontrollers and microprocessors in electrical communication engineering....Microcontrollers and microprocessors in electrical communication engineering....
Microcontrollers and microprocessors in electrical communication engineering....
 
8051 SERIAL PORTS.pptx
8051 SERIAL PORTS.pptx8051 SERIAL PORTS.pptx
8051 SERIAL PORTS.pptx
 
Addressing mode and instruction set using 8051
Addressing mode and instruction set using 8051Addressing mode and instruction set using 8051
Addressing mode and instruction set using 8051
 
Serial data transfer
Serial data transferSerial data transfer
Serial data transfer
 
8051 serial communication1
8051 serial communication1 8051 serial communication1
8051 serial communication1
 
8051 microcontroller notes continuous
8051 microcontroller notes continuous 8051 microcontroller notes continuous
8051 microcontroller notes continuous
 
Library Book Locator
Library Book LocatorLibrary Book Locator
Library Book Locator
 
8051 TIMER COUNTER SERIAL COMM. INTERUPT PROGRAMMING.pdf
8051 TIMER COUNTER SERIAL COMM. INTERUPT PROGRAMMING.pdf8051 TIMER COUNTER SERIAL COMM. INTERUPT PROGRAMMING.pdf
8051 TIMER COUNTER SERIAL COMM. INTERUPT PROGRAMMING.pdf
 
7 serial port
7 serial port7 serial port
7 serial port
 
Class10
Class10Class10
Class10
 
8051 serial communication
8051 serial communication8051 serial communication
8051 serial communication
 
The presentation is about USART and serial communication
The presentation is about USART and serial communicationThe presentation is about USART and serial communication
The presentation is about USART and serial communication
 
Modem synchronization and control
Modem synchronization and controlModem synchronization and control
Modem synchronization and control
 
DATA TRANSFER SCHEMES OF 8085
DATA TRANSFER SCHEMES OF 8085DATA TRANSFER SCHEMES OF 8085
DATA TRANSFER SCHEMES OF 8085
 
Analog Transmission
Analog TransmissionAnalog Transmission
Analog Transmission
 
Lecture 2 encoding
Lecture 2 encoding Lecture 2 encoding
Lecture 2 encoding
 
Lecture 2 encoding
Lecture 2 encodingLecture 2 encoding
Lecture 2 encoding
 
lesson01.ppt
lesson01.pptlesson01.ppt
lesson01.ppt
 

More from Vikas Dongre

Lcd interfaing using 8051 and assambly language programming
Lcd interfaing using 8051 and assambly language programmingLcd interfaing using 8051 and assambly language programming
Lcd interfaing using 8051 and assambly language programmingVikas Dongre
 
Job opportunities for electronics engineering
Job opportunities for electronics engineeringJob opportunities for electronics engineering
Job opportunities for electronics engineeringVikas Dongre
 
Educational video creation: Tools and tips
Educational video creation: Tools and tipsEducational video creation: Tools and tips
Educational video creation: Tools and tipsVikas Dongre
 
Scope of job education and business after HSC
Scope of job  education and business after HSCScope of job  education and business after HSC
Scope of job education and business after HSCVikas Dongre
 
Introduction to digital logic gates
Introduction to digital logic gatesIntroduction to digital logic gates
Introduction to digital logic gatesVikas Dongre
 
Introduction to binary number system
Introduction to binary number systemIntroduction to binary number system
Introduction to binary number systemVikas Dongre
 
Timer programming for 8051 using embedded c
Timer programming for 8051 using embedded cTimer programming for 8051 using embedded c
Timer programming for 8051 using embedded cVikas Dongre
 
Arithmetic and Logic instructions in Embedded C
Arithmetic and Logic instructions in Embedded CArithmetic and Logic instructions in Embedded C
Arithmetic and Logic instructions in Embedded CVikas Dongre
 
Introduction to Embedded system programming using 8051
Introduction to Embedded system programming using 8051Introduction to Embedded system programming using 8051
Introduction to Embedded system programming using 8051Vikas Dongre
 
Interrupts programming in embedded C using 8051
Interrupts programming in embedded C using 8051Interrupts programming in embedded C using 8051
Interrupts programming in embedded C using 8051Vikas Dongre
 
Arithmetic and logic operations in c
Arithmetic and logic operations in cArithmetic and logic operations in c
Arithmetic and logic operations in cVikas Dongre
 
Arithmetic and logic operations in c
Arithmetic and logic operations in cArithmetic and logic operations in c
Arithmetic and logic operations in cVikas Dongre
 
Classification of embedded systems
Classification of embedded systemsClassification of embedded systems
Classification of embedded systemsVikas Dongre
 
Characteristics of embedded systems
Characteristics of embedded systemsCharacteristics of embedded systems
Characteristics of embedded systemsVikas Dongre
 
Features of 89c51,pic,avr & arm processors
Features of 89c51,pic,avr & arm processorsFeatures of 89c51,pic,avr & arm processors
Features of 89c51,pic,avr & arm processorsVikas Dongre
 
Microcontroller architecture
Microcontroller architectureMicrocontroller architecture
Microcontroller architectureVikas Dongre
 
2. block diagram and components of embedded system
2. block diagram and components of embedded system2. block diagram and components of embedded system
2. block diagram and components of embedded systemVikas Dongre
 
1. advantages and applications of embedded system
1. advantages and applications of embedded system1. advantages and applications of embedded system
1. advantages and applications of embedded systemVikas Dongre
 
Innovative improvements in electronic engineering laboratory education using eml
Innovative improvements in electronic engineering laboratory education using emlInnovative improvements in electronic engineering laboratory education using eml
Innovative improvements in electronic engineering laboratory education using emlVikas Dongre
 
Devnagari handwritten numeral recognition using geometric features and statis...
Devnagari handwritten numeral recognition using geometric features and statis...Devnagari handwritten numeral recognition using geometric features and statis...
Devnagari handwritten numeral recognition using geometric features and statis...Vikas Dongre
 

More from Vikas Dongre (20)

Lcd interfaing using 8051 and assambly language programming
Lcd interfaing using 8051 and assambly language programmingLcd interfaing using 8051 and assambly language programming
Lcd interfaing using 8051 and assambly language programming
 
Job opportunities for electronics engineering
Job opportunities for electronics engineeringJob opportunities for electronics engineering
Job opportunities for electronics engineering
 
Educational video creation: Tools and tips
Educational video creation: Tools and tipsEducational video creation: Tools and tips
Educational video creation: Tools and tips
 
Scope of job education and business after HSC
Scope of job  education and business after HSCScope of job  education and business after HSC
Scope of job education and business after HSC
 
Introduction to digital logic gates
Introduction to digital logic gatesIntroduction to digital logic gates
Introduction to digital logic gates
 
Introduction to binary number system
Introduction to binary number systemIntroduction to binary number system
Introduction to binary number system
 
Timer programming for 8051 using embedded c
Timer programming for 8051 using embedded cTimer programming for 8051 using embedded c
Timer programming for 8051 using embedded c
 
Arithmetic and Logic instructions in Embedded C
Arithmetic and Logic instructions in Embedded CArithmetic and Logic instructions in Embedded C
Arithmetic and Logic instructions in Embedded C
 
Introduction to Embedded system programming using 8051
Introduction to Embedded system programming using 8051Introduction to Embedded system programming using 8051
Introduction to Embedded system programming using 8051
 
Interrupts programming in embedded C using 8051
Interrupts programming in embedded C using 8051Interrupts programming in embedded C using 8051
Interrupts programming in embedded C using 8051
 
Arithmetic and logic operations in c
Arithmetic and logic operations in cArithmetic and logic operations in c
Arithmetic and logic operations in c
 
Arithmetic and logic operations in c
Arithmetic and logic operations in cArithmetic and logic operations in c
Arithmetic and logic operations in c
 
Classification of embedded systems
Classification of embedded systemsClassification of embedded systems
Classification of embedded systems
 
Characteristics of embedded systems
Characteristics of embedded systemsCharacteristics of embedded systems
Characteristics of embedded systems
 
Features of 89c51,pic,avr & arm processors
Features of 89c51,pic,avr & arm processorsFeatures of 89c51,pic,avr & arm processors
Features of 89c51,pic,avr & arm processors
 
Microcontroller architecture
Microcontroller architectureMicrocontroller architecture
Microcontroller architecture
 
2. block diagram and components of embedded system
2. block diagram and components of embedded system2. block diagram and components of embedded system
2. block diagram and components of embedded system
 
1. advantages and applications of embedded system
1. advantages and applications of embedded system1. advantages and applications of embedded system
1. advantages and applications of embedded system
 
Innovative improvements in electronic engineering laboratory education using eml
Innovative improvements in electronic engineering laboratory education using emlInnovative improvements in electronic engineering laboratory education using eml
Innovative improvements in electronic engineering laboratory education using eml
 
Devnagari handwritten numeral recognition using geometric features and statis...
Devnagari handwritten numeral recognition using geometric features and statis...Devnagari handwritten numeral recognition using geometric features and statis...
Devnagari handwritten numeral recognition using geometric features and statis...
 

Recently uploaded

Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 

Recently uploaded (20)

Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 

Serial communication

  • 1. Dr. Vikas Dongre HOD Electronics Government Polytechnic Washim dongrevj1@gmail.com High Resolution
  • 2. Objectives • Types of communication • Baud rate setting • Various SFRs used for serial communication • Various modes of serial communication • Programs for transmission and reception with demonstration
  • 3. UART UART Universal Asynchronous Receiver Transmitter
  • 4. Basics of serial communication Parallel: expensive - short distance ( Within parts of a system) – fast Serial :cheaper– long distance(Few Mtr. to many KM by modem)-slow
  • 5. Basics of serial communication
  • 6. Start and stop bits When there is no transfer the signal is high Transmission begins with a start (low) bit LSB first Finally 1 stop bit (high) Data transfer rate (baud rate) is stated in bps bps: bit per second Framing ASCII “A” (41H)
  • 8. In RS232, a 1 is represented by -3 ~ -25 V, while a 0 bit is +3 ~ +25 V, making -3 to +3 undefined
  • 10. How to communicate 8051 to PC  Connect TXD to RXD and RXD to TXD from pc to 8051  Use max232 to transform signal from TTL level to RS232 level  The baud rate of the transmitting 8051 must matched the baud rate of the receiving 8051 or pc  PC standard baud rate  2400-4800-9600-14400-19200-28800-33600-57600  Timer 1 in mode 2 ( auto reload) is used for baud rate generation  The 8051 UART divides the machine cycle frequency by 32  Machine cycle is 1/12 XTAL frequency
  • 12. RxD and TxD pins in the 8051 • TxD pin 11 of the 8051 (P3.1) • RxD pin 10 of the 8051 (P3.0) SBUF register MOV SBUF, #’D’ ;load SBUF=44H, ASCII for ‘D’ MOV SBUF, A ;copy accumulator into SBUF MOV A, SBUF ;copy SBUF into accumulator SFRs used SBUF, SCON, PCON for actual communication TCON,TMOD,TH1, TL1 for Baud Rate generation
  • 14. Modes of operation SM0 SM1 MODE operation transmit rate 0 0 0 shift register fixed (xtal/12) 0 1 1 8 bit UART variable (timer1) 1 0 2 9 bit UART fixed (xtal/32 or xtal/64) 1 1 3 9 bit UART variable (timer1)
  • 15. Modes of operation • Mode 0 : • Serial data enters and exits through RxD • TxD outputs the shift clock. • 8 bits are transmitted/received(LSB first) • The baud rate is fixed a 1/12 the oscillator frequency. • Application • Port expansion 8051 TXD RXD Shift register clk data
  • 16. Modes of operation • Mode 1 • Ten bits are transmitted (through TxD) or received (through RxD) • A start bit (0), 8 data bits (LSB first), and a stop bit (1) • On receive, the stop bit goes into RB8 in SCON • the baud rate is determined by the Timer 1 overflow rate. • Transmission is initiated by any instruction that uses SBUF as a destination register.
  • 18. Power control register  Bit 7 of PCON register  If SMOD=1 double baud rate  PCON is not bit addressable  How to set SMOD Mov a, pcon Setb acc.7 Mov pcon,a
  • 19. • Mode 2 : • Eleven bits are transmitted (through TxD), received (through RxD) • A start bit (0) • 8 data bits (LSB first) • A programmable 9th data bit • and a stop bit (1) • On transmit, the 9th bit (TB8) can be assigned 0 or 1. • On receive, the 9th data bit goes into RB8 in SCON. • the 9th can be parity bit • The baud rate is programmable to 1/32 or 1/64 the oscillator frequency in Mode 2 by SMOD bit in PCON register • Mode 3 • Same as mode 2 • But may have a variable baud rate generated from Timer 1. Modes of operation
  • 20. Steps for Serial Transmission programming 1. Set communication mode using SCON SFR 2. Set Baud rate using TMOD , TH1 SFR 3. Start timer to generate baud rate 4. Move data in SBUF which you wish to transmit 5. Wait till the data byte is transmitted by monitoring the setting of TI flag 6. Clear TI flag 7. Repeat step 4 to 6 again and again to transmit more bytes Note: Serial transmission and serial reception should run on both transmitting and receiving controllers at the same time , that too with same baud rate
  • 21. Serial Transmit(1) ORG 0000 MOV TMOD ,#20H ; set timer 1 in mode 2 MOV TH1, #-3 ; set baud rate as 9600 MOV SCON, #50H ; set communication in mode 1 with receive enable SETB TR1 ; start timer to generate baud rate AGAIN: MOV SBUF, #Y’ ;Transmit Y back: JNB TI, back CLR TI MOV SBUF, #'E‘ ;Transmit E JNB TI,$ CLR TI MOV SBUF, #'S‘ ; Transmit S JNB TI,$ CLR TI MOV SBUF, #' ‘ : Transmit space JNB TI,$ CLR TI SJMP AGAIN END
  • 22.
  • 23. ORG 0000 MOV TMOD ,#20H MOV TH1, #-3 MOV SCON, #50H SETB TR1 AGAIN: MOV SBUF, #"M" CALL TRANSMIT MOV SBUF, #'S' CALL TRANSMIT MOV SBUF, #'B' CALL TRANSMIT MOV SBUF, #'T' CALL TRANSMIT MOV SBUF, #'E' CALL TRANSMIT MOV SBUF, #' ' CALL TRANSMIT SJMP AGAIN TRANSMIT: JNB TI, $ CLR TI RET Serial Transmit(2)
  • 24. ORG 0000 MOV TMOD ,#20H MOV TH1, #-3 MOV SCON, #50H SETB TR1 SETB TI AGAIN: MOV R0,#10 MOV DPTR,#100H BACK: MOV A,#00H MOVC A, @A+DPTR MOV SBUF,A CALL TRANSMIT INC DPTR DJNZ R0, BACK SJMP AGAIN TRANSMIT: JNB TI,$ CLR TI RET ORG 100H DB 'G','P',' ', 'W', 'A', 'S', 'H', 'I', 'M',' ' END Serial Transmit(3)
  • 25. Steps for Serial Reception programming 1. Set communication mode using SCON SFR 2. Set Baud rate using TMOD , TH1 SFR 3. Start timer to generate baud rate 4. Wait till the data byte is transmitted by monitoring the setting of RI flag 5. Move data received in SBUF to other place like memory or use on any port 6. Clear RI flag 7. Repeat step 4 to 6 again and again to transmit more bytes
  • 26. ;PROGRAM FOR RECEIVING DATA SERIALY ORG 0000 MOV TMOD ,#20H ;SET TIMER 1 IN MODE 2 MOV TH1, #-3 ; SET BAUD AS 9600 MOV SCON, #50H ; ENABLE RECRIVE SETB TR1 ; START TIMER BACK: JNB RI, $ ; CHECK IF BUFFER FULL MOV A,SBUF ; IF YES READ THE SBUFFER MOV P1,A ; SEND RECEIVED DATA TO PORT 1 CLR RI ; CLEAR RECEIVE FLAG SJMP BACK END Serial Receive
  • 27. Summery • Concept of Serial and Parallel communication • Asynchronous communication • Concept of Start and Stop bits • SCON, SMOD SFRs used for serial communication • Various modes of serial communication • Programs for transmission and reception with Keil Simulation
  • 28. Thank you !!! Dr. Vikas Dongre HOD Electronics Government Polytechnic Washim dongrevj1@gmail.com