AnsweredAssumed Answered

The B-side analog channel inputs of ADC0 in LPC55S69 can't convert normally

Question asked by L JX on Dec 5, 2019
Latest reply on Dec 15, 2019 by L JX

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?

 

Outcomes