Application Note 71 of 80 002-26071 Rev. *B
2021-09-07
Clock configuration setup in TRAVEO™ T2G family CYT4D series MCUs
Supplementary information
6.2.2.1 Configuration
Table 33 lists the parameters and Table 34 lists the functions of the configuration part of in the SDL for ILO0
calibration using clock calibration counter settings.
Table 33 List of ILO0 calibration using clock calibration counter settings parameters
CY_SYSCLK_ILO_TARGET_FREQ
Define the ILO_0 setting parameter
Define the ILO_1 setting parameter
Define the measurement clock
Current ILO 0 frequency stored
Table 34 List of ILO0 calibration using clock calibration counter settings functions
Unlock the watchdog timer.
Get the current ILO 0 frequency.
Cy_SysClk_IloTrim
(iloFreq, iloNo)
iloFreq: Current ILO 0 frequency
iloNo: Trimming ILO number
6.2.2.2 Sample code for the initial configuration of ILO0 calibration using clock
calibration counter settings
Code Listing 63 to Code Listing 64 show the sample code.
Code Listing 63 General configuration of ILO0 calibration using clock calibration counter settings
#define CY_SYSCLK_DIV_ROUND(a, b) (((a) + ((b) / 2ull)) / (b))
#define CY_SYSCLK_ILO_TARGET_FREQ 32768ul
#define ILO_0 0
#define ILO_1 1
#define ILONo ILO_0
int32_t iloFreq;
int main(void)
{
/* Enable global interrupts. */
__enable_irq();
Cy_WDT_Disable();
:
/* return: Frequency of ILO */
ILOFreq = GetILOClockFreq();
:
/* Must unlock WDT befor update Trim */
Cy_WDT_Unlock();
Trim_diff = Cy_SysClk_IloTrim(ILOFreq,ILONo);
:
for(;;);
}
Define the target ILO 0 frequency.
(1) Watchdog timer disable
(2) Get the current ILO 0 frequency. See Code Listing
59.
Trimming the ILO 0. See Code Listing 64.
Define the CY_SYSCLK_DIV_ROUND function.