S12ZVM Vsup Measure Problem

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

S12ZVM Vsup Measure Problem

613 次查看
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

标记 (1)
0 项奖励
回复
1 回复

518 次查看
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 项奖励
回复