Académique Documents
Professionnel Documents
Culture Documents
Chapter 10
Outlines
• Contrast and compare serial versus parallel
communication
• List the advantages of serial communication over
parallel
• Explain serial communication protocol
• Contrast synchronous versus asynchronous
communication
• Contrast half-versus full-duplex transmission
Computer Engineering - Suranaree University of Technology
Heading
1.Basic of Serial Communications
- Parallel VS Serial
- Simplex Half- and Full duplex
- Asynchronous Serial
- Data transfer rate
- RS232 Standard
2.8051 Connection to RS232
- MAX232 Connection
3.8051 Serial Port Programming
- Frame SCON
- Baud Timer(TMOD,TR1,TH1,PCON)
Computer Engineering - Suranaree University of Technology
RS232 pins
TxD pin 11 of
the 8051 (P3.1)
RxD pin 10 of
the 8051 (P3.0)
Computer Engineering - Suranaree University of Technology
MAX232
Figure 10–7: (a) Inside MAX232 and (b) its Connection to the 8051 (Null Modem)
Computer Engineering - Suranaree University of Technology
MAX233
Figure 10–8:(a) Inside MAX233 and (b) Its Connection to the 8051 (Null Modem)
Computer Engineering - Suranaree University of Technology
-Frame
SCON
-Baud
Timer(TMOD,TR1,TH1)
SMOD in PCON Reg.
SMOD1
2 x Oscillater Frequency
BaudRate =
32 x 12 x [256 - (th1)]
9600 @18.432MHz SMOD1=0, TH1=251(FBH)
9600 @11.0592MHz SMOD1=0, TH1=253(FDH)
http://www.intel.com/design/mcs51/applnots/270490.htm
Computer Engineering - Suranaree University of Technology
Oscillater Frequency
Buad rate=
32 x [65536 - (RCAP2H,RCAP2L)]
9600 @18.432MHz RCAP2H,RCAP2L = 65476 = FFC4H
9600 @11.0592MHz RCAP2H,RCAP2L = 65500 = FFDCH
http://www.intel.com/design/mcs51/applnots/270490.htm
Computer Engineering - Suranaree University of Technology
Example10.1
Computer Engineering - Suranaree University of Technology
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
Computer Engineering - Suranaree University of Technology
SM0,SM1
Example10.2
Computer Engineering - Suranaree University of Technology
Example10.3
Computer Engineering - Suranaree University of Technology
Example10.4
Computer Engineering - Suranaree University of Technology
Example10.5
Computer Engineering - Suranaree University of Technology
Computer Engineering - Suranaree University of Technology
Computer Engineering - Suranaree University of Technology