Академический Документы
Профессиональный Документы
Культура Документы
for
8051 Development Kit
8051DK-6x10
For Workshop on
1. A 6cm x 10cm 8051 Development kit PCB with following devices on it:
a. P89V51RD2BN microcontroller chip.
b. MAX232 chip
c. 3mm LEDs 4 Nos.
d. Pushbutton Switches 4Nos.
e. Seven Segment Display (Common Cathode) 1Nos.
f. 0.5 cm DC motor with driver circuit.
g. Serial DB-9 Connector.
h. B-type USB connector.
i. 11.0592 MHz crystal and other discrete components.
3. A serial Cable.
1
2
8
3
9
15
10
4
11
12
5
13 6
7
14
Identification
Features:
1. The size of the kit is very small, due to which it is extremely handy and can
be easily used without proper lab setup with a laptop machine.
Size in cm: 6 x 10
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.
8051DK-6x10 Manual Page 10
Clock on Finish
3. The place on the left hand side is the project window. It shows all the
details about the project.
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.
6. Turn the kit off by pressing the pushbutton switch (AC/DC) switch and then
switch it on. The above box disappears and the hex file gets transferred.
ALTERNATIVELY
6. At this point press the BOOT switch on the kit. Reset the device by
pressing the RESET switch (while keeping the BOOT switch pressed), and
then release the BOOT switch. The above window disappears and the .HEX
file is transferred to the microcontroller.
7. After the software shows Finish (bottom right of the window) Press
RESET switch to execute your program.
8. In case of 89C51RD2xx, select this device, locate the hex file, follow STEP 6
(above) and then press start button on the software.
Change the numbers 0xaa and 0x55 to change the pattern of the LEDs.
# 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 LEDs at port 1.
# include<reg51rx.h>
void prog1();
void delay();
main()
{
int r;
P2=0xff;
if (P2!=0xff)
{
void prog1(void)
{
P1=0x00;
delay();
P1=0xff;
delay();
main();
}
void delay(void)
{
int t;
for(t=0;t<50000;t++);
}
Code 3
This code displays the count 0 to 9 on seven segment display interfaced on port 0.
# include<reg51rx.h>
main()
{
int t,i,u;
static code char num[] = {0x7e,0x48,0x3d,0x6d,0x4b,0x67,0x77,0x4c,0x7f};
for(i=0;i<10;i++)
{
P0=num[i];
for(u=0;u<20;u++)
{
for(t=0;t<50000;t++);
Code 4
Set the baud rate on hyper-terminal at 9600 bps
/************************************************************/
/* this displays how to serially communicate without printf */
/************************************************************/
#include<reg51rx.h>
void main()
{
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
}