Configuration; Sample Code For The Initial Configuration Of Lpeco Prescaler Settings - Infineon TRAVEO T2G family CYT4D Series Manual

Table of Contents

Advertisement

Clock configuration setup in TRAVEO™ T2G family CYT4D series MCUs
Configuring the internal clock
5.11.2

Configuration

Table 21
lists the parameters and
prescaler settings.
Table 21
List of LPECO prescaler settings parameters
Parameters
LPECO_PRESCALER_TARGET_FR
EQ
WAIT_FOR_STABILIZATION
CLK_FREQ_LPECO
PATH_SOURCE_CLOCK_FREQ
Table 22
List of LPECO prescaler settings functions
Functions
AllClockConfiguration()
Cy_SysClk_ClkBak_LPECO_Set
Prescale(frac,int)
Cy_SysClk_ClkBak_LPECO_Ena
bleDivider(divInt,divFract
)
Cy_SysClk_ClkBak_LPECO_Pre
scalerOkay()
5.11.3

Sample code for the initial configuration of LPECO prescaler settings

Code Listing 51
to
Code Listing 55
Code Listing 51
General configuration of LPECO prescaler settings
#define LPECO_PRESCALER_TARGET_FREQ (1234567ul)
#define CLK_FREQ_LPECO
#define PATH_SOURCE_CLOCK_FREQ CLK_FREQ_LPECO
/** Wait time definition **/
#define WAIT_FOR_STABILIZATION (10000ul)
int main(void)
{
:
/* Set Clock Configuring registers */
AllClockConfiguration();
:
/* Please check clock output using oscilloscope after CPU reached here. */
for(;;);
}
Application Note
Table 22
lists the functions of the configuration part of in the SDL for LPECO
ECO prescaler target frequency
Waiting for stabilization
ECO clock frequency
PATH source clock frequency
Description
Clock configuration
Prescaler integer and
fractional divider to
generate 32.768 kHz from
the LPECO
Set the prescaler enable for
the LPECO.
Return the status from the
LPECO after setting the
prescaler divider.
show the sample code.
(8000000ul)
Define the TIMEOUT variable.
LPECO prescaler setting. See
Description
frac = fixedPointDivNum & 0x000000FFul
int = (fixedPointDivNum & 0x0003FF00ul) >>
8ul) - 1ul
divInt = 0x3FF
divFract = 0xFF
Define the LPECO prescaler target frequency.
Define the LPECO clock frequency.
Code Listing
62 of 80
Value
1234567ul
10000ul
8000000ul (8 MHz)
CLK_FREQ_LPECO
Value
52.
002-26071 Rev. *B
2021-09-07

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents