Bosch Appliances TTCAN user manual Example for Bit Timing at low Baudrate

Models: TTCAN

1 77
Download 77 pages 249 b
Page 53
Image 53

TTCAN

User’s Manual

Revision 1.6

4.2.1.8 Example for Bit Timing at low Baudrate

In this example, the frequency of CAN_CLK is 2 MHz, BRP is 1, the bit rate is 100 KBit/s.

tq

1

s

delay of bus driver

200

ns

delay of receiver circuit

80

ns

delay of bus line (40m)

220

ns

tProp

1

s

tSJW

4

s

tTSeg1

5

s

tTSeg2

4

s

tSync-Seg

1

s

bit time

10

s

tolerance for CAN_CLK

1.58

%

 

 

=

= 2 • tCAN_CLK

= 1 • tq = 4 • tq

= tProp + tSJW

= Information Processing Time + 3 • tq = 1 • tq

= tSync-Seg + tTSeg1 + tTSeg2

= min(PB 1, PB 2)

----------------------------------------------------------------

2 × (13 × bit time PB2)

s

---------------------------------------------------------

2 × (13 × 10µs s)

manual_about.fm

In this example, the concatenated bit time parameters are (4-1)3&(5-1)4&(4-1)2&(2-1)6, the Bit Timing Register is programmed to= 0x34C1.

4.2.2 Configuration of the Message Memory

The whole Message Memory has to be configured before the end of the initialisation, but is also possible to change the configuration of Message Objects during CAN communication.

The CAN software driver library should offer subroutines that:

Transfer a complete message structure into a Message Object. (Configuration)

Transfer the data bytes of a message into a Message Object and set TxRqst and NewDat. (Start a new transmission)

Get the data bytes of a message from a Message Object and clear NewDat (and IntPnd). (Read received data)

Get the complete message from a Message Object and clear NewDat (and IntPnd). (Read a received message, including identifier, from a Message Object with UMask = ‘1’)

Parameters of the subroutines are the Message Number and a pointer to a complete message structure or to the data bytes of a message structure.

Two methods are possible to assign the IFx Interface Register sets to these subroutines. In the first method, the tasks of the application program that may access the module are assorted in two groups. Each group is restricted to the use of one of the Interface Register sets. The tasks of one group may interrupt tasks of the other group, but not of the same group.

In the second method, which may be a special case of the first method, there are only two tasks is the application program that access the module. A Read_Message task that uses IFC1 to get received messages (full messages or data bytes only) from the Message RAM and a Write_Message task that uses IFC2 to write messages to be transmitted (or to be configured) into the Message RAM. Both tasks may interrupt each other.

The CAN communication may be controlled interrupt-driven or by polling. The module’s Interrupt Register points to Message Objects with IntPnd = ‘1’. It is updated even if the interrupt line to the CPU is disabled (IE = ‘0’).

BOSCH

- 53/77 -

11.11.02

Page 53
Image 53
Bosch Appliances TTCAN user manual Example for Bit Timing at low Baudrate, 2 Configuration of the Message Memory