Application Note
24 of 80
002-26071 Rev. *B
2021-09-07
Clock configuration setup in TRAVEO™ T2G family CYT4D series MCUs
Configuration of the clock resources
Table 6
List of LPECO settings functions
Functions
Description
Value
Cy_WDT_Disable()
Disable the watchdog timer.
–
Cy_SysClk_ClkBak_LPECO_Se
tLoadCap(range)
Set the load capacitance range for the
LPECO crystal.
CY_SYSCLK_BAK_LPECO_LC
AP_5TO10PF
Cy_SysClk_ClkBak_LPECO_Se
tFrequency(range)
Set the frequency range for the LPECO
crystal.
CY_SYSCLK_BAK_LPECO_FR
EQ_6TO8MHZ
Cy_SysClk_ClkBak_LPECO_Se
tAmplitude(value)
Set the maximum oscillation amplitude
value for the LPECO crystal.
CY_SYSCLK_BAK_LPECO_AM
P_MAX_1P35V
Cy_SysClk_ClkBak_LPECO_En
able()
Enable the LPECO.
–
Cy_SysClk_ClkBak_LPECO_Re
ady()
Return the status of LPECO stabilization.
–
3.5.2
Sample code for the initial configuration of LPECO settings
show the sample code.
Code Listing 14
General configuration of LPECO settings
:
/** Wait time definition **/
#define WAIT_FOR_STABILIZATION (10000ul)
:
#define CLK_FREQ_LPECO (8000000ul)
:
static void AllClockConfiguration(void);
:
int main(void)
{
/* disable watchdog timer */
Cy_WDT_Disable();
:
/* Enable interrupt */
__enable_irq();
/* Set Clock Configuring registers */
AllClockConfiguration();
/* Measure clock frequencies using ECO and check */
MeasureClockFrequency();
CompareExpectedAndMeasured();
/* Read register value and re-calculate the frequency and check */
RecalucClockFrequencyValues();
CompareExpectedAndCaluclated();
/* Start output internal clock */
Cy_GPIO_Pin_Init(CY_HF3_CLK_OUT_PORT, CY_HF3_CLK_OUT_PIN, &clkOutPortConfig);
/* Please ensure output clock frequency using oscilloscope */
for(;;);
}
Define the TIMEOUT variable.
Define oscillator parameters to use for software calculation.