Intel 87C196CB, 8XC196NT user manual Programming the Bit Timing 0 CANBTIME0 Register, Unchanged

Models: 8XC196NT 87C196CB

1 155
Download 155 pages 42.65 Kb
Page 76
Image 76
7.4.2Programming the Bit Timing 0 (CAN_BTIME0) Register

CAN SERIAL COMMUNICATIONS CONTROLLER

7.4.2Programming the Bit Timing 0 (CAN_BTIME0) Register

Bit timing register 0 (Figure 7-7) defines the length of one time quantum and the maximum

amount by which the sample point can be moved (tTSEG1 or tTSEG2 can be shortened and the other lengthened) to compensate for resynchronization.

CAN_BTIME0

Address:

1E3FH

(87C196CB)

Reset State:

Unchanged

Program the CAN bit timing 0 (CAN_BTIME0) register to define the length of one time quantum and the maximum number of time quanta by which a bit time can be modified for resynchronization.

87C196CB

7

SJW1

SJW0

BRP5

BRP4

 

 

 

 

0

BRP3

BRP2

BRP1

BRP0

 

 

 

 

Bit

Bit

 

Function

Number

Mnemonic

 

 

 

 

 

 

7:6

SJW1:0

Synchronization Jump Width

 

 

This field defines the maximum number of time quanta by which a resyn-

 

 

chronization can modify tTSEG1 and tTSEG2. Valid programmed values are 0–

 

 

3. The hardware adds 1 to the programmed value, so a “1” value causes

 

 

the CAN peripheral to add or subtract 2 time quanta, for example. This

 

 

adjustment has no effect on the total bit time; if tTSEG1 is increased by 2 tq,

 

 

tTSEG2 is decreased by 2 tq, and vice versa.

5:0

BRP5:0

Baud-rate Prescaler

 

 

 

This field defines the length of one time quantum (tq), using the following

 

 

formula, where tXTAL1 is the input clock period on XTAL1. Valid programmed

 

 

values are 0–63.

 

 

 

tq = 2tXTAL1 × (BRP + 1)

 

 

For example, at 20 MHz operation, the system clock period is 50 ns.

 

 

Writing 3 to BRP achieves a time quanta of 400 ns; writing 1 to BRP

 

 

achieves a time quanta of 200 ns.

 

 

tq = (2 × 50) × (3 + 1)

= 400 ns

 

 

tq = (2 × 50) × (1 + 1)

= 200 ns

 

 

 

 

The CCE bit (CAN_CON.6) must be set to enable write access to this register.

Figure 7-7. CAN Bit Timing 0 (CAN_BTIME0) Register

7-15

Page 76
Image 76
Intel 87C196CB, 8XC196NT user manual Programming the Bit Timing 0 CANBTIME0 Register, Unchanged