AnsweredAssumed Answered

JN5169 ADC Problem

Question asked by Matt Ferrari on Jan 24, 2019
Latest reply on Feb 21, 2019 by Matt Ferrari

I have written the following function to configure and enable the JN5169 ADC:

 

/*****************************************************************************
* NAME: vConfigureADC()
* DESCRIPTION: Calls the necessary functions to bring up the ADC
*****************************************************************************/

void vConfigureADC( void )
{

vAHI_ApConfigure( E_AHI_AP_REGULATOR_ENABLE,
                  E_AHI_AP_INT_DISABLE,
                  E_AHI_AP_SAMPLE_2,
                  E_AHI_AP_CLOCKDIV_500KHZ,
                  E_AHI_AP_INTREF );

vAHI_ProtocolPower(TRUE);

vAHI_ApSetBandGap( E_AHI_AP_BANDGAP_ENABLE );

while( bAHI_APRegulatorEnabled() == FALSE );

// PROBLEM:  bAHI_APRegulatorEnabled() never returns "TRUE"...

vAHI_AdcEnable( E_AHI_ADC_SINGLE_SHOT, E_AHI_AP_INPUT_RANGE_1, E_AHI_ADC_SRC_ADC_1);

}

 

Because bAHI_APRegulatorEnabled() never returns TRUE, the program gets stuck here.

 

What am I doing wrong...?  

Is there something else needed in order for bAHI_APRegulatorEnabled() to return TRUE?

 

Thanks, Matt

Outcomes