Pro. fianl - Intro to Microcomputer Name: ? ? ? Student ID:...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
Intro to Microcomputer Final Project Report The purpose of this lab: Use the LCD and Timer to design a simple Watch that displays the complete date and time. Time: Hour: Minute: Second and Date: Year/Month/Day Hardware used in this Lab: 1) Main board: ICE 8051 2) Target board: LCD Computer 3) Target board: a. 7SEGx4 LED Name : ? ? ? Student ID : 9823189 Group number : 21 Class period : 5GH
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Program code RS REG P2.0 RW REG P2.1 E REG P2.2 .SYMBOLS ON ORG 00H JMP START ORG 0BH JMP TIMER0 ORG 50H START: MOV R5,#250 CALL DELAY MOV A,#00111011B ; 8-bit data access CALL COMMAND ; Double row, 5 * 7 dot matrix font MOV A,#00001100B ; monitor ON CALL COMMAND ; the cursor doesn’t show, not blink MOV A,#00000001B ; clear full screen CALL COMMAND MOV R5,#FFH CALL DELAY MOV A,#10000000B ;set DD RAM address 0 CALL COMMAND MOV 30H,#32H ; displayed on the LCD data, the ASCII code values MOV 31H,#30H MOV 32H,#31H MOV 33H,#31H ; year 2011 (30H~33H) MOV 34H,#2FH ; (34H) MOV 35H,#30H MOV 36H,#31H ; Month 01 (35H~36H) MOV 37H,#2FH ; (37H) MOV 38H,#30H MOV 39H,#31H ; Day 01 (38H~39H) MOV 3AH,#6 ; Week 6 - (3AH) MOV 3BH,#30H MOV 3CH,#39H ; 09 Hours (3BH~3CH) MOV 3DH,#3AH ; - (3DH) MOV 3EH,#30H MOV 3FH,#30H ; 00 minute (3EH~3FH) MOV 40H,#20H ; blank - (40H) MOV 41H,#30H
Background image of page 2
MOV 42H,#30H ; 00 second (41H~42H) SETB ET0 ; TIMER0 initialization CLR TF0 SETB PT0 ; set High Priority MOV TMOD,#01H MOV TL0,#F0H ; Set trigger once per second MOV TH0,#D8H SETB TR0 SETB EA LCD: MOV R0,#30H ; 30H= R0, because there are data from 30H ~ 42H MOV A,#83H ;AC=03H CALL COMMAND line1: ; New Year Month Day MOV A,@R0 ; Using I. Ad. Method 30H ~ 39H of the data read out one by one CALL SENDDATA ; And displayed to the LCD, 03H ~ 0CH INC R0 CJNE R0,#3AH,line1 ;if R0≠3AH,jump to line1,if not, R0=3AH, represent new Y/M/D, Continue to the next line MOV R0,#3BH ; 3BH moves to R0 MOV A,#C6H ; AC=46H CALL COMMAND line2: ; New Hour/Min/Sec MOV A,@R0 ; Using ind. ad. Method 3BH ~ 42H to read out data one by one CALL SENDDATA ; Display the LCD 46H~4DH INC R0 CJNE R0,#43H,line2 ;ifR0≠43H,jump line2, if not, R0=43H,represent new H/M/S ,Continue to the next line MOV R1,#0 ;R1=0 MOV DPTR,#week_t ;(DPTR)=week_t address MOV A,#C2H ;AC=42H CALL COMMAND MOV A,3AH ; move,week,into A MOV B,#3 MUL AB MOV R0,A ; R0 = week*3 line3: ; New week MOV A,R0 MOVC A,@A+DPTR ; using the index table "week_t" abbrev. in the week reading CALL SENDDATA ; Display to the LCD 42H~44H INC R0 INC R1
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CJNE R1,#3,line3 ;ifR1≠3,jump line3,if not, R1=3,represent new week, Continue to the next line. MODE:
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/11/2012 for the course ELECTRIC 101 taught by Professor Chen during the Spring '11 term at National Chiao Tung University.

Page1 / 10

Pro. fianl - Intro to Microcomputer Name: ? ? ? Student ID:...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online