Configuration; Sample Code For The Initial Configuration Of Ilo0 Calibration Using Clock Calibration Counter Settings - Infineon TRAVEO T2G family CYT4D Series Manual

Table of Contents

Advertisement

Clock configuration setup in TRAVEO™ T2G family CYT4D series MCUs
Supplementary information
6.2.2.1

Configuration

Table 33
lists the parameters and
calibration using clock calibration counter settings.
Table 33
List of ILO0 calibration using clock calibration counter settings parameters
Parameters
CY_SYSCLK_ILO_TARGET_FREQ
ILO_0
ILO_1
ILONo
iloFreq
Table 34
List of ILO0 calibration using clock calibration counter settings functions
Functions
Cy_WDT_Disable()
Cy_WDT_Unlock()
GetILOClockFreq()
Cy_SysClk_IloTrim
(iloFreq, 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
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
#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(;;);
}
Application Note
Table 34
lists the functions of the configuration part of in the SDL for ILO0
Description
ILO target frequency
Define the ILO_0 setting parameter
Define the ILO_1 setting parameter
Define the measurement clock
Current ILO 0 frequency stored
Description
WDT disable
Unlock the watchdog timer.
Get the current ILO 0 frequency.
Set the trim:
iloFreq: Current ILO 0 frequency
iloNo: Trimming ILO number
show the sample code.
32768ul
Define the ILO 0 number.
(1) Watchdog timer disable
(2) Get the current ILO 0 frequency. See
59.
Watchdog timer unlock
Trimming the ILO 0. See
71 of 80
32768ul (32.768 kHz)
0ul
1ul
ILO_0
iloFreq: iloFreq
iloNo: ILONo
Define the CY_SYSCLK_DIV_ROUND function.
Define the target ILO 0 frequency.
Code Listing
Code Listing
64.
Value
Value
002-26071 Rev. *B
2021-09-07

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents