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

Table of Contents

Advertisement

Clock configuration setup in TRAVEO™ T2G family CYT4D series MCUs
Supplementary information
Table 32
List of clock calibration counter with ILO0 and ECO settings functions
Functions
GetILOClockFreq()
Cy_SysClk_StartClk
MeasurementCounters
(clk1, count1,clk2)
Cy_SysClk_ClkMeasurement
CountersDone()
Cy_SysClk_ClkMeasurement
CountersGetFreq
(MesauredFreq, refClkFreq)
6.2.1.3
Sample code for the initial configuration of the clock calibration
counter with ILO0 and ECO settings
Code Listing 58
to
Code Listing 62
Code Listing 58
General configuration of the clock calibration counter with ILO0 and ECO settings
#define CY_SYSCLK_DIV_ROUND(a, b) (((a) + ((b) / 2ull)) / (b))
#define ILO_0
0ul
#define ILO_1
1ul
#define ILONo
ILO_0
#define CLK_FREQ_ECO
int32_t ILOFreq;
stc_clock_measure clockMeasuredInfo[] =
{
#if(ILONo
== ILO_0)
{.name = CY_SYSCLK_MEAS_CLK_ILO0,
#else
{.name = CY_SYSCLK_MEAS_CLK_ILO1,
#endif
};
int main(void)
{
:
/* Enable interrupt */
__enable_irq();
/* Set Clock Configuring registers */
AllClockConfiguration();
/* return: Frequency of ILO */
ILOFreq = GetILOClockFreq();
/* Please check clock output using oscilloscope after CPU reached here. */
for(;;);
}
Application Note
Description
Get the ILO 0 frequency.
Set and start calibration.
Clk1: Reference clock
Count1: Measurement period
Clk2: measurement clock
Check if counter measurement is
done.
Get the measurement clock
frequency
MesauredFreq: Stored
measurement clock frequency
refClkFreq: Reference clock
frequency
show the sample code.
Define the measurement clock (ILO0).
(16000000ul)
.measuredFreq= 0ul},
.measuredFreq= 0ul},
(1) ECO and ILO0 setting. See
68 of 80
[Set the counter]
clk1 = CY_SYSCLK_MEAS_CLK_ECO =
0x101ul
count1 = counter1
clk2 = clockMeasuredInfo[].name
MesauredFreq =
clockMeasuredInfo[].measuredFreq
refClkFreq = CLK_FREQ_ECO
Define the CY_SYSCLK_DIV_ROUND function.
3.1 Setting the ECO
and
3.4 Configuring
Get the clock frequency. See
Code Listing
Value
ILO0/ILO1.
59.
002-26071 Rev. *B
2021-09-07

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents