Renesas RA Family Getting Started with Low Power Applications for RA6 and
RA4 Groups
R11AN0471EU0104 Rev.1.04 Page 25 of 40
Oct.1.21
Figure 24. Release IO from IOKEEP State MCU Reset
The following code stops the LOCO clock when it is not used as count source for AGT0 as shown in Figure
25.
Figure 25. Stop LOCO Clock when It is Unused
5.1.2 Change System Clock at Run-Time
When the MCU powers up, the default clock will be the configured clock as part of the BSP. Selecting the
clock for the application is done through the FSP configurator using the clock tree, which is available in the
Clocks tab.
In the changing clock use case application, the current running system clock is read via the
R_CGC_SystemClockGet API and a new system clock source is configured. The following code is used for
reading the currently running system clock shown in
Figure 26.
Figure 26. Read the running System Clock
In order to configure the new source for the system clock, proper divisors are required so that the peripherals
get the permitted range of frequencies. Users need to calculate this based on the peripherals used in the
application. The new system clock is configured via the API R_CGC_ClocksCfg.
Also, the clock sources need to be started if they are not already running. This is done using the API
R_CGC_ClockStart as shown in the Figure 27.
Figure 27. Starting the Clock Source