Beruflich Dokumente
Kultur Dokumente
User’s Guide
For
A.P.Deshpande
Lecturer
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.
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
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.
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
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.
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.
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:
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
Rows Columns
R1 P1.0 C1 P1.4
R2 P1.1 C2 P1.5
R3 P1.2 C3 P1.6
R4 P1.3
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
5.4.) LED:
Device I/O pin
LEDA (red) P0.4
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
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
; 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
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
YCCE/ECE/MANUAL-8051/PTK/APD 16
7. Serial data transfer via RS 232 port
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
YCCE/ECE/MANUAL-8051/PTK/APD 18
8.3. Circuit Diagram
1 2 3 4 5 SCL SDA
12V P3.7 P3.6 P3.5 P3.4 P3.2 P3.3
LED DC SUPPLY
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