| データシートサーチシステム |
|
SN8A1702AX データシート(PDF) 20 Page - SONiX Technology Company |
|
|
|||||||||||||||||||||||||||||
SN8A1702AX データシート(HTML) 20 Page - SONiX Technology Company |
|
20 / 112 page ![]() Preliminary SN8P1702A/SN8P1703A 8-bit micro-controller build-in 12-bit ADC SONiX TECHNOLOGY CO., LTD Page 20 Revision 0.5 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 END_ADDR1,A ; save low end address to end_addr1 MOV A,#END_USER_CODE$M B0MOV END_ADDR2,A ; Save middle end address to end_addr2 CLR Y ; Set Y to 00H CLR Z ; Set Z to 00H @@: CALL YZ_CHECK ; Call function of check yz value MOVC ; B0BSET FC ; Clear C flag ADD DATA1,A ; Add A to Data1 MOV A,R ADC DATA2,A ; Add R to Data2 JMP END_CHECK ; Check if the YZ address = the end of code AAA: INCMS Z ;Z=Z+1 JMP @B ; If Z! = 00H calculate to next address JMP Y_ADD_1 ; If Z=00H increase Y END_CHECK: MOV A,END_ADDR1 CMPRS A,Z ; Check if Z = low end address JMP AAA ; If Not jump to checksum calculate MOV A,END_ADDR2 CMPRS A,Y ; If Yes, check if Y = middle end address JMP AAA ; If Not jump to checksum calculate JMP CHECKSUM_END ; If Yes checksum calculated is done. YZ_CHECK: ;check if YZ=0004H MOV A,#04H CMPRS A,Z ;check if Z=04H RET ;if Not return to checksum calculate MOV A,#00H CMPRS A,Y ;if Yes, check if Y=00H RET ;if Not return to checksum calculate INCMS Z ;if Yes, increase 4 to Z INCMS Z INCMS Z INCMS Z RET ;set YZ=0008H then return Y_ADD_1: INCMS Y ;increase Y NOP JMP @B ;jump to checksum calculate CHECKSUM_END: ………. ………. END_USER_CODE: ;Label of program end |
|
リンク URL |
| ALLDATASHEETはお客様のビジネスに役立ちますか? [ DONATE ] |
Alldatasheetは | 広告 | お問い合わせ | プライバシーポリシー | データシートへのリンク | リンク交換 | メーカーリスト All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |