Sie sind auf Seite 1von 21

Developed as Learning Material for

Training of Students under TEQIP

User’s Guide
For

8051 Development Board- DB - 51

Designed & Developed In-house


by
P.T.Karule
Assistant Professor & HoD

A.P.Deshpande
Lecturer

Department of Electronics & Communication


Engineering
Yeshwantrao Chavan College of Engineering,
Nagpur - 441 110
2007-2008
Table of Contents
1. Introduction
2. Getting started
2.1 Unpacking
2.2 On the board
2.3 Power Supply Requirement
2.4 Computer requirement
3. Installing Software
3.1. Installing RIDE – assembler
3.1.1. About RIDE Assembler (FREE software available on web)
3.1.2. RKit51+XA Installations and Invocation
3.1.3. Help Documents
3.1.4. Reference Manuals
3.1.5. Support
3.2. Installing Flash Magic – In-System Programmer
3.2.1. About Flash Magic
3.2.2. Installation of Flash Magic
3.2.3. Support
4. How to use DB-51, assembler and ISP
4.1. Connecting the board to PC
4.2. How to use assembler - RIDE (software)
4.3. How to use – Flash Magic In-system Programmer (software)
4.4. How to down load program on the kit (DB-51)
5. Port pins used for connection of devices
5.1.) LCD (16 character X 2 Line)
5.2.) Tele keypad (4 x 3)
5.3.) Common anode seven segment display (One digit)
5.4.) LED
5.5.) I2C bus
5.6.) Stepper Motor Connector (J9)
5.7.) RS232 bus: (connector D9F)
5.8.) DC supply available for stepper motor
6. Sample test programs
6.1. Program #1: 8 bit LCD program to display "Dept. of ECE" in first line &
"YCCE8051/PTK/APD" in second line
6.2. Program #2: Blink LED connected to P0.4
7. Serial data transfer via RS 232 port
7.1. Using HyperTerminal
7.2. Baud rate setting of microcontroller
8. Hardware description
8.1. DB – 51 kit on board Components
8.2. Layout Map of components & connectors on the board
8.3. Circuit diagram
9. Appendix

YCCE/ECE/MANUAL-8051/PTK/APD 2
1. Introduction
The 8051 based single board development system (DB – 51) support 8051 family
microcontroller. The software supplied with this kit is having Assembler and In System
Programmer (ISP). Due to this software assembling and programming Flash program
memory becomes very easy. The user for developing real time projects can use this
mini board as a development platform. User can design, build and test any 8051 based
application / project with the help of this development board quickly.
This system is useful for students, teachers, professionals and hobbyist. Student
can apply his theoretical knowledge to develop some project and test it with the help of
this system. Teacher can set new experiments for students based on 8051
microcontroller interfacing with Keypad (3X4), seven-segment display, LED, Switches,
relay, LCD, RTC, E2PROM, I2C bus and RS232 bus. Teacher can also set experiments
based on timer application (as timer / event counter) and serial communication (data
transfer from kit to PC and PC to kit). The professional can develop, test and debug his
project. Also hobbyist can use this board to design and develop their own applications.
This board (DB-51) is provided with PHILIPS P89v51RD2 microcontroller.

YCCE/ECE/MANUAL-8051/PTK/APD 3
2. Getting Started
2.1 Unpacking
You will find following items in the package.
¾ DB – 51 kit with LCD (16 character X 2 line)
¾ Serial communication cable
¾ Transformer (9-0-9) with power cable
¾ CD-ROM containing software and data sheets
ƒ RIDE assembler
ƒ FLASH MAGIC (ISP)
2.2 On the board
On DB – 51 board you will find
¾ Microcontroller PHILIPS P89v51RD2 (8051 family)
¾ RTC DS1307 (64 x 8 Serial Real-Time Clock)
¾ EEPROM 24C32 (Two wire serial EEPROM)
¾ MAX232
¾ One Seven Segment Display
¾ One LED
¾ ISP switch
¾ RESET switch
¾ IC 7447 (BCD to 7seg driver)
¾ ULN 2803 (Stepper motor driver)
¾ Connector for RS232, LCD, I/O ports & power supply
2.3 Power Supply Requirement :
Power supply of 230V AC for step down transformer 9-0-9. The onboard rectifier
convert it to +9V and –9V which is regulated by 7805 to provide 5V DC to all
components on the board. Transformer output is connected to J8 connector (3 PIN) on
a kit.

2.4 Computer requirement :


• An 80486 processor (or better) running a 32-bit Microsoft operating system:
• Operating System Microsoft 95/98/ME/NT/2000/XP
• Memory Required 16 megabyte (MB) of RAM

YCCE/ECE/MANUAL-8051/PTK/APD 4
• A hard-disk drive with 30 megabytes of free space. The actual space required
depends on the options you select. Additional space is needed for your source-
code files and the executable files created from them.
• COM port (RS232)
• Mouse

3. Installing Software:
Copy the folder (ycce_kit) from CD to your computer
Ycce_kit consist of RIDE assembler, FLASH MAGIC ISP software, sample
programs and data sheets

3.1. Installing RIDE - assembler

3.1.1. About RIDE Assembler (FREE software available on web)


RKit51+XA is a set of tools that are smoothly integrated into a single environment
called RIDE.
Using this unique Integrated Development Environment (IDE) you can:
• Create and edit your programs, written in either assembly or C language.
• Run the compilers, linkers and debugger tools.
• Maintaining a dual project “80C51 – XA”, switching at any time from a 51-
derivative to an XA-derivative, with just one click!

3.1.2. RKit51+XA Installations and Invocation


The « RKit51+XA-Installation » program (INSTALL.EXE) installs all the necessary files
and correctly configures the environment for running the interface and the development
tools. Please close all other active application programs prior to installation.
To run the installation program :
1. Select SW_8051 >> ride-new >> EVAL >> INSTALL.EXE
2 Follow the instructions in the installation window.
3 After restarting the computer select Start | Programs | Raisonanace Kit 6.1 | Ride IDE

YCCE/ECE/MANUAL-8051/PTK/APD 5
3.1.3. Help Documents

Extensive on-line help is available. You can access via the Help command in main screen or,
for context-sensitive help, you can press F1 from a specific window with a highlighted item.

3.1.4. Reference Manuals

The Reference Manuals are available on the CD-ROM in *.pdf format and you can read
them with Acrobat Reader. Acrobat Reader is not available on the CD, but you can
download the latest version without charge from the Adobe web site :
http://www.adobe.com/acrobat

3.1.5. Support

For any question related to the RKit51+XA, you may send an email to
support@raisonance.com.
You can also download the latest version of RC-51 and RC-XA C compilers from our
WEB sites : http://www.raisonance.com or http://www.raisonance.fr

3.2. Installing Flash Magic – In-System Programmer


(FREE software available on website of Embedded Systems Academy )

YCCE/ECE/MANUAL-8051/PTK/APD 6
3.2.1. About Flash Magic:
NXP Semiconductors produce a range of Microcontrollers that feature both on-chip
Flash memory and the ability to be reprogrammed using In-System Programming
technology.
Flash Magic is Windows software from the Embedded Systems Academy that allows
easy access to all the ISP features provided by the devices. These features include:
• Erasing the Flash memory (individual blocks or the whole device)
• Programming the Flash memory
• Modifying the Boot Vector and Status Byte
• Reading Flash memory
• Performing a blank check on a section of Flash memory
• Reading the signature bytes
• Reading and writing the security bits
• Direct load of a new baud rate (high speed communications)
• Sending commands to place device in Boot loader mode
3.2.2. Installation of Flash Magic:
To run the installation program:
1. Select SW_8051 --- Flash Magic Setup ----double click
2. Follow the instructions in the installation window.
3. After restarting the computer select Start | Programs | Flash Magic | Flash Magic

3.2.3. Support
For support you can visit web sites
support@esacademy.com
www.esacademy.com/software/flashmagic

YCCE/ECE/MANUAL-8051/PTK/APD 7
4. How to use DB-51, assembler and ISP
4.1. Connecting the board to PC :
¾ The serial communication cable supplied with the board should be used to
connect the RS 232 port of board to the COM_1 port of the PC.
¾ Insert the transformer output connector (3pin) into the onboard power socket.
¾ Plug the power adaptor into 230V AC mains outlet
The DB – 51 is now ready to turn ON.

4.2. How to use assembler - RIDE (software):

You can create a shortcut of RIDE IDE on desktop.


To open assembler:
¾ Click on >>Start >> Programs >> Raisonanace Kit 6.1 >> Ride IDE or click icon
RIDE IDE on desktop (It will open a window of RIDE assembler)
¾ Click on file >> New >> assembler files >> untitled.a51>>
¾ Type assembly language program. First line of your program will be always
$MOD51 and last line will be END, then save as xyz.a51

YCCE/ECE/MANUAL-8051/PTK/APD 8
¾ Click on file >> Project>> Translate xyz.a51 >> check for errors in the window
below.
¾ Rectify the errors and then Click on file >> Project>> Build all
¾ After assembling xyz.hex file is created.

¾ To execute the program AND check the result


¾ Click on >> debug >> start xyz.aof
¾ To view the contents of port, registers
¾ Click on >> view >> hardware peripherals >> P1
¾ Click on >> view >> Main registers
¾ Click on >> view >> Data dump >> Data View
YCCE/ECE/MANUAL-8051/PTK/APD 9
¾ To execute program in single stepping mode >> press F7 and see the result
¾ After execution Click on >> debug >> terminate

YCCE/ECE/MANUAL-8051/PTK/APD 10
4.3. How to use – Flash Magic In-system Programmer (software):
Flash Magic ISP is used to down load hex file of program into flash memory of
89v51RD2. Ensure that serial cable is connected to COM port
Click on Flash Magic icon
>>Options>>adv option>>Hardware>>unselect use DTR
Follow the 5 steps given below:

¾ Follow Step 1, Step 2: Select Erase Block, Step 3 to Step 5


¾ Select the settings as given in the above window.

4.4. How to down load program on the kit (DB-51)


¾ Press step5: start button
¾ Press both the switches present on kit simultaneously RESET and ISP
¾ Then first release RESET and then release ISP switch.
¾ The HEX file is transferred to microcontroller (To run program press RESET)

YCCE/ECE/MANUAL-8051/PTK/APD 11
5. Port pins used for connection of devices
5.1.) LCD (16 character X 2 Line):
Signal I/O pin
RS P0.5
R/W P0.6
EN P0.7
D0 – D7 (8 bit) P2.0 – P2.7

5.2.) Tele keypad (4 x 3):

Rows Columns
R1 P1.0 C1 P1.4
R2 P1.1 C2 P1.5
R3 P1.2 C3 P1.6
R4 P1.3

Row – Col Key No.


R1 – C1 1
R1 – C2 2
R1 – C3 3
R2 – C1 4
R2 – C2 5
R2 – C3 6
R3 – C1 7
R3 – C2 8
R3 – C3 9
R4 – C1 *
R4 – C2 0
R4 – C3 #

YCCE/ECE/MANUAL-8051/PTK/APD 12
5.3.) Common anode seven segment display (One digit)

Signal of IC 7447
(BCD to 7 seg code I/O pin
converter)
DCBA P0.3 –P0.0

P0.3 P0.2 P0.1 P0.0


D C B A

5.4.) LED:
Device I/O pin
LEDA (red) P0.4

5.5.) I2C bus:


Signal I/O pin
SCL P3.2
SDA P3.3

5.6.) Stepper Motor Connector (J9):

J9 (Connector) I/O pin


1 12V
2 P3.7
3 P3.6
4 P3.5
5 P3.4

