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

Why a PIC16F18446 produces two 3 MHz periods from one stable 16 MHz oscillator

A 16 MHz active oscillator feeds a PIC16F18446 and its numerically controlled oscillator produces three megahertz. A long-gate counter shows the expected mean, while a scope period histogram has two clear clusters. Reporting the spread as oscillator jitter would attribute a digital scheduling effect to the reference. Count input cycles between output edges first, then determine whether the resulting signal meets the receiver's needs.

Output edges follow integer input cycles

The PIC16F18446 numerically controlled oscillator adds a fixed increment to its accumulator each clock. In fixed-duty mode, each accumulator overflow toggles the output. Two overflows form a full period. The average toggle rate can be programmed finely, but the output still changes on module clock events. If the desired toggle spacing is fractional, adjacent integer spacings produce the intended average.

Use a compliant external clock mode with a 16 MHz active oscillator and verify the NCO uses the sixteen-megahertz system clock. A twenty-bit accumulator has a modulus of 1,048,576. An increment of 393,216 is three eighths of that. The mean overflow rate is six megahertz and the fixed-duty output is three megahertz. Read back the actual module clock selection before using the oscillator label in this calculation.

The input period is 62.5 nanoseconds. With a three-eighths increment, eight input cycles produce three overflows. Starting the illustrative accumulator at zero gives overflows on cycles three, six, eight, eleven, fourteen, and sixteen. Alternating edges are two or three input periods apart, so an individual high or low can be 125 or 187.5 nanoseconds. Rising edges are separated by five or six input cycles, or 312.5 and 375 nanoseconds. Because each eight-cycle block toggles an odd number of times, the full logic sequence repeats every sixteen input periods. That is one microsecond and contains three output cycles.

Capture both waveforms together

Capture the external clock and NCO output at appropriate high-impedance measurement planes. Where accessible, check the actual MCU input as well as the source output. Set a sample rate that can resolve transitions and record thresholds and channel deskew. Compare consecutive rising-edge intervals, then collect a longer histogram. If peaks are separated by approximately 62.5 nanoseconds with no corresponding anomaly at the input, verify the accumulator behavior before considering a source substitution.

Record individual high and low durations alongside the period histogram. If a receiver needs a high time of at least 140 nanoseconds, a 125-nanosecond high in the example violates that condition, even at the correct mean frequency. Long-term average duty may be near fifty percent while some individual cycles are asymmetric. A receiver specification should cover the minimum valid high and low time and allowable period variation. A display average cannot replace those values.

For a separate check, set the increment to one quarter of the modulus. An overflow then occurs every four input periods, and fixed-duty mode produces one cycle per eight input periods. With the same 16 MHz active oscillator, mean output is two megahertz and both halves are 250 nanoseconds. A multi-peak distribution at three megahertz that becomes one peak here supports the scheduling explanation. If this change fails to explain the result and input edges also look abnormal, inspect the reference path and buffers.

Check trigger bias too. Save every edge from several full repetitions without triggering selectively on short or long periods. In the example, three consecutive steady periods contain intervals of five, five, and six input cycles in some order, depending on capture start. An apparently equal population can come from too short a record or missing intervals between segments. Verify continuous event coverage before interpreting histogram counts.

Use the evidence to assess a substitution

When comparing two oscillator samples on the same board, keep the increment, input supply, output mapping, and probing unchanged. Compare input frequency and stability before comparing output clusters and sequence. A small source frequency change scales all expected intervals. It cannot remove their inherent distribution. A much longer interval, such as nine input cycles or more with unchanged settings, calls for checking edge acquisition, pin mapping, or an unexpected module restart.

Record clock selection, increment, output mode, expected period groups, and receiver minimum pulse width. Save an interval covering a full repeated pattern to compare the relative counts with the calculation, so one particularly long or short cycle does not dominate judgment. If each cycle must be nearly constant, choose a clock scheme that fits the receiver. Tighter tolerance at sixteen megahertz does not remove time quantization in the NCO.

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.