Hi All,
i have a LPC4088 and the Developer’s Kit board. I would like to get two AIN running. One works but if i just double the command it doesn't work:
pinmode_s ADC_IO = { .port = 0, .pin = 24, .mode = 1};
#define ADC LPC_ADC
#define ADC_CH 1
#define ADC_INTCH ADC_ADINTEN1
#define ADC_NVIC_IRQ ADC_IRQn
PINSEL_SetPinMode(ADC_IO.port, ADC_IO.pin, ADC_IO.mode);
PINSEL_SetAnalogPinMode(ADC_IO.port, ADC_IO.pin, true);
ADC_Init(ADC, 200000);
ADC_ChannelCmd(ADC, ADC_CH, ENABLE);
ADC_IntConfig(ADC, ADC_INTCH, ENABLE);
ADC_StartCmd(ADC, 1);
uint16_t val = ADC_ChannelGetData(ADC, ADC_CH);
So this is the relevant code for 1 channel. What i did is literally double the code and change the channel and naming a bit like:
#define ADC2 LPC_ADC
#define ADC_CH2 2
#define ADC_INTCH2 ADC_ADINTEN2
#define ADC_NVIC_IRQ2 ADC_IRQn
or
ADC_Init(ADC2, 200000);
ADC_ChannelCmd(ADC2, ADC_CH2, ENABLE);
ADC_IntConfig(ADC2, ADC_INTCH2, ENABLE);
or
ADC_StartCmd(ADC2, 1);
With breakpoints i know it stops right after i try to get the value of the first channel.
Does somebody has any idea what i do wrong?
Thanks!!
All the best,
Jan