8051 sfr kanaad
TRANSCRIPT
-
8/12/2019 8051 Sfr Kanaad
1/6
KANAAD_2007
THE TIMER CONTROL (TCON) SPECIAL FUNCTION REGISTER
Bit 7 6 5 4 3 2 1 0
Symbol TF1 TR1 TF0 TR0 IE1 IT1 IE0 IT0
Bit Symbol Function7 TF1 Timer 1 Overflow flags. Set when timer rolls from all 1s to
0. Cleared when processor vectors to execute interruptservice routine located at program address 001Bh.
6 TR1 Timer 1 run control bit. Set to 1 by program to enable timerto count; Cleared to 0 by program to halt timer. Does notreset timer.
5 TF0 Timer 0 Overflow flag. Set when timer rolls from all 1s to 0.Cleared when processor vectors to execute interruptservice routine located at program address 000Bh.
4 TR0 Timer 0 run control bit. Set to 1 by program to enable timer
to count; Cleared to 0 by program to halt timer. Does notreset timer.
3 IE1 External interrupt 1 edge flag. Set to 1 when a high-to-lowedge signal is received is received on port 3 pin 3.3(INT1). Cleared when processor vectors to interruptservice routine located at program address 0013h. Notrelated to timer operations.
2 IT1 External interrupt 1 signal type control bit. Set to 1 byprogram to enable external interrupt 1 to be triggered by afalling edge signal. Set to 0 by program to enable a low-level signal on external interrupt 1 to generate an interrupt.
1 IE0 External interrupt 0 edge flag. Set to 1 when a high-to-lowedge signal is received is received on port 3 pin 3.2(INT0). Cleared when processor vectors to interruptservice routine located at program address 0003h. Notrelated to timer operations.
0 IT0 External interrupt 0 signal type control bit. Set to 1 byprogram to enable external interrupt 0 to be triggered by afalling edge signal. Set to 0 by program to enable a low-level signal on external interrupt 0 to generate an interrupt.
Internal RAM address of TCON is 0088H.
This register is Bit addressable.
On reset all bits are 0.
8051 SPECIAL FUNCTION REGISTER 1
-
8/12/2019 8051 Sfr Kanaad
2/6
KANAAD_2007
THE TIMER MODE CONTROL (TMOD) SPECIAL FUNCTION REGISTER
Bit 7 6 5 4 3 2 1 0
Symbol GATE C/T M1 M0
GATE C/T
M1 M0
Bit Symbol Function
7/3 Gate OR gate enable bit, which controls RUN/STOP of timer1/0. Set to 1 by Program to enable timer to run if bitTR1/TR0 in TCON is set and signal on external interruptINT1/ INT0 pin is high. Cleared to 0 by program to enabletimer to run if bit TR1/TR0 in TCON is set.
6/2 C/T Set to 1 by program to make timer 1/0 act as counter bycounting pulses from external input pins 3.5(T1) or3.4(T0). Cleared to 0 by program to make timer act astimer by counting internal frequency.
5/1 M1 Timer / Counter operating mode select bit 1. Set / cleared
by program to select mode4/0 M0 Timer / Counter operating mode select bit 0. Set / cleared
by program to select mode
M1 M0 Mode
0 0 0
0 1 1
1 0 2
1 1 3
Internal RAM address of TMOD is 0089H.
This register is Not Bit addressable.On reset all bits are 0.
8051 SPECIAL FUNCTION REGISTER 2
-
8/12/2019 8051 Sfr Kanaad
3/6
-
8/12/2019 8051 Sfr Kanaad
4/6
KANAAD_2007
THE POWER MODE CONTROL (PCON) SPECIAL FUNCTION REGISTER
Bit 7 6 5 4 3 2 1 0
Symbol SMOD - - - GF1 GF0 PD IDL
Bit Symbol Function7 SMOD Serial baud rate modify bit. Set to 1 by program to double
baud rate using timer 1 for modes 1,2 & 3. Cleared to 0 byprogram to use timer 1 baud rate.
6-4 - Not implemented.
3 GF1 General-purpose user flag bit 1. Set /cleared by program.
2 GF0 General-purpose user flag bit 0. Set /cleared by program.
1 PD Power down bit. Set to 1 by program to enter power downconfiguration for CHMOS processors.
0 IDL Idle mode bit. Set to 1 by program to enter idle modeconfiguration for CHMOS processors.
Internal RAM address of PCON is 0087H.
This register is Not Bit addressable.On reset all bits are 0.
8051 SPECIAL FUNCTION REGISTER 4
-
8/12/2019 8051 Sfr Kanaad
5/6
KANAAD_2007
THE INTERRUPT ENABLE (IE) SPECIAL FUNCTION REGISTER
Bit 7 6 5 4 3 2 1 0
Symbol EA - ET2 ES ET1 EX1 ET0 EX0
Bit Symbol Function7 EA Enable interrupt bit. Cleared to 0 by program to disable all
interrupt; set to 1 to permit individual interrupts to beenabled by their enable bits.
6 Not implemented.
5 ET2 Enable timer 2 overflow interrupt. Set to 1 by program toenable timer 2 overflow interrupt; cleared to 0 to disabletimer 2 overflow interrupt. (timer 2 in only in IC 89c52)
4 ES Enable serial port interrupt. Set to 1 by program to enableserial port interrupt; cleared to 0 to disable serial portinterrupt.
3 ET1 Enable timer 1 overflow interrupt. Set to 1 by program toenable timer 1 overflow interrupt; cleared to 0 to disabletimer 1 overflow interrupt.
2 EX1 Enable external interrupt 1. Set to 1 by program to enableINT1 interrupt; cleared to 0 to disable INT1 interrupt.
1 ET0 Enable timer 0 overflow interrupt. Set to 1 by program toenable timer 0 overflow interrupt; cleared to 0 to disabletimer 0 overflow interrupt.
0 EX0 Enable external interrupt 0. Set to 1 by program to enableINT0 interrupt; cleared to 0 to disable INT0 interrupt.
Internal RAM address of IE is 00A8H.
This register is Bit addressable.
On reset all bits are 0.
8051 SPECIAL FUNCTION REGISTER 5
-
8/12/2019 8051 Sfr Kanaad
6/6
KANAAD_2007
THE INTERRUPT PRIORITY (IP) SPECIAL FUNCTION REGISTER
Bit 7 6 5 4 3 2 1 0
Symbol - - PT2 PS PT1 PX1 PT0 PX0
Bit Symbol Function7 & 6 - Not implemented.
5 PT2 Priority of timer 2 interrupt. Set/ cleared by program.
4 PS Priority of serial port interrupt. Set/ cleared by program.
3 PT1 Priority of timer 1 overflow interrupt. Set/ cleared byprogram.
2 PX1 Priority of external interrupt 1. Set/ cleared by program.
1 PT0 Priority of timer 2 overflow interrupt. Set/ cleared byprogram.
0 PX0 Priority of external interrupt 1. Set/ cleared by program.
Internal RAM address of IP is 00B8H.This register is Bit addressable.On reset all bits are 0.
8051 SPECIAL FUNCTION REGISTER 6