Looking for a MCU with “accurate” ADC - Page 1
Forum section: electronics / general

author: T.
author_rank: Newbie
timestamp: August 17, 2018, 08:30:26 am
content: Hello!I need to measure several voltages and temperatures for monitoring, fan control, over temperature shutdown and under voltage shutdown. The measurements do not need to be very precise, buttotal error should less than ±5%(1% of range and 4% of reading) for a temperature range of-20°C to 65°C. Since the voltage divider also has an error, the ADC must have a less than1% offset error and less than 3% gain error.First I thought that this is a relaxed specification, since most modern MCU have multi-channel ADCs with 10 Bit or more resolution, but then I tried sum-up the error of the internal reference, temperature drift and long term drift. Either I could not found the specification (e.g. ADC is only specified for TA = 25°C or short after calibration) and/or the internal reference voltage was very inaccurate with up to 4% error.Can anybody recommend a MCU with good ADC with >7 input channels?Alternative a MUX ADC.-Thomas

author: ogden
author_rank: Super Contributor
timestamp: August 17, 2018, 09:00:33 am
content: Quote from: T. on August 17, 2018, 08:30:26 amCheck MSP430, those with factory calibration data segment in the flash. Feeling tells that reference/ADC calibration will "fix" your problem. BTW many other uC have factory cal data for their bandgap reference. Drift of bandgap and ADC combined usually is 100 ppm/oC or so.

author: mikerj
author_rank: Super Contributor
timestamp: August 17, 2018, 09:28:03 am
content: The Analog Devices ADuC parts have some very high spec analog peripherals, though you do pay for the privilege.

author: jpanhalt
author_rank: Super Contributor
timestamp: August 17, 2018, 09:50:05 am
content: Quote from: T. on August 17, 2018, 08:30:26 amI'm not sure I agree with your calculation of total error based on the sum of independent errors. You may well be over estimating the error of 1% + 5%. Lots of references on this subject as it occurs frequently. Here's just one:http://lectureonline.cl.msu.edu/~mmp/labs/error/e2.htmEdit: Maybe a trivial example will help you see that. Flip a coin. The error in coming up heads is 50%. If you flip two coins, the error in coming up both heads is not 100%.

author: T.
author_rank: Newbie
timestamp: August 17, 2018, 12:27:04 pm
content: The MSP430 looks very promising.ADuC is an overkill. (too expensive to big packet)I forgot to to mention: the price should be below 2$ and the packet should be small (20 to 32 PINs)ogden is rigth. Self calibration will fix my problem, but it needs to be periodic calibration.Since the monitoring can't be stopped, the calibration has to be done in between the normal measurement.With calibration a STM32 should be fine to.

author: snarkysparky
author_rank: Frequent Contributor
timestamp: August 17, 2018, 12:35:58 pm
content: put a stable voltage reference on the board and read it periodically. Calibrate on the fly..

author: AndyC_772
author_rank: Super Contributor
timestamp: August 17, 2018, 12:52:40 pm
content: ...or pick a microcontroller which lets you use an external reference directly. Many micros give the choice of using the supply, the internal reference, or an external reference voltage.

author: wraper
author_rank: Unknown
timestamp: August 17, 2018, 01:10:19 pm
content: Look at Silicon Labs EFM8BB series and if not sufficient at EFM8LB series. You could also get rig of some external components needed because analog part is quite flexible. Specs in the datasheets are given at full operating temperature range.

