欢迎访问ic37.com |
会员登录 免费注册
发布采购

SN8P1604AK 参数 Datasheet PDF下载

SN8P1604AK图片预览
型号: SN8P1604AK
PDF下载: 下载PDF文件 查看货源
内容描述: 8位微控制器 [8-Bit Micro-Controller]
分类和应用: 微控制器
文件页数/大小: 94 页 / 531 K
品牌: SONIX [ SONIX TECHNOLOGY COMPANY ]
 浏览型号SN8P1604AK的Datasheet PDF文件第15页浏览型号SN8P1604AK的Datasheet PDF文件第16页浏览型号SN8P1604AK的Datasheet PDF文件第17页浏览型号SN8P1604AK的Datasheet PDF文件第18页浏览型号SN8P1604AK的Datasheet PDF文件第20页浏览型号SN8P1604AK的Datasheet PDF文件第21页浏览型号SN8P1604AK的Datasheet PDF文件第22页浏览型号SN8P1604AK的Datasheet PDF文件第23页  
SN8P1600  
8-bit micro-controller  
CHECKSUM CALCULATION  
The ROM addresses 0004H~0007H and last address are reserved area. User should avoid these addresses  
(0004H~0007H and last address) when calculate the Checksum value.  
Example:  
The demo program shows how to avoid 0004H~0007H when calculated Checksum from 00H to the end of  
user’s code  
MOV  
A,#END_USER_CODE$L  
B0MOV  
MOV  
END_ADDR1,A  
;save low end address to end_addr1  
A,#END_USER_CODE$  
M
B0MOV  
CLR  
END_ADDR2,A  
;save middle end address to end_addr2  
;set Y to ooH  
Y
Z
CLR  
;set Z to 00H  
@@:  
CALL  
MOVC  
B0BSET  
ADD  
YZ_CHECK  
;call function of check yz value  
;
FC  
;clear C glag  
DATA1,A  
A,R  
;add A to Data1  
MOV  
ADC  
DATA2,A  
END_CHECK  
;add R to Data2  
JMP  
;check if the YZ address = the end of code  
AAA:  
INCMS  
JMP  
Z
;Z=Z+1  
@B  
;if Z!= 00H calculate to next address  
;if Z=00H increase Y  
JMP  
Y_ADD_1  
END_CHECK:  
MOV  
A,END_ADDR1  
CMPRS  
JMP  
A,Z  
;check if Z = low end address  
AAA  
;if Not jump to checksum calculate  
MOV  
A,END_ADDR2  
A,Y  
CMPRS  
JMP  
;if Yes, check if Y = middle end address  
;if Not jump to checksum calculate  
;if Yes checksum calculated is done.  
;check if YZ=0004H  
AAA  
JMP  
CHECKSUM_END  
YZ_CHECK:  
MOV  
A,#04H  
A,Z  
CMPRS  
RET  
;check if Z=04H  
;if Not return to checksum calculate  
MOV  
A,#00H  
A,Y  
CMPRS  
RET  
;if Yes, check if Y=00H  
;if Not return to checksum calculate  
;if Yes, increase 4 to Z  
INCMS  
INCMS  
INCMS  
INCMS  
RET  
Z
Z
Z
Z
;set YZ=0008H then return  
;increase Y  
Y_ADD_1:  
INCMS  
NOP  
Y
JMP  
@B  
;jump to checksum calculate  
CHECKSUM_END:  
END_USER_CODE:  
……….  
……….  
;Label of program end  
SONiX TECHNOLOGY CO., LTD  
Page 19  
Revision 1.94  
 复制成功!