If firmware programs the MCP2515-I/SO for a 16 MHz oscillator and the board actually runs at 8 MHz, the nominal CAN bit rate falls to half the configured value as long as the CNF settings stay the same. Check the actual oscillator frequency, read back the timing registers, and compare the calculated bit time with a capture. Successful SPI reads establish that the host can exchange data with the controller. The CAN timing still needs its own check.
1 Identify the oscillator on the board you are testing
Start with the populated board. Record its revision and look up the fitted crystal or external clock source in the matching bill of materials and schematic. Check the marking against those records. If you are working with a module, use the module revision and fitted part alongside the controller marking. Two assemblies with the same controller order code can use different clock sources.
Look up the oscillator frequency the driver used when it chose the CNF values. A bit rate option in an application or configuration file can be paired with a separate oscillator option. Record both. The host processor clock and SPI serial clock belong in separate fields. Changing the SPI clock changes the host interface timing. The CAN time quantum comes from the MCP2515 oscillator and its configured prescaler.
If the board exposes CLKOUT, use it to check the controller clock where the circuit allows. Confirm that CLKEN is enabled, the pin is selected for clock output, and the CLKPRE setting is known. Convert the measured output back to the oscillator frequency using that divider. The shared output can carry the start of frame signal when selected for that function, so identify its mode before interpreting a trace.
An example is a 4 MHz CLKOUT measurement with a divider of two. That gives an 8 MHz oscillator frequency if the pin is in clock output mode. Save the setting and the measurement together. A clock measurement without the divider can make a correctly configured oscillator look like another hardware variant.
2 Recalculate CAN bit time from the CNF readback
Use the CNF1 BRP field as an encoded value. Call the value in BRP[5:0] b. The effective prescaler factor is b+1, and the time quantum TQ in seconds is 2 × (b+1) / FOSC, with FOSC in hertz. Register 5-1 in the Microchip data sheet gives this relationship. With b equal to zero, the effective factor is one.
Count the time quanta in the complete bit. The synchronization segment, propagation segment, phase segment 1 and phase segment 2 together give the total N. Multiply N by TQ for the nominal bit time. Its reciprocal is the nominal bit rate. With the same prescaler field and the same segments, halving the oscillator frequency doubles every time quantum and the full bit time.
For this calculation, use 1 TQ for synchronization, 5 for propagation, 6 for PS1 and 4 for PS2. Assume BTLMODE is set to one so that CNF3 selects PS2, and use an SJW of 1 TQ. The total is 16 TQ and sampling occurs after 12 TQ, at 75% of the nominal bit time.
| Actual FOSC | BRP field b | Bit time | Nominal bit rate |
|---|---|---|---|
| 16 MHz | 1 | 4 µs | 250 kbit/s |
| 8 MHz | 1 | 8 µs | 125 kbit/s |
| 8 MHz | 0 | 4 µs | 250 kbit/s |
These rows illustrate a frequency mismatch and one way to recover the same nominal rate in that example. The 4 TQ PS2 covers the assumed 1 TQ SJW. Confirm the propagation delay budget and sample point against the real bus before adopting any timing. A driver may choose a different valid segment combination for the same nominal rate.
Write CNF1, CNF2 and CNF3 in Configuration mode. Verify the actual mode through the OPMOD field in CANSTAT and read back all three registers. If another initialization step overwrites them, calculate from the values that remain in effect for the test. Save the readback beside the target rate so the next person can reproduce your calculation.
3 Separate SPI, controller timing and the physical bus
Begin with an isolated bench setup, a known peer at the target nominal bit rate, and an analyzer. Observe a known frame and measure an identifiable bit cell. A single flat portion of the trace can span several bits, so use the frame pattern or a suitable decode to identify the interval. A repeatable bit time of about 8 µs instead of 4 µs in the example gives you a concrete reason to revisit the oscillator and CNF values.
Internal Loopback mode routes a message from the transmit buffer to the receive path inside the controller. A passing loopback gives you evidence for the path that test exercised. Check actual Normal mode, the external transceiver, the bus connection and the peer separately. Record whether the peer was operating normally and able to acknowledge a frame.
| Observation | Check next |
|---|---|
| CNF readback differs from what was written | Actual Configuration mode, SPI chip select and the write sequence |
| Measured bit time is about twice the expected value | Oscillator frequency, encoded BRP field and effective segment lengths |
| Internal loopback passes but bus traffic fails | Actual operating mode, transceiver state, wiring and termination |
| Bit rate matches but there is no ACK | Whether a known peer is in a mode that can acknowledge |
If the board uses an MCP2551-I/SN, check the transceiver's own supply and operating conditions. Capture the corresponding signal at TXCAN and on the bus side of the transceiver. Comparing both points can help locate where an expected signal stops. A correct TXCAN bit time alone leaves the bus path and the peer untested.
If the host is an STM32F103C8T6 and it never begins the SPI transactions, first confirm it is running the intended application. The STM32 boot pin setup guide covers that separate startup check. Once the application is running, return to the controller and bus measurements.
4 Record the hardware and firmware combination that passed
Save the board revision, actual clock source, firmware build, CNF readback and bus capture in one test record. Include the observed bit time and the known peer's configured rate. A technician repeating the check can then identify whether the controller configuration changed, the assembled board changed, or the measurement conditions changed.
When a repair uses another module revision, check the fitted oscillator before loading the same firmware configuration. Repeat the test at the required CAN rate and confirm traffic in both directions under the project's test conditions. Record whether the result covers a bench sample or the specific board revision and firmware combination you intend to use.
Microchip lists MCP2515-I/SO as an industrial temperature device in an 18-lead SOIC package. Keep that full controller order code distinct from the module identifier, the fitted oscillator and the transceiver order code. A quotation for the controller identifies the chip. Ask for a separate assembly line item if you need a module built to a particular clock and board revision.
The technical references are Microchip data sheet DS20001801K, Sections 5, 8 and 10, and the product identification section. The example table contains nominal calculations from the documented timing relationship.
Include the full MCP2515-I/SO order code, quantity, board revision and fitted oscillator frequency in your request. For a repair or sample validation, add the required package and target CAN bit rate. Send the controller and transceiver order codes to SUNTEC as separate BOM lines so they can be checked separately.
Prepared by the SUNTEC Technical Team at Suzhou SUNTEC Electronics Co., Ltd.