Hello eugenr,
You can refer to the lpcopen code for mcb 4357, there has the adc code.
http://www.nxp.com/downloads/en/software/lpcopen_3_01_keil_iar_mcb_4357.zip
It seems you didn't enable the burst mode, if yes, the ADC conversions are software controlled, you need to call :
Chip_ADC_SetStartMode(_LPC_ADC_ID, ADC_START_NOW, ADC_TRIGGERMODE_RISING);
After the ADC convert done, then trigger the next adc conversion.
/* Interrupt routine for ADC example */
static void App_Interrupt_Test(void)
{
/* Enable ADC Interrupt */
NVIC_EnableIRQ(_LPC_ADC_IRQ);
Chip_ADC_Int_SetChannelCmd(_LPC_ADC_ID, _ADC_CHANNLE, ENABLE);
/* Enable burst mode if any, the AD converter does repeated conversions
at the rate selected by the CLKS field in burst mode automatically */
if (Burst_Mode_Flag) {
Chip_ADC_SetBurstCmd(_LPC_ADC_ID, ENABLE);
}
Interrupt_Continue_Flag = 1;
ADC_Interrupt_Done_Flag = 1;
while (Interrupt_Continue_Flag) {
if (!Burst_Mode_Flag && ADC_Interrupt_Done_Flag) {
ADC_Interrupt_Done_Flag = 0;
Chip_ADC_SetStartMode(_LPC_ADC_ID, ADC_START_NOW, ADC_TRIGGERMODE_RISING);
}
}
/* Disable burst mode if any */
if (Burst_Mode_Flag) {
Chip_ADC_SetBurstCmd(_LPC_ADC_ID, DISABLE);
}
/* Disable ADC interrupt */
NVIC_DisableIRQ(_LPC_ADC_IRQ);
}
More details, please refer to the lpcopen code, or refer to my attached adc.c file.
If you still have question, please let me know!
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------