SST89C58电子盘电路及代码

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

文章摘要: movc a, @a+dptr ; get the data in message inc dptr ; point to next byte in message mov R0, dph ; save the address mov R1, dpl mov DPTR, #Data_Reg ; point to ADC movx @dptr, a ; w

SST89C58电子盘电路及代码,标签:电路图讲解,电路图练习,http://www.88dzw.com
        movc  a,    @a+dptr     ; get the data in message
        inc      dptr                    ; point to next byte in message
        mov   R0,   dph            ; save the address
        mov   R1,   dpl

        mov   DPTR, #Data_Reg      ; point to ADC
        movx  @dptr, a                     ; write 1 byte data into ADC

        djnz  B,   write
        djnz  R7, write                       ; write all 512 bytes to ADC

        ret

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

Read_Sctr:    mov   R2,   #1               ; read 1 sector at a time.
        mov   R3,   #0Ah           ; suppose LBA to be 000000Ah
        mov   R4,   #0
        mov   R5,   #0
        mov   R6,   #0
        mov   R7,   #ReadSctr
        acall  Function

        acall   WaitDRQ

        acall   Read512

        ret

;========================================
; read 1 sector of 512 bytes data and write into flash on chip of SST FlashFlex51 MCU

Read512:    mov   R7,      #2          ; 512 bytes = 2 * 256
        mov   B,        #0
        mov   dptr,    #Data_Reg
        mov   SFAH, #high(FlashAddrs)
        mov   SFAL, #low(FlashAddrs)
        orl      SFCF, #40h        ; set IAPEN=1 to enable IAP

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


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