AnsweredAssumed Answered

Kinetis MKM34Z256VLX7: VREFST flag does not set as expected

Question asked by Matteo Perego on May 11, 2018
Latest reply on Jun 11, 2018 by Philip Drake

Hi,
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.

 

 

void BOARD_VREF_Config(void)
{
vref_config_t config;

/*
* config.bufferMode = kVREF_ModeHighPowerBuffer;
* config.bufferMode = kVREF_ModeTightRegulationBuffer;
* config.enableExternalVoltRef = false;
* config.enableLowRef = false;
*/

/* Get vref default config. */
VREF_GetDefaultConfig(&config);
/* Enable low reference volt (VREF_L) */
config.enableLowRef = true;
/*Enable low power mode*/
config.bufferMode = kVREF_ModeHighPowerBuffer; 
/* Init vref */
VREF_Init(VREF, &config);
/* Vref set low trim reference (VREF_L) */
VREF_SetLowReferenceTrimVal(VREF, 3U);
/* Vref set trim, this value will not be the same with every boards */
VREF_SetTrimVal(VREF, 46U);
}

 

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;

 

Best regards.

Outcomes