Specialist Supplier of Crystals & Frequency Control Componentssales@mecxtal.com.cn0755-26500570
MERLIN home / Rednote / Measurement and Acceptance

Why does each ESP32-S3 ADC channel get one-third of the sample rate with a healthy 40 MHz crystal?

A fixture first records one channel at more than 20,000 results per second. After adding two channels to the ESP32-S3 continuous sequence, the same calibration tone traverses three times as many periods on the plotted time scale. The 40 MHz quartz crystal still measures correctly. Count by ADC unit and channel tag, then verify sample spacing against an independent signal. Normal channel scheduling and buffer loss can both thin a channel's results, but call for different corrections.

Find out which channel supplied each result

The Espressif hardware design guide specifies a 40 MHz main crystal. The continuous ADC driver separately configures an expected sampling frequency and a channel pattern. DMA records can carry the ADC unit, channel, and raw value, and the driver delivers conversion frames. The 40 MHz quartz crystal supplies the underlying reference. Host callback rate, overall conversion rate, and each channel's sample rate measure different stages. Counting callbacks confuses a frame with a sample. Counting all channel tags together hides the share going to one channel.

Use a single supported ADC unit and a pattern with three distinct channels, each present once. Suppose the measured aggregate is 24,000 conversions per second, with stable round-robin operation and no drops. Each channel gets about 8,000 results per second. A one-channel pattern can give the entire rate to that input. If software still assigns 24,000 samples per second to the filtered single-channel data, the time axis shrinks by a factor of three and a 1 kHz test tone appears at 3 kHz.

Verify both rates with one analog signal

Apply an independently verified 1 kHz signal with suitable range and bias to the first input. Drive the others with distinct stable DC levels. Verify on a scope that the input is not clipping or picking up line interference through the fixture. Use an independent two-second window, excluding incomplete frames at start or stop. Save raw records and parsed tags. A host task timestamp for a buffer is not the acquisition time of each sample.

At 24,000 total conversions per second, a full two-second window holds about 48,000 records, 16,000 per channel. At 8,000 per second, the 1 kHz signal occupies about eight samples per cycle. The one-channel case gives about 24. Estimate the period over a full waveform window and check that the original tags repeat the selected pattern. Small frame-count differences near the boundaries warrant a consistent gate definition before being interpreted as frequency error.

Return to one, two, and three channels without changing the nominal aggregate setting. Keep the measured rate per channel and total result count. If total rate remains stable, the pattern shares records as expected, and reconstructing with the actual channel rate restores 1 kHz, the explanation is sample allocation and labeling. The inputs are not acquired simultaneously. Here the ideal spacing is about 41.7 µs between consecutive conversions and 125 µs between samples from one channel. Use a shared test signal to measure channel skew if phase is a requirement.

Separate ordinary round-robin operation from dropped data

The driver documentation explains that the result pool can overflow and that a read can return fewer bytes than requested. Apply the busiest product load and retain overflow events and actual byte counts. If channel order remains periodic while the total drops, look at the frame pool, reader, and reporting tasks. If only one channel looks wrong, check ADC unit and channel in the raw stream. Invalid records and confusing bytes with results can cause errors during parsing.

Give the non-tone channels different fixed DC levels in a control run. Their codes independently identify the records even if a parser misaligns the tags. If the one-channel run maintains the expected count while three channels overrun the pool, check whether handling each record costs more with three channels enabled. When low-power settings can change clock conditions, record the driver version and its power-management constraints and check the actual timing. A slow user-task read alone does not establish a changed ADC rate.

For fast signals, verify whether the remaining per-channel rate is sufficient. The recoverable bandwidth per input drops as more channels are added, so calculate analog filtering from the actual channel rate. Try one tone comfortably inside the required band and one near its edge to identify aliasing. The same aggregate rate does not preserve the earlier single-channel filter and spectral acceptance conditions.

Use the same independent generator and channel pattern for chamber runs. Avoid changing buffer size while changing the crystal. If data loss at a new temperature occurs only during bulk reporting, record both temperature and host load and examine the overflow events. Preserve the requested and measured rates. The exact integer passed to the configuration does not establish the resulting count in each second.

Keep the independent 40 MHz crystal reading, nominal and observed aggregate rate, pattern, and per-channel counts in the acceptance record. If the original and candidate crystals both pass and the effect follows pattern position or buffer load, correct acquisition or parsing. Investigate the clock chain and crystal if the sample-rate change still tracks an independently verified reference shift under the same configuration and with complete data.

References

WeChat

MERLIN · TIMING COMPONENTS

Scan with WeChat to contact Sales

Add our WeCom contacts from your usual WeChat app.

On desktop, scan with your phone. On mobile, save the QR image and select it from your album in WeChat Scan.