5.7.) RS232 bus: (connector D9F)


Signal I/O pin
TXD P3.1
RXD P3.0

5.8.) DC supply available for stepper motor

Connector Voltage
J10 12V
J11 5V

YCCE/ECE/MANUAL-8051/PTK/APD 13
6. Sample test programs
Program #1
; 8 bit LCD program to display "Dept. of ECE" in first line
; & "YCCE8051/PTK/APD" in second line
$MOD51
LCD_PORT EQU P2
LCD_EN EQU P0.7
LCD_RW EQU P0.6
LCD_RS EQU P0.5
ORG 0000H
MOV SP,#40H ; Initialise stack pointer
ACALL LCD_INIT ; Initialise LCD
MOV DPTR,#0100H ; Base address of Look up table
MOV R5,#00H ; Index
L3: MOV A,R5 ; Display First Line
MOVC A,@A+DPTR
CJNE A,#24H,L10
MOV A,#0C0H ; DD RAM Address (Second Line)
ACALL COMM ; Display Second Line
INC R5
L12: MOV A,R5
MOVC A,@A+DPTR
CJNE A,#24H,L11
L13: SJMP L13
L10: ACALL DISP ; Subroutine to send data to DR
INC R5
SJMP L3
L11: ACALL DISP
INC R5
SJMP L11

LCD_INIT: ACALL delay_100ms ; Delay of 100msec


MOV A,#38H ; Function set instruction is given 3 times
ACALL COMM ; Subroutine to send data to IR
ACALL delay_100ms ; delay
MOV A,#38H
ACALL COMM
ACALL delay_5ms
MOV A,#38H ; 001DL NFXX, DL=1: 8 bit, N=1: 2Line, F=0: 5x7 font
ACALL COMM
ACALL delay_5ms
MOV A,#08H ; Display OFF (0000 1 D C B)
ACALL COMM
MOV A,#06H ; Entry mode: increment (0000 01 I/D S)
ACALL COMM
MOV A,#0FH ; Display ON (0000 1 D C B), CURSOR BLINK
ACALL COMM
MOV A,#01H ; Clear Display
ACALL COMM
MOV A,#82H ; DD RAM Address 3RD POSITION(First Line)
ACALL COMM
RET

; Subroutine to send data to IR


COMM: CLR LCD_EN ; EN=0
CLR LCD_RS ; RS= 0, Register select (IR)
CLR LCD_RW ; RW=0, WRITE
MOV LCD_PORT, A ; Send Data
SETB LCD_EN
NOP
NOP
NOP
NOP
CLR LCD_EN
ACALL delay_5ms
RET

YCCE/ECE/MANUAL-8051/PTK/APD 14
;Subroutine to send data to DR
DISP: CLR LCD_EN ; EN=0
SETB LCD_RS ; RS=1, Register select (DR)
CLR LCD_RW ; RW=0, WRITE
MOV LCD_PORT,A ; Send data
SETB LCD_EN
NOP
NOP
NOP
NOP
CLR LCD_EN
ACALL delay_1ms
RET

; Subroutine For Delay


delay_1ms: MOV R0, #02H ;N=2 2/1
L2: MOV R1, #0FEH ; N = 254 2/1
L1: DJNZ R1, L1 ; Decrement R1& JNZ 2/2
DJNZ R0, L2 ; Decrement R0& JNZ 2/2
RET

delay_5ms: MOV R0, #0AH ; N = 10 2/1


L22: MOV R1, #0FEH ; N = 254 2/1
L21: DJNZ R1, L21 ; Decrement R1& JNZ 2/2
DJNZ R0, L22 ; Decrement R0& JNZ 2/2
RET

delay_100ms: MOV R0, #0C8H ; N = 200 2/1


L32: MOV R1, #0FFH ; N = 255 2/1
L31: DJNZ R1, L31 ; Decrement R1& JNZ 2/2
DJNZ R0, L32 ; Decrement R0& JNZ 2/2
RET

