User`s manual

User’s Manual 15
FLASHLED1.c—demonstrates the use of assembly language to flash LEDs DS1 and
DS2 on the Prototyping Board at different rates. Once you have compiled and run this
program, LEDs DS1 and DS2 will flash on/off at different rates.
FLASHLED2.c—demonstrates the use of cofunctions and costatements to flash LEDs
DS1 and DS2 on the Prototyping Board at different rates. Once you have compiled and
run this program, LEDs DS1 and DS2 will flash on/off at different rates.
TOGGLESWITCH.c—demonstrates the use of costatements to detect switches using the
press-and-release method of debouncing. LEDs DS1 and DS2 on the Prototyping
Board are turned on and off when you press switches S2 and S3. S2 and S3 are con-
trolled by PD5 and PD4 respectively.
IR_DEMO.c—Demonstrates sending Modbus ASCII packets between two Prototyping
Board assemblies via the IrDA transceivers with the IrDA transceivers facing each other.
Note that this sample program requires a second Prototyping Board or Digi single-
board computer that has an IrDA chip and is running the
IR_DEMO.C
sample program
associated with it.
First, compile and run the IR_DEMO.C sample program from the SAMPLES folder spe-
cific to the other system on the second system, then remove the programming cable and
press the RESET button so that the first assembly is operating in the Run mode. Then
connect the programming cable to the RCM3400 Prototyping Board, and compile and
run the IR_DEMO.C sample program from the SAMPLES\RCM3400 folder on the
RCM3400 system. With the IrDA transceivers on the two Prototyping Boards facing
each other, press switch S2 on the RCM3400 Prototyping Board to transmit a packet.
The other system will return a response packet that will then appear in the Dynamic C
STDIO window. The test packets and response packets have different codes.
Once you have loaded and executed these five programs and have an understanding of
how Dynamic C and the RCM3400 modules interact, you can move on and try the other
sample programs, or begin building your own.
3.2.1 Serial Communication
The following sample programs are found in the
SERIAL subdirectory in
SAMPLES\RCM3400.
FLOWCONTROL.C—This program demonstrates how to configure Serial Port C for
CTS/RTS with serial data coming from Serial Port D (TxD) at 115,200 bps. The serial
data received are displayed in the STDIO window.
To set up the Prototyping Board, you will need to tie TxD and RxD
together on the RS-232 header at J5, and you will also tie TxC and
RxC together using the jumpers supplied in the Development Kit as
shown in the diagram.
A repeating triangular pattern should print out in the STDIO window.
The program will periodically switch flow control on or off to demonstrate the effect of
no flow control.
J5
RxC TxC
GND
TxD RxD