author: Siwastaja
author_rank: Super Contributor
timestamp: August 17, 2018, 01:45:23 pm
content: Your target accuracy should be easy to achieve. You are almost there with uncalibrated, lowest cost internal references on most MCUs, but as you have found out, not quite.For low unit cost but higher and more risky development costs, go for calibrating the inaccurate internal reference. Plus side is, you calibrate all effects including reference, ADC and external components at once. Only long-time drift is left. Minus side is, developing the calibration equipment and code takes some time.I have done this a few times: a peltier-based oven and software-controlled, calibrated power supply (or a lower-accuracy controllable power supply coupled with higher accuracy software-readable multimeter) can easily generate you test vectors in about an hour - the oven needs to be sized for the batch size so that the calibration doesn't slow down your manufacturing process, causing more cost than it saves.In my case, I needed to measure voltages between 2.5 and 4.2V at temperatures between -20 degC and +60 degC using cheap MCUs, so IIRC, the test vector for the calibration setup was something like this:T1 = +3 degCT2 = +25 degCT3 = +50 degCV1 = 2.6VV2 = 3.4VV3 = 4.1V(each voltage measured at each temperature)Then, using extrapolation and interpolation, I'd get:- Voltage offset- Voltage gain- Temperature coefficient for voltage offset- Temperature coefficient for voltage gainIf this sounds tedious and/or risky, or you are not comfortable creating such a complex manufacturing line, consider using external reference already specified well within your tolerance over worst case conditions. Do the same for the resistor divider. As your reference will be costing at least $1, you can easily upgrade your $0.001 1% resistors to $0.05 0.1% resistors. Sometimes, you can find 0.5% resistors almost for 1% prices.And, indeed some microcontrollers come with manufacturer calibration data for the reference and ADC. With your own setup, you can do better (and calibrate for external effects as well), and are not locked in to these few product lines that provide such data. But the cost and risk in building your own calibration line is self-evident.In your case, however, a simple single offset compensation, even without temperature compensation, could be enough to satisfy your requirements. This would be easy in production, using one single software-readable DMM and a bit of code.

author: wraper
author_rank: Unknown
timestamp: August 17, 2018, 01:56:26 pm
content: Quote from: Siwastaja on August 17, 2018, 01:45:23 pmEFM8BB has ± 1.8% vref in full -40o+85(or 125)oC temperature and full Vcc range starting from $0.30

author: Gribo
author_rank: Frequent Contributor
timestamp: August 17, 2018, 02:03:13 pm
content: There is also the MSP430AFE2xx family. Basically, a Sigma Delta ADC with an MCU. It also supports external VREF.

author: ogden
author_rank: Super Contributor
timestamp: August 17, 2018, 02:03:23 pm
content: Quote from: T. on August 17, 2018, 12:27:04 pmNo. It does not need to be periodic. Those on-die references does not drift away over time so much (at given temperature). Your <= 4% application will be fine definitely. You want two point temperature calibration and compensation, that's it.

author: splin
author_rank: Frequent Contributor
timestamp: August 18, 2018, 01:06:21 am
content: You can use almost any MCU with an ADC - you'd have to be trying quite hard to not meet +/-5% without calibration! Don't let the tail wag the dog - choose the micro based on more important factors such as familiarity, development tools, support, availability etc.The internal references are often rather poor so if it isn't accurate enough then amost all (all?) MCU's allow you to use Vdd as the reference - either through an analog supply voltage pin Vdda (or the like) or directly from Vdd (Vdda may be internally connected to Vdd on small packages). Many low cost regulators are available with output tolerances of +/-2% including initial tolerance and full temperature range. Eg. the AP2022 cost < 7 cents:https://www.avnet.com/shop/us/products/diodes-inc/ap2202r-33tre1-3074457345631341369?CMP=EMA_Octopart_inventoryfeed_VSE?aka_re=1Additional error will come from output load current regulation, amongst others, but that may well not be much of an issue as the load current will be often be pretty constant when you are taking measurements with the ADC. Noise may be an issue but lots of averaging may suffice.If that isn't good enough the AS431 (or AP431S) is a 2.5V .5% reference with maximum .4% deviation over -40 to +85C. It costs < 4 cents:https://www.avnet.com/shop/us/products/diodes-inc/as431antr-g1-3074457345625002707?CMP=EMA_Octopart_inventoryfeed_VSEThere are many other TL431 variants but this has the best temperature spec as far as I can see and is also the cheapest.If you don't want to spare an ADC input to measure the reference you could use it to supply the micro directly (<100mA) or buffered using a transistor or even a voltage regulator. This has the extra benefit of saving the cost of the regulator. Be aware though that TL431 references can be a bit tricky wrt stability so some care would be required.All solutions will have long term drift to contend with but this is often poorly, or not specified for low cost devices. I don't think I've ever seen a drift spec greater than 120ppm per sqrt(1000) hours for references which equates to .08% over 5 years so probably not a big concern. When specified it is usually at 25C so a regulator running rather hotter would likely be worse so some Arrenhius calculations might be in order.Your 1% offset allowance is very high - I expect most MCU ADCs have specs of 2 or 3 LSBs offset at most so < .3% for a 10 bit device and probably rather less than .1% for most.I'd be careful about your 1% allowance for voltage divider error; if the divider ratio is 1:9 or less the error approaches twice the tolerance of each resistor. So a 1% error would require each resistors to remain within .5% of nominal over life which is a challange unless you are buying relatively expensive parts. Eg. Yaego RT series .1% thin film are around 4 cents, but look at the specs for the various drift factors: .5% max for soldering, another .5% for 1000hrs load life at 70C, add .5% max for humidity exposure, plus .5% for low temperature exposure, vibration, board flexing etc. etc.And then there's the shelf life stability, assuming the resistors spend most of their life at benign temperatures - but that is rarely specified for lower cost parts. You could easily get to 2% or more over the life of the equipment depending on which factors you choose to include. In reality you are extremely unlikely to suffer such drift but 1% is easily possible.Vishay Beyschlag 25ppm .1% MMA0204 cost around 15 cents from Digikey but have much better stability specs so .5% total drift over life should be easily achievable.

