Вы находитесь на странице: 1из 3

How to calculate CAN bit timing parameters

SamplePoi
nt

SYNC_SEG PROP_SEG SEG1 SEG2


Nominal Bit Time

Time Quanta The TQ length derives from the bit rate presale and the used
oscillator frequency.

SYNC_SEG It is used to synchronize the various bus nodes (SYNC_SEG has always
a length of 1 TQ)

PROP_SEG Propagation segment that follows is there to compensate for a physical


delay of the signal going over wire and its received in driver.

SEG1 - It is used to compensate for edge phase errors and may be lengthened
during resynchronization

SEG2 - Is last segment and its duration concludes full bit time.

SamplePoint from 50 90% (87.5% is preferred value used by CAN open and
Device Net or this is defined by Software project)

Nominal BIT Time (NBT) This is the sum of all the CAN bit time segments

Calculation CAN bit timing parameters need to following next steps:

1. Calculate the time quanta clock by dividing frequency to the Baud


Rate. Choose a prescaler value for CAN peripherals clock frequency.
The CAN peripherals clock frequency is chosen so that the desired CAN
nominal bit time is an integer number of a time quanta.

frequency
Number Time Quanta/bit=
baudratedivizo r

2. Calculate period of bit and period of a time quanta.

Bit time=1/baudrate
TQ length=Bit Time/ NumberTimeQuanta

3. Calculate CAN timing parameters.

Bus length=310 8 m/ sTQtime ( s )PROPseg

Bus length
PROPseg= 8
310 m/sTQtime ( s )

SYNC SEG+ + SEG 1 SYNC SEG ++ SEG 1


= =SamplePoint
SYNC SEG ++ SEG 1+ SEG 2 NBT

Example:

Baud Rate: 500kbit -> 500 000 bit/s


CAN peripherals clock frequency: 20MHz -> 20 000 000 Hz
Bus length: 150m

Step 1)

6
2010 Hz 200
3
= =40
50010 b/ s 5

Choose a prescaler value:

1-> 40
2 -> 20
3 -> 10
5 -> 8
A prescaler value of 5 gives a CAN peripherals clock.

=>NBT= 8

Step 2)
Period of a BIT

1 1
3
= 5
=2106 =2us
50010 0.510

Period of a TQ

2 us
=0.25us
8

Step 3)

BusLength=3108TQPROPseg

Bus length
PROPseg= 8
310 TQ

150 m 150
PROPseg= = =2
310 m/s0.2510 s 75
8 6

SYNC SEG+ + SEG 1


=SamplePoint
SYNC SEG ++ SEG 1+ SEG 2

1+2+SEG 1 1+ 2+SEG 1
= 0.875
1+2+ SEG 1+ SEG 2 8

> Seg 1=0.87583 =4

> Seg 2=1+2+ SEG 18=1

SYNC_SEG : 1

PROP :2

SEG1 :4

SEG2 :1

Вам также может понравиться