I am using development board TWR-KM34Z75M and I have found a problem about Vref stabilization flag.
The VREFST flag is supposed to be set when the signal is stable, but this is not whap happens.
From the moment I enable the Vref module (VREFEN = 1) the VREFST flag is istantaneously set to 1!
I didn't find a way to clear it, so how to set up correctly the Vref module in order to see this flag working?
It's very important for me to check when the Vref is stable, so why this flag doesn't work correctly?
This is the code about the Vref configuration.
* config.bufferMode = kVREF_ModeHighPowerBuffer;
* config.bufferMode = kVREF_ModeTightRegulationBuffer;
* config.enableExternalVoltRef = false;
* config.enableLowRef = false;
/* Get vref default config. */
/* Enable low reference volt (VREF_L) */
config.enableLowRef = true;
/*Enable low power mode*/
config.bufferMode = kVREF_ModeHighPowerBuffer;
/* Init vref */
/* Vref set low trim reference (VREF_L) */
/* Vref set trim, this value will not be the same with every boards */
All these functions and structs are taken from nxp libraries.
Try to debug step by step the VREF_Init function and you will see the problem when you'll reach this line:
/* Enable VREF module */
reg |= VREF_SC_VREFEN(1U);
/* Update bit-field from value to Status and Control register */
base->VREFH_SC = reg;