AN1105 STMicroelectronics, AN1105 Datasheet - Page 28

no-image

AN1105

Manufacturer Part Number
AN1105
Description
ST7 PCAN PERIPHERAL DRIVER
Manufacturer
STMicroelectronics
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
AN1105W-12-RR
Quantity:
13 804
Part Number:
AN1105W-22-RR
Manufacturer:
SANYO
Quantity:
8 570
Part Number:
AN1105W-TR
Manufacturer:
PANASONIC
Quantity:
27 995
Part Number:
AN1105W-TR
Manufacturer:
STANLEY
Quantity:
20 000
ST7 pCAN PERIPHERAL DRIVER
– Identifiers may exist on the bus that do not concern our cell.
2.2.2 Cell Configuration
Open then the can_custom.h file. You can see the two first lines of code:
//#define WAKE_UP_PULSE
//#define RUN_ON_START_UP
According to our requirements (See
Section 2.2.1
"Application"), we only want to define the
RUN_ON_STARTUP option.
So modify the code the following way:
//#define WAKE_UP_PULSE
#define RUN_ON_START_UP
2.2.2.1 Bit Timing
First of all, we have to decide the speed of our network. Let’s say, for example, 250 kilobaud.
Look in your can_custom.h file. You see the following code:
#define INIT_BRPR 0x00
#define INIT_BTR 0x00
The following two registers define the bit timing in the cell.
The BRPR register contains the size of time quantum, in number of clock ticks, in a bit field
named BRP (See
Section 1.3.2 "Bit
timing").This field ranges from 0 to 63. The true value for
a time quanta is then BRPR+1.
The BTR register contains the size of the two synchronization segments in time quanta, in two
different bit fields: BS1 and BS2(“). BS1 ranges from 0 to 7and BS2 from 0 to 3. The actual
length of bit segments in time quanta is then BS1+1 and BS2+1.
You must always chose BS1>BS2, so that the sampling point takes place in the second half of
the bit.
Use the following formula:
fcpu Hz
fbus Bauds
=
------------------------------------------------------------------------ -
1
+
BRP
3
+
BS1
+
BS2
For example, in our case, fcpu = 8 MHz.
So, fbus = fcpu/32.
We have then the following possibilities:
BTR+1
BS1+BS2+3
2
16
28/100

Related parts for AN1105