EasyManua.ls Logo

Infineon TRAVEO T2G family CYT4D Series - 6.2.2.1 Configuration; 6.2.2.2 Sample code for the initial configuration of ILO0 calibration using clock calibration counter settings

Infineon TRAVEO T2G family CYT4D Series
80 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
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
Parameters
Description
Value
CY_SYSCLK_ILO_TARGET_FREQ
ILO target frequency
32768ul (32.768 kHz)
ILO_0
Define the ILO_0 setting parameter
0ul
ILO_1
Define the ILO_1 setting parameter
1ul
ILONo
Define the measurement clock
ILO_0
iloFreq
Current ILO 0 frequency stored
Table 34 List of ILO0 calibration using clock calibration counter settings functions
Functions
Description
Value
Cy_WDT_Disable()
WDT disable
Cy_WDT_Unlock()
Unlock the watchdog timer.
GetILOClockFreq()
Get the current ILO 0 frequency.
Cy_SysClk_IloTrim
(iloFreq, iloNo)
Set the trim:
iloFreq: Current ILO 0 frequency
iloFreq: iloFreq
iloNo: Trimming ILO number
iloNo: ILONo
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.
Watchdog timer unlock
Trimming the ILO 0. See Code Listing 64.
Define the CY_SYSCLK_DIV_ROUND function.
Define the ILO 0 number.