author: nctnico
author_rank: Super Contributor
timestamp: August 18, 2018, 01:59:38 pm
content: Quote from: T. on August 17, 2018, 08:30:26 amLook at NXP LPC1000 series together with a low thermal drift regulator.

author: NorthGuy
author_rank: Super Contributor
timestamp: August 18, 2018, 03:28:54 pm
content: By the description of your tasks (and by your requirements) you don't need much. The internal VREF may be very inaccurate (probably adequate for fan control, but still won't meet your suggested requirements). if you have a regulated power supply, you can use VDD as a voltage reference. It will be accurate enough coupled with almost any ADC in the market. Most ADCs will let you to use VDD as a reference. If not, you can always measure either a single point VDD/2 or multiple references (such as 0.25*VDD and 0.75*VDD) and scale all the other measurements accordingly.Nearly any MCU with analog function (such as a small $0.50 PIC) will do the job.

author: lucazader
author_rank: Regular Contributor
timestamp: August 20, 2018, 03:01:52 am
content: STM32's ADCs have factory calibration data, as well as a vref channel that you can use to constantly update and scale your reading accordingly.In my projects i just have the vref channel setup so that it reads the reference whenever other adc readings are taking, and then it always scales the data output accordingly.

author: ebclr
author_rank: Super Contributor
timestamp: August 22, 2018, 01:44:04 am
content: Take a look on this oneNice AD, and Full LCD supporthttp://www.ti.com/product/msp430f6736a?keyMatch=mcu%2024%20bit%20adc&tisearch=Search-EN-Everything

author: wraper
author_rank: Unknown
timestamp: August 22, 2018, 01:53:44 am
content: Quote from: ebclr on August 22, 2018, 01:44:04 amTwice of the max acceptable price and 3 times more pins than needed (op asked for small footprint). And who cares about LCD which is not there.Quote

author: ebclr
author_rank: Super Contributor
timestamp: August 22, 2018, 12:15:25 pm
content: Also you can check 8051F350, and PIC18F87J72

author: ogden
author_rank: Super Contributor
timestamp: August 22, 2018, 09:07:54 pm
content: Quote from: ebclr on August 22, 2018, 12:15:25 pmWhich part of requirement "packet should be small (20 to 32 PINs)" you did not understand?

author: technix
author_rank: Super Contributor
timestamp: August 22, 2018, 09:15:25 pm
content: I would also prefer calibrating the internal ADC - in fact I would even forgo the entire analog chain and calibrate against the actual input signal directly as a transfer function. You don't even need to know the actual transfer function, just assume a polynomial since all transfer function can be approximated using its term-truncated Taylor series. Run usual program directly but program a unity transfer function coefficients first during calibration, inject some known signals and record the outputs, now solve for the coefficients in the polynomial transfer function and write them into the nonvolatile configuration memory.

