Jäger ADwin-Gold-USB Manual page 42

Hide thumbs Also See for ADwin-Gold-USB:
Table of Contents

Advertisement

CAN add-on
38
The following table shows the admitted values and the meaning of the individ-
ual ranges:
Range
Admitted
Meaning
values
SJW
0 ... 3
Max. pulse elongation during bus synchronization
BRP
0 ... 63
Pre-scaler
SPL
0 ... 1
Sampling mode
TSEG1
2 ... 15
Time segments before sampling
TSEG2
1 ... 7
Time segments after sampling
The default setting of the ranges SJW and SPL is 0 and should only be
changed if necessary. Select the sample point (specified by TSEG1 and
TSEG2) in such a way that it is between 50% and 80% of the total bit length.
The CAN bus frequency is calculated as follows:
f
CAN
The following table illustrates all common settings for the Baud rates.
Baud rate [kBit/s]
BRP
TSEG1
TSEG2
BTR0
BTR1
Sample point[%]
Fig. 29 – CAN: Setting the Baud rates
Access to the two timing registers is only possible, when the access has been
enabled before. This is done by the CCE-bit in the control register. The bit has
to be reset afterwards.
Interrupt / 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.
Programming
The interface is easily programmed using ADbasic instructions:
Range
Initialization
8MHz
=
--------------------------------------------------------------------------------------- -
(
) TSEG1
(
BRP
+
1
+
125
250
3
1
6
6
7
7
03h
01h
76h
76h
54
54
Instructions
INIT_CAN
EN_INTERRUPT
SET_CAN_BAUDRATE
ADwin-Gold USB / ENET, manual version 3.8, October 2005
ADwin
)
TSEG2
+
3
500
1.000
0
0
6
2
7
3
00h
00h
76h
32h
54
60

Advertisement

Table of Contents
loading

This manual is also suitable for:

Adwin-gold-enet

Table of Contents