1. User’s Manual
for
8051 Development Kit
8051SM-10x15
Developed at S.R.K.N.E.C.
M.Tech. VLSI Lab
By: Anish Goel
Assist. Prof. Electronics Dept.
(M.S.E.E., NJIT, USA)
2. CONTENTS
1. Introduction
2. Details of the development kit and features.
3. Connecting and powering up the kit.
4. Tutorial on RIDE and Flash Magic
5. Sample codes
8051SM-10x15 Manual Page 2
3. Chapter 1
Introduction
This development kit is a high end 8051microcontroller development kit intended
for advanced embedded applications. The kit is developed using surface mount
technology, double sided PCB and uses surface mounting components. The
development kit contains the following:
1. A 10cm x 15cm 8051 Development kit PCB with following devices on it:
a. P89V51RD2FBC microcontroller chip.
b. MAX232 chip
c. DS 1307 RTC chip
d. AT24C16 EEPROM chip
e. ULN2803 chip
f. SMD LED’s – 8 Nos.
g. Pushbutton Switches – 6 Nos.
h. Serial DB-9 Connector.
i. 32.768 Khz crystal and 3V battery for RTC
j. LM7805 voltage regulator IC and filtering capacitors.
k. 11.0592 MHz crystal and other discrete components.
2. A serial Cable.
3. A CD containing the required software’s and this instruction manual.
4. 16x2 LCD module mounted on 16 pin FRC connector.
5. 5x2 FRC/ribbon cables – 4 Nos.
6. D.C. Adaptor
8051SM-10x15 Manual Page 3
4. Chapter 2
Details of the development kit and Features
10 1
11
2
12
3
13
4
14
15 2
2
12 5
16
6
17
7
18 8
19 9
20
8051SM-10x15 Manual Page 4
5. Identification
1 ------------------------------------------------------ Outputs of ULN2803
2 ------------------------------------------------------ LED’s
3 ------------------------------------------------------ ULN 2803 IC
4 ------------------------------------------------------ AT24C16 IC
5 ------------------------------------------------------ FRC connectors *
6 ------------------------------------------------------ DC Jack
7 ------------------------------------------------------ Capacitor and filter
8 ------------------------------------------------------Input Switches
9 ------------------------------------------------------ON/OFF Switch
10 ------------------------------------------------------LCD contrast control preset
11 ------------------------------------------------------ LCD connector
12 ------------------------------------------------------ Serial Port DB-9 Connector
13 ------------------------------------------------------MAX232 IC
14 ------------------------------------------------------DS1307 RTC IC
15 ------------------------------------------------------Crystal for RTC
16 ------------------------------------------------------Crystal for microcontroller
17 ------------------------------------------------------P89V51RD2 MuC
18 ------------------------------------------------------Expansion Slot
19 ------------------------------------------------------Battery back-up for RTC
20 ------------------------------------------------------Power ON LED
* Refer to following sections for detailed configuration.
8051SM-10x15 Manual Page 5
6. Features:
1. The size of the kit is very small, due to SMD’s and double sided PCB and it is
extremely handy and can be easily used without proper lab setup with a
laptop machine.
Size in cm: 10 x 15
2. CPU of the development kit P89V51RD2FBC which is a In-system
programmable microcontroller with intel 8051 architecture.
3. For basic input/output interface LED’s and switches are provided.
4. The switches are provided as per configuration of a menu driven program.
5. ULN2803 IC provides up to 8 Darlington pairs that may be used for driving
motors or relays.
6. A MAX-232 IC with capacitors is interfaced to the microcontroller at its SCI
port to provide serial communication.
7. Power-ON reset circuitry is provided on the board that resets the
microcontroller when it is powered up. A reset switch is also present to
reset the microcontroller at any instance.
8. DC adaptor is provided to power up the kit. A ON/OFF switch is present to
turn the kit ON/OFF. Power-ON indicator LED indicates if the kit is getting
power.
9. A 11.0592 MHz crystal is present on the board to provide clock to the chip.
10.Male FRC connector pins are available on the kit as expansion slot to
interface any other PCB or device to the microcontroller besides the ON-
board interfaces.
11.LCD is interfaced in 4 bit mode and backlight of the LCD can be turned
ON/OFF by software. Contrast control is provided using preset.
12. DS1307 Real time clock IC with crystal and battery back-up is available on-
board to support real time applications.
13. AT24C16 EEPROM chip (2KB) is present on board to learn I2C interface and
provide memory to the kit.
14. All ports of 8051 are available at the FRC male connectors of 5x2
configurations to make the connections flexible. Any of the on-board
8051SM-10x15 Manual Page 6
7. interfaces and devices may be connected to any of these ports using the
FRC ribbon cables.
Pin connections for MuC on the Kit.
Pin Number Function Connected to: Comments
1 Port 1 5th Bit (P1.5) Port 1 Con. Pin 6 --
2 Port 1 6st Bit (P1.6) Port 1 Con. Pin 7 --
3 Port 1 7th Bit (P1.7) Port 1 Con. Pin 8 --
4 Reset Reset Switch --
th
5 Port 3 0 Bit (P3.0)/RXD Port 3 Con. Pin 1 --
6 NIC NC --
st
7 Port 3 1 Bit (P3.1)/TXD Port 3 Con. Pin 2 --
8 Port 3 2nd Bit (P3.2) Port 3 Con. Pin 3 --
9 Port 3 3rd Bit (P3.3) Port 3 Con. Pin 4 --
10 Port 3 4th Bit (P3.4) Port 3 Con. Pin 5 --
11 Port 3 5th Bit (P3.5) Port 3 Con. Pin 6 --
12 Port 3 6th Bit (P3.6) Port 3 Con. Pin 7 --
13 Port 3 7th Bit (P3.7) Port 3 Con. Pin 8 --
14 XTAL1 Crystal --
15 XTAL2 Crystal --
16 VSS GND --
17 NIC NC --
th
18 Port 2 0 Bit (P2.0 ) Port 2 Con. Pin 1 --
19 Port 2 1st Bit (P2.1) Port 2 Con. Pin 2 --
20 Port 2 2nd Bit (P2.2) Port 2 Con. Pin 3 --
21 Port 2 3rd Bit (P2.3) Port 2 Con. Pin 4 --
22 Port 2 4th Bit (P2.4) Port 2 Con. Pin 5 --
23 Port 2 5th Bit (P2.5) Port 2 Con. Pin 6 --
24 Port 2 6th Bit (P2.6) Port 2 Con. Pin 7 --
25 Port 2 7th Bit (P2.7) Port 2 Con. Pin 8 --
26 PSEN VCC --
27 ALE NC --
28 NIC NC --
29 EA/Vpp VCC --
30 Port 0 7th Bit (P0.7 ) Port 0 Con. Pin 8 --
31 Port 0 6th Bit (P0.6) Port 0 Con. Pin 7 --
32 Port 0 5th Bit (P0.5) Port 0 Con. Pin 6 --
33 Port 0 4th Bit (P0.4) Port 0 Con. Pin 5 --
34 Port 0 3rd Bit (P0.3) Port 0 Con. Pin 4 --
8051SM-10x15 Manual Page 7
8. 35 Port 0 2nd Bit (P0.2) Port 0 Con. Pin 3 --
st
36 Port 0 1 Bit (P0.1) Port 0 Con. Pin 2 --
th
37 Port 0 0 Bit (P0.0) Port 0 Con. Pin 1 --
38 VCC VCC --
39 NIC NC --
40 Port 1 0th Bit (P1.0) Port 1 Con. Pin 1 --
41 Port 1 1st Bit (P1.1) Port 1 Con. Pin 2 --
nd
42 Port 1 2 Bit (P1.2) Port 1 Con. Pin 3 --
rd
43 Port 1 3 Bit (P1.3) Port 1 Con. Pin 4 --
th
44 Port 1 4 Bit (P1.4) Port 1 Con. Pin 5 --
* NIC: No internal Connection. ** NC: Not connected.
Connection details from FRC connectors and Devices point of view
ULN2803 PORT 0
Pin Config. of all FRC’s
LED’s PORT 1
1 2
3 4
5 6
7 8
LCD PORT 3
9 10
Switch and I2C PORT 2
8051SM-10x15 Manual Page 8
11. Chapter 3
Connecting and powering up the kit
1. Power is provided to the kit through DC adaptor provided with the kit.
2. Do not connect A.C. adaptor or DC adaptor with opposite polarity
configuration pin.
3. Plug-in the adaptor in the A.C socket and insert the output pin of the adaptor
into the D.C. jack present on the kit PCB.
4. After connecting the adaptor, push the ON/OFF switch.
5. The power LED on the kit turns ON to indicate that the kit is powered up
properly.
6. The serial cable provided with the kit is used to transfer the hex code from
the PC to the kit and also as a serial link between the kit and any other
device while performing serial communication.
7. Connect one of the ends of the serial cable (Male connector) to the female
serial DB-9 connector on the kit.
8. Connect the other end of this cable to the serial port of the computer
(Desktop).
9. A USB to serial convertor may be used if the kit is to be connected to a
Laptop.
10.There is no indication whether the serial link between the kit and computer
is has been established. It is automatically verified once a program is
transferred from the computer to the microcontroller successfully.
8051SM-10x15 Manual Page 11
12. Chapter 4
Tutorial on RIDE and Flash Magic
Executing sample programs using RIDE.
1. Open the RIDE software.
2. To make a new project:
• Project New
• Specify a “Name”.
• Directory where the project is to be stored.
• Target family as 80C51.
• Click “Next”.
• Select the target device as: Atmel-AT89S52, or Philips-
P89C/V51RD2xx.
8051SM-10x15 Manual Page 12
13. • Clock on “Finish”
3. The place on the left hand side is the project window. It shows all the
details about the project.
4. To create new file: File New C File.
5. Write your code into the window on the right and save it.
6. Right click on your project name in the project window and click on “Add
node source/application”.
7. Brows the saved C-File and click ok. This includes the C-File in the project.
8. To generate .HEX file of the project press F9. The hex file is generated is
there are no errors in the code.
9. The location of the .HEX file is shown at the bottom of the RIDE window.
8051SM-10x15 Manual Page 13
14. 10. This file can be directly transferred to the microcontroller using Flash
magic.
Programming the microcontroller P89C/V51RD2BN using Philips Flash
Magic
1. Open the Philips flash magic software.
2. Make the following setting in the software:
• Select the appropriate COM port where the kit is connected.
• Select the Baud rate (Generally keep it at 9600)
• Select the device (89C51RD2xx or 89V51RD2) according to the
microcontroller place on board.
• Place a tick on “Erase all flash”
3. Brows your code’s .HEX File I the hex file space.
8051SM-10x15 Manual Page 14
15. 4. Click on the “Start” button.
5. The software gives a message “Reset the device in ISP mode now” (in case
of 89V51RD2)
6. Turn the kit off by pressing the pushbutton switch (ON/OFF) switch and
then switch it on. The above box disappears and the hex file gets transferred.
7. After the software shows “Finish” (bottom right of the window) Press
“RESET” switch to execute your program.
8051SM-10x15 Manual Page 15
16. Chapter 5
Sample codes
Code 1
This code will blink LED’s alternatively.
Connect a FRC cable from the connector labeled “Port 1” to connector labeled “LED”
/*Change the numbers 0xaa and 0x55 to change the pattern of the LED’s.*/
# include<reg51rx.h>
main()
{
int t;
P1=0xaa;
for(t=0;t<50000;t++);
P1=0x55;
for(t=0;t<50000;t++);
main();
}
Code 2
This code checks if any of the switches at port 2 is pressed and then blinks the LED’s at port 1.
Connect a FRC cable from the connector labeled “Port 1” to connector labeled “LED”
Connect another FRC cable from connector labeled “Port 2” to connector labeled “I2C and
Switches”.
# include<reg51rx.h>
void prog1();
void delay();
main()
{
int r;
8051SM-10x15 Manual Page 16
17. P2=0xff;
if (P2!=0xff)
{
prog1();
}
}
void prog1(void)
{
P1=0x00;
delay();
P1=0xff;
delay();
main();
}
void delay(void)
{
int t;
for(t=0;t<50000;t++);
}
Code 3
Set the baud rate on hyper-terminal at 9600 bps
/************************************************************/
/* this displays how to serially communicate without printf */
/************************************************************/
/* Change the matter in the statement “Hello World” to change the message.
#include<reg51rx.h>
void comsend(char *);
void cominit();
void main()
8051SM-10x15 Manual Page 17
18. {
cominit();//initialize UART for communication
comsend("Hello World");//send the string
while(1);//stop
}
void cominit()
{
TH1=-3;//timer 1 used as baud rate generator, gives 9600 baud
TMOD=0x20;//timer 1 in mode 1
TR1=1;//start timer 1
SCON=0x50;//intialize UART
}
void comsend(char *dat)//read data
{
char data temp;//temporary
for(temp=0;dat[temp];temp++)//count characters in the string
{
TI=0;
SBUF=dat[temp];//transmit character
while(!TI);//wait for transmission
}
}
Code 4
This code will display a message on the LCD.
Connect a FRC cable from the connector labeled “Port 2” to connector labeled “LCD”
#include <reg51rx.h>
//********************************************************
// DEFINE
//*********************************************************
// LCD
8051SM-10x15 Manual Page 18