Resolution AFE MKM34Z256

Showing results for 
Search instead for 
Did you mean: 

Resolution AFE MKM34Z256

Contributor I


I want to understand what is the exact resolution of the AFE. I use TWR-KM34Z75M. For my minds, as I use Adc 24 bits resolution is : quantum = Vref/(2**n-1) with Vref = 1.2V et n=24.

In Sdk example "afe_interrupt", on Vref initialization function VrefH (1.2V ) and VrefL (0.4V) are initialized. Why VrefL is it needed ? Exact tension resolution is it Vref = VrefH - VrefL = 0.8V ?

void APP_VREF_Config(void)
    vref_config_t config;

    /* Get vref default configure */
     * config.bufferMode = kVREF_ModeHighPowerBuffer;
     * config.bufferMode = kVREF_ModeTightRegulationBuffer;
     * config.enableExternalVoltRef = false;
     * config.enableLowRef = false;
    /* Enable low reference volt */
    config.enableLowRef = true;

    /* Init vref */
    VREF_Init(VREF, &config);

    /* Vref set trim reference */
    VREF_SetLowReferenceTrimVal(VREF, 3U);

    /* Vref set trim, this value will not be the same with every boards */

Can you give me exact way to convert Adc value to real value please ?

Thanks for advance,

IOI Labs

Labels (1)
Tags (2)
0 Kudos
2 Replies

Contributor III

Maybe others will also have the same problem, update the following reference calculation formula for others' reference.


50mV would be represented as (838,860) which is (0000 1100 1100 1100 1100 1100) in binary or (C CCCC) in Hex.

To represent -50mV you need the two’s complement of this number (-838,860), which is (1111 0011 0011 0011 0011 0100) in binary or (F3 3334) In Hex.


250mV would be represented as (4,194,304) which is (0100 0000 0000 0000 0000 0000) in binary or (40 0000) in Hex.

To represent -250mV you need the two’s complement of this number (-4,194,304), which is (1100 0000 0000 0000 0000 0000) or (C0 0000) in Hex.


0 Kudos

NXP TechSupport
NXP TechSupport

Hi, Ioi,

The AFE module uses a complicated reference voltage system, but as you know that the range of AFE analog pin is from -500mV to +500mV, one LSB voltage is LSB=1V/(2**24), in other words, the analog voltage is (digital sample value)*[1/(2**24)]. For the digital sample value, 0x7F FFFF represents  +500mV, 0x80 0000 represents -500mV.

Hope it can help you


Xiangjun rong

0 Kudos