; Message Here
ORG 0100H
DB 'Dept. of ECE$'
DB 'YCCC8051/PTK/APD$'
END
---------------------------------------------------------------------------------------------------------------------
Program #2
; Blink LED connected to P0.4
$MOD51
LED EQU P0.4
ORG 0000H
MOV SP,#40H ; Initialise stack pointer
L1: SETB LED
ACALL delay_1sec
CLR LED
ACALL delay_1sec
SJMP L1

; Subroutine For Delay

delay_1sec: MOV R2,#08H


L44 MOV R1,#0F4H
L42: MOV R0,#0FFH
L41: DJNZ R0,L41
DJNZ R1,L42
DJNZ R2,L44
RET
END

YCCE/ECE/MANUAL-8051/PTK/APD 15
Program #3
;Display 0 to 9 continuously in loop
; 7 segment display common anode connected to P0.3---P0.0 (4LSB)

$MOD51
ORG 0000H
START: MOV SP,#40H
L5: MOV R1,#00H ;START WITH '0'
L1: MOV A,R1 ; in ACC
MOV P0,A ; send it to display
ACALL delay_2sec ; wait 2 sec
INC R1
CJNE R1,#0AH,L1 ;Compare for > 9
SJMP L5

;Subroutine for delay of 2 sec


delay_2sec: MOV R2,#10H
L4: MOV R3,#0FFH
L3: MOV R4,#0FFH
L2: DJNZ R4,L2
DJNZ R3,L3
DJNZ R2,L4
RET
END

YCCE/ECE/MANUAL-8051/PTK/APD 16
7. Serial data transfer via RS 232 port

7.1. Using HyperTerminal:


You can run serial data transfer program on DB-51, you can get display on
computer monitor using hyper terminal program. To use hyper terminal program of your
PC steps are as follows:
Click on start >> programs >> accessories >> communications >> hyper
terminal >> new connection >> name XYZ_1 >> connect using COM1
Properties (configure) as follows:
Bits per second = 9600
Data bits = 8
Parity bit = none
Stop bit = 1
Flow control = none
Properties (settings) as follows:
• Window keys
• Ctrl+H
• Simulation VT100
Save the settings
Now you can use hyper terminal program (XYZ_1) to see key no of pressed key on PC
terminal

7.2. Baud rate setting of microcontroller

Baud Rate Timer 1


Fosc SMOD
Reload Reload
Value C/T Mode
Value
19.2K 11.059MHz 1 0 2 FDH
9.6K 11.059MHz 0 0 2 FDH
4.8K 11.059MHz 0 0 2 FAH
2.4K 11.059MHz 0 0 2 F4H
1.2K 11.059MHz 0 0 2 E8H
137.5 11.059MHz 0 0 2 1DH

YCCE/ECE/MANUAL-8051/PTK/APD 17
8. Hardware description
8.1. DB – 51 kit on board Components
¾ Microcontroller P89v51RD2 (8051 family)
¾ RTC1307 (64 x 8 Serial Real-Time Clock)
¾ AT24C32 (Two wire serial EEPROM)
¾ MAX232
¾ One seven segment display
¾ One LED
¾ ISP switch
¾ Reset switch
¾ 7447 (BCD to 7 seg driver)
¾ ULN 2803 stepper motor driver
¾ Connector for RS232, LCD, Stepper motorI/O bus & power supply

8.2. Layout Map of components & connectors on the board:-

YCCE/ECE/MANUAL-8051/PTK/APD 18
8.3. Circuit Diagram

Interfacing of LCD, 7segment, LED’s, Stepper Motor, I2C

LCD (16x2) 7SEGMENT (BCD)


RS RW EN D7 - D0 D C B A
P0.5 P0.6 P0.7 P2 P0.3 P0.2 P0.1 P0.0

STEPPER MOTOR I2C

1 2 3 4 5 SCL SDA
12V P3.7 P3.6 P3.5 P3.4 P3.2 P3.3

LED DC SUPPLY

