AP29000
Connecting C166 and C500 Microcontroller to CAN
Ways of handling the SAE 81C90/91 and the CAN Module on the C167CR / C515C
Application Note
60
V 1.0, 2004-02
OC = 0x18;
/* (Addr. 02h) DOM=LOW, RECESSIVE=HIGH */
/* 0 0 0 1 1 0 0 0 */
/* Tx1 Tx0 OCM */
The Clock Control Register is used to determine the output frequency of the
SAE 81C90/91's CLK pin. The output frequency may be the oscillator frquency divided
by 1, 2, 4, 6, 8, 10, 12 or 14 or may be switched off completely. Writing to this register
requires a special protocol in order to avoid erroneous writing. In the following
example, the output frequency shall be programmed to f
osc
/2:
CCR = 0x80;
/* Prepare writing to CCR (Addr. 14h) */
CCR = 0x01;
/* Switch output frequency to fosc/2 */
Please note that this must be two consecutive accesses to the SAE 81C90/91.
•
In the descriptor bytes, the identifier of the message objects and the length of the
Data Field is configured. The values have to be chosen according to the message
objects in other CAN nodes the SAE 81C90/91 shall communicate with. With the
RTR bit, the SAE 81C90/91 distinguishes between message objects handling
only
Data Frames
(RTR=0) or handling
only Remote Frames
(RTR=1). Please mind the
following table:
Table 5
SAE
81C90/91
RTR-BIT
Behaviour
Transmission of this
message object will
generate...
If a Data
Frame with
a matching
identifier is
received...
If a Remote
Frame with a
matching
identifier is
received...
RTR Bit = 0
= Object
that handles
Data Frames
... a Data Frame.
... the Data
Frame is
stored.
... the Remote
Frame is NOT
answered.
RTR Bit = 1
= Object
that handles
Remote
Frames
...a Remote Frame. The
corresponding Data
Frame is NOT stored in
this MO! The Data
Frame has to be
received by another MO
... the Data
Frame is
NOT
stored.
... the Remote
Frame is
answered with
the
corresponding
Data Frame.