标签:电路图讲解,电路图练习,http://www.5idzw.com
SST89C58电子盘电路及代码,http://www.5idzw.com
mov B, #0
mov dptr, #Data_Reg
mov SFAH, #high(FlashAddrs)
mov SFAL, #low(FlashAddrs)
orl SFCF, #40h ; set IAPEN=1 to enable IAP
read: movx a, @dptr ; read 1 byte data from ADC
mov SFDT, a ; program into on-chip flash
mov SFCM, #0Eh ; issue Byte-Program command
acall Done? ; wait until done
mov a, SFAL ; adjust the address of flash
add a, #1
mov SFAL, a
mov a, SFAH
addc a, #0
mov SFAH, a
djnz B, read
djnz R7, read
anl SFCF, #0BFh ; disable IAP
ret
;========================================
Compare: mov dptr, #message ; point to message
mov SFAH, #high(FlashAddrs)
mov SFAL, #low(FlashAddrs)
orl SFCF, #40h ; IAPEN=1
clr F0
mov R7, #2
mov B, #0
verify: clr a
movc a, @a+dptr ; get original data in message
inc dptr
mov SFCM, #0Ch ; issue BYTE-VERIFY command
nop
xrl a, SFDT ; SFDT contains data in flash, these data come from ADC
jz skip
setb F0 ; set flag F0 (PSW.5) if any discrepancy.
skip: mov a, SFAL ; increase the address of flash
add a, #1
mov SFAL, a
mov a, SFAH
addc a, #0
mov SFAH, a
djnz B, verify
djnz R7, verify
anl SFCF, #0BFh ; disable IAP
ret
;========================================================================
message: DB "This demo program demonstrates how easy to design "
DB "SST ATA-Disk Chip into SST FlashFlex51 embedded microcontroller. "
DB "After you understand how to use the basic WriteSector and ReadSector "
DB "functions, it's easy to try any others."
DB "The hardware connection between ADC and MCU is also very simple,"
DB "just like you expand any I/O or data memory in your application system. "
,SST89C58电子盘电路及代码
mov B, #0
mov dptr, #Data_Reg
mov SFAH, #high(FlashAddrs)
mov SFAL, #low(FlashAddrs)
orl SFCF, #40h ; set IAPEN=1 to enable IAP
read: movx a, @dptr ; read 1 byte data from ADC
mov SFDT, a ; program into on-chip flash
mov SFCM, #0Eh ; issue Byte-Program command
acall Done? ; wait until done
mov a, SFAL ; adjust the address of flash
add a, #1
mov SFAL, a
mov a, SFAH
addc a, #0
mov SFAH, a
djnz B, read
djnz R7, read
anl SFCF, #0BFh ; disable IAP
ret
;========================================
Compare: mov dptr, #message ; point to message
mov SFAH, #high(FlashAddrs)
mov SFAL, #low(FlashAddrs)
orl SFCF, #40h ; IAPEN=1
clr F0
mov R7, #2
mov B, #0
verify: clr a
movc a, @a+dptr ; get original data in message
inc dptr
mov SFCM, #0Ch ; issue BYTE-VERIFY command
nop
xrl a, SFDT ; SFDT contains data in flash, these data come from ADC
jz skip
setb F0 ; set flag F0 (PSW.5) if any discrepancy.
skip: mov a, SFAL ; increase the address of flash
add a, #1
mov SFAL, a
mov a, SFAH
addc a, #0
mov SFAH, a
djnz B, verify
djnz R7, verify
anl SFCF, #0BFh ; disable IAP
ret
;========================================================================
message: DB "This demo program demonstrates how easy to design "
DB "SST ATA-Disk Chip into SST FlashFlex51 embedded microcontroller. "
DB "After you understand how to use the basic WriteSector and ReadSector "
DB "functions, it's easy to try any others."
DB "The hardware connection between ADC and MCU is also very simple,"
DB "just like you expand any I/O or data memory in your application system. "
,SST89C58电子盘电路及代码
上一篇:LMl872 基本测试电路图