SST89C58电子盘电路及代码

[05-23 02:47:29]   来源:http://www.88dzw.com  单片机电路图   阅读:8300

文章摘要: movx @dptr, a ret;Busy: mov dptr, #status movx a, @dptr jb acc.7, Busy jb acc.0, errors; jnb acc.6, Busy clr a ; acc=0 when successful clr C ; C=0, ADC is not busy (BUSY=

SST89C58电子盘电路及代码,标签:电路图讲解,电路图练习,http://www.88dzw.com
        movx @dptr, a
        ret

;========================================

Busy:             mov  dptr, #status
        movx a, @dptr
        jb   acc.7, Busy
               jb   acc.0, errors
;        jnb  acc.6, Busy
        clr  a                        ; acc=0 when successful
        clr  C                        ; C=0, ADC is not busy (BUSY=0) and no error (ERR=0)
        ret            ; and is ready to accept commands (RDY=1)

errors:           mov  dptr, #Error_Reg
        movx a, @dptr
        setb C                      ; C=1 flags error codes contained in ACC register
        ret

;========================================

WaitDRQ:      mov  dptr, #status
        movx a, @dptr
        jb   acc.7,  WaitDRQ     ; if BUSY=1, then WaitDRQ
        jnb  acc.3, WaitDRQ     ; if DRQ=0, then WaitDRQ
               jb   acc.0,  errors           ; if ERR=1, then read errors code and set flag C
;        jnb  acc.6, WaitDRQ
        clr  a
        clr  C                             ; C=0, ADC is BUSY=0, DRQ=1, ERR=0.
        ret             

;========================================

Done?:       mov   a, SFST
        jb       acc.2,     Done?
                     ret

上一页  [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]  下一页


Tag:单片机电路图电路图讲解,电路图练习电子电路图 - 单片机电路图