SLIDE 1
8051 Serial Port and Timer/Counter Serial Port Timer Counter - - PowerPoint PPT Presentation
8051 Serial Port and Timer/Counter Serial Port Timer Counter - - PowerPoint PPT Presentation
8051 Serial Port and Timer/Counter Serial Port Timer Counter Chatchai Jantaraprim (cj@coe.psu.ac.th) 8051 Serial Port Serial communications High speed CMOS signal levels Full duplex No modem status/control signals Registers SBUF Two
SLIDE 2
SLIDE 3
8051 Serial Port
SCON Register
RI TI RB8 TB8 REN SM2 SM1 SM0 7 6 5 4 3 2 1 SCON
SLIDE 4
8051 Serial Port
SCON Register (cont.) RIReceive Interrupt Flag
Set by hardware on received. must clear by software
TITransmit Interrupt Flag
Set by hardware on transmitted, must clear by hardware
RB8 Receive bit 8
Mode 2,3 : copy of bit 8 Mode 1 & SM2 clear : copy of stop bit
TB8 Transmit bit 8
The 9th data bit of mode 2,3. Set or clear by software
REN Receive Enable
Set by software to enable reception, if is cleared reception will be blocked.
SM2 Serial Mode (bit 2)
Use in mode 2,3 for multiprocessor communications
SLIDE 5
8051 Serial Port
SCON Register (cont.) SM1 & SM0Serial Mode (bit 6 & 7)
Operating modes
Operating modes Mode 08-bit shift register, f/12
1Mbit with 12Mhz Oscillator Frequency
Mode 18-bit UART, variable baud rate Mode 29-bit UART, f/64 or f/32
187.5K and 375K with 12MHz Oscillator Frequency
Mode 39-bit UART, variable baud rate
SLIDE 6
8051 Serial Port
Baud Rate Variable Baud Rate SMOD Baud Rate = 2 x f
- 384 x (256 - TH1)
Baud Rate f SMOD TH1 62.5K 12.000 1 FFh 19.2K 11.059 1 FDh 9.6K 11.059 0 FDh 4.8K 11.059 0 FAh 2.4K 11.059 0 F4h 1.2K 11.059 0 E8h
SLIDE 7