🎉 75% of content is free forever — Unlock Premium from $10/mo →
CW
NEWSLIVESearch All Content
đŸ’ŧ Servicesâ„šī¸ Aboutâœ‰ī¸ ContactView Pricing Plansfrom $10

ADC Modes, Sampling Rates, and Calibration

Microcontrollers & ARMADC, DMA and SerialđŸŸĸ Free Lesson

ADC Modes, Sampling Rates, and Calibration

What You'll Learn

  • 1Set resolution and sample time for a source impedance
  • 2Choose polling, interrupt, or DMA data handling
  • 3Trigger conversions from a timer for synchronous sampling
  • 4Calibrate and reference the ADC correctly

The analog to digital converter bridges the physical world and the register map, and its accuracy depends as much on configuration as on silicon. Resolution sets the quantization step, sample time sets how long the internal capacitor can charge through the source impedance, and the reference voltage sets the full scale. Conversion can run free, be polled, or be triggered by a timer so that measurements line up with PWM activity. Getting these choices right separates a stable reading from one that wanders with the code path.

Resolution, Sample Time, and Source Impedance

A typical successive approximation ADC offers twelve, ten, eight, or six bit resolution, where each extra bit doubles the conversion time and the required settling. Sample time is a number of ADC clock cycles during which the sample and hold capacitor connects to the input, and the resistor plus capacitor formed with the source impedance must settle within that window.

High impedance sources such as a bare thermistor need long sample times or an external op amp buffer, otherwise the reading depends on the previous channel and looks noisy or stuck. The conversion clock itself must stay inside the range from the datasheet, which usually means dividing the peripheral clock by four or more.

Triggers, Scan Sequences, and Alignment

Conversions can start on a software write, on an external trigger edge, or on a timer trigger output, and timer triggering is what aligns sampling to a PWM period for motor control. Scan mode walks a sequence of channels in order and stores results into a data register or into separate result registers, and continuous mode restarts the sequence immediately after it finishes.

Data alignment left or right decides how a twelve bit result sits in a sixteen bit register, and forgetting that produces readings off by a factor of sixteen. Regular and injected groups on some parts let a high priority sequence preempt the ordinary one, which is how current sensing interrupts a background voltage scan.

Calibration, References, and Error Handling

Most ADCs provide a startup calibration that measures internal offset and linearity and stores correction values; running it after enabling the peripheral costs little and removes a visible offset. The reference pins or internal reference determine full scale, so noise or drift on the reference appears directly in every reading. Internal channels such as the temperature sensor and the band gap reference give a known value to sanity check the whole chain.

Overrun occurs when a new conversion finishes before the previous result was read, and the flag must be cleared or the data path stalls. Moving results with DMA removes overrun for scan sequences entirely, which is the standard approach when several channels convert continuously.

ADC Configuration Settings

SettingRangeImpact
Resolution6 to 12 bitsStep size and conversion time
Sample timeA few to hundreds of cyclesSettling against source impedance
Trigger sourceSoftware, timer, or external pinAlignment with system events
Scan modeSingle channel or sequenceMulti channel acquisition
Data alignmentLeft or right shiftedHow the result maps into the register
Clock prescalerDivider from peripheral clockKeeps the ADC inside its clock range

Real-World Examples

  • Read a potentiometer — Use twelve bit resolution with a long sample time and average several conversions to reduce noise.
  • Sample currents in sync with PWM — Trigger the ADC from the timer update so conversion happens away from switching edges.
  • Scan four sensor channels — Enable scan with DMA so a full sequence lands in a buffer without any overrun risk.
  • Verify accuracy — Read the internal band gap channel and compare against the datasheet voltage to confirm reference behavior.

💡Match Sample Time to Impedance

If the source cannot charge the sampling capacitor within the sample window, no amount of averaging will fix the systematic error.

Common Mistakes

Ignoring source impedance

Fix: A high impedance divider with a short sample time produces readings that depend on the previously selected channel.

Forgetting to run calibration

Fix: Skipping the built-in calibration leaves an offset that shows up as a constant reading error.

Polling a fast scan sequence

