ADwin-Pro II
Hardware, manual Dec. 2018
161
Pro II: Extension and Interface Modules
Pro II-CAN-2 Rev. E
ADwin
In this example, the comparison of bit 2 is responsible for the assignment of the
messages, because the bits 3...10 of the compared identifiers are identical (=
0) and the bits 0 and 1 are not compared, because they are set to zero in the
global mask (= not relevant).
Setting the bus frequency
The
CAN bus frequency
depends on the configuration of the controller.
The initialization with
Init_CAN
configures the controller automatically to a
CAN bus frequency of 1 MHz. If the CAN bus is to operate with a different fre-
quency, just use the instruction
Set_CAN_Baudrate
.
With low speed CAN, the maximum bus frequency is 125kBit/s.
Bus frequency for
special cases
In some special cases, it may be better to select configurations other than
those set with
Set_CAN_Baudrate
. For this purpose specified registers have
to be set with the instruction
Poke
. The structure of the register is described
in the controller documentation.
Enable Interrupt / Trigger Event
A message object can be enabled to trigger an interrupt when a message
arrives. The interrupt output of the CAN controller is connected to the event
input of the processor. The processor reacts immediately to incoming mes-
sages without having to control the message input (polling).
You can enable the interrupts of several message objects. Which object has
caused the interrupt, can be seen in the interrupt register (
5Fh
): It contains the
number of the message object that caused the interrupt. If the interrupt flag
(new message flag) is reset in the message object, the interrupt register will be
updated. If there is no interrupt the register is set to 0. If another interrupt
occurs during working with the first interrupt its source will be shown in the
interrupt register. An additional interrupt does not occur in this case.
Module revisions
Differences between revisions are described below. The revision number is
located on the front panel.
Different revision characters mean different module characteristics and are
documented separately. A counter number is added for internal purpose.
Programming
The module is comfortably programmed with
ADbasic
instructions. The
instructions are described in
ADbasic
online help and in the Pro II Software
manual.
Message ID
ID of the message object
1
…001b
2
…010b
3
…011b
4
…100b
1 (
…001b
)
x
x
x
0
2 (
…010b
)
x
x
x
0
3 (
…011b
)
x
x
x
0
4 (
…100b
)
0
0
0
x
x: Message is admitted
0: Message is not admitted
Revision
Output
date
Changes to previous revision
E
First version