Professional Documents
Culture Documents
Students Project
Board
ADVANCE TECHNOLOGY
S.C.O. 160 1st Floor Sec 24D
CHANDIGARH
Ph. No. 0172-5086213
Email ID: atechindia@gmail.com
1
INDEX
S.No Topics Page. No
1. Introduction…………………………………. 03
2.1 P89C51RD2/AT89s51
2.2 RTC & E2PROM
2.3 LCD 16x2
2.4 Relays 6V DC
2.5 2 Seven Segment
2.6 8 Output Leds
2.7 RS 232 Connector
2.8 Dip Switches
2.9 Power Supply 5V
4. Experiments ………………………………. 22
2
FOREWORD
Since the Time to Market is crucial MAB can reduce the development time
since testing of basic devices can be done and by the time PCBs are
manufactured designer is ready with the tested code.
3
INTRODUCTION
AT-51 has on board
P89C51RD2/AT89s51
RTC &E2PROM
LCD 16x2
Relays 6V DC
2 seven segment
8 ouput leds
Dip switches
Power Supply 5V
RS-232 (FOR SERIAL INTERFACE)
CENTRAL PROCESSOR
MEMORY
Voltage Current
+ 5 V dc 1A
4
HARDWARE DIAGRAM
LCD
LED O/P
Programming
Seven Connector
Segmen
t
Relay 8051 UC
RTC
Eprom
RS 232
5
BLOCK DIAGRAM OF 8051 STUDENT PROJECT BOARD
PROG
LCD SECTION CONN
SEVEN
SEGMENT
P0
BLUE
TOOT
H
UC BL
P1
UE
RTC & EPROM TO
RELAY AND SECTI
8051 OT
BUZZER ON
BL
H
SECTION P2
UE
TO
OT
SE
H
CT
POWER
SECTION SELECTOR BL
IO
RS
SWITCH DIGITAL IN UE
N
232
TO
SE
OT
CT
H
IO
N
SE
CT
IO
N
6
CONFIGURATION AND INSTALLATION
1. Put all jumpers near PROG CONN on right corner on hardware board
2. Shift all left side if using Philips 89c51rd2bn.
3. Shift all right side if using atmel AT89S51.
4. Connect 5V power source to hardware board.
5. connect programming adaptor connector to PROG CONN. On
harware board just to right corner to program microcontroller through
FLASH MAGIC.
6. switch ON 1,2,3,4,5,6,7,8 switches of DIP switch (selector switch), to
see output
LCD
7-SEGMENT
LED
DIGITAL
INPUT
RELAY&
BUZZER
SERIAL
COMMU.
7
Connections for Experiments
LCD
Data P1
RS P3.6
E P3.7
7-segment
Control Port P3
Data port P0
LEDs
Port P0
Relay
Relay1 port P0.1
Buzzer port P0.0
RS 232(serial comm.)
RX Port P3.2
TX Port P3.1
8
HOW TO PROGRAM THE MICRO CONTROLLER ON
THE KIT
b) Click START.
“FINISHED”
9
Microcontroller 8051 Project Board Components
P89C51RD2
Features
• On-chip Flash Program Memory with In-System Programming
(ISP) and In-Application Programming (IAP) capability
• Boot ROM contains low-level Flash programming routines for
downloading via the UART
• Can be programmed by the end-user application (IAP)
• Parallel programming with 87C51 compatible hardware interface
to programmer
• Supports 6-clock/12-clock mode via parallel programmer (default
clock mode after Chip Erase is 12-clock)
• 6-clock/12-clock mode Flash bit erasable and programmable via
ISP
• 6-clock/12-clock mode programmable “on-the-fly” by SFR bit
• Peripherals (PCA, timers, UART) may use either 6-clock or
12-clock mode while the CPU is in 6-clock mode
• Speed up to 20 MHz with 6-clock cycles per machine cycle
(40 MHz equivalent performance); up to 33 MHz with 12 clocks
per machine cycle
• Fully static operation
• RAM expandable externally to 64 Kbytes
• Four interrupt priority levels
• Seven interrupt sources
• Four 8-bit I/O ports
• Full-duplex enhanced UART
– Framing error detection
– Automatic address recognition
• Power control modes
– Clock can be stopped and resumed
– Idle mode
– Power down mode
• Programmable clock-out pin
• Second DPTR register• Asynchronous port reset
• Low EMI (inhibit ALE)
• Programmable Counter Array (PCA)
– PWM
– Capture/compare
10
USE OF COMPILER AND PROGRAMMER
Compiler: KEIL
11
3. Go to the project & click on new project
12
5. when you click on the save button ,following window opens
13
6. Select Philips & 89c51RD2xx
14
1) Then make a New File.
9. Write or copy your gsm code there & save it with extension .c or .asm
depending on your coding.
15
2) Go to target & then source group, right click on there & click on the
option add files to the project.
16
3) Go to the option for target, click on output &tick on create hex file
option
17
5) It will show you 0 errors &0 warning on Output Window.
↑↑
After performing all these steps the chip will be configured through Flash
Magic .Let us hand on the steps of chip configuration through Flash
Magic………
Special Notes: -
Make all the DIP switches in off position before burning the program
in the controller.
Connect the Programming Cable on your Kit (prog. Conn.)and other
side of cable with the COM Port of the Computer.
Burn the Program in the microcontroller with help of Flash Magic as
explained in the next section.
18
How to use FLASH-MAGIC
3. Configuration
Click options and then click Advanced options…
19
now set the parameters as shown below
20
4. After selection of the chip (P89C51RDHxx) , Port (Com1),
Osc.Mhz(11.0592) we can see the window as below:
Select the blocks to erase, browse for the hex file to be loaded. Press
Start
21
Experiment
/* This program displays data on LCD, 7-seg and switches the relays on/off
simultaneously
LCD is working in 4-bit mode. LCD data is sent through P1.0 to P1.3 pins.
The control of 7-seg
is on P0.0 to P0.3 and data is sent through P2*/
#include <REG51F.H>
void delay()
{
int j1;
for(j1=0;j1<=1000;j1++);
}
void delay1()
{
int j1;
for(j1=0;j1<=100;j1++);
}
void longdelay()
{
int i1,k;
// for(i1=0;i1<=10;i1++)
22
for(k=0;k<=50;k++);
}
void verylongdelay()
{
int m1,m2;
for(m1=0;m1<=1000;m1++)
for(m2;m2<=100;m2++);
23
delay1();
e = 0;
delay1();
}
void timer1() interrupt 3
{
TR1=0;
for(e1=0;e1<=100;e1++)
{
P0=0x01;
P2=0xff;
delay();
P0=0x02;
P2=0xbf;
delay();
P0=0x04;
P2=0xed;
delay();
P0=0x08;
P2=0x86;
delay();
}
P0=0x00;
relay1=1;
verylongdelay();
verylongdelay();
relay1=0;
verylongdelay();
verylongdelay();
relay2=1;
verylongdelay();
verylongdelay();
relay2=0;
verylongdelay();
verylongdelay();
TL1=0x00;
TH1=0x00;
TR1=1;
24
}
} */
void main()
{
relay1=0;
relay2=0;
while(1)
{
TMOD=0x10;
for(z1=0;z1<=10;z1++)
{
TL1=0x00;
TH1=0x00;
IE=0x88;
TR1=1;
}
for(j=0;j<=5;j++)
{
lcd_inst(command[j]);
delay1();
}
for(i=0;i<=39;i++)
{
lcd_data(a[i]);
delay1();
}
for(x=1;x<=39;x++)
{
lcd_inst(0x18);
delay1();
}
}
}
25