Sample Programs - Rabbit RabbitCore RCM3209 User Manual

C-programmable module with ethernet
Table of Contents

Advertisement

3.2 Sample Programs

Of the many sample programs included with Dynamic C, several are specific to the
RCM3209/RCM3229. Sample programs illustrating the general operation of the
RCM3209/RCM3229, and serial communication are provided in the
folder. Each sample program has comments that describe the purpose and function of the
program. Follow the instructions at the beginning of the sample program.
—uses the
CONTROLLED.C
LEDs DS1 and DS2 on the Prototyping Board on and off.
Parallel Port G bit 6 = LED DS1
Parallel Port G bit 7 = LED DS2
Once you have compiled and run this program, you will be prompted via the Dynamic C
STDIO
window to select LED DS1 or DS2. Use your PC keyboard to make your selec-
tion.
Once you have selected the LED, you will be prompted to select to turn the LED either
ON or OFF. A logic low will light up the LED you selected.
—demonstrates the use of costatements to flash LEDs DS1 and DS2 on
FLASHLED1.c
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.
—demonstrates the use of cofunctions and costatements to flash LEDs
FLASHLED2.c
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
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.
—Demonstrates sending Modbus ASCII packets between two Prototyping
IR_DEMO.c
Board assemblies via the IrDA transceivers with the IrDA transceivers facing each other.
Note that this sample program will only work with the RCM30/31/32XX Prototyping
Board.
First, compile and run this program on one Prototyping Board assembly, then remove
the programming cable and press the
the first RabbitCore module is operating in the
ming cable to the second Prototyping Board assembly with the RCM3209/RCM3229
and compile and run the same sample program. With the programming cable still con-
nected to the second Prototyping Board assembly, press switch S2 on the second Proto-
typing Board to transmit a packet. Once the first Prototyping Board assembly receives a
test packet, it will send back a response packet that will be displayed 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 RCM3209/RCM3229 modules interact, you can move on and try
the other sample programs, or begin building your own.
16
STDIO
window to demonstrate digital outputs by toggling
—demonstrates the use of costatements (cooperative multitasking)
RESET
SAMPLES\RCM3200
button on the Prototyping Board so that
Run
mode. Then connect the program-
RabbitCore RCM3209/RCM3229

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the RabbitCore RCM3209 and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Rabbitcore rcm3229

Table of Contents