EasyManua.ls Logo

STC micro STC8A8K64D4 Series - Page 207

Default Icon
901 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
STC8A8K64D4 Series Manual
-
- 191 -
minute DATA 32H
hour DATA 33H
scan_index DATA 34H
LCD_buff DATA 40H ;40H~47H
;************************************************************
ORG 0000H
LJMP F_Main
ORG 000BH
LJMP F_Timer0_Interrupt
;************************************************************
ORG 0100H
F_Main:
CLR A
MOV P3M1, A ;Set as a quasi-bidirectional port
MOV P3M0, A
MOV P5M1, A ;Set as a quasi-bidirectional port
MOV P5M0, A
MOV P1M1, #0 ; segments are set as push-pull output mode
MOV P1M0, #0ffh
ANL P2M1, #NOT 0f0h ; segments are set as push-pull output mode
ORL P2M0, #0f0h
ORL P2M1, #00fH ; All COM outputs are high impedance, and COM’s voltage is the midpoint
ANL P2M0, #0f0H
MOV SP, #0D0H
MOV PSW, #0
USING 0 ;Select bank0 R0 ~ R7
;************************************************************
MOV R2, #8
MOV R0, #LCD_buff
L_ClearLcdRam:
MOV @R0, #0
INC R0
DJNZ R2, L_ClearLcdRam
LCALL F_Timer0_init
SETB EA
; ORL LCD_buff, #020H ;Display hour-minute division interval:
; ORL LCD_buff, #002H ;Display minute-second division interval:
MOV hour, #12
MOV minute, #00
MOV second, #00
LCALL F_LoadRTC ;Display time
;************************************************************
L_Main_Loop:
JNB B_2ms, L_Main_Loop ;2ms beat
CLR B_2ms
INC cnt_500ms
MOV A, cnt_500ms
CJNE A, #250, L_Main_Loop
;reach to 500ms
MOV cnt_500ms, #0;

Table of Contents

Related product manuals