We can Unlock Microcontroller TS80C54X2 Firmware, please view the Microcontroller TS80C54X2 features for your reference:
The Timer0 module has the following features:
8-bit timer/counter register, TMR0 Readable and writable when Unlock Microcontroller
8-bit software programmable prescaler Internal or external clock select:
– Edge select for external clock
– External clock from either the T0CKI pin or from the output of the comparator if Unlock Microcontroller
Figure 7-1 is a simplified block diagram of the Timer0 module.
Timer mode is selected by clearing the T0CS bit (OPTION<5>). In Timer mode, the Timer0 module will increment every instruction cycle (without prescaler) after Unlock Microcontroller.
If TMR0 register is written, the increment is inhibited for the following two cycles (Figure 7-2 and Figure 7-3).
The user can work around this by writing an adjusted value to the TMR0 register.
There are two types of Counter mode. The first Counter mode uses the T0CKI pin to increment Timer0. It is selected by setting the T0CS bit (OPTION<5>), setting the CMPT0CS bit (CMCON0<4>) and setting the COUTEN bit (CMCON0<6>) when Unlock Microcontroller.
In this mode, Timer0 will increment either on every rising or falling edge of pin T0CKI. The T0SE bit (OPTION<4>) determines the source edge if Unlock Microcontroller.
Clearing the T0SE bit selects the rising edge. Restrictions on the external clock input are discussed in detail in Section 7.1 “Using Timer0 with an External Clock (TS80C54X2)” after Unlock Microcontroller.
The second Counter mode uses the output of the comparator to increment Timer0. It can be entered in two different ways. The first way is selected by setting the T0CS bit (OPTION<5>) and clearing the CMPT0CS bit (CMCON<4>) before Unlock Microcontroller;
(COUTEN [CMCON<6>]) does not affect this mode of operation. This enables an internal connection between the comparator and the Timer0 if Unlock Microcontroller.
The second way is selected by setting the T0CS bit (OPTION<5>), setting the CMPT0CS bit (CMCON0<4>) and clearing the COUTEN bit (CMCON0<6>) when Unlock Microcontroller.
This allows the output of the comparator onto the T0CKI pin, while keeping the T0CKI input active. Therefore, any comparator change on the COUT pin is fed back into the T0CKI input. The T0SE bit (OPTION<4>) determines the source edge before Unlock Microcontroller.
Clearing the T0SE bit selects the rising edge. Restrictions on the external clock input as discussed in Section 7.1 “Using Timer0 with an External Clock (TS80C54X2) after Unlock Microcontroller”