User Manual 8051 Training Kit
User Manual 8051 Training Kit
USER MANUAL
MICROCONTROLLER TRAINING
AND DEVELOPMENT KIT
CONTENTS
2
8051ETK-01 TRAINING AND DEVELOPMENT KIT
8051ETK-01 is also designed with features which make it ideal as a first step
educational tool, as well as an advanced and powerful development platform.
The manual contains a start-up guide and a walk-through of the major modules
and components of the kit and their functionalities. It also contains comprehen-
sive block diagrams and figures of the kit, safety precautions for using the kit
and maximum and minimum power ratings. Sample codes, tutorials, lectures
and datasheets of all the components used are given in the 8051ETK-01 CD.
The 8051ETK-01 kit also includes 8051 Programmer for burning Hex file into
the microcontroller. The EZ-Downloader is the software of programmer which is
also available on the CD supplied with the kit.
It is hoped that the user will have as much pleasure using the kit as we had
designing it!
“The Design Team”
3
PACKAGE CONTENTS
4
FEATURES AND SPECIFICATIONS
5
SAFETY GUIDELINES
• Do not remove the microcontroller from the programmer during the burn-
ing process. Doing so may end up in damaging the controller perma-
nently.
• While mounting the microcontroller on the ZIF sockets (of both Develop-
ment board and Programmer), keep in mind the correct direction of the
microcontroller.
• While testing any of the output displays (LED array, 7-segment or LCD),
select the jumpers according to the guidelines (given in corresponding
section) for correct functionality.
• While plugging the LCD cable, keep in mind the correct direction of the
cable.
• Do not adjust the pot knobs without going through the details of their
working. Doing so may disturb the resolution of ADC.
6
8051ETK-01 BOARD LAYOUT
7
HARDWARE DETAILS OF 8051ETK-01
In 8051ETK-01 board, all the four ports of the microcontroller are fully
used and yet are flexible for external / specific use by the user. For this
purpose, P0, P1, and P2 have been provided with 2x4 headers for external
use. The headers are identified by Port 0, Port 1 and Port 2 on the board.
The layout of the headers is shown in the FIG 1.
As P0 of the microcontroller needs external pull up resistors, a resistor
pack RP2 of (8x4.7K) is connected with Port 0.
8
HARDWARE DETAILS OF 8051ETK-01
Hardware of the 8051ETK-01 board has been divided into various modules
which are explained as follow.
a. POWER MODULE
The kit is supplied with an AC Adapter of the following electrical ratings and is the main
source of Power Supply:
9
HARDWARE DETAILS OF 8051ETK-01
V cc
■ ■
■ ■ 12V R1
■ ■ 5V (Vcc)
GND PWR LED
12V
DC IN 12V IN
1 2
2 1
12V
5
DC IN V
1 2
D1 7812 7805 VCC IN
1 3 1 3
V IN VOUT VIN VOUT VCC
S
AC
1N4004 + GND + GND +
AC/DC C4 GND
+
2
2
AC C2 C3
1 1 2
2 B
AC
-
GND
-
2
AC
-
FIG 4:FIG
Power Supply
1: Power Circuit
Module
b. RESET CIRCUIT
The reset input is the RST pin, which is input to a Schmitt trigger. The re-
set is accomplished by holding the RST pin high for at least two machine
cycles, while the oscillator is running.
10
HARDWARE DETAILS OF 8051ETK-01
C14
R8 RESET
9
R7
RST
c. DISPLAY MODULE
In 8051ETK-01 board, Port 0 of the microcontroller is connected to three
different type of displays i.e. LED Array, 7-Segment Display (SSD) and
Liquid Crystal Display (LCD). Each one can be enabled through respective
jumpers on the board.
11
HARDWARE DETAILS OF 8051ETK-01
input, NPN Darlington driver. The IC ULN2803 is used for driving high current LEDs. In
order to select LEDs out of other display devices i.e. SSD and LCD, the jumper < LED
■■
7-SEG > should be fixed on left as
1
2
3
VCC
P0.7 P0.6 P0.5 P0.4 P0.3 P0.2 P0.1 P0.0
dp g f e d c b a
VCC
U5A
1 18
IN OUT
10
COM
U5B
2 17
IN OUT
U4 10
COM
40
P1.0 Vcc
39 U5C
P1.1 P0.0
38 3 16
P1.2 P0.1 IN OUT
37 10
P1.3 P0.2 COM
36 R14 a
P1.4 P0.3
35 U5D R15 b
P1.5 P0.4
34 4 15 R16 c
P1.6 P0.5 IN OUT
33 10 R17 d
P1.7 P0.6 COM
32 R18 e
RESET P0.7
31 U5E R19 f
P3.0/RXD EA
30 5 14 R20 g
P3.1/TXD ALE IN OUT
29 10 R21 dp
P3.2/INT0 PSEN COM
28
P3.3/INT1 P2.7
27 U5F
P3.4/T0 P2.6
26 6 13
P3.5/T1 P2.5 IN OUT
25 10
P3.6/WR P2.4 COM
24
P3.7/RD P2.3
23 U5G
XTAL1 P2.2
22 7 12
XTAL2 P2.1 IN OUT
21 10
GND P2.0 COM
U5H
8 11
IN OUT
10
COM
12
HARDWARE DETAILS OF 8051ETK-01
4 Digits, i.e. DIG1, DIG2, DIG3 and DIG4 of SSD are active low and are
connected to P2.4, P2.5, P2.6 and P2.7 respectively through transistor
switches Q1, Q2, Q3 & Q4 respectively. In order to select the SSD the
jumper < LED 7-SEG > should be fixed as
■■
1 2 3
VCC
DS4 DS3/WR DS2/EN DS1/RS
Q1 Q2 Q3 Q4
R31 R32 R33 R34
Table 1
7-SEGs of
Port Pins Digits Port Pins
SSD
a P0.0 DIG1 P2.4
b P0.1 DIG2 P2.5
c P0.2 DIG3 P2.6
d P0.3 DIG4 P2.7
e P0.4
f P0.5
g P0.6
dp P0.7
13
HARDWARE DETAILS OF 8051ETK-01
1 2 3 1 2 3
VCC
LCD Port
1 2
3 4 DS1/RS
DS3/WR 5 6 DS2/EN
D0 7 8 D1
D2 9 10 D3
D4 11 12 D5
D6 13 14 D7
15 16
Table 2
LCD CON-
LCD DATA
PORT PINS TROL SIG- PORT PINS
BUS
NALS
D0 P0.0 RS P2.7
D1 P0.1 EN P2.6
D2 P0.2 WR P2.5
D3 P0.3
D4 P0.4
D5 P0.5
D6 P0.6
D7 P0.7
14
HARDWARE DETAILS OF 8051ETK-01
d. ADC MODULE
8051ETK-01 has an 8-bit A/D Module for real time data acquisition. The
core of this module is 8-bit A/D Chip ADC0804 (U3) on the board.
The other major components of the module are LM35 temperature sensor
(for analogue input voltage) and LM324 op-amp (for current and voltage
amplification).
The output of LM35 is to be compatible with input of the ADC. For this
purpose the output of LM35 is required to be amplified. This amplifica-
tion is done through LM324 (U2). LM 324 is a quad op-amp having four
independent, high gain op-amps. Connection diagram is shown. The
voltage from LM35 is amplified 5 times after a buffer (section A of the
LM324), gain of the amplifier (section B of the LM324) can be adjusted
15
HARDWARE DETAILS OF 8051ETK-01
through the adjustment pot “Gain” which amplifies the maximum output
of LM35 up to 5V which corresponds to 100ºC. It means that total gain of
the amplifier required will be equal to 5 because the output of LM35 is
1V at 100 ºC. Since the amplifier is wired in non-inverting configuration
so the gain is expressed as:
Vo Rf
Gain = = 1+
Vin Rin
Rf
5 = 1+
Rin
Rf
= 5 −1 = 4
Rin
U2A
4
2
1
3
R
R
U2
5
11
7 ADC IN
VC 6
C
4
Analog IN R
11
1 + 12V
Vi
2
3 _ Gain
+C R
16
HARDWARE DETAILS OF 8051ETK-01
(ii) ADC0804
The ADC0804 is an 8-bit, CMOS, successive approximation analog to
digital converter, which has a 0-5V analogue input voltage range. It can
be easily interfaced to most microprocessors and microcontrollers. It
gives an 8-bit digital output with conversion time <100micro-seconds.
The 8-bit Digital output from ADC is connected to the Port 0 of the micro-
controller. The control signals of ADC i.e. WR (Start Conversion), INTR
(End of Conversion) and RD (Output Enable) are connected to P3.7,
P3.6 and to GND respectively. The functions of these control signals are
explained below.
17
HARDWARE DETAILS OF 8051ETK-01
the reference voltage for the IC is either 1/2 of the voltage which is ap-
plied to the Vcc supply pin, or is equal to the voltage which is externally
forced at the VREF/2 pin. This allows for a pseudo-ratio metric voltage
reference using, for the V+ supply, a 5V reference voltage. Alternatively,
a voltage less than 2.56V can be applied to the VREF/2 input. The inter-
nal gain to the VREF/2 input is 2 to allow this factor of 2reduction in the
reference voltage.
Port 1
8
7
6
5
4
3
2
1
VREF
VCC
20
U3 U4
7 18 1 40
Vin(-) lsbDB0 P1. 0 Vcc
VccREF
17 2 39
DB1 P1. 1 P0. 0
ADC IN 6 16 3 38
Vin(+) DB2 P1. 2 P0. 1
<1.28 2.56> 15 4 37
DB3 P1. 3 P0. 2
14 5 36
DB4 P1. 4 P0. 3
8 13 6 35
1
2
3
C16
C8 C8
Z3 Z1 Z2
18
HARDWARE DETAILS OF 8051ETK-01
These are three output control devices connected to the port 2 of the mi-
crocontroller. This will give experience of controlling / activating DC, AC
and Ac / Dc loads. The control devices are Triac, Darlington and Relay.
The connected load must not exceed the voltage/current rating of the de-
vices. The schematics, of these control devices and its brief description is
given in the succeeding paragraph
12V
R24
VCC EXT PWR
P2.2 4N25
R25
P2. Q5
P2.1 4N25
P2.1 DAR
P2.0
HOT
P2.0 TRIG
MOC3041
AC Load
2
1
R2 PHASE
HOT
Triac
TRIG
LOAD
19
HARDWARE DETAILS OF 8051ETK-01
EXT
R2
R2
DAR
DC Load
Darlington
1
2
3
12
V
D
Re-
2
lay Relay
A
1
R2
Q 2
Q 2 3
5 5
1
2
R2 3
3 Relay
B
20
HARDWARE DETAILS OF 8051ETK-01
f. Analogue Comparator
12V VCC
Comparator
1
2
R26
1
2
3
9 LM324
4
Z4
LED
FIG 18: (a) Analogue Comparator (b) Selection jumper (c) Status LED
21
HARDWARE DETAILS OF 8051ETK-01
RP1
Ext Event1 Ext Event0 Ext INT1 Ext INT0
1
2
2
2
1
INT0
INT1 T1 T0 INT1 INT0
T0
T1
FIG 19: (a) Push Buttons (b) Jumpers for External connections
22
HARDWARE DETAILS OF 8051ETK-01
the cable length increases, the capacity and DC loading effect reduce the
noise margin to an unacceptable level. To overcome this short coming
and to communicate with non-TTL level (pc serial port) a voltage level in-
terpreter is needed. This interpretation is done through standard trans-
ceiver IC’s like MAX232.
The MAX232 (transceiver) accepts TTL level inputs and converts these
two RS 232 output voltage level and also performs the opposite conver-
sion.
On board RS 232 based serial interface has been provided so that serial
interfacing with PC is established for communication between the board
and PC. Pins P3.0 (TXD) are used for this propose and schematic of this
circuit is shown in Fig.20.
VCC
8 1
C1
7
5 3
9 C1
4 2 4
U1
8
C1
3 5
16
7
2 10
TXD
6 RXD
9 6
1
15 C1
RS232
j. BUZZER
23
HARDWARE DETAILS OF 8051ETK-01
VCC
R10
BUZZER
+
T1
-
FIG 21: Buzzer Interface
24
8051ETK-01 PROGRAMMER
The 8051ETK-01 Programmer included in the Kit is used to burn hex files
into the microcontroller. It has the same ZIF socket as the 8051ETK-01
Development Board and care must be taken to insert the controller in the
right direction into the ZIF socket. The programmer is supplied with
8051ETK-01 Downloader software and the AC adapter. The AC adapter
provided is used to power up the Programmer. An LED on the programmer
board blinks when the programmer is powered up to indicate it is active.
The same LED glows blue and red alternately with greater intensity while a
hex file is being burnt into the controller. At the end of the programming the
LED resumes its blinking status.
AT AT
89C51 AT
89C51 89C51
A
FIG 22: (a) Master Controller Inserted, showing the (b) Target Controller inserted in the right
Direction of Target Controller Direction in the ZIF socket
25
SOFTWARE
a) Keil Compiler
EZ-Downloader software burns the generated hex file into the microcontrol-
ler. It has the following functionalities:
1.Reads hex file
2.Erases the previous hex code from the microcontroller
3.Writes the hex file into the target microcontroller
4.Verifies the signature bytes on the microcontroller
5.To Lock & Fast Verify, Check manually the Lock & Fast Verify options
shown in the window
26