S12ZVM Vsup Measure Problem

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S12ZVM Vsup Measure Problem

611 Views
dufour-thibaut
Contributor I

Hi,

I'm working on S12ZVM microcontroller, and I'm measuring the Vsup voltage, the adc_result is good until it reaches 328 (14.7V for me).

After this value the result doesn't move, and before it is correctly tracking the supply voltage.

My code at each interrupt :

static void DIOS12ZVM_ADC_GetValuesConfig0 ( void )
{
SetADCRealResults_u16( VCSOUT, ( adc0_results_u16[1] << 6U ) ) ;
#if 1
SetADCRealResults_u16( TMES, ( adc0_results_u16[0] << 6U ) ) ;
temp = adc0_results_u16[2]; // to debug
temp1 = temp << 6U ; // to debug
SetADCRealResults_u16( UMES, ( temp1 ) ) ;
#else
#warning "This code is only to test with NXP Eval Board"
SetADCRealResults_u16( TMES, 32800 ) ; /* Simulate 25 Deg C */
SetADCRealResults_u16( UMES, 16738 ) ; /* Simulate ~12V */
#endif
}

temp = 328 after 14.7V

Thank you

Thibaut

Tags (1)
0 Kudos
Reply
1 Reply

516 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi Thibaut,

Could you please use this example:

BATS Voltage Supply Sense example code for MagniV devices 

You should be able to use the main.c and ADC_LBA.h files without any modification.

It can measure VSUP up to 29V (Table G-1, #7)..

The max ADC input voltage is therefore ~ 3.22V (29V / 9).

Regards,

Daniel 

0 Kudos
Reply