author: ebclr
author_rank: Super Contributor
timestamp: August 24, 2018, 05:23:13 pm
content: I didn't read anything about low pin count or packing, did you?"Looking for a MCU with “accurate” ADC« on: August 17, 2018, 06:30:26 pm »Say ThanksReplyQuoteHello!I need to measure several voltages and temperatures for monitoring, fan control, over temperature shutdown and under voltage shutdown. The measurements do not need to be very precise, but total error should less than ±5% (1% of range and 4% of reading) for a temperature range of -20°C to 65°C. Since the voltage divider also has an error, the ADC must have a less than 1% offset error and less than 3% gain error.First I thought that this is a relaxed specification, since most modern MCU have multi-channel ADCs with 10 Bit or more resolution, but then I tried sum-up the error of the internal reference, temperature drift and long term drift. Either I could not found the specification (e.g. ADC is only specified for TA = 25°C or short after calibration) and/or the internal reference voltage was very inaccurate with up to 4% error.Can anybody recommend a MCU with good ADC with >7 input channels?Alternative a MUX ADC.-Thomas"

author: ogden
author_rank: Super Contributor
timestamp: August 24, 2018, 06:35:11 pm
content: Quote from: ebclr on August 24, 2018, 05:23:13 pmWhat about this post from OP?Quote from: T. on August 17, 2018, 12:27:04 pm Funny that you did not even try to use search to find where sentence I mention "packet should be small (20 to 32 PINs)" comes from

author: vini_i
author_rank: Regular Contributor
timestamp: August 24, 2018, 08:10:47 pm
content: QuoteTrue calibration before installation and recalibration after operation is performed in a controlled environment. The device would have to be removed, attached to reference equipment, verified, adjusted, reverified, and then put back in service. It is not practical to try and calibrate equipment that is performing measurements.Because you are using a uC it is possible to create a script that interacts with the uC and reference equipment. This could make the calibration/recalibration super fast but the device would still have to be removed from operation.

author: mikerj
author_rank: Super Contributor
timestamp: August 24, 2018, 10:02:43 pm
content: Quote from: ogden on August 24, 2018, 06:35:11 pmNo-one should need to search a page to find all the requirements of someone asking for help, they should be in the first post. If they change, or additional requirements need to be added then the first post should be amended. It prevents exactly this kind of thing.

author: splin
author_rank: Frequent Contributor
timestamp: August 25, 2018, 02:14:05 am
content: Quote from: mikerj on August 24, 2018, 10:02:43 pmNo no no!!!!!!Let me repeat that -No no no!!!When posts get substantially edited the whole thread can collapse into total confusion. The whole history is lost and it becomes impossible to know what subsequent responses were responding to because the time relationship between all the posts in a thread are lost.Some clearly documented minor edits, such as typos, are ok. It might be acceptable to mark part of a post specifically as containing information that may be kept up to date (such as the multimeter specs table) but that still risks some posters viewing, and possibly acting upon one version of the data and others seeing a later, different version with lots of potential for confusion.Updating a post is great for viewers who encounter the post for the first time after the last update but is terrible for those who revisit or follow a thread, potentially (if they care enough), requiring them to reread the whole thread every time they come back to it.

author: technix
author_rank: Super Contributor
timestamp: August 25, 2018, 03:11:47 am
content: Quote from: splin on August 25, 2018, 02:14:05 amIf only the forum software can support a revision history feature for the posts...

author: splin
author_rank: Frequent Contributor
timestamp: August 25, 2018, 05:13:18 am
content: Quote from: technix on August 25, 2018, 03:11:47 amIf only. That could be a really useful feature for the forum administrators in the event of a legal case whereby they have to reconstruct the exact time of events that occurred in a discussion leading to a criminal episode.Fortunately the forum software doesn't support 'a revision history feature for the posts' - through the UI - because it is so much simpler and more obvious, for those who aren't members of the 'revisionist illuminati', to work out what is going on by reading the thread.

author: technix
author_rank: Super Contributor
timestamp: August 25, 2018, 09:41:39 am
content: Quote from: splin on August 25, 2018, 05:13:18 amIf I recalled it right, Github’s discussion is constructed as a giant Git repo with each post and edit being a commit in it. This does allow viewing the full history of all posts using the Git blame feature.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: August 28, 2018, 12:58:54 am
content: Quote from: wraper on August 17, 2018, 01:56:26 pmThat sounds like a very good fit. SiLabs have good Analog performance.