Set output voltage on the core LDO regulator.
When changing from a higher voltage to a lower voltage as when the device enters system ULP mode, ensure that:
- The device maximum operating frequency for all the Clk_HF paths, peripheral, and slow clock are under the ULP Limitations.
- The total current consumption is under the ULP Limitations.
- The appropriate wait states values are set for the flash using The Cy_SysLib_SetWaitStates() function as explained below.
Setting wait states values for flash
The flash access time when the core voltage is 0.9 V (nominal) is longer than at 1.1 V (nominal). Therefore, the number of the wait states must be adjusted. Use the Cy_SysLib_SetWaitStates() function to set the appropriate wait state values for flash.
To change from a higher voltage to a lower voltage 0.9 V (nominal), call the Cy_SysLib_SetWaitStates(true, hfClkFreqMz) function before changing the voltage, where hfClkFreqMz is the frequency of HfClk0 in MHz.
To change from a lower voltage to a higher voltage 1.1 V (nominal), calling the Cy_SysLib_SetWaitStates(false, hfClkFreqMz) function to set the wait states is optional, but can be done to improve performance. The clock frequency may now be increased up to LP Limitations.
- Note
- 1. The output is set to 0.9 V (nominal) - the system is in ULP mode and flash works for read-only operation.
-
2. The output is set to 1.1 V (nominal) - the system is in LP mode and flash works for read and write operations.
-
3. The actual device Vccd voltage can be different from the nominal voltage because the actual voltage value depends on conditions including the load current.
For more detail, refer to the Switching the System into Ultra Low Power and Switching the System into Low Power sections. Refer to the SysLib (System Library) driver for more detail about setting the wait states.
- Parameters
-
- Returns
- CY_SYSPM_SUCCESS - The voltage is set.
- CY_SYSPM_INVALID_STATE - The voltage was not set. The voltage cannot be set because the protection context value is higher than zero (PC > 0) or the device revision does not support modifying registers via syscall.
- CY_SYSPM_CANCELED - Operation was canceled. Call the function again until the function returns CY_SYSPM_SUCCESS. See cy_en_syspm_status_t. For the PSoC 64 devices there are possible situations when function returns the PRA error status code. This is because for PSoC 64 devices the function uses the PRA driver to change the protected registers. Refer to cy_en_pra_status_t for more details.
- Note
- This API is available for CAT1A, CAT1B(PSoC C3) devices.
- Function Usage
{
{
uint32_t triesToSetVoltage = 5u;
do
{
--triesToSetVoltage;
if (0U == triesToSetVoltage)
{
}
}
}
{
{
uint32_t triesToSetVoltage = 5u;
do
{
--triesToSetVoltage;
if (0U == triesToSetVoltage)
{
}
}
}