{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Functional Description - 1 FUNCTIONAL DESCRIPTION The whole...

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

View Full Document Right Arrow Icon
1. F UNCTIONAL D ESCRIPTION The whole process of program is executed in the following code. ‘DISPLAY_INFO’ is the only part that provides the execution of other subroutines. ;R0=Minute ;R1=Second ;R2=Current temp ;R3=Target temp 4 ;R4=Target min ;*****************DISPLAY_INFO ******************* DISPLAY_INFO: LCALL FIRST_LINE_LCD LCALL CURRENT_TEMP LCALL TARGET_TEMP LCALL SECOND_LINE_LCD LCALL UPDATE_TIMER LCALL CHECK_COUNTDOWN SJMP DISPLAY_INFO RET
Background image of page 1

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

View Full Document Right Arrow Icon
;*****************END OF DISPLAY_INFO ************ 1.1. LCD M ODULE This module consists of the display functions. Everything is related to the LCD including initializations are included here. It prepares first line of the lcd to write on. In the first line, there is target temperature and current temperature. ;*****************FIRST_LINE_LCD ******************* FIRST_LINE_LCD: PUSH ACC MOV A,#38H ;TWO LINES, 5X7 MATRIX ACALL COMNWRT ;WHEN SENDING A COMMAND, USE COMNWRT SUBROUTINE ACALL DELAY ;GIVE LCD SOME TIME MOV A,#0FH ;DISPLAY ON, CURSOR BLINKING ACALL COMNWRT ACALL DELAY MOV A,#01H ;CLEAR DISPLAY SCREEN ACALL COMNWRT ACALL DELAY MOV A,#06H ;INCREMENT CURSOR (SHIFT CURSOR TO RIGHT) ACALL COMNWRT ACALL DELAY MOV A,#80H ;FORCE CURSOR TO BEGINNING OF THE FIRST LINE ACALL COMNWRT POP ACC
Background image of page 2
RET ;*****************END OF FIRST_LINE_LCD ************ ;/////////////////////////////////////////////////// This part for the second line of the lcd that holds the time. ;*****************SECOND_LINE_LCD ******************* SECOND_LINE_LCD: PUSH ACC MOV A,#0C0h ;FORCE CURSOR TO BEGINNING OF THE SECOND LINE ACALL COMNWRT POP ACC RET ;*****************END OF SECOND_LINE_LCD ***************************** These are subroutines for sending data and commands. ;***********************************LCD************************************** COMNWRT: ;THIS SUBROUTINE IS FOR SENDING THE COMMANDS TO LCD MOV P1,A ;THE COMMAND IS STORED IN A, SEND IT TO LCD CLR P3.5 ;RS=0 BEFORE SENDING COMMAND CLR P3.6 ;R/W=0 TP WRITE SETB P3.7 ;SEND A HIGH TO LOW SIGNAL TO ENABLE PIN ACALL DELAY CLR P3.7 RET DATAWRT: ;THIS SUBROUTINE IS FOR SENDING THE DATA TO BE DISPLAYED MOV P1,A ;SEND THE DATA STORED IN A TO LCD SETB P3.5 ;RS=1 BEFORE SENDING DATA CLR P3.6 ;R/W=0 TP WRITE SETB P3.7 ;SEND A HIGH TO LOW SIGNAL TO ENABLE PIN
Background image of page 3

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

View Full Document Right Arrow Icon
ACALL DELAY CLR P3.7 RET ;***********************************LCD************************************** That shows the target temperature which is stored in R3. ;*****************TARGET_TEMP ******************** TARGET_TEMP: PUSH ACC MOV A,#" " ACALL DATAWRT ACALL DELAY MOV A,#"T" ACALL DATAWRT ACALL DELAY MOV A,#"A" ACALL DATAWRT ACALL DELAY MOV A,#"R" ACALL DATAWRT ACALL DELAY MOV A,#":" ACALL DATAWRT ACALL DELAY MOV A,R3 MOV B,#10 DIV AB ADD A,#30H
Background image of page 4
ACALL DATAWRT ACALL DELAY MOV A,B ORL A, #30H ACALL DATAWRT ACALL DELAY POP ACC RET ;*****************END OF TARGET_TEMP************** That shows the current temperature which is stored in R2. ;*****************CURRENT_TEMP ******************* CURRENT_TEMP: PUSH ACC MOV A,#"C" ACALL DATAWRT ACALL DELAY MOV A,#"U" ACALL DATAWRT ACALL DELAY MOV A,#"R" ACALL DATAWRT ACALL DELAY MOV A,#":" ACALL DATAWRT ACALL DELAY
Background image of page 5

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

View Full Document Right Arrow Icon
RD BIT P2.7 WR BIT P2.6 INTR BIT P2.5 MYDATA EQU P0 MOV P0,#0FFH SETB INTR ;LOW-TO-HÝGH PULSE CLR WR SETB WR JB INTR,$ CLR RD MOV A,MYDATA MOV B, #35 MUL AB MOV A,B ADD A, #25 MOV R2,A MOV B,#10 DIV AB ADD A,#30H ACALL DATAWRT ACALL DELAY MOV A,B ORL A, #30H ACALL DATAWRT ACALL DELAY
Background image of page 6
SETB RD POP ACC RET ;*****************END OF CURRENT_TEMP ************ 1.2. S ERIAL C OMMUNICATIONS MODULE When taking interrupt in Free-run mode, it jumps there. When user enters ‘t’, ‘m’, ‘c’, characters, this subroutine calls needed method otherwise it gives an error messeage.
Background image of page 7

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

View Full Document Right Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}