STC8A8K64D4 Series Manual
13.3.5 Timer 2 working mode ............................................................................................................290
13.3.6 Timer 2 calculation formula ......................................................................................................291
13.4 Timer 3/4 (24-bit timer, 8-bit prescaler + 16-bit timing) ....................................................................291
13.4.1 Timer4 and Timer 3 Control Register (T4T3M) ........................................................................291
13.4.2 Timer 3 Counting Registers .......................................................................................................292
13.4.3 Timer 4 Counting Registers .......................................................................................................292
13.4.4 Timer 3 8-bit Prescaler Register (TM3PS) ............................................................................292
13.4.5 Timer 4 8-bit Prescaler Register (TM4PS) ............................................................................293
13.4.6 Timer 3 working mode ............................................................................................................293
13.4.7 Timer 4 working mode ............................................................................................................293
13.4.8 Timer 3 calculation formula ......................................................................................................294
13.4.9 Timer 4 calculation formula ......................................................................................................294
13.5 Example Routines ...............................................................................................................................295
13.5.1 Timer 0 (Mode 0 – 16-bit auto reload) ......................................................................................295
13.5.2 Timer 0 (Mode 1 – 16-bit non-auto reload) ...............................................................................296
13.5.3 Timer 0 (Mode 2 - 8-bit auto reload) .........................................................................................298
13.5.4 Timer 0 (Mode 3 - 16-bit auto reload with non-maskable interrupt) .........................................300
13.5.5 Timer 0 (External count - T0 is extended for external falling edge interrupt) ...........................302
13.5.6 Timer 0 (Pulse width measurement for high-level width of INT0) ...........................................304
13.5.7 Timer 0 (Mode 0, Divided clock output) ...................................................................................306
13.5.8 Timer 1 (Mode 0 - 16-bit auto reload) .......................................................................................308
13.5.9 Timer 1 (Mode 1 - 16-bit non-auto reload) ................................................................................310
13.5.10 Timer 1 (Mode 2 - 8-bit auto reload) .......................................................................................312
13.5.11 Timer 1 (External count – T1 is extended for external falling edge interrupt) ........................314
13.5.12 Timer 1 (Pulse width measurement for high-level width of INT1) .........................................315
13.5.13 Timer 1 (Mode 0, Divided clock output) .................................................................................318
13.5.14 Timer 1 (Mode 0) is used as baud rate generator of UART1 ...................................................319
13.5.15 Timer 1 (Mode 2) is used as baud rate generator of UART1 ...................................................323
13.5.16 Timer 2 (16-bit auto reload) .....................................................................................................327
13.5.17 Timer 2 (External count – T2 is extended for external falling edge interrupt) ........................329
13.5.18 Timer 2 (Divided clock output) ...............................................................................................331
13.5.19 Timer 2 is used as baud rate generator of UART1 ...................................................................333
13.5.20 Timer 2 is used as baud rate generator of UART2 ...................................................................337
13.5.21 Timer 2 is used as baud rate generator of UART3 ...................................................................341
13.5.22 Timer 2 is used as baud rate generator of UART4 ...................................................................345
13.5.23 Timer 3 (16-bit auto reload) .....................................................................................................349
13.5.24 Timer 3 (External count – T3 is extended for external falling edge interrupt) ........................352
13.5.25 Timer 3 (Divided clock output) ...............................................................................................354
13.5.26 Timer 3 is used as baud rate generator of UART3 ...................................................................356
13.5.27 Timer 4 (16-bit auto reload) .....................................................................................................360
13.5.28 Timer 4 (External count – T4 is extended for external falling edge interrupt) ........................363
13.5.29 Timer 4 (Divided clock output) ...............................................................................................365
13.5.30 Timer 4 is used as baud rate generator of UART4 ...................................................................367
14 UART Communication ..............................................................................................................................372