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

Why can an MCP2518FD run at half the CAN bit rate with a healthy 40 MHz crystal?

An MCP2518FD board responds to SPI after a crystal lot change but no longer communicates with other CAN nodes. CLKO measures the frequency expected in the design notes, and the quartz unit is marked 40 MHz. The controller can divide the oscillator output separately for the clock pin and for its CAN engine. An expected CLKO reading alone does not establish the SYSCLK used in the bit-timing calculation.

Trace the two destinations in the oscillator diagram

Microchip lists suitable 40, 20 or 4 MHz crystal, ceramic resonator and external clock references. A 4 MHz reference can be multiplied by ten using the internal PLL. A 40 MHz crystal can use the direct reference path. CLKO divides that result by one, two, four or ten as programmed in CLKODIV. SCLKDIV separately divides SYSCLK by one or two for the CAN controller and RAM interface. Read both fields on known-good and failing boards.

With a 40 MHz reference and CLKO division by four, the normal clock pin output is 10 MHz. Changing just SCLKDIV can halve the CAN clock from 40 to 20 MHz without changing that 10 MHz measurement. An alternative configuration with a 20 MHz crystal and division by two at CLKO can also give 10 MHz. Record reference frequency, PLL status and both divisors together. Confirm the pin is configured for a continuous clock instead of the start-of-frame signal before interpreting a periodic reading.

Calculate the two timing configurations

Consider a network with a nominal rate of 500 kbit/s and a 2 µs bit. With 40 MHz SYSCLK and an actual prescaler value of one, a time quantum is 25 ns. A bit has 80 quanta. For a nominal sample point at 80%, 64 quanta precede that point. A sync segment of one, a first timing segment of 63 and a second of 16 give that arithmetic. This is an illustration. Check propagation delay, allowable register settings, synchronization jump width and the settings of the actual network.

If SYSCLK drops to 20 MHz without changing the prescaler or total of 80 quanta, each quantum becomes 50 ns. A bit now lasts 4 µs and the rate is 250 kbit/s. For the intended 500 kbit/s at 20 MHz, recalculation can use 40 quanta. A nominal 80% sample point then requires 32 quanta through the first segment and eight afterward. Check whether the registers store a quantity directly or encode one less. Review the CAN FD data phase as well, including its separate prescaler and sample point and the transceiver path's delay.

For a first-pass data-phase example at 2 Mbit/s, each bit lasts 500 ns. A prescaler of one gives 20 quanta at 40 MHz and 10 quanta at 20 MHz. A nominal 80% sample time is 400 ns in both cases, but moving it by one quantum changes it by 25 ns or 50 ns respectively. The achievable sample positions differ. Validate data-phase field limits, transceiver round-trip delay and transmitter delay compensation before accepting a configuration. Test with the real harness and the replacement transceiver.

SPI communication establishes that the host can reach the controller. Where feasible, capture chip select, TXCAN and the differential bus on one record. If the timing fields are correct but an external transmission never starts, check whether the controller remains in a nontransmitting mode or the transceiver is still in standby.

For scale, a hypothetical ±30 ppm 40 MHz crystal has an initial allowance of about ±1,200 Hz. A ±20 ppm grade would allow about ±800 Hz. At a fixed divider those contribute approximately ±15 and ±10 bits per second, respectively, near the nominal 500 kbit/s. This simple scaling does not set a network tolerance. It explains why a factor-of-two rate error is more likely to be a divider choice than a normal crystal tolerance difference.

Leave a record that supports the next decision

Read back OSC and both bit-timing settings in the field configuration. Note when the device enters and leaves Configuration mode and check for later writes that overwrite the result. In an isolated bench setup, observe a documented test frame at the transmit pin and on the bus. Identify the part of the bit pattern being used to measure timing and account for stuffing. Check both arbitration and data phases with a CAN FD-capable tool. Finally validate with the production harness and termination.

Repeat from cold power-on and after sleep. Confirm the PLL-ready state for boards using the 4 MHz reference and PLL, and review oscillator readiness and initialization on direct-reference boards as well. Keep the complete 40 MHz crystal configuration, load, drive allowance and startup requirements on the purchase side. A candidate active 40 MHz oscillator also needs a review of the external input connection, levels and supply. Engineering can retain reference type, synchronization settings, PLL and divider fields, and the measured bit widths by board revision. That record explains how two boards can have the same CLKO measurement and different bus rates, and helps determine whether the next fix is a component, a clock route or a bit-timing value.

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.