MCP2510 - Bit Timing
MCP2510 - Bit Timing
The Controller Area Network (CAN) protocol is an t bit = tSyncSeg + t PropSeg + tPS1 + t PS2
asynchronous serial bus with Non-Return to Zero
(NRZ) bit coding designed for fast, robust communica-
tions in harsh environments, such as automotive and Associated with the NBT are the Sample Point, Syn-
industrial applications. The CAN protocol allows the chronization Jump Width (SJW), and Information Pro-
user to program the bit rate, the sample point of the bit, cessing Time (IPT), which are explained later.
and the number of times the bit is sampled. With these
features, the network can be optimized for a given SYNCHRONIZATION SEGMENT
application.
The Synchronization Segment (SyncSeg) is the first
There are relationships between bit timing parameters, segment in the NBT and is used to synchronize the
the physical bus propagation delays, and the oscillator nodes on the bus. Bit edges are expected to occur
tolerances throughout the system. This application within the SyncSeg. This segment is fixed at 1TQ.
note investigates these relationships as they pertain to
Microchip’s CAN module and assists in optimizing the PROPAGATION SEGMENT
bit timing for given physical system attributes.
The Propagation Segment (PropSeg) exists to com-
pensate for physical delays between nodes. The prop-
THE CAN BIT TIME agation delay is defined as twice the sum of the signal’s
The CAN bit time is made up of non-overlapping seg- propagation time on the bus line, including the delays
ments. Each of these segments are made up of integer associated with the bus driver. The PropSeg is pro-
units called Time Quanta (TQ) and are explained later grammable from 1 - 8TQ.
in this application note. The Nominal Bit Rate (NBR) is
defined in the CAN specification as the number of bits PHASE SEGMENT 1 AND PHASE SEGMENT 2
per second transmitted by an ideal transmitter with no The two phase segments, PS1 and PS2 are used to
resynchronization and can be described with the compensate for edge phase errors on the bus. PS1 can
equation: be lengthened or PS2 can be shortened by resyncroni-
1 zation. PS1 is programmable from 1 - 8TQ and PS2 is
NBR = f bit = -------
t bit programmable from 2 - 8TQ.
Sample
Point
Nominal Bit Time (NBT), tbit
tosc
TBRPCLK
TQ
(tTQ)
bit 7 bit 0
Sample Point
Propagation Delay
Time (t)
Input Signal (e = 0)
PhaseSeg2 (PS2)
SyncSeg PropSeg PhaseSeg1 (PS1)
SJW (PS2)
SJW (PS1)
Sample
Point
Input Signal
(e > 0)
PhaseSeg2 (PS2)
SyncSeg PropSeg PhaseSeg1 (PS1)
SJW (PS2)
SJW (PS1)
Sample
Point
Nominal Bit Time (NBT)
PhaseSeg2 (PS2)
SyncSeg PropSeg PhaseSeg1 (PS1)
SJW (PS2)
SJW (PS1)
Sample
Point
The bit stuffing rule guarantees that no more than five #TQSJW > tSJW(B) / TQ(B) = 250 ns / 123.44 ns
like bits in a row will be transmitted during a message = 2.025
frame. The only exception is at the end of the message #TQSJW = 3
that includes ten recessive bits (one ACK delimiter,
seven end-of-frame bits, and three interframe space
bits).
TQ
TQ = tPROP = 750 ns
tbit = 10TQ = 7.5 µs → 133.3 kb/s
SyncSeg = 1TQ
PropSeg = tPROP = 1TQ
PS1 = SJWMAX = 4TQ
PS2 = SJWMAX = 4TQ
SJWMAX = 0.4NBT = 4TQ
TQ
TQ = tPROP / 6 = 125 ns
tbit = 10TQ = 1.25 µs → 800 kb/s
SyncSeg = 1TQ
PropSeg = tPROP = 6TQ
PS1 = 1TQ
PS2 = 2TQ
SJWMAX = 1TQ
REFERENCES CONCLUSION
MCP2510 Data Sheet, DS21291, Microchip Technol- Setting up CAN bit timing is not an arbitrary process.
ogy, Inc. The system designer must be aware of the compo-
Lawrenz, Wolfhard, “CAN System Engineering From nents that affect bit timing and compensate to get opti-
Theory to Practical Applications”, Springer, 1997 mal performance across the network. For example, if
the desired system uses oscillators with the maximum
“CAN Specification”, Version 2.0, Parts A and B, Robert tolerance, the maximum bus length is reduced. Like-
Bosch GmbH, 1991 wise, if maximum bus length is desired, the oscillator
“ISO11898”, International Standards Organization, tolerances must be minimized. CAN data rates must
1993 also be considered because the data rate is a third vari-
Controller Area Network (CAN) Basics, DS00713 able that determines maximum length and maximum
oscillator tolerances.
PIC18C Reference Manual, DS39500
This application note should help assist system engi-
PIC18C58 Datasheet, DS30475 neers design a controller area network for optimal per-
formance based on requirements of the system.