1 2 3 4 5 12V - GND 5V - GND


P0.4 - - - - J10 J11

YCCE/ECE/MANUAL-8051/PTK/APD 19
J10 J11
D1 U2 CONN-SIL2 CONN-SIL2
7805
J8 12V 1 3 VCC
VI VO
3 1N4001
D2 J6

GND
D8

12V 1
GND 2

VCC1
GND 2
2
1 C10 C11 C12 LED
CONN-SIL18
1000u 100n 100n

2
CONN-SIL3 1N4001
GND R9

GND 1
VCC2
3
P05 4
P06 5
P07 6
D0 7
D1 8
D2 9
D310
D411
D512
D613
D714
VCC 15
GND 16
17
18
330k

C1

VCC
J1
U1 1 J2 R2
VCC

19 39 P00 2 P00
1 J7
GND

100n
XTAL1 P0.0/AD0
X1 P0.1/AD1
38 P01 3 P01
2
10k
1
37 P02 4 P02
3 6
CRYSTAL
JP1 C8 C2 18
P0.2/AD2
36 P03 5 P03
4 2
XTAL2 P0.3/AD3
35 p04 6 P04
5 7
JUMPER 10u P0.4/AD4
34 p05 7 P05
6 C3 3
P0.5/AD5
100n 33 p06 8 P06
7 8
P0.6/AD6
9 32 p07 9 P07
8 4
RST P0.7/AD7 J3 100n 9
R3 P2.0/A8
21 D0 1 CONN-SIL9 CONN-SIL8 5
22 D1 2
10k
JP2 R1
P2.1/A9
23 D2 3 1 3 U3 CONN-D9F
P2.2/A10
29 24 D3 4
GND

PSEN P2.3/A11
JUMPER 30 25 D4 5
10k ALE P2.4/A12 C1+ C1-
VCC
31 26 D5 6
EA P2.5/A13
27 D6 7 TXD 11 14
P2.6/A14 T1IN T1OUT
28 D7 8 RXD 12 13
J5 P2.7/A15 J4 GND 10
R1OUT R1IN
7 GND
T2IN T2OUT
8 1 10 RXD1 CONN-SIL8 9 8

VCC
7 2
P1.0 P3.0/RXD
11 TXD2
R2OUT R2IN C5
P1.1 P3.1/TXD
6 3 12 SCL3 2
P1.2 P3.2/INT0 VS+
5 4 13 SDA4 6
P1.3 P3.3/INT1 VS-
4 5 14 ST1 5 100n C7
VCC

3 6
P1.4 P3.4/T0
15 ST2 6 C6 10
P1.5 P3.5/T1 C2+ C2-
2 7 16 ST3 7

GND
U6 1 8
P1.6 P3.6/WR
17 ST4 8
P1.7 P3.7/RD
P00 7 13 4 5 MAX232 100n
A QA
P01 1 12 CONN-SIL8 AT89C51 CONN-SIL8
B QB
P02 2 11
P03 6
C QC
10 C4
D QD
4 9
BI/RBO QE
5 15
RBI QF
3 14 100n
GND

LT QG

P04
7447
U4 C9

12V

12V
SEVEN1
DISP1 2 3 U7 J9
X2 VBAT
U5 R4 COM
10 1
7 330n ST4 1 18 2
SOUT 330k 1B 1C
X2 3
A2 WP
7 ST3 2
2B 2C
17 3
2 5 SDA ST2 3 16 4
CRYSTAL A1 SDA 3B 3C
5 SDA 1 6 SCL ST1 4 15 5
GND

SDA A0 SCK 4B 4C
1 6 SCL 5 14
X1 SCL
24C32A D3 6
5B 5C
13 CONN-SIL5
LED 6B 6C
DS1307 7 12
7B 7C
8 11
VCC
8B 8C
ULN2803
MODFILE=ULN280X.MDF
PACKAGE=DIL18
9. Appendix
Pins and signals of 89C51

Das könnte Ihnen auch gefallen