CAN add-on
ADwin
40
ADwin-Gold
USB / ENET, manual version 3.8, October 2005
Parity
– Parity: In order to recognize an error or incorrect data during the transfer,
a parity bit can be transferred at the same time. The parity can be even
or odd or you can have no parity bit at all.
Data bits
– Data bits: the active data to be transferred may be 5...8 bits long.
Stop bits
– Stop bits: The number of stop bits can be set to 1, 1½ or 2. Here the num-
ber of stop bits depends on the number of data bits:
• 5 data bits: 1 or 1½ stop bits.
• 6…8 data bits: 1 or 2 stop bits.
Baud rate
– Baud rate: The physical data are between 35 Baud and 2.304MBaud;
when using an RS-232 interface the maximum Baud rate is 115.2
kBaud.
The Baud Rates are derived by the clock rate of the module; the basic
clock rate has a frequency of 2.304MHz. Based on this fact, every Baud
rate is possible that can be derived by an integer division of the basic fre-
quency. The divisor can have values between
1...0FFFFh
. The follow-
ing table shows some common Baud rates and their divisors:
Fig. 30 – RS-xxx: Baud rates
Special features of RS485
Via a RS485 interface more than 2 participants can communicate with each
other. (Contrary to the RS232 interface). With RS485 interfaces a bus can be
set up.
Consider the following:
– There is no handshake, because a handshake is only possible between
2 participants.
– The interface must know if it should write to the bus or get data from the
bus (
RS485_SEND
).
9.3.2 Programming
Functionality and programming of the interface depend on this controller. The
controller is easily programmed with
ADbasic
instructions:
The instructions are in the include file
<ADWGCAN.INC>
. More information can
also be found in the
ADbasic
manual and the online help.
Baud rate
Divisor
Baud rate
Divisor
dez.
hex.
dez.
hex.
2304000
1
00 01h
19200
120
00 78h
1152000
2
00 02h
9600
240
00 F0h
460800
5
00 05h
4800
480
01 E0h
230400
10
00 0Ah
2400
960
03 C0h
115200
20
00 14h
1200
1920
07 80h
57600
40
00 28h
600
3840
0F 00h
38400
60
00 3Ch
300
7680
1E 00h
Range
Instructions
Initialization
RS_INIT
,
RS_RESET
Receiving and transmitting of data
RS485_SEND
,
READ_FIFO
,
WRITE_FIFO
Write and read access
to the controller register
GET_RS
,
SET_RS