Hi,
I'm using a LPC4370 HSADC wich is working good with internal DC VIN_NEG reference.
Now I want to use the external reference wich is at 360mV on the board, but as soon as I execute Chip_HSADC_EnablePower(LPC_ADCHS) the VIN_NEG pin outputs 500mV.
Here is the code that we execute :
setupClock(frequency); // Configure clock for measure.
Chip_HSADC_Init(LPC_ADCHS); // Initialize HSADC.
Chip_HSADC_DisablePowerDownMode(LPC_ADCHS);
Chip_HSADC_SetupFIFO(LPC_ADCHS, FIFO_INT_SIZE, PACKED_FIFO); // Configure FIFO.
// Select negative as external reference, Positive as external.
Chip_HSADC_SetACDCBias(LPC_ADCHS, currentChannel, HSADC_CHANNEL_NODCBIAS, HSADC_CHANNEL_NODCBIAS);
for(i = 0; i < 1;i++)
{
Chip_HSADC_SetActiveDescriptor(LPC_ADCHS,0,i); // Activate descriptor table 0 with 0<ID<8.
Chip_HSADC_SetupDescEntry(LPC_ADCHS, 0, i,0);
}
// External trigger only, on falling edge, 0x90 recovery clocks, add channel IF to FIFO entry
Chip_HSADC_ConfigureTrigger(LPC_ADCHS, HSADC_CONFIG_TRIGGER_EXT,
HSADC_CONFIG_TRIGGER_RISEEXT,
HSADC_CONFIG_TRIGGER_NOEXTSYNC,HSADC_CHANNEL_ID_EN_ADD, 0x90);
// Edge detection enabled/Synchronization/No pulse
LPC_GIMA->ADCHS_TRIGGER_IN = (1 << 1 | 1 << 2 | 0 << 3 );
// Only one PWM used as trigger source.
LPC_GIMA->ADCHS_TRIGGER_IN |= 7 << 4; // CTOUT_8
Chip_HSADC_SetupDescEntry(LPC_ADCHS,0, 0, (HSADC_DESC_CH(currentChannel) |
HSADC_DESC_BRANCH_FIRST | HSADC_DESC_MATCH(1)| HSADC_DESC_THRESH_NONE |HSADC_DESC_RESET_TIMER ));
Chip_HSADC_SetPowerSpeed(LPC_ADCHS,true);
Chip_HSADC_EnablePower(LPC_ADCHS);
Chip_HSADC_DisablePowerDownMode(LPC_ADCHS);
Any idea of what's happening ?
Hi,
Could you please try using the following configuration?
Chip_HSADC_SetACDCBias(LPC_ADCHS, 0, HSADC_CHANNEL_DCBIAS, HSADC_CHANNEL_NODCBIAS);
Please let me know if this helps.
Have a great day,
Sol
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------