Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
8XC196Kx,8XC196Jx,87C196CA microcontroller family user's manual.1995.pdf
Скачиваний:
57
Добавлен:
23.08.2013
Размер:
3.97 Mб
Скачать

8XC196Kx, Jx, CA USER’S MANUAL

12.3.5 Bit Timing

A message object consists of a series of bits transmitted in consecutive bit times. The CAN protocol specifies a bit time composed of four separate, nonoverlapping time segments: a synchronization delay segment, a propagation delay segment, and two phase delay segments (Figure 12-4 and Table 12-8). The CAN controller implements a bit time as three segments, combining

PROP_SEG and PHASE_SEG1 into tTSEG1 (Figure 12-5 and Table 12-9). This implementation is identical to that of the 82527 CAN peripheral.

Nominal Bit Time

SYNC_SEG

PROP_SEG

PHASE_SEG1

PHASE_SEG2

 

 

 

 

 

 

Sample

Transmit

 

 

 

 

A2603-01

 

 

 

 

 

 

 

 

Figure 12-4. A Bit Time as Specified by the CAN Protocol

 

 

 

 

Table 12-8. CAN Protocol Bit Time Segments

 

 

 

 

 

 

 

 

Symbol

Definition

 

 

 

 

 

 

 

SYNC_SEG

The synchronization delay segment allows for synchronization of the various nodes on

 

 

 

the bus. An edge is expected to lie within this segment.

 

 

 

 

 

 

 

PROP_SEG

The propagation delay segment compensates for the physical delay times within the

 

 

 

network. It is twice the sum of the signal’s propagation time on the bus line, the input

 

 

 

comparator delay, and the output driver delay. The factor of two accounts for the

 

 

 

requirement that all nodes monitor all bus transmissions for errors.

 

 

 

 

 

 

 

PHASE_SEG1

This segment compensates for edge phase errors. It can be lengthened or shortened by

 

 

 

resynchronization.

 

 

 

 

 

 

 

PHASE_SEG2

This segment compensates for edge phase errors. It can be lengthened or shortened by

 

 

 

resynchronization.

 

 

 

 

 

 

 

12-10

CAN SERIAL COMMUNICATIONS CONTROLLER

 

 

Bit Time

t SYNC

t TSEG1

t TSEG2

_SEG

 

 

1 tq

(TSEG1 + 1)tq

 

(TSEG2 + 1)tq

 

Sample

Transmit

A2602-01

Figure 12-5. A Bit Time as Implemented in the CAN Controller

 

Table 12-9. CAN Controller Bit Time Segments

Symbol

Definition

 

 

tSYNC_SEG

This time segment is equivalent to SYNC_SEG in the CAN protocol. Its length is one time

 

quantum.

 

 

tTSEG1

This time segment is equivalent to the sum of PROP_SEG and PHASE_SEG1 in the CAN

 

protocol. Its length is specified by the TSEG1 field in bit timing register 1. To allow for resyn-

 

chronization, the sample point can be moved (tTSEG1 or tTSEG2 can be shortened and the other

 

lengthened) by 1 to 4 time quanta, depending on the programmed value of the SJW field in bit

 

timing register 0.

 

The CAN controller samples the bus once or three times, depending on the value of the

 

sampling mode (SPL) bit in bit timing register 0. In three-sample mode, the hardware

 

lengthens tTSEG1 by 2 time quanta to allow time for the additional two bus samples. In this

 

case, the “sample point” shown in Figure 12-5 is the time of the third sample; the first and

 

second samples occur 2 and 1 time quanta earlier, respectively.

 

 

tTSEG2

This time segment is equivalent to PHASE_SEG2 in the CAN protocol. Its length is specified

 

by the TSEG2 field in bit timing register 1. To allow for resynchronization, the sample point

 

can be moved (tTSEG1 or tTSEG2 can be shortened and the other lengthened) by 1 to 4 time

 

quanta, depending on the programmed value of the SJW field in bit timing register 0.

 

 

12-11

8XC196Kx, Jx, CA USER’S MANUAL

12.3.5.1Bit Timing Equations

The bit timing equations of the integrated CAN controller are equivalent to those for the 82527 CAN peripheral with the DSC bit in the CPU interface register set (system clock divided by two). The following equations show the timing calculations for the integrated CAN controller and the 82527 CAN peripheral, respectively.

 

Fosc

CAN Controller CAN bus frequency = ------------------------------------------------------------------------------------------------------------

 

2 × ( BRP + 1) × ( 3 + TSEG1 + TSEG2)

 

Fosc

82527 CAN bus frequency = -(---DSC--------------+-----1----)----×------(---BRP--------------+-----1---)-----×------(--3-----+-----TSEG1---------------------+-----TSEG2----------------------)-

where:

 

FOSC

= the input clock frequency on the XTAL1 pin, in MHz

BRP

= the value of the BRP bit in bit timing register 0

TSEG1

= the value of the TSEG1 field in bit timing register 0

TSEG2

= the value of the TSEG1 field in bit timing register 1

Table 12-10 defines the bit timing relationships of the CAN controller.

 

Table 12-10. Bit Timing Relationships

Timing

Definition

Parameter

 

 

 

tBITTIME

tSYNC_SEG + tTSEG1 + tTSEG2

tXTAL1

input clock period on XTAL1 (50 ns at 20 MHz operation)

tq

2tXTAL1 × (BRP + 1), where BRP is a field in bit timing register 0 (valid values are 0–63)

tSYNC_SEG

1tq

tTSEG1

(TSEG1 + 1) × tq, where TSEG1 is a field in bit timing register 1 (valid values are 2–15)

tTSEG2

(TSEG2 + 1) × tq, where TSEG2 is a field in bit timing register 1 (valid values are 1–7)

tSJW

(SJW + 1) × tq, where SJW is a field in bit timing register 0 (valid values are 0–3)

tPROP

The portion of tTSEG1 that is equivalent to PROP_SEG as defined by the CAN protocol. Twice

 

the maximum sum of the physical bus delay, input comparator delay, and output driver delay,

 

rounded up to the nearest multiple of tq.

 

 

12-12

Соседние файлы в предмете Электротехника