.public main
.public start
.include "S3C8275.reg"
;//==============define symbol==============
page0to0 equ 00h
page1to1 equ 11h
page0to2 equ 20h
page1to2 equ 21h
page2to0 equ 02h
powerkey equ 0fah ;;//
; ==================intterupt define=====================
;; vector 00f6h, watch_timer_int ;// irq2 watch timer vector
org 0100h
jp start
;;//=============reset===================================
start:
nop
nop
ld spl,# 0ffh
call init_hardware
;//=========main program=================================
org 200h
main:
sb0
; ld p4,#0ffh
ld r0,#0
ld r1,#1
ldb p0.3,r0
call delay
call delay
call delay
call delay
call delay
call delay
call delay
call delay
ldb p0.3,r1
call delay
call delay
call delay
call delay
call delay
call delay
call delay
call delay
call delay
jp main
;;//=================================================sub
init_hardware:
di
;//------------chen xu chu shi hua
ld btcon,# 10100011b ;//disable WATCH DOG
ld clkcon,# 00011000b ;fxx
ld imr,#00000101b ;.3bit external inter(P0.0) ;.2bit watchtime ;.0bit Timer1
ld sym,# 01h
ld pp,# page0to0
;//------------sb0------------------------------------
sb0
ld osccon,# 04h ;//main oscillator select
ld stpcon,# 10100101b
ld p0conh,# 00000010b
ld p0conl,# 10101010b
ld p0pur,# 0ffh
ld p0,# 0ffh
; ld p1conh,# 00h
; ld p1conl,# 00h
; ld p1,# 0ffh
; ld p1pur,# 0ffh
; ld p2conh,# 00h
; ld p2conl,# 00h
; ld p2pur,# 0ffh
; ld p3conl,# 00h
; ld p3conh,# 00h
; ld p3,# 7fh
; ld p3pur,# 0ffh
; ld extipnd,# 00h ;//清除中断标志位
; ld exticonh,# 00h
; ld exticonl,#00000001b ;p00 set falling edge into inter
;//------------sb1--------------------------
sb1
ld wtcon,# 01001110b ;;//0.91ms 中断;
; ld tadata,# 0ffh
; ld tbdata,# 0ffh
ld tacon,# 10111110b ;set fxx/8
; ld p4conh,# 0aah
; ld p4conl,# 10101010b
; ld p4,#0ffh
; ld p5conh,# 10101010b
; ld p5conl,# 10101010b
; ld p5,00h
; ld p6con,# 000h
; ld lcon,# 01100001b
;//------------clear ram------------------------
sb0
ld pp,#page0to0
; call rampage0clr
ei
ret
;//================delay================================
delay:
push
pp
push
r0
ld
pp,#00h
ld r0,#16-3
d50:
nop
djnz
r0,d50
pop
r0
pop
pp
ret
END |