MCB517AC Evaluation Board User’s Guide
33
BLINKY Example Program
The following simple program, BLINKY, is an exercise you may use to test the
MCB517AC and verify that you can use the tools provided to generate a working
program.
BLINKY does nothing more than blink the LEDs on the MCB517AC evaluation
board. The complete source listing for the program is as follows:
/* BLINKY.C - LED Flasher for the Keil MCB517AC Evaluation Board */
#include <reg517a.h> /* Include 80C517A header file */
void wait (void) { /* wait function */
; } /* only to delay for LED flashes */
void main (void) {
unsigned int i; /* Delay var */
unsigned char j; /* LED var */
while (1) { /* Loop forever */
for (j=0x01; j< 0x80; j<<=1) { /* Blink LED 0,1,2,3,4,5,6,7 */
P4 = j; /* Output to LED Port */
for (i = 0; i < 10000; i++) { /* Delay for 1000 Counts */
wait (); /* call wait function */
}
}
for (j=0x80; j> 0x01; j>>=1) { /* Blink LED 7,6,5,4,3,2,1,0 */
P4 = j; /* Output to LED Port */
for (i = 0; i < 10000; i++) { /* Delay for 10000 Counts */
wait (); /* call wait function */
}
}
}
}
You may build the BLINKY example program either using the 8051 tools from
the MS-DOS command line or you may use the µVision integrated development
environment and dScope. Both methods are described below.
Using the MS-DOS Command Line Tools
Use the following command line to compile the BLINKY example program:
C51 BLINKY.C DEBUG
Use the following command line to link the BLINKY example program for use
with the 8051 monitor:
L51 BLINKY.OBJ CODE (0100H)
Summary of Contents for MCB517AC
Page 6: ...vi Contents...
Page 23: ...MCB517AC Evaluation Board User s Guide 17 Schematics...
Page 24: ...18 Chapter 3 Hardware...
Page 25: ...MCB517AC Evaluation Board User s Guide 19...
Page 26: ...20 Chapter 3 Hardware...
Page 27: ...MCB517AC Evaluation Board User s Guide 21 Printed Board Assembly...
Page 32: ...26 Chapter 3 Hardware...
Page 34: ......