38
Smartcat (BL2100)
4.2 Sample Programs
Sample programs are provided in the Dynamic C
Samples
folder. The sample program
PONG.C
demonstrates the output to the
STDIO
window.
The various directories in the
Samples
folder contain specific sample programs that illus-
trate the use of the corresponding Dynamic C libraries.
The
BL2100
folder provides sample programs specific to the BL2100. Each sample pro-
gram has comments that describe the purpose and function of the program. Follow the
instructions at the beginning of the sample program.
To run a sample program, open it with the
File
menu (if it is not still open), compile it
using the
Compile
menu, and then run it by selecting
Run
in the
Run
menu. The BL2100
must be connected to a PC using the programming cable as described in Section 2.1,
“BL2100 Connections.”
More complete information on Dynamic C is provided in the
Dynamic C User’s Manual
.
TCP/IP specific functions are described in the
Dynamic C TCP/IP User’s Manual
. Infor-
mation on using the TCP/IP features and sample programs is provided in Section 5,
“Using the TCP/IP Features.”
4.2.1 Digital I/O
The following sample programs are found in the
IO
subdirectory in
SAMPLES\BL2100
.
•
DIGIN.C
—Demonstrates the use of the digital inputs. Using the Demonstration Board,
you can see an input channel toggle from HIGH to LOW when pressing a pushbutton
on the Demonstration Board. See Appendix D for hookup instructions for the Demon-
stration Board.
•
DIGOUT.C
—Demonstrates the use of the high-current outputs configured as either
sinking or sourcing outputs. Using the Demonstration Board, you can see an LED tog-
gle on/off via a high-current output. See Appendix D for hookup instructions for the
Demonstration Board.
•
PWM.C
—Demonstrates the use of Timer B to generate a PWM signal on PE5-INT
located on header J11/J10. The program generates a 42 Hz PWM signal with the duty
cycle adjustable from 1 to 99%.
4.2.2 Serial Communication
The following sample programs are found in the
RS232
subdirectory in
SAMPLES\BL2100
.
•
PUTS.C
—Transmits and then receives an ASCII string on Serial Ports B and C. It also
displays the serial data received from both ports in the
STDIO
window.
•
RELAYCHR.C
—This program echoes characters over Serial Port B to Serial Port C. It
must be run with a serial utility such as Hyperterminal.
Summary of Contents for Smartcat
Page 6: ...Smartcat BL2100 ...
Page 14: ...8 Smartcat BL2100 ...
Page 60: ...54 Smartcat BL2100 ...
Page 78: ...72 Smartcat BL2100 ...
Page 84: ...78 Smartcat BL2100 ...
Page 118: ...112 Smartcat BL2100 ...
Page 124: ...118 Smartcat BL2100 ...
Page 132: ...126 Smartcat BL2100 ...
Page 134: ......