PIC18F258 MICROCHIP [Microchip Technology], PIC18F258 Datasheet - Page 234

no-image

PIC18F258

Manufacturer Part Number
PIC18F258
Description
High Performance, 28/40-Pin Enhanced FLASH Microcontrollers with CAN
Manufacturer
MICROCHIP [Microchip Technology]
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC18F258-E/SO
Manufacturer:
MIC
Quantity:
20 000
Part Number:
PIC18F258-I/P
Manufacturer:
ST
Quantity:
320
Part Number:
PIC18F258-I/SO
Manufacturer:
MICROCHIP
Quantity:
2 000
Part Number:
PIC18F258-I/SO
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC18F2580
Manufacturer:
MIC
Quantity:
20 000
Part Number:
PIC18F2580-E/ML
Manufacturer:
Microchip Technology
Quantity:
135
Part Number:
PIC18F2580-E/SO
Manufacturer:
Microchi
Quantity:
2 952
Part Number:
PIC18F2580-E/SP
Manufacturer:
Microchip Technology
Quantity:
135
Part Number:
PIC18F2580-I/SO
Manufacturer:
MICRO
Quantity:
10
Part Number:
PIC18F2580-I/SO
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC18F2580-I/SO
0
Part Number:
PIC18F2585-I/SO
Quantity:
2
PIC18FXX8
FIGURE 19-9:
19.9
Some requirements for programming of the time
segments:
• Prop Seg + Phase Seg 1 ≥ Phase Seg 2
• Phase Seg 2 ≥ Sync Jump Width.
For example, assume that a 125 kHz CAN baud rate is
desired, using 20 MHz for F
a baud rate prescaler value of 04h gives a T
To obtain a Nominal Bit Rate of 125 kHz, the Nominal
Bit Time must be 8 µs, or 16 T
Using 1 T
gation Segment and 7 T
place the sample point at 10 T
This leaves 6 T
By the rules above, the Sync Jump Width could be the
maximum of 4 T
only necessary when the clock generation of the differ-
ent nodes is inaccurate or unstable, such as using
ceramic resonators. Typically, an SJW of 1 is enough.
19.10 Oscillator Tolerance
As a rule of thumb, the bit timing requirements allow
ceramic resonators to be used in applications with
transmission rates of up to 125 Kbit/sec. For the full bus
speed range of the CAN protocol, a quartz oscillator is
required. A maximum node-to-node oscillator variation
of 1.7% is allowed.
19.11 Bit Timing Configuration
The configuration registers (BRGCON1, BRGCON2,
BRGCON3) control the bit timing for the CAN bus inter-
face. These registers can only be modified when the
PIC18FXX8 is in Configuration mode.
DS41159B-page 232
T
Q
Programming Time Segments
Registers
Q
for the Sync Segment, 2 T
Sync
Q
Q
for Phase Segment 2.
. However, normally a large SJW is
SHORTENING A BIT PERIOD (SUBTRACTING SJW FROM PHASE SEGMENT 2)
Segment
Q
Prop
for Phase Segment 1 would
OSC
Q
.
. With a T
Q
after the transition.
Q
for the Propa-
OSC
Actual Bit Length
Q
of 500 ns.
Segment 1
of 50 ns,
Phase
Nominal Bit Length
Preliminary
Sample Point
19.11.1
The BRP bits control the baud rate prescaler. The
SJW<1:0> bits select the synchronization jump width in
terms of multiples of T
19.11.2
The PRSEG bits set the length of the propagation seg-
ment in terms of T
phase segment 1 in T
many times the RXCAN pin is sampled. Setting this bit
to a ‘1’ causes the bus to be sampled three times; twice
at T
sample point (which is at the end of phase segment 1).
The value of the bus is determined to be the value read
during at least two of the samples. If the SAM bit is set
to a ‘0’, then the RXCAN pin is sampled only once at
the sample point. The SEG2PHTS bit controls how the
length of phase segment 2 is determined. If this bit is
set to a ‘1’, then the length of phase segment 2 is deter-
mined by the SEG2PH bits of BRGCON3. If the
SEG2PHTS bit is set to a ‘0’, then the length of phase
segment 2 is the greater of phase segment 1 and the
information processing time (which is fixed at 2 T
the PIC18FXX8).
19.11.3
The PHSEG2<2:0> bits set the length (in T
segment 2, if the SEG2PHTS bit is set to a ‘1’. If the
SEG2PHTS bit is set to a ‘0’, then the PHSEG2<2:0>
bits have no effect.
Q
/2 before the sample point, and once at the normal
BRGCON1
BRGCON2
BRGCON3
Segment 2
Phase
Q
. The SEG1PH bits set the length of
Q
.
Q
 2002 Microchip Technology Inc.
. The SAM bit controls how
≤ SJW
Q
) of phase
Q
for

Related parts for PIC18F258