I run the adc demo at the path of "NXP.LPCXpresso55S69_BSP.12.0.1\driver_examples\lpadc\interrupt\cm33_core0\mdk".
The ADC0_0(A-side mux, connected to PIO0_23) convert normally.
However, when i change the code to using ADC0_8(B-side mux, PIO0_16), the Conversion results is always 0.
The following is the configuration I modified:
1. change the channel (the line 24 of "lpadc_interrupt.c"):
#define DEMO_LPADC_USER_CHANNEL 8U
2.configure the PIO0_16(the line 69 of "pin_mux.c")::
const uint32_t port0_pin16_config = (/* Pin is configured as ADC0_0 */
/* No addition pin function */
/* Standard mode, output slew rate control is enabled */
/* Input function is not inverted */
/* Enables analog function */
/* Open drain is disabled */
/* Analog switch is closed (enabled) */
/* PORT0 PIN23 (coords: 20) is configured as ADC0_0 */
IOCON_PinMuxSet(IOCON, 0U, 16U, port0_pin16_config);
3.change the sample Channel Mode (Set conversion CMD configuration in the "lpadc_interrupt.c") :
mLpadcCommandConfigStruct.sampleChannelMode = kLPADC_SampleChannelSingleEndSideB;
So I want to know why the Conversion results is incorrect.
Is my operation wrong?
I think the ADC0 pin description is incorrect,
PIO1_9 is B-side mux, analog input channel 4
PIO1_0 is B-side mux, analog input channel 3
PIO0_12 is B-side mux, analog input channel 2
PIO0_11 is B-side mux, analog input channel 1
PIO0_16 is B-side mux, analog input channel 0
Pls have a try.
Thank you for your reply .
I have a try according to the pin description you proposed, and I think you are right.
After i change the channel number for B-Side mux pins, the ADC0can run normally.