Datasheet

Page 5
VCC-MCU
P0.7
P0.6
P0.5
P0.4
P0.3
P0.2
P0.1
P0.0
C1 C2 C3
X1
R1
U1 U2
R2
P0.7
P0.6
P0.5
P0.4
P0.2
P0.1
P0.0
P0.3
R3
4K7
R7
4K7
R4
4K7
R8
4K7
R5
4K7
R9
4K7
R6
4K7
R10
4K7
LD0
LED
LD4
LED
LD1
LED
LD5
LED
LD2
LED
LD6
LED
LD3
LED
LD7
LED
LED blinking is just turning ON and OFF LEDs
that are connected to desired PORT pins. In order
to see the example in action, it is necessary to
connect the target microcontroller according to
schematics shown on Figure 2-1. In the project
we are about to write, we will use only PORT0,
so you should connect the LEDs to PORT0 only.
Let’s make a simple “Hello world” example for the selected
microcontroller. First thing embedded programmers usually
write is a simple LED blinking program. So, let’s do that in a few
simple lines of C code.
Prior to creating a new project, it is necessary to do the following:
Step 1: Install the compiler
Install the mikroC PRO for 8051 compiler from the Product DVD or
download it from the MikroElektronika website:
Step 2: Start up the compiler
Double click on the compiler icon in the Start menu, or on your
desktop to Start up the mikroC PRO for 8051 compiler. The mikroC
PRO for 8051 IDE (Integrated Development Environment) will appear
on the screen. Now you are ready to start creating a new project.
2. Hardware connection
Figure 2-1:
Hardware connection schematic
www.mikroe.com/mikroc/8051/