6.7 Demo Programs about Interrupts (C and ASM) ................................ 132
6.7.1 External Interrupt 0 (
INT0
) Demo Programs (C and ASM) ........................... 132
6.7.2 External Interrupt 1 (
INT1
) Demo Programs (C and ASM) ........................... 136
6.7.3 Programs of P3.4/T0 Interrupt(falling edge) used to wake up PD mode .........140
6.7.4 Programs of P3.5/T1 Interrupt(falling edge) used to wake up PD mode .........142
6.7.5 Program of P3.0/RxD Interrupt(falling edge) used to wake up PD mode ........ 144
6.7.6 Program of PCA Interrupt used to wake up Power Down mode ...................... 147
Chapter 7. Timer/Counter 0/1 .................................................151
7.1 Special Function Registers about Timer/Counter .............................. 151
7.2 Timer/Counter 0
Mode of Operation (Compatible with traditional 8051 MCU) ........155
7.2.1
Mode 0 (13-bit Timer/Counter) ..................................................................................... 155
7.2.2
Mode 1 (16-bit Timer/Counter) and Demo Programs (C and ASM) ............................. 156
7.2.3
Mode 2 (8-bit Auto-Reload Mode) and Demo Programs (C and ASM) ........................160
7.2.4
Mode 3 (Two 8-bit Timers/Couters) .............................................................................. 163
7.3 Timer/Counter 1 Mode of Operation ................................................. 164
7.3.1
Mode 0 (13-bit Timer/Counter) ..................................................................................... 164
7.3.2
Mode 1 (16-bit Timer/Counter) and Demo Programs (C and ASM) ............................. 165
7.3.3
Mode 2 (8-bit Auto-Reload Mode) and Demo Programs (C and ASM) ........................169
7.4 Programmable Clock Output and Demo Programs (C and ASM) .... 172
7.4.1 Timer 0 Programmable Clock-out on P1.0 and Demo Program(C and ASM) . 174
7.4.2 Timer 1 Programmable Clock-out on P1.1 and Demo Program(C and ASM) . 177
7.5 Application note for Timer in practice .............................................. 180
Chapter 8. UART with Enhanced Function ...........................181
8.1 Special Function Registers about UART ........................................... 181
8.2 UART Operation Modes ................................................................... 185
8.2.1 Mode 0: 8-Bit Shift Register............................................................................. 185
8.2.2 Mode 1: 8-Bit UART with Variable Baud Rate ................................................ 187
8.2.3 Mode 2: 9-Bit UART with Fixed Baud Rate .................................................... 189
8.2.4 Mode 3: 9-Bit UART with Variable Baud Rate ................................................ 191
8.3 Frame Error Detection ....................................................................... 193
8.4 Multiprocessor Communications ...................................................... 193
8.5 Automatic Address Recognition ........................................................ 194
8.6 Buad Rates ......................................................................................... 196
8.7 Demo Programs about UART (C and ASM) ..................................... 197