Fix: Conversions outrun the CPU and set overrun; use interrupt or DMA transfer instead.

Key Takeaways

  • Resolution and sample time trade accuracy against conversion speed.
  • Timer triggers align conversions with PWM and control events.
  • Calibration and a clean reference set the real accuracy floor.
  • DMA removes overrun in scan and continuous conversion modes.

Frequently Asked Questions

Why does my reading jump when another channel converts?

The input has not settled, so the sample capacitor still holds charge from the previous channel; lengthen the sample time.

How fast can the ADC really run?

Total time is sample time plus conversion time per channel, divided into the conversion clock, minus any injected trigger slots.

Is the ADC reading absolute?

Only if the reference is known and stable; otherwise readings are a ratio of the reference voltage.

Interview Questions

Q1: Explain why a timer trigger matters for motor control.

Triggering ADC conversion from the timer centers sampling in the quiet part of the PWM period and synchronizes current reads with the control loop.

Q2: How do you size sample time?

Estimate the source resistance with the internal sampling resistance, compute the RC time constant, and choose a sample window of several time constants for settling.


Extended Learning: Beyond the Basics

Key Concepts Summary

This lesson covers fundamental concepts that serve as building blocks for more advanced topics. Master these basics before moving to intermediate and advanced material.

Prerequisite Knowledge

Before studying this topic in depth, ensure you understand:

  • Basic definitions and terminology
  • Core formulas and their derivations
  • Common applications in real-world scenarios
  • Typical pitfalls and misconceptions

Step-by-Step Walkthrough

Let us work through a complete example to solidify understanding:

Step 1: Identify the problem type. Determine which category this problem falls into and which approach is most appropriate.

Step 2: Apply the relevant formula. Substitute known values into the appropriate equation, paying attention to units and constraints.

Step 3: Simplify and solve. Work through the algebra step by step, checking each intermediate result.

Step 4: Verify the answer. Check that the solution satisfies the original conditions and makes logical sense.

Common Mistakes to Avoid

  1. Misidentifying the problem type — Always start by categorizing the problem
  2. Incorrect formula application — Verify the formula applies to your specific case
  3. Unit errors — Always check units are consistent throughout
  4. Sign errors — Pay careful attention to positive and negative values
  5. Rounding too early — Keep full precision until the final answer
  6. Forgetting constraints — Check that solutions satisfy all given conditions

Real-World Applications

Understanding this concept is essential for:

  • Advanced problem solving in examinations
  • Building intuition for more complex topics
  • Developing analytical thinking skills
  • Applying mathematical reasoning to practical situations

Practice Exercises

  1. Basic: Solve 5 problems of increasing difficulty using the core concept.
  2. Intermediate: Apply the concept to word problems with multiple steps.
  3. Advanced: Combine this concept with 2-3 other topics in a comprehensive problem.
  4. Challenge: Create your own problem that requires this concept plus additional knowledge.

Interview and Exam Tips

  • Common question patterns: Identify which exam or interview formats test this topic
  • Time management: Practice completing problems within time constraints
  • Common traps: Know the typical mistakes examiners set as distractors
  • Verification strategy: Develop a quick method to check your answer

Related Topics

Quick Reference Card

ConceptFormula/RuleKey InsightCommon Use
Core DefinitionSee main textUnderstand the intuitionFoundation for all applications
Key FormulaSee main textMemorize the derivationDirect problem solving
Special CaseSee main textRecognize when it appliesSimplifies complex problems
Edge CaseSee main textKnow the limitationsAvoids errors

Further Reading

For students who want to go deeper:

  • Standard textbooks on the subject
  • Research papers applying this concept
  • Online courses with video explanations
  • Practice problem collections with detailed solutions
CW

ChatWhole Learn Editorial Team

Written by experienced data scientists, software engineers, and educators. All content is reviewed by industry professionals to ensure accuracy and relevance.

Last reviewed: 2026-11-14

—
☆☆☆☆☆
0 ratings

Rate & Feedback

Need Expert Microcontrollers & ARM Help?

Get personalized tutoring, project support, or professional consulting.

Advertisement