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

Tracing the Actual Timer Clock on a 24 MHz Board With a 12 MHz Peripheral Bus

A timer’s registers can sit on a bus without being counted at the bus frequency. Identify the timer’s actual input before using the register-interface clock to calculate an update interval.

An owned industrial acquisition board generates periodic internal requests. The diagnostic screen reports a 12 MHz peripheral bus. That would suggest one request every 200 µs if the timer ran at that rate, but the offline record shows a request every 100 µs. The external 24 MHz oscillator did not double in frequency. When the peripheral bus is divided, some microcontrollers can supply some timers on a separate route at twice the peripheral bus rate. Check the clock tree before diagnosing a crystal at an exact two-to-one discrepancy.

The register interface and counter need not use the same frequency

The processor needs bus access to timer registers, while the counter needs an input that advances it. Those functions can use different clock distribution paths. In one implementation, an undivided peripheral bus yields a timer input equal to the bus clock. When the bus prescaler is not one, the timer input can equal twice the bus rate. External inputs, other clocks, and timer-specific settings can also apply. This is one device rule, not a rule for every controller or timer.

This is not a guarantee that a crystal replacement will make the timer always run twice as fast. The ratio belongs to the internal distribution state. Changing clock source, bus prescaler, or module selection can change the relation. System and bus frequencies alone cannot establish the timer input.

Separate the distribution ratio upstream of the timer from the timer’s internal prescaler and count settings. They affect the interval at different stages. Combining them without distinction can multiply an error when a power-saving mode changes the tree. Trace the path from the known reference to the update event.

Hypothetical example: the same count gives two answers

This is a low-voltage timing calculation, not a register-programming recipe. Assume a 24 MHz reference and a 48 MHz internal system clock in the specified mode. One peripheral bus is divided by four to 12 MHz. Under the timer rule above and with that internal source selected, the timer input is 24 MHz instead of 12 MHz.

Assume no further timer prescaling and 2,400 effective counts per desired period. Then 2,400 ÷ 24,000,000 seconds gives 100 µs. Using 12 MHz in the denominator gives 200 µs, exactly twice as long. The example uses effective counts rather than a register value. Counter start and end values, direction, and update-event definitions determine how a field value maps to effective counts.

Calculation pointAssumed valueWhat the value describes
External reference24 MHzInput to the controller clock tree
System clock48 MHzVerified internal upstream frequency
Peripheral bus12 MHzBus that hosts the registers
Timer input24 MHzCounting frequency for this example
2,400 effective counts100 µsTheoretical acquisition-request interval

An exact two-to-one ratio can also arise from a different edge definition, such as counting both edges for one event or generating two logs in one application loop. Verify whether the observation is a hardware update or a host action. If clock routing is correct, investigate counter and event interpretation.

Verify the 24 MHz reference at its own input point

If the board needs a 24 MHz, 1.2 V, single-ended CMOS oscillator, SCTF SX2M24.000E20F30THN is a starting candidate. Confirm the complete order code, supply, levels, temperature, and effective load. This does not identify any commercial controller’s parts or establish that the signal reaches the timer directly. Some operating modes may instead use an internal oscillator.

The nominal reference period is about 41.67 ns. A correct reading there does not establish every downstream divider. A doubled final event rate does not establish an incorrectly marked frequency. Verify the input, internal selection, and event individually before filing a material report. Do not ask an oscillator supplier to guarantee the controller’s firmware routing.

Assign each verified frequency to a node

On an owned isolated low-voltage setup or from offline logs, record hardware revision, mode, timer instance, and the applicable clock diagram. Use approved read-only records to verify actual selection. Keep external reference, system clock, bus, timer input, and counted result separate. If a stage cannot be observed directly, label a value derived from documentation and conditions as calculated.

Verification pointRecordMisinterpretation to avoid
Reference inputFull code, test point, and operating conditionsInferring a bad part from application request timing
Peripheral busSource, division, and active modeUsing register-bus rate as count rate
Timer inputInstance, actual source, and supported multiplierApplying another controller generation’s rule
CounterPrescaler, effective counts, and event definitionDouble-counting endpoints or edges
ApplicationSeparate times for request and acquisitionConfusing a correct timer with data-processing delay

If purchasing specifies one acquisition per 100 µs, clarify whether that means triggering, completing, or receiving usable data. The events can be separated in time. Verify board events under specified modes and verify the external frequency source against its own electrical requirements. Keep the supplier commitments distinct.

Frequently asked questions

The bus and timer report the same frequency. Can we assume the next revision does too? No. Divider settings or source selection may change even if the external reference does not. Keep the current path and verify the next revision on the same basis.

Does doubling a software delay fix the problem? It may change a downstream observation without explaining the hardware event rate. Identify the timing requirement and verify the path and result before closing the issue.

Map each frequency to a node and calculate the period with a consistent count definition. Investigate oscillator quality when the external reference shows an independent, reproducible anomaly.

Under the same hypothetical rule, suppose the system clock stays at 48 MHz and the bus changes from undivided to divide-by-two. The bus changes from 48 MHz to 24 MHz, but the timer can still use 48 MHz because it moves from the equal-rate path to twice the bus clock. A bus-rate change therefore does not establish a timer-rate change. Keep both stages before and after the transition and report individual operating modes rather than an average.

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.