User`s manual
User’s Manual 53
4.3.3 Serial Communication
The following sample programs are found in the RS232 subdirectory in SAMPLES\OP7200.
• PUTS.C—This program transmits and then
receives an ASCII string on Serial Ports C and
D. The serial data received are displayed in the
STDIO window.
To set up the OP7200, you will need to tie
TxC and RxD together on the screw-terminal
header at J10, and you will also tie TxD and
RxC together as shown in the diagram.
• RELAYCHR.C—This program echoes charac-
ters to or from a serial utility such as Hyper-
Terminal or Tera Term.
To set up the OP7200, you will need to tie
TxC and RxD together on the screw-terminal
header at J10.
Set up HyperTerminal or Tera Term as follows: 19200 bps, 8 data bits, no parity, 1 stop
bit, and no flow control. Here are a few additional settings if you are using Tera Term.
X Disable Local Echo in the Terminal setup
X Enable the receive and line feed options (CR + LF) under New line in the Terminal setup
Now when you type characters in the HyperTerminal or Tera Term window, they will
appear in the window because they are being echoed back by the sample program.
Two sample programs, MASTER.C and SLAVE.C, are available in the RS485 subdirectory
in SAMPLES\OP7200 to illustrate RS-485 master/slave communication. To run these
sample programs, you will need a second Rabbit-based system with RS-485—another
Rabbit single-board computer or OP7200 may be used as long as you use the master or
slave sample program associated with that board.
The RS-485 connections between the slave and master devices are as follows.
• RS485+ to RS485+
• RS485– to RS485–
• GND to GND
Then connect your PC COM port to screw-terminal
header J10 as follows.
X PC Tx to RxC on J10
X PC Rx to TxD on J10
X PC GND to GND on J10
J10
GND
+485
485
RXD/CTS
TXD/RTS
RXC
TXC
/RST
IN15
IN14
IN13
IN12
J10
GND
+485
485
RXD/CTS
TXD/RTS
RXC
TXC
/RST
IN15
IN14
IN13
IN12
5
4
3
2
1
9
8
76
GND
DTR
Tx (out)
Rx (in)
DCD
RING
CTS
RTS
DSR
COM