GD32W51x User Manual
913
cycles, V
s
(the voltage of sample pin) reaches V
th
(the threshold voltage).
There is also a max cycle number defined by MCN in TSI_CTL0 register. When the cycle
number reaches MCN, FSM returns to IDLE state and stops after Compare State, whether
V
s
reaches V
th
or not.
26.3.5.
Clock and duration time of states
There are 3 clocks in TSI module: HCLK, CTCLK(Charge Transfer Clock) and ECCLK(Extend
Charge Clock). HCLK is system clock and drives TSI’s register and FSM. CTCLK, which is
divided from HCLK with division factor defined by register CTCDIV is the clock used for
calculating the duration time of the charge state and Charge Transfer state. ECCLK, which is
divided from HCLK with division factor defined by register ECCDIV is the clock used to
calculate the maximum duration time of Extend Charge state. ECCLK and CTCLK are
independent of each other.
The duration time of each state except Extend Charge state is fixed in each loop according
to the configuration of the register.
The duration time of Buffer Time1, Buffer Time2 and Buffer Time3 are fixed to 2 HCLK periods.
The duration time of Charge state and Charge Transfer state is defined by CDT and CTDT
bits (see TSI_CTL0 register section for detail).
Generally, the variation range of extend charge frequency is limited to between 10% and 50%.
And the duration time of Extend Charge state changes in each cycle of the charge-transfer
FSM and the maximum duration time are defined by ECDT[6:0] in TSI_CTL0 register. If the
Extend Charge state is enabled, the longest change time is when cycle number is ECDT+2.
The duration time of Extend Charge state in each cycle is presented in
time of Extend Charge state in each cycle
Table 26-2. Duration time of Extend Charge state in each cycle
Cycle Num ber
Num ber of ECCLKs in Extend Charge state
1
0
2
1
…
ECDT
ECDT-1
ECDT+1
ECDT
ECDT+2
ECDT+1
ECDT+3
ECDT
ECDT+4
ECDT-1
…
…
2*ECDT+1
2
2*ECDT+2
1
2*ECDT+3
0
2*ECDT+4
1
2*ECDT+5
2