I/O port reading and writing as long as the data into the corresponding I/O port latch can be, then for the timing/ counter, serial I/O port how to use it? In the microcontroller, there are some independent storage units are used to control these devices, known as the Special Function register (SFR).
Symbol |
Address |
function Introduction |
B |
f0h |
b Register |
Acc |
e0h |
Accumulator |
PSW |
d0h |
Program Status Word |
Ip |
b8h |
Interrupt-Priority Control register |
P3 |
b0h |
P3 Port Latch |
Ie |
a8h |
Interrupt Allow control register |
P2 |
a0h |
P2 Port Latch |
Sbuf |
99H |
Serial Port latch |
SCON |
98H |
Serial Port Control Register |
P1 |
90H |
P1 Port Latch |
TH1 |
8DH |
Timer/Counter 1 (High 8-bit) |
TH0 |
8CH |
Timer/Counter 1 (Low 8-bit) |
TL1 |
8BH |
Timer/Counter 0 (High 8-bit) |
TL0 |
8AH |
Timer/Counter 0 (Low 8-bit) |
Tmod |
89A |
Timer/Counter Mode control register |
TCON |
88H |
Timer/Counter Control register |
DPH |
83H |
Data address pointer (8 bits high) |
Dpl |
82H |
Data address pointer (low 8 bits) |
Sp |
81H |
Stack pointer |
P0 |
80H |
P0 Port Latch |
PCON |
87H |
Power Control Register |
Table 1
Special function Register address image table
Common SFR:
1. Accumulator a 2. Register B 3. Program status word PSW 4.p0, P1, P2, P3
5.DPTR: A data pointer that can be used to access any unit of the external data memory, if not, can also be used as a general-purpose register, we have decided how to use. 16 bits, consisting of two 8-bit registers DPH, DPL. It is primarily used for storing a 16-bit address as an address pointer to external memory (outside RAM and ROM).
6.SP: Stack pointer. (specifically used to indicate the address of the top data on the stack.) )
Using the stack this way to put data (a batch of time) only need to know the first Data address unit to be able to simplify the operation.
Single chip microcomputer special function register