ADC output fluctuation in LPC54608J512BD208 microcontroller

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ADC output fluctuation in LPC54608J512BD208 microcontroller

1,304 Views
prasannanaik
Contributor III

Hi,

I am using LPC54608J512BD208 microcontroller in an application.

The ADC accuracy is crucial as the product is used in a Power protection segment.

I am getting fluctuations in ADC output with constant DC input. The datasheet claims max error of 4.5LSB but i am getting more than 10 counts fluctuations as shown in the results below.

I have performed some experiments on the OM13092 development board to check the problem observed on LPC546 microcontroller. We have found fluctuations in the development board as well.
Details of connection/board configuration:
   1) Channels used ADC0_4 (J12/2),ADC0_5 (J12/4) & ADC0_6 (J12/6)
   2) Evaluation board: OM13092
   3) Power: Debug port J8 of OM13092
   4) Core clock: 100 MHz (External 12MHz crystal frequency stepped up through PLL)
   5) ADC clock: 1 MHz (Synchronous)
   6) ADC sample time number = 7 
   
   
Experiment 1: GND from P3 of OM13092 connected to ADC0_4, ADC0_5 & ADC0_6
ADC channel
                  ADC output
MinMax
ADC0_4010
ADC0_506
ADC0_605
Fluctuations of 10 count with GND input

Experiment 2: 1.65V DC generated through a Voltage divider circuit of 10K each fed to channel ADC0_4
                            3.3V(J10/12) of OM13092 and GND (J10/18) is used to dirve the voltage divider network.
ADC Channel
ADC Output
MinMax
ADC0_520412053
Fluctuation of 12 count with a fixed DC input.
I have also attached the code for your reference.
Please help in resolving the issue.
Two issues have been identified so far in LPC546 controller :
1) PE Micro debugger causes fluctuations in ADC output in custom board:
   I have used uart to verify the issue of PE Micro debugger.

Card 1:

 

Input Voltage(V)ADC Channel
With PE Micro
Without PE MIcro
MinMaxMinMax
1.65 V (DC)

ADC0_02014207520472051
ADC0_42020206420452054
ADC0_52032205820462051
ADC0_62016206020482056
ADC0_72021205620462052
ADC0_82018205120412048

Card 2:

 

Input Voltage(V)ADC Channel
With PE Micro
Without PE MIcro
MinMaxMinMax
1.65 V (DC)

ADC0_02010206620462052
ADC0_42035206120472054
ADC0_52031206220452051
ADC0_62025205920502056
ADC0_72019205620462052
ADC0_82037204920412048

2) Fluctuations in ADC output even on LPC546 board as explained earlier.
Kindly help in addressing these issues.
Thanks & best regards,
Prasanna
Labels (1)
0 Kudos
5 Replies

1,164 Views
frank_m
Senior Contributor III

Do you have the separate and stable VDDA, and not connected to VDD ?

Have you tried to observe VDDA during the conversions, with and without the debugger ?

One should keep in mind that mixed chips like MCUs (with both analog and digital functionality) are always a compromise - usually sacrificing accuracy/noise performance for BOM costs.

A debug pod will use the internal JTAG periphery, and thus have an impact on current consumption.

0 Kudos

1,164 Views
prasannanaik
Contributor III

Hi frankmeyer‌ & xiangjun.rong‌,

I had started a similar query few months back on NXP forum.

https://community.nxp.com/thread/518705 

I have recently shared a firmware which is causing me problem even on the development boad of NXP.

I am using OM130920 development board.

Can you look at that query as well and check if you find anything from that?

Thanks & best regards,

Prasanna

0 Kudos

1,164 Views
prasannanaik
Contributor III

Hi,

Further observations on LPC546 ADC on LPC546 evaluation board (OM13092):
1) I was trying to observe the ADC fluctuation on sample driver code (ADC interrupt) on a single channel i.e ADC0_4.
    The sample code has a core clock of 180MHz derived from FRO_12Mhz through PLL. Ths clock is stepped scaled down by a factor  of 3  and used as ADC clock.
    When 0V is connected to ADC0_4, the ADC output varies from 32 to 34.
2) When the core clock is changed to 48MHz FROH and ADC clock is scaled down by a factor of 3(i.e 16 MHz), the adc output varies from 0          to 1 for a 0V input
3) In experiment 2, if all the printf code is commented then the ADC output fluctuates from 0 to 9 counts for a 0V input.
4) In the code shared earlier in this mail chain (100 MHz core with ADC operating at 1MHz), i have modified the code to sample a single              channel i.e ADC0_4. When the interrupt mode is kept at ADC_INTERRUPT_AFTER_ENTIRE SEQUENCE, the ADC output varies from 0 to 12      counts whereas it varies by only one count if interrupt mode is kept at ADC_INTERRUPT_AFTER_EACH_CONVERSION. 
    However, while sampling multiple channels in a sequence, this interrupt mode setting doesn't produce any difference i.e. ADC output            varies by more than 10 counts.
I have attached the codes used in experiment 4.
Thanks and best regards,
Prasanna
0 Kudos

1,163 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Prasanna,

From the description, I see that two factors take effect on the ADC sample fluctuation if you sample DC voltage.

1)High ADC clock frequency leads to the sample fluctuation

2)If you sample single channel, the sample fluctuation is okay. If you sample multiple channels in ONE sequence, the fluctuation for ONE DC channels is a bit big.

For the first factor, I think it is a rule that lower ADC frequency can improve the sample fluctuation. For the second factor, I am not sure.

I think it is okay from software perspective that the TSAMP bits is set up as 7, and you use 1MHz ADC clock.

BTW, I suggest you do software  ADC calibration before sampling and check if it can improve the sample fluctuation.

From hardware, I suggest you connect a RC(100 ohm and 2.2nF cap) circuit on each ADC analog channel.

pastedImage_1.png

As you know that the ADC sample fluctuation is complex, I do not guarantee it can solve the issue. anyway, pls have a try.

BR

XiangJun Rong

0 Kudos

1,164 Views
prasannanaik
Contributor III

Hi xiangjun.rong‌,

1) I have tried changing the ADC clock to 1 MHz and 500 KHz but no improvement.

     I have attached the firmware for 1 MHz ADC clock for OM13092 board.

     Can you please check the code at your board. 

     I have attached the picture of the test set up as well.

     I have connected ground as input to ADC0_4 channel.

2) Ideally, entire sequence sampling also should not cause any problem as per the ADC specifications of LPC546.

Thanks & best regards,

Prasanna

0 Kudos