24
RabbitCore RCM3365/RCM3375
3.2.3 Serial Communication
The following sample programs can be found in the SAMPLES\RCM3360\SERIAL folder.
FLOWCONTROL.C
—This program demonstrates hardware flow control by configuring
Serial Port F for CTS/RTS with serial data coming from TxE (Serial Port E) at 115,200
bps. One character at a time is received and is displayed in the STDIO window.
To set up the Prototyping Board, you will need to tie
TxE and RxE together on the RS-232 header at J14,
and you will also tie TxF and RxF together as shown in
the diagram.
A repeating triangular pattern should print out in the
STDIO
window. The program periodically switches RTS (TxF) flow control on or off to
demonstrate the effect of hardware flow control.
PARITY.C
—This program demonstrates the use of parity modes by repeatedly sending
byte values 0–127 from Serial Port E to Serial Port F. The program will switch between
generating parity or not on Serial Port E. Serial Port F will always be checking parity,
so parity errors should occur during every other sequence.
To set up the Prototyping Board, you will need to tie
TxE and RxF together on the RS-232 header at J14 as
shown in the diagram.
The Dynamic C STDIO window will display the error
sequence.
SIMPLE3WIRE.C
—This program demonstrates basic RS-232 serial communication.
Lower case characters are sent by TxE, and are received by RxF. The characters are
converted to upper case and are sent out by TxF, are received by RxE, and are displayed
in the Dynamic C STDIO window.
To set up the Prototyping Board, you will need to tie
TxE and RxF together on the RS-232 header at J14, and
you will also tie RxE and TxF together as shown in the
diagram.
SIMPLE5WIRE.C
—This program demonstrates 5-wire RS-232 serial communication
by providing flow control (RTS/CTS) on Serial Port F and data flow on Serial Port E.
To set up the Prototyping Board, you will need to tie
TxE and RxE together on the RS-232 header at J14,
and you will also tie TxF and RxF together as shown in
the diagram.
Once you have compiled and run this program, you can
test flow control by disconnecting TxF from RxF while the program is running. Char-
acters will no longer appear in the STDIO window, and will display again once TxF is
connected back to RxF. (Do not disconnect the data path between TxE and RxE.)
J14
TxE RxE GND TxF RxF 485+ GND 485
J14
TxE RxE GND TxF RxF 485+ GND 485
J14
TxE RxE GND TxF RxF 485+ GND 485
J14
TxE RxE GND TxF RxF 485+ GND 485