Professional Documents
Culture Documents
__________________________________________________________________________________
HPS_________________________________________________________________ 1
Quick Start Guide - 8051 Development Kit OM TECHNOLOGY CENTRE
__________________________________________________________________________________
Information in this document, including URL’s and other internet website reference
is subject to change without notice.
HPS_________________________________________________________________ 2
Quick Start Guide - 8051 Development Kit OM TECHNOLOGY CENTRE
__________________________________________________________________________________
Contents
Installing software’s 5
Getting started 6
Projects
Interfacing LED 14
Interfacing switch and LED 16
Demonstration of serial communication 18
Getting help 20
HPS_________________________________________________________________ 3
Quick Start Guide - 8051 Development Kit OM TECHNOLOGY CENTRE
__________________________________________________________________________________
Overview of Development board
This Development Board provides an easy and low cost way to develop projects based
on 8051 microcontrollers without the need to purchase any other equipment such as
programmer or emulators. All required software’s are available as free download,
including a C compiler
Note: All required software’s are included in accompanying CD.
PORT 3 I/O PINS
5V Regulator PORT 0 I/O PINS
Microcontroller
TTL to RS232
Converter
Serial cable
Connector
Power Input
8-25 V AC/DC
Features:
1. Standard 89C51RD2 CPU clocked at 11.0592 MHz.
2. All 32 I/O pins are available at the edge of the board.
3. Onboard TTL to RS232 level converter for easy PC interface.
4. Onboard rectifier and 5V regulator.
5. 5V and Ground are available on each port connectors for external interfacing.
HPS_________________________________________________________________ 4
Quick Start Guide - 8051 Development Kit OM TECHNOLOGY CENTRE
__________________________________________________________________________________
Installing Software’s
1. Editor – is a program that allows you to edit plain text file including .c, .asm, .txt, .
html, .php & many more. (Notepad)
2. Compiler – is a program that converts high level language into machine
understandable (Binary) language. (SDCC, Keil)
3. Programmer – is a program which programs hex file into microcontroller. (Flash
Magic)
Installing SDCC (Small Device C Compiler): is freeware ANSI C compiler that targets
Intel 8051 and many more.
Follow the same steps as guided in the previous section, except locate the below file
Development kit/compilers/sdcc/sdcc-2.7.0-setup
If errors are encountered during installation, this document will not cover those
errors.
HPS_________________________________________________________________ 5
Quick Start Guide - 8051 Development Kit OM TECHNOLOGY CENTRE
__________________________________________________________________________________
Getting Started
After installing software’s it’s time to play with it.
Compiling program using Keil µVision2. Follow below steps. Figures will guide you.
6. From the File Menu select New, a new Text window appears.
7. Save the file by typing suitable file name with its extension .c (or asm).
HPS_________________________________________________________________ 8
Quick Start Guide - 8051 Development Kit OM TECHNOLOGY CENTRE
__________________________________________________________________________________
9. Right click on the folder named Target1 in the project window and select options
for Target ‘Target1’.
HPS_________________________________________________________________ 9
Quick Start Guide - 8051 Development Kit OM TECHNOLOGY CENTRE
__________________________________________________________________________________
10. In the output tab click on create HEX file and click on OK.
11. Expand Target1, a sub folder Source Group 1 appears in the project window.
12. Right click on the Source Group 1 select Add Files to Group ‘Source Group 1’
HPS_________________________________________________________________ 10
Quick Start Guide - 8051 Development Kit OM TECHNOLOGY CENTRE
__________________________________________________________________________________
13. Select the file (your program) then click on Add then Close window.
15. If there are no syntax errors a source file is compiled and a hex file is created in
the directory in which the project is saved.
HPS_________________________________________________________________ 12
Quick Start Guide - 8051 Development Kit OM TECHNOLOGY CENTRE
__________________________________________________________________________________
Projects
1. Interfacing of LED
Components required
1. LED
2. Resistor
3. Breadboard
4. Connecting wires
Note: all components are included in our development Kit except BreadBoard.
Hardware connection
Note: Assuming the reader is similar with breadboard connection.
Connect anode terminal (longer lead) of LED to resistor and another end of resistor
to Vcc. Connect cathode terminal of LED to P1.0 (pin 1) of microcontroller using
connecting wires.
Software programming
Copy paste (program if it is in pdf format) or write below program in the keil
software and compile (follow Instructions in “Getting Started “ ) to get hex file.
Program this hex file to microcontroller using Flash Magic.
After programming is complete reset the device to execute your program. Now
LED blinks approximately at 1Hz. Congrats!
HPS_________________________________________________________________ 14
Quick Start Guide - 8051 Development Kit OM TECHNOLOGY CENTRE
__________________________________________________________________________________
/* ------------------------------------------
Demonstration of interfacing an LED
Designed for 89c51 running at 11.0592 MHz
Hardware Connection
Connect anode terminal (longer lead) of LED to Vcc through 330 ohm resistor. Connect cathode
terminal of LED to P1_0 (pin 1) of microcontroller.
Compile with Keil Compiler.
Operation: when MCU power up LED blinks continuously at frequency of 1Hz.
Feedback appreciated: prashanthbs_08@yahoo.co.in
----------------------------------------------------------------*/
//INCLUDES DEFINITION OF 89C51
#include<at89x51.h> // Includes definition of 89x51
//CONSTANT DEFINES
#define INPUT_PIN 1 // define 1 as INPUT_PIN
#define TRUE 1 // define 1 as true
//PINS DEFINE
#define LED P1_0 // define port P1_0 as LED
//FUNCTIONS PROTOYPES
void main(void);
void Delay(unsigned int time);
Components required
1. LED
2. Resistor
3. Breadboard
4. Switch
4. Connecting wires
Note: all components are included in our development Kit except Breadboard.
Hardware connection
Note: Assuming the reader is similar with breadboard connection.
Software programming
After programming is complete reset the device to execute your program. Now
press the switch, LED lights up, release light disappears. Cheers!
HPS_________________________________________________________________ 16
Quick Start Guide - 8051 Development Kit OM TECHNOLOGY CENTRE
__________________________________________________________________________________
/* -----------------------------------------------------
Demonstration of interfacing switch and LED
--------------------------------------------------------
Designed for 89c51 running at 11.0592Mhz
Hardware Connection
-------------------
Connect one terminal of switch to P1_1 (pin 2 pf microcontroller) and another terminal to
ground.
Connect anode (longer lead) of LED to vcc through 330 ohm resistor. Connect cathode of
LED to P1_0 (pin 1) of microcontroller.
Operation: when MCU power up, continuously copies the status of switch to LED
Hence as along as switch is pressed LED lights up.
----------------------------------------------------------------------------
Feedback appreciated: prashanthbs_08@yahoo.co.in
----------------------------------------------------------------------------*/
//INCLUDES
#include<at89x51.h> // Includes definition of 8051
//DEFINE CONSTANT
//FUNCTION DEFINES
void main(void) // main function begins
{
LED = INPUT_PIN; //LED acts as input pin
SWITCH = INPUT_PIN; //Switch acts as input pin
//END OF PROGRAM
HPS_________________________________________________________________ 17
Quick Start Guide - 8051 Development Kit OM TECHNOLOGY CENTRE
__________________________________________________________________________________
Components required
None (all components are on the board).
Hardware connection No Hardware connections. Smile on Face!
Software programming
Copy paste (program if it
is in pdf format) or write
below program in the
keil software and
compile (follow
Instructions in “Getting
Started “ ) to get hex file.
Program this hex file to
microcontroller using
Flash Magic.
After programming is
complete reset the device
to execute your program.
Set the parameters: COM Port - Com Port number to which development board is
connected (usually COM1), Baud rate – 9600, Data bits – 8, Parity – None, Stop bits -
1, Handshaking - None.
Click on connect. Type Text in transmit window and click on send. The Message
is echo back from your microcontroller.
HPS_________________________________________________________________ 18
Quick Start Guide - 8051 Development Kit OM TECHNOLOGY CENTRE
__________________________________________________________________________________
/*-----------------------------------------------------------------------------------------------------------------------------------------
Demonstration of serial communication - ECHO program
Designed for 89c51 running at 11.0592 MHz. Communication between PC and microcontroller.
RS232 serial specification: 9600 baud rate, 8-bit , 1- Start bit, 1-stop bit, Parity none
Hardware Connection
Connect serial cable provided with 89c51 Development kit to Development board and PC.
compile with Keil Compiler.
Note: Hyper Terminal / Terminal v1.9b software required for communication
Operation: receives data from PC (or any serial device) and transmit same data back to PC- A ECHO program
Feedback appreciated: prashanthbs_08@yahoo.co.in
--------------------------------------------------------------------------------------------------------------------------------------------*/
//INCLUDES
#include<at89x51.h>
//Includes definition of 89c51
//DEFINE CONSTANT
#define Baud_rate 0xFD // for 9600 Baud rate
//DEFINE PROTOTYPES
void main(void);
void SerialInitialize(void);
void SendByteSerially(unsigned char ascii);
unsigned char ReceiveByteSerially(void);
//FUNCTIONS
void main(void) // kick start from here
{
unsigned char serialdata; // declare serialdata variable as unsigned char
SerialInitialize(); // call routine to initialize serial communication
while(1) // infinite loop
{
serialdata = ReceiveByteSerially(); // receive data from serial port
SendByteSerially(serialdata); // send data back to pc
}
} // end of main program
void SerialInitialize(void) // initialize serial communication
{
TMOD = (( TMOD & 0x0F) | 0x20); // Timer 1 in Mode 2 to generate baud rate
SCON = 0x50; // serial mode 1, 8-data bit , 1-start bit , 1-stop bit , REN enabled.
TH1 = Baud_rate; // load timer value
TR1 = 1; // start timer
}
void SendByteSerially(unsigned char serialdata)
{
SBUF = serialdata; // load data to serial buffer register
while(TI == 0); // wait until transmission to complete
TI = 0; // clear transmission interrupt flag
}
unsigned char ReceiveByteSerially(void)
{
while(RI == 0); // wait until data being received
RI = 0; // clear flag
return SBUF; // return serial data
}
// END OF PROGRAM
HPS_________________________________________________________________ 19
Quick Start Guide - 8051 Development Kit OM TECHNOLOGY CENTRE
__________________________________________________________________________________
Getting help
HPS_________________________________________________________________ 20