Timing records disagree with elapsed time while stepping the program, yet the measured crystal frequency is normal. Determine whether the debugger stopped the processor, a particular counter, or the entire acquisition path. A debugger pause is a different condition from production operation.
This example uses an in-house isolated low-voltage counter board, synthetic inputs, and approved debug settings. It is unconnected to production controls or external systems, and production protection and access settings remain in place. A crystal supplies a controller reference in the example. The clock tree establishes whether a given timer uses it and how the controller multiplies and distributes that clock.
A peripheral may run while the processor is halted
A breakpoint can stop program execution. Some chips allow selected peripherals to freeze during a processor halt while others continue. This depends on the device and configuration. Sharing a system clock does not imply identical halt behavior. The crystal can keep oscillating when one peripheral stops counting.
The inverse is also possible. Software stops processing while hardware clocks and counters continue. On resume, one read may return a large elapsed interval, including time the processor spent halted. A hardware chain may continue generating samples that software cannot service, leading to gaps later. Compare counter readings and actual samples with the pause record instead of relying on the debugger cursor.
Connecting a debugger, hitting a breakpoint, single-stepping, and a normal startup with the debugger detached are four conditions. Distinguish behavior that appears whenever the debugger is connected from behavior that occurs only after a halt. Keep firmware and host settings fixed across comparisons before assigning a difference to clock frequency.
Example: three seconds at a breakpoint can produce different counts
Suppose a peripheral normally counts at 1 kHz, one tick per 1 ms. An independent timer measures a five-second test including a three-second halt. If the peripheral continues and does not overflow, its count ideally increases by 5,000 ticks. If configured to freeze while the processor is halted, it counts for the other two seconds and ideally increases by 2,000 ticks. The crystal can remain active in both cases.
A software loop counter advances only when execution reaches a specified point. Pauses, debugger actions, and handling queued events after resume can alter its relationship to a peripheral counter. A 3,000-tick discrepancy does not show that the crystal frequency changed during the three seconds. These are synthetic timings and exclude transition boundaries, instrument resolution, and real chip response latency.
To verify a design intended to record every millisecond, capture a continuous run without breakpoints. Use an approved debug state separately to characterize freezing. One test qualifies the product's acquisition cadence and the other identifies what the tool changes.
Record the boundaries needed to reproduce the results
Run the development board as intended for production with the same synthetic input, board revision, and firmware. If possible, use an independent test point or approved logs to check that the board reference stays active. Next, connect the debugger without halting. Run a third test in the designated debug state. For each run, record whether a breakpoint was hit, halt duration, timer behavior, and which sample sequence numbers were received after resume. Averaging these runs would hide the different test conditions.
| Observation | What to record | What it establishes |
|---|---|---|
| External timing | Start, end, and pause window on a common trigger | Independently observed elapsed time |
| Board reference | Actual frequency, probe point, and enable state | Whether the oscillator lost its output |
| Peripheral and software | Input timing, count, resume state, execution point | Distinguishes freeze, backlog, and lost samples |
| Debug configuration | Firmware version, attached or halted state, configuration scope | Separates debug effects from production qualification |
A single post-resume value cannot prove how many valid samples were acquired during the halt. Keep external synthetic-event sequence numbers and observe whether the events arrive through a suitable independent path. Counting may continue even if reads and printing occur only after resume. A late log entry does not establish a late sample. Repeat the same input in an approved continuous mode to see whether the symptom is confined to debugging.
A clock purchase requirement cannot stand in for runtime conditions
SCTF's 3X series from mainland China consists of passive quartz crystals and covers 8 MHz. It is a lead for an appropriate circuit, without identifying an original part in a particular acquisition board. Confirm full part number, frequency, equivalent series resistance, load capacitance, drive, package, and temperature range. Engineering should use approved methods to verify startup, operating states, and output frequency on the actual circuit.
If the clock meets device requirements in continuous and debug modes and the symptom occurs only during a halt, correct the test configuration and interpretation first. If clock loss, supply faults, or repeated resets occur without breakpoints, investigate those hardware observations separately. Component acceptance needs electrical measurements. Product release needs operating results under the required conditions.
Document the state used for production regression. To measure time from power-on to continuous acquisition, use a supported observation method that leaves system operation intact or compare against existing approved records. Breakpoints locate execution steps. Their elapsed time does not establish normal production performance. Keep debug logs separate from uninterrupted runtime records.
Record how each repeat ended, including whether the fixed acquisition length completed normally or after a manual halt and resume. If attaching the debugger changes results even without a halt and the firmware is the same, check its effect on operating modes and measurement load. Do not reuse breakpoint count corrections for a different state.
When sharing the log with purchasing, identify both the conditions under which the component clock was verified and the debug state in which the application issue occurs. Keep sample lots, probes, board revisions, and environments traceable. The appropriate teams can then fill the separate specification and test gaps.
Frequently asked questions
Does an unchanged timer value at a breakpoint show the crystal stopped? The peripheral may have frozen. Measure the reference independently and verify which clock the counter actually uses.
Why can stepping pass while continuous acquisition loses samples? Stepping changes processor timing relative to peripherals and can mask normal system load. Repeat in the specified continuous mode with sample sequence numbers, then locate the loss in generation, readout, or reporting.
