A 3.3 V ATmega328P board starts oscillating after a 20 MHz crystal is fitted, and a test program appears to run. Production qualification still has two separate questions. Does the actual system clock fit the device's supply voltage? Does it stay in the permitted range from the beginning of reset through firmware initialization? The frequency marked on the crystal answers neither question by itself.
Put 3.3 V and 20 MHz on the same plot
Microchip DS40002061A section 29.3 plots maximum frequency against VCC. The chapter specifies electrical characteristics for −40 to 85 °C. The figure shows 10 MHz at 2.7 V and 20 MHz at 4.5 V, with a linear boundary between those endpoints. At 3.3 V, the interpolation is 10 + (3.3−2.7)/(4.5−2.7) × 10, or about 13.3 MHz. Running the system clock directly at 20 MHz falls outside the plotted region.
Use the lowest voltage expected at the microcontroller supply pins. Suppose the board has a nominal 3.3 V rail, ±5% static tolerance and an additional 0.10 V drop at worst load. The low end is 3.3 × 0.95 − 0.10 = 3.035 V. The same plot gives approximately 11.86 MHz at that voltage, about 1.47 MHz below the value obtained using only the nominal rail. These tolerance and drop figures are examples. In a real review, use the regulator's guaranteed limits and the measured pin-level transient. Check the relevant speed-grade data for a different device grade or temperature range.
Trace the 20 MHz oscillator to the system clock
Read the actual fuses, including clock source and CKDIV8. Then inspect where the bootloader and application change CLKPR. Microchip's System Clock Prescaler section defines the reset settings. With CKDIV8 programmed, the initial division is by eight. If the selected oscillator mode and board circuit support 20 MHz, the initial system clock is then 2.5 MHz. A subsequent divide-by-two setting gives 10 MHz. Check that frequency at the minimum voltage in the design. If any stage switches to divide by one, the system runs at 20 MHz. Verify whether that transition can occur at 3.3 V or while the supply is still rising.
Also verify the conditions for the selected oscillator or external clock input mode. A passive crystal has its own requirements for frequency range, load capacitance, ESR and start-up. Dividing the downstream system clock to 10 MHz leaves the crystal circuit running at 20 MHz, so qualify that circuit separately. A probe can add enough capacitance to change an oscillator waveform. When practical, use the supported clock-output function or a programmed diagnostic waveform for the system-frequency measurement.
Recalculate interfaces after changing the divider
Consider a target of 9,600 baud using the asynchronous USART in normal-speed mode. With a 10 MHz system clock, use fosc/[16 × (UBRR + 1)]. UBRR = 64 gives about 9,615.38 baud, or +0.16%. If the firmware still uses UBRR = 129, as it might for a 20 MHz clock, the board running at 10 MHz produces about 4,807.69 baud. When a serial connection fails after a clock change, check the actual system clock and register setting before adjusting the other endpoint. Then evaluate the total link error budget, including the other device.
Check timers, PWM, SPI and loops that depend on execution time as well. Document the clock during boot and during normal operation. If the bootloader uses a serial interface before the main application's USART initialization, qualify that stage against its own clock setting. In production, check the fuse values and the firmware image after programming, since those choices affect clock speed independently of the board assembly.
Define what purchasing and engineering will approve
When the goal is faster processing, start with the minimum supply, the permitted CPU clock, and the interface or timing requirements affected by a change. That determines whether to choose another crystal, change the prescaler, or redesign the supply arrangement. If the project keeps a 20 MHz crystal and runs the system at 10 MHz on its existing rail, record the approved crystal specification, oscillator mode, initial prescale and application prescale together. Before raising the MCU supply, check the logic levels and power sequencing of the 3.3 V peripherals.
Capture evidence in stages. First mark the lowest intended supply and the system operating frequency on the applicable curve. Then capture supply, reset and a clock indicator at the project's cold start, worst load and supply-transient conditions. Finally check the actual interface rates and functions after initialization. A room-temperature program run supplies evidence for that specimen and condition. A design outside the rated region needs a change or a device with a guarantee for the intended combination.
During a supply dip, compare the clock that is actually running with the supply at the chip. The plotted boundary for 10 MHz is 2.7 V. If a relay causes a momentary dip to 2.6 V, check whether the MCU is already held in reset or is still executing at 10 MHz. A steady multimeter reading misses that interval. If the design uses brownout detection, check the guaranteed levels and response conditions for the selected threshold. If execution persists after the supply crosses the limit, revise the supply, reset supervision or clock settings.
