日本黄色一级经典视频|伊人久久精品视频|亚洲黄色色周成人视频九九九|av免费网址黄色小短片|黄色Av无码亚洲成年人|亚洲1区2区3区无码|真人黄片免费观看|无码一级小说欧美日免费三级|日韩中文字幕91在线看|精品久久久无码中文字幕边打电话

當前位置:首頁 > 單片機 > 單片機
[導(dǎo)讀] ;***********************************************************************;;title: Em78p458/9 comparator test program ;;Description:比較器結(jié)果由Port60輸出,當R3的bit7為1時,輸出high pulse,當R

;***********************************************************************;
;title: Em78p458/9 comparator test program ;


;Description:比較器結(jié)果由Port60輸出,當R3的bit7為1時,輸出high pulse,當R3的 ;
; bit7為0時,輸出low pulse.比較器輸出由port57輸出與port60一樣的 ;
;     波形。 ;
;Company: ELAN MICROELECTRONICS (SZ) LTD.INC ;
;************************************************************************;

include "d:wiceincem78_headfileem78p458.inc" ;include em78p458 head file
;=================================================================================
dly1 == 0x30 ;delay register 1
dly2 == 0x31 ;delay register 2
;----------------------------------------------------------
org 0
jmp start
org 0x08
reti
start:
disi
mov a,@0b00000000
contw ;set cont register
bs r9,5 ; register segment
mov a,@0b00000000
iow ioc51 ;set port51,52 funtion
bc r9,5 ;
mov a,@0b01100000 ;bit6(CE)=1,enable comparator,
;bit5(coe)=1,set comparator
iow ioca0
mov a,@0b01100000
iow ioc50 ;set port56,57 input,
mov a,@0b00000000
iow ioc60 ;set port6 output
start1:
mov a,@0b00010100
mov port5,a ;CIN+ nop
nop
call compout ;port60 output low
mov a,@0x32
call delay ;delay time 5ms
;
mov a,@0b00010010
mov port5,a ;CIN+>CIN-
nop
nop
call compout ;port60 output high
mov a,@0x64
call delay ;delay time 10ms
;
mov a,@0b00001100
mov port5,a ;CIN+ nop
nop
call compout ;Port60 output low
mov a,@0x96
call delay ;delay time 15ms
;
mov a,@0b00001010
mov port5,a
nop
nop
call compout ;port60 output high
mov a,@0xC8
call delay ;delay time 20ms
jmp start1
;--------------------------
compout: ;port60 output subprogram
jbs status,7
jmp comparator0
comparator1:
bs port6,0
jmp $+2
comparator0:
bc port6,0
ret
;---------------------
delay: ;delay time subprogram
mov dly1,a
delay1:
mov a,@0x15 ;100us delay time,4MHz,cLOCk=4
mov dly2,a
delay2:
djz dly2
jmp delay2
djz dly1
jmp delay1
ret
;-----------------
eop
end


本站聲明: 本文章由作者或相關(guān)機構(gòu)授權(quán)發(fā)布,目的在于傳遞更多信息,并不代表本站贊同其觀點,本站亦不保證或承諾內(nèi)容真實性等。需要轉(zhuǎn)載請聯(lián)系該專欄作者,如若文章內(nèi)容侵犯您的權(quán)益,請及時聯(lián)系本站刪除( 郵箱:macysun@21ic.com )。
換一批
延伸閱讀
關(guān)閉