Microchip Technology DM164134 Data Sheet

Page of 402
PIC18FXX8
DS41159E-page 234
© 2006 Microchip Technology Inc.
19.7.1
TIME QUANTA
As already mentioned, the time quanta is a fixed unit
derived from the oscillator period and baud rate
prescaler. Its relationship to T
BIT
 and the nominal bit
rate is shown in Example 19-2.
EXAMPLE 19-2:
CALCULATING T
Q
NOMINAL BIT RATE AND 
NOMINAL BIT TIME
The frequencies of the oscillators in the different nodes
must be coordinated in order to provide a system wide
specified nominal bit time. This means that all oscilla-
tors must have a T
OSC
 that is an integral divisor of T
Q
.
It should also be noted that although the number of T
Q
is programmable from 4 to 25, the usable minimum is
8 T
Q
.
 
A bit time of less than 8 T
Q
 in length is not
ensured to operate correctly.
19.7.2
SYNCHRONIZATION SEGMENT
This part of the bit time is used to synchronize the
various CAN nodes on the bus. The edge of the input
signal is expected to occur during the sync segment.
The duration is 1 T
Q
.
19.7.3
PROPAGATION SEGMENT 
This part of the bit time is used to compensate for
physical delay times within the network. These delay
times consist of the signal propagation time on the bus
line and the internal delay time of the nodes. The length
of the Propagation Segment can be programmed from
1 T
Q
 to 8 T
Q
 by setting the PRSEG2:PRSEG0 bits.
19.7.4
PHASE BUFFER SEGMENTS
The phase buffer segments are used to optimally
locate the sampling point of the received bit within the
nominal bit time. The sampling point occurs between
Phase Segment 1 and Phase Segment 2. These
segments can be lengthened or shortened by the
resynchronization process. The end of Phase Segment
1 determines the sampling point within a bit time.
Phase Segment 1 is programmable from 1 T
Q
 to 8 T
Q
in duration. Phase Segment 2 provides delay before
the next transmitted data transition and is also
programmable from 1 T
Q
 to 8 T
Q
 in duration. However,
due to IPT requirements, the actual minimum length of
Phase Segment 2 is 2 T
Q
 or it may be defined to be
equal to the greater of Phase Segment 1 or the
Information Processing Time (IPT). 
19.7.5
SAMPLE POINT
The sample point is the point of time at which the bus
level is read and the value of the received bit is deter-
mined. The sampling point occurs at the end of Phase
Segment 1. If the bit timing is slow and contains many
T
Q
, it is possible to specify multiple sampling of the bus
line at the sample point. The value of the received bit is
determined to be the value of the majority decision of
three values. The three samples are taken at the sam-
ple point and twice before, with a time of T
Q
/2 between
each sample.
19.7.6
INFORMATION PROCESSING TIME
The Information Processing Time (IPT) is the time
segment, starting at the sample point, that is reserved
for calculation of the subsequent bit level. The CAN
specification defines this time to be less than or equal
to 2 T
Q
. The PIC18FXX8 defines this time to be 2 T
Q
.
Thus, Phase Segment 2 must be at least 2 T
Q
 long.
T
Q
 (
μs) = (2 * (BRP + 1))/F
OSC
 (MHz) 
T
BIT
 (
μs) = T
Q
 (
μs) * number of T
Q
 per bit interval
Nominal Bit Rate (bits/s) = 1/T
BIT
CASE 1:
For F
OSC
 = 16 MHz, BRP<5:0> = 00h and 
Nominal Bit Time = 8 T
Q
:
T
= (2 * 1)/16 = 0.125
μs (125 ns)
T
BIT
 = 8 * 0.125 = 1
μs (10
-6
s)
Nominal Bit Rate = 1/10
-6 
= 10
6
 bits/s (1 Mb/s)
CASE 2:
For F
OSC
 = 20 MHz, BRP<5:0> = 01h and 
Nominal Bit Time = 8 T
Q
:
T
= (2 * 2)/20 = 0.2
μs (200 ns) 
T
BIT
 = 8 * 0.2 = 1.6
μs (1.6 * 10
-6
s)
Nominal Bit Rate = 1/1.6 * 10
-6
s =
625,000 bits/s
(625 Kb/s)
CASE 3:
For F
OSC
 = 25 MHz, BRP<5:0> = 3Fh and 
Nominal Bit Time = 25 T
Q
:
T
Q
 
= (2 * 64)/25 = 5.12
μs
T
BIT
 = 25 * 5.12 = 128
μs (1.28 * 10
-4
s)
Nominal Bit Rate = 1/1.28 * 10
-4
 =
7813 bits/s
(7.8 Kb/s)