User`s manual

User’s Manual 17
Two sample programs, MASTER.C and SLAVE.C, are available to illustrate RS-485
master/slave communication. To run these sample programs, you will need a second Rab-
bit-based system with RS-485, and you will also have to add an RS-485 transceiver such
as the SP483E and bias resistors to the Prototyping Board.
The RS-485 connections between the slave and master devices are as follows.
RS485+ to RS485+
RS485– to RS485–
GND to GND
MASTER.C—This program demonstrates a simple RS-485 transmission of lower case
letters to a slave RCM2300. The slave will send back converted upper case letters back
to the master RCM2300 and display them in the STDIO window. Use SLAVE.C to
program the slave RCM2300—reset the slave before you run MASTER.C on the master.
SLAVE.C—This program demonstrates a simple RS-485 transmission of lower case
letters to a master RCM2300. The slave will send back converted upper case letters
back to the master RCM2300 and display them in the STDIO window. Compile and run
this program on the slave before you use MASTER.C to program the master.
You can then access Serial Port A through HyperTermi-
nal or Tera Term using the programming cable’s DIAG
connector to connect the programming header (J1) on
the RCM2300 to the PC COM port. Serial Port C can be
accessed with your own hookup wire to connect TxC
and RxC as shown from header J6 on the Prototyping
Board to the 10-pin header to DB9 cable, which is con-
nected to the PC COM port.
The diagram shows the connections.
You will have to connect PC0 and
PC1 (Serial Port D) on the Prototyp-
ing Board to the RS-485 transceiver,
and you will connect PD3 to the
RS-485 transceiver to enable or dis-
able the RS-485 transmitter.
J6
TxB
RxB
GND
RxC
TxC
Serial Port C
681 W
220 W
681 W
485+
485
A
B
termi-
nation
bias
bias
Vcc
PC0
PC1
PD3
DI
RO
DE
/RE
Vcc
RS-485
CHIP
47 kW