This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Reduce noise on ADC12

Other Parts Discussed in Thread: MSP-TS430PN80USB, MSP430F5529

Hi guys,
I'm using the MSP430 ADC12 function to make analog to digital conversion. But seems like the digital value I get always not the same. For example for a fixed voltage value, I get, 13058, 13018, 13099, 13045, 13078... and so on all different. Is it the noise that make the value fluctuated? If yes, how do we reduce the difference / noise of each value?

  • Hi, you should ensure that all the different settling times of the parts within the controller are considered. E.g. you will only get a stable conversion result if the reference voltage has settled....

    Another topic is the complete application. I mean how the sensor is connected to the MSP430. The PCB layout should be optimized and the backup capacitors should be used. Especially the corner of the chip where all the analog pins are located should be defined in a way that digital noise do not disturb the signals. You can also improve the conversion results by reducing noise on the chip while conversions are done - I mean switch of the CPU (e.g. LPM0).

    It is also a good idea not to connect the JTAG tools why you test your performance of the ADC. The JTAG connection causes additional noise in the system that may affect the AD conversion results.

    Regards.

  • Hi Voyager,

    When you say 

    Voyager said:

     You can also improve the conversion results by reducing noise on the chip while conversions are done - I mean switch of the CPU (e.g. LPM0).

     

    Does this mean you will get better conversion results while in LPM0? I looked through the users guide and I could not find a reference to this. Is from experience or is there an App note regarding this?

    Thanks,

    Barry

  • Gaston_Melo_Arg said:

    You can do an oversampling http://focus.ti.com/mcu/docs/litabsmultiplefilelist.tsp?sectionId=96&tabId=1502&literatureNumber=slaa323&docCategoryId=1&familyId=342

    there's a lot of threads in this forum about this issue.

    Regards

    Gastón

    Thanks for the suggestion about oversampling.

    Actually, I got try the oversampling method already. I used ADC12 and oversampled it to 16bit. But after oversampled, even though the noise had been reduced and the difference of the values had been cut down, the data are still fluctuated. Is there anyway I can reduce the noise further?

  • can you be more specific about what are you doing? You are using your own board or kit?

    Regards

    Gastón

  • Steven Gan Teck Yik said:
    Actually, I got try the oversampling method already. I used ADC12 and oversampled it to 16bit. But after oversampled, even though the noise had been reduced and the difference of the values had been cut down, the data are still fluctuated. Is there anyway I can reduce the noise further?

    Well, oversampling to 16 bit only works if you have a pink noise generator or a waveform generator that overlaps your signal. If you don't have this, you cannot oversample, only average, and it does not increase the bit depth. I talked about this in detail in another recent post.

    If you already did 'oversampling' (actually averaging 256 samples, I assume, from your 'increase to 16 bit' statement), then you have an average over 256 times the samling time. If your signal is still 'noisy' the question is: how much signal and how much noise do you have on the input? Do you have a 'signal' at all? or is the noise part louder than the signal part?
    In this case, you'll need to do statistical analysis or digital filtering (not jsut averaging) the values.
    If you have a DC signal that changes really slow, you can apply an external filter (a series resistor and a capacitor) to form a low-pass filter. Then you don't need the averaging at all (which simply is another, digital, low-pass filter)

    It's vital to knoe your signal and the type of noise you have. Each type of noise/distortion requires its own type of filter.

  • Hi blb,

    I also have not seen such a recommendation in TI's official documentation. This is more an experience I made during my works. For sure, it also depends on the device itself - there are devices that are better or worse....

    Regards.

  • blb said:
    Does this mean you will get better conversion results while in LPM0?

    On devices without a separate AVCC pin (or no decoupling of AVCC) and no separate GND routing of AVss., goign into LPM0 will stop the small current peaks caused by the processor operation. These have a small but noticeable influence on the reference as well as on the GND signal level (remember: current*resistance= voltage, so any current consumed causes GND to change based on the GND line resistance, and any change in ths current causes GND and therefore your reference base to pulsate)

  • Gaston_Melo_Arg said:

    can you be more specific about what are you doing? You are using your own board or kit?

    Regards

    Gastón

    Hi sir.

    Actually I'm using the MSP-TS430PN80USB board from TI as testing. How is this board do in term of noise?

  • Jens-Michael Gross said:

    If you have a DC signal that changes really slow, you can apply an external filter (a series resistor and a capacitor) to form a low-pass filter. Then you don't need the averaging at all (which simply is another, digital, low-pass filter)

    It's vital to knoe your signal and the type of noise you have. Each type of noise/distortion requires its own type of filter.

    Is the low pass filter something like this? http://en.wikipedia.org/wiki/File:RC_Divider.svg

    Then, what is the resistor and capacitor value that is suitable?

  • uff... the MSP-TS430PN80USB board... that's one of the target boards where the MSP430 is placed in a socket. That's for sure not an ideal design to get stable AD conversion results. Are all the caps soldered on the board? I am thinking about the caps for the reference Vref, and the supply voltage. When you do your ADC test disconnect the JTAG tool! For an optimal design it would be good to get rid of the socket - but this means you have to do your own PCB.

  • Voyager said:

    uff... the MSP-TS430PN80USB board... that's one of the target boards where the MSP430 is placed in a socket. That's for sure not an ideal design to get stable AD conversion results. Are all the caps soldered on the board? I am thinking about the caps for the reference Vref, and the supply voltage. When you do your ADC test disconnect the JTAG tool! For an optimal design it would be good to get rid of the socket - but this means you have to do your own PCB.

    I'm still in testing stages so I need the JTAG on board to connect it with a MSP430 USB Debug Interface (MSP-FET430UIF) to do debug from CCS4.

    Yes, all the caps are soldered except the caps of the external crystal of course.

    The reference voltage I use for this testing is the internal reference voltage of 2.5V.

    So, is there anyway to reduce the noise in this settings?

  • ok... having the JTAG tool connected while doing ADC performance measurements is not a so good idea. I saw in the past (in different MSP430 devices) issues when JTAG communication was in progress.The reason for this may be the bad PCB layout of the target boards...

    What I would try is to improve the supply voltage of your setup. I assume you use the JTAG to supply the board. I would remove the JTAG supply and use a battery to supply the MSP430. Maybe taking a look into the target board layout makes also sense. Look for digital signal lines that are routed in the area where the analog signals are... If you find any try to keep these signals lines quiet....

    Maybe it could also help to wait a little bit longer as soon as you switch on the analog components on the MSP430. Usually you ensure that the settling times are considered in your program. Because of the parasitics on the target board this may take a little bit longer....

  • Voyager said:

    What I would try is to improve the supply voltage of your setup. I assume you use the JTAG to supply the board. I would remove the JTAG supply and use a battery to supply the MSP430. Maybe taking a look into the target board layout makes also sense. Look for digital signal lines that are routed in the area where the analog signals are... If you find any try to keep these signals lines quiet....

    Then how am I going to debug and see the various conversion values from CCS4 if the JTAG is removed?

  • Steven Gan Teck Yik said:
    Then how am I going to debug and see the various conversion values from CCS4 if the JTAG is removed?


    What about a good old serial connection that sends the data to the PC? Of course, attaching an LCD looks nicer, or an LED display.
    In the early stages of exploring the 5438 years ag, I just used a digital I/O pin to transmit a 16 bit value as the length of the high and low pulse. My external digital counter was nicely showing me the resulting two bytes (increaseed by 1, so I could transfer 0-bytes).

    Be creative!

  • During a chip characterization usually special boards with optimized analog performance are used. For example, for INL and DNL measurements there are often logic analyzers used that read the conversion results from a parallel interface (e.g. from digital I/O ports).

    For an application it may already help to do a reset having an external battery and USB tool disconnected. The ADC results could be stored in RAM after a while when the RAM is full (e.g. a LED is switched on) the JTAG tool could be connected to the running target. I think MSP430 supports this and then it would be possible to read out the data.

    For sure, a more elegant solution is to do an optimized board where the communication interface is included in a way that does not interfere with the analog measurements ....

  • Ok. I'll try.
    Another thing, I notice that the the difference of the ADC value that I convert out with the multimeter value I measure is around 0.01V. For example, if my multimeter show 1.50V then the ADC value I get will be 1.49V. Is this normal? Or is it my multimeter got problem? How do we know the ADC value we get is accurate?

  • Steven Gan Teck Yik said:
    For example, if my multimeter show 1.50V then the ADC value I get will be 1.49V. Is this normal?

    Unless you use expensive calibrated equipment, yes. Typical multimeters have an error of +-1% of the maximum reading. So on 2V, +-0.02V are normal.

    Steven Gan Teck Yik said:
    Or is it my multimeter got problem?

    Not per definition of the multimeter performance.

    Steven Gan Teck Yik said:
    How do we know the ADC value we get is accurate?

    By calibration. With evenmore expensive calibration equipment.
    Or by defining the allowed error margin wide enough (then it is accurate by definition).

    usually, the absolute readings are always more or less incorrect. The datasheet of a multimeter tells you, how incorrect it may be while the multimeter is still not to be considered defect.
    The more important thing often is the relative accurace. If the last digit of a multimieter reading changes, the abolute value may be incorrect by some %, the relative change, however, will be what it seems to be.

    As a rule of thumb: Analog measurement is always inprecise. The only question is: how much? And this shoudl be specified in a datasheet.

  • Ok. Thanks for the info sir.

    Another thing, so is it true that I can only have 12 channel (A0-A7, A12-A15) to measure external value for ADC12? Can the other 4 channel (Veref+, Vref-/Veref-, Temperature diode, AVcc-AVss/2) be use to input external value?

  • Dear Steven,

    Yes it is true.

    you can have only 12 channels to measure the external inputs. others are for References and Temperature sensor.

    Milap

  • You can have the reading fluctuation problem in your measurement, connect the 0.1uF Box capacitor between your ADC channel Pin and AVSS Pin.

    we have tried out the thing and we got the stable reading. Not even single bit change. we got the throughout linearity of our Full scale values.

    Milap

     

  • milap patel said:

    You can have the reading fluctuation problem in your measurement, connect the 0.1uF Box capacitor between your ADC channel Pin and AVSS Pin.

    we have tried out the thing and we got the stable reading. Not even single bit change. we got the throughout linearity of our Full scale values.

    Milap

     

    Is it? But mine have fluctuation. Is it because of connection problem? Because I connect my components onto a breadboard / protoboard. Is direct solder would be better?

  • ADC is a very critical thing to handle.

    always it is better to connect the component to ADC pin with shortest parth/connection. so it is better that fix/solder it with nearest to adc pin.

  • I'm using the MSP430F5529 mcu and I set it to use the internal reference voltage of 2.5V for the ADC.
    Now are we able to tap out it's internal reference voltage of 2.5V and measure using multimeter? Is there some output for it or pin so that I can measure? Cos I can't seem any from the datasheet.

  • I've found out that the internal reference voltage can be output at a pin Vref+ after searching the datasheet and you need to enable the reference output register ADC12REFOUT. Then I can measure the +Vref pin which is exactly 2.5V with my multimeter.

    But now the problem is the ADC12 conversion result is not accurate anymore for any channel. Before I enable the  ADC12REFOUT register, when I measure 2V with the ADC, I can get the raw value for example 3310 from one of the channel which is quite accurate. But now I only get raw value around 205 which is way below the actual value. Why? Is it that there are other settings that comes with ADC12REFOUT register? Or is it that ADC12REFOUT register is not suppose to be use like this? Cos when I disable it, I can get the accurate value again.

  • Dear Steven,

    Yes you can monitor the internal reference at VREF+ PIN. for that you have to write REFOUT = 1 in REFCTL register 0. see adc section in user guide, they have clearly mention the thing.

    PUT 1 in REFOUT bit. and measure it by multimeter at VREF+ PIN

     "When REFOUT = 1, the reference is available at the VREF+ terminal, as well as,
    used as the reference for the conversion and utilizes the larger buffer. When REFOUT = 0, the reference is only used as the reference
    for the conversion and utilizes the smaller buffer."

     

     

  • Dear Steven,

    Now i got your point,

    You can see the datasheet page no 71 & 72

    6663.msp430f5529.pdf

    Use capacitor at Vref+/- Pin for avoid settling error when REFOUT = 1.

    (1) The reference is supplied to the ADC by the REF module and is buffered locally inside the ADC. The ADC uses two internal buffers, one
    smaller and one larger for driving the VREF+ terminal. When REFOUT = 1, the reference is available at the VREF+ terminal, as well as,
    used as the reference for the conversion and utilizes the larger buffer. When REFOUT = 0, the reference is only used as the reference
    for the conversion and utilizes the smaller buffer.
    (2) The internal reference current is supplied via terminal AVCC. Consumption is independent of the ADC12ON control bit, unless a
    conversion is active. REFOUT = 0 represents the current contribution of the smaller buffer. REFOUT = 1 represents the current
    contribution of the larger buffer without external load.

    (3) The temperature sensor is provided by the REF module. Its current is supplied via terminal AVCC and is equivalent to IREF+ with REFON =1 and REFOUT = 0.

    (4) Contribution only due to the reference and buffer including package. This does not include resistance due to PCB trace, etc.
    (5) Two decoupling capacitors, 10μF and 100nF, should be connected to VREF to decouple the dynamic current required for an external
    reference source if it is used for the ADC12_A. See also the MSP430x5xx Family User's Guide (SLAU208).
    (6) Calculated using the box method: (MAX(-40 to 85°C) – MIN(-40 to 85°C)) / MIN(-40 to 85°C)/(85°C – (–40°C)).
    (7) The condition is that the error in a conversion started after tREFON is less than ±0.5 LSB. The settling time depends on the external
    capacitive load when REFOUT = 1.

     

  • Thanks for trying to explain there milap.

    But I do not use +Vref for external reference voltage. Let me explain my condition to you again.

    In the beginning, everything is fine where I can get my ADC raw value of around 3310 from my mcu when I measure 2V and my reference voltage for this is the internal reference voltage of 2.5V. When I calculate the voltage value of 3310 which is 2.5*(3310/2^12) = 2.02V and this is quite accurate.

    Now out of curiosity, I want to measure the internal reference voltage of 2.5V which I set just now to see whether it is really 2.5V using a multimeter. So, I need a pin from the mcu which output the internal reference voltage of 2.5V. From the datasheet I found out that you can put ADC12REFOUT=1 and the internal reference voltage of 2.5V will output at P5.0 which is pin 9 of this MSP430F5529.

    So after I put ADC12REFOUT=1, my ADC raw value result when I measure 2V is not accurate anymore. My value drop to only around 205. Which ever channel (A0-A15) I try also the same. That is way below my previous value which is 3310 before I put ADC12REFOUT=1. I did not change anything from the coding and the hardware besides the ADC12REFOUT.

    So why is that? Is there any other setting I need to configure to get the value correct again?

  • Further testing, I found out that you need to put ADC12RES=1 for the ADC12CTL2 register. Only then I can get back the accurate raw value which is around 3310. Does ADC12RES related to ADC12REFOUT? Is this method correct?

    From the datasheet, ADC12RES is for setting resolution and ADC12RES=1 set it to 10 bit only. But I thought the default resolution is always 12 bit?  Please explain guys.

  • Steven Gan Teck Yik said:
    From the datasheet, ADC12RES is for setting resolution and ADC12RES=1 set it to 10 bit only. But I thought the default resolution is always 12 bit?

    The ADC12 can be set for 8, 10 or 12 bti resolution. Since a conversion requires 1 clock cycle more than the resolution is, 8 bit conversion, if sufficient, is 4 clock cycles faster. Teh ADC simply skips the last 2 or 4 conversion steps if ADC12SR is 1 or 0. (teh default is 2 and 12 bit resolution, but some people accitentally overwrite this).

    However, I wonder how you can get a result value of 3310 if ADC12RESi is 1. The maximum value should be 1023 then.

    What could explain the increased stability is that the conversion on 12 bit is 15% shorter. That means the reference voltage is stressed 15% less before the ADC goes into sampling cycle and the reference is released.

    IIRC, the errata sheets for almost all 5x family devices contain an entry that you need to output the reference and attach external capacitors if you run the ADC on >2MHz ADC12CLK. (the default is ADC12OSC with 6MHz).

**Attention** This is a public forum