14 Timer Delay Calculation 04-09-2024
14 Timer Delay Calculation 04-09-2024
14 Timer Delay Calculation 04-09-2024
= 11.0592 MHz
(a) in hex
• (FFFF – YYXX + 1) × 1.085 s
• where YYXX are TH, TL initial values
respectively.
• Notice that values YYXX are in hex.
(b) in decimal
• Convert YYXX values of the TH, TL register to
decimal to get a NNNNN decimal number
• then (65536 – NNNNN) × 1.085 s
Program (1/3)
• square wave of 50% duty on P1.5
• Timer 0 is used
Note
Mode 1 is not auto reload then the program must
reload the TH1, TL1 register every timer overflow if we
want to have a continuous wave.