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 */
IOCON_PIO_FUNC0 |
/* No addition pin function */
IOCON_PIO_MODE_INACT |
/* Standard mode, output slew rate control is enabled */
IOCON_PIO_SLEW_STANDARD |
/* Input function is not inverted */
IOCON_PIO_INV_DI |
/* Enables analog function */
IOCON_PIO_ANALOG_EN |
/* Open drain is disabled */
IOCON_PIO_OPENDRAIN_DI |
/* Analog switch is closed (enabled) */
IOCON_PIO_ASW_EN);
/* 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?
Hi,
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.
BR
XiangJun Rong
Hi,
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.
BR
LJX