8051 Special Function Registers

PCON SFR

 

Bit

Symbol

7

SMOD

6

--

5

---

4

---

3

GF1

2

GF0

1

PD

0

IDL

SCON SFR

 

Bit

Symbol

7

SM0

6

SM1

5

SM2

4

REN

3

TB8

2

RB8

1

TI

0

RI

SM0

SM1

Mode

Description

0

0

0

shift register

0

1

1

8-bit variable baud rate UART

1

0

2

9-bit UART

1

1

3

9-bit variable baud rate UART

 

 

TMOD SFR

 

 

Bit

Name

Timer

7

Gate

1

6

C/T-bar

1

5

M1

1

4

M0

1

3

Gate

0

2

C/T-bar

0

1

M1

0

0

M0

0

M1

M0

Mode

Description

0

0

0

13-bit timer mode

0

1

1

16-bit timer mode

1

0

2

8-bit auto-reload mode

1

1

3

Split timer mode

 

 

TCON SFR

 

 

Bit

Symbol

Description

7

TF1

Timer 1 overflow

6

TR1

Timer 1 start/stop

5

TF0

Timer 0 overflow

4

TR0

Timer 0 start/stop

3

IE1

External interrupt 1 flag

2

IT1

External interrupt 1 type:

0 = low-level; 1 = edge

1

IE0

External interrupt 0 flag

0

IT0

External interrupt 0 type:

0 = low-level; 1 = edge

Vector Table

 

 

Interrupt

Flag

Vector

System reset

RST

0000H

External interrupt 0

IE0

0003H

Timer 0

TF0

000BH

External interrupt 1

IE1

0013H

Timer 1

TF1

001BH

Serial port

RI or TI

0023H

 

 

Interrupt

Enable SFR

 

1 = enable

0 = disable

Symbol

Bit Number

Description

EA

7

Enable/disable all interrupts.

--

6

 

--

5

 

ES

4

Enable/disable serial port interrupts.

ET1

3

Enable/disable timer 1 interrupt.

EX1

2

Enable/disable external 1.

ET0

1

Enable/disable timer 0 interrupt.

EX0

0

Enable/disable external 0 interrupt.

Interrupt Priority SFR

 

1= high

0 = low

Symbol

Bit Number

Description

--

7

 

--

6

 

--

5

 

PS

4

Serial port

PT1

3

Timer 1

PX1

2

External interrupt 1

PT0

1

Timer 0

PX0

0

External interrupt 0