?? at45db041d.s
字號(hào):
clr R20
xjmp L180
L177:
.dbline 648
; {
.dbline 649
; eeprom_write_byte((i+16*0),TestWriteBuffer[i]);
movw R24,R28
adiw R24,4
mov R30,R20
clr R31
add R30,R24
adc R31,R25
ldd R18,z+0
mov R16,R20
clr R17
xcall _eeprom_write_byte
.dbline 650
; eeprom_write_byte((i+16*1),TestReadBuffer[i]);
movw R24,R28
adiw R24,14
mov R30,R20
clr R31
add R30,R24
adc R31,R25
ldd R18,z+0
mov R16,R20
clr R17
subi R16,240 ; offset = 16
sbci R17,255
xcall _eeprom_write_byte
.dbline 651
; }
L178:
.dbline 647
inc R20
L180:
.dbline 647
cpi R20,10
brlo L177
X38:
.dbline -2
L174:
.dbline 0 ; func end
adiw R28,24
ld R20,y+
ret
.dbsym l TestReadBuffer 14 A[10:10]c
.dbsym l TestWriteBuffer 4 A[10:10]c
.dbsym r i 20 c
.dbend
.area lit(rom, con, rel)
L182:
.byte 10,9
.byte 8,7
.byte 6,5
.byte 4,3
.byte 2,1
L183:
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.area text(rom, con, rel)
.dbfile E:\item\car\AT45DB041D\AT45DB041D.c
.dbfunc e Test_Flash_Page_to_Page _Test_Flash_Page_to_Page fV
; TestReadBuffer -> y+16
; TestWriteBuffer -> y+6
; i -> R20
.even
_Test_Flash_Page_to_Page::
st -y,R20
sbiw R28,26
.dbline -1
.dbline 656
; }
;
; //Test_Flash_Page_to_Page
; void Test_Flash_Page_to_Page(void)
; {
.dbline 658
; unsigned char i;
; unsigned char TestWriteBuffer[10]={10,9,8,7,6,5,4,3,2,1};
ldi R24,<L182
ldi R25,>L182
movw R30,R28
adiw R30,6
ldi R16,10
ldi R17,0
st -y,R31
st -y,R30
st -y,R25
st -y,R24
xcall asgncblk
.dbline 659
; unsigned char TestReadBuffer[10] ={0,0,0,0,0,0,0,0,0,0};
ldi R24,<L183
ldi R25,>L183
movw R30,R28
adiw R30,16
ldi R16,10
ldi R17,0
st -y,R31
st -y,R30
st -y,R25
st -y,R24
xcall asgncblk
.dbline 662
;
; //將數(shù)據(jù)寫(xiě)到內(nèi)存中(自動(dòng)先寫(xiě)到BUFFER1 OR BURRER2中再將數(shù)據(jù)寫(xiě)到內(nèi)存中)
; Main_Memory_Page_Program_Through_Buffer(Buffer1,0,0,TestWriteBuffer,10);
ldi R24,10
ldi R25,0
std y+5,R25
std y+4,R24
movw R24,R28
adiw R24,6
std y+3,R25
std y+2,R24
clr R2
std y+0,R2
clr R18
clr R19
ldi R16,1
xcall _Main_Memory_Page_Program_Through_Buffer
.dbline 664
; //從內(nèi)存中讀取數(shù)據(jù)到數(shù)組rData中(直接讀取數(shù)據(jù)不經(jīng)過(guò)BUFFER1 OR BURRER2)
; DF_Main_Memory_Page_Read(0,0,TestReadBuffer,10);
ldi R24,10
ldi R25,0
std y+3,R25
std y+2,R24
movw R24,R28
adiw R24,16
std y+1,R25
std y+0,R24
clr R18
clr R16
clr R17
xcall _DF_Main_Memory_Page_Read
.dbline 666
;
; for(i=0;i<10;i++)//把要寫(xiě)入的和讀出的數(shù)據(jù)寫(xiě)入EEPROM用于比較
clr R20
xjmp L187
L184:
.dbline 667
; {
.dbline 668
; eeprom_write_byte((i+16*2),TestWriteBuffer[i]);
movw R24,R28
adiw R24,6
mov R30,R20
clr R31
add R30,R24
adc R31,R25
ldd R18,z+0
mov R16,R20
clr R17
subi R16,224 ; offset = 32
sbci R17,255
xcall _eeprom_write_byte
.dbline 669
; eeprom_write_byte((i+16*3),TestReadBuffer[i]);
movw R24,R28
adiw R24,16
mov R30,R20
clr R31
add R30,R24
adc R31,R25
ldd R18,z+0
mov R16,R20
clr R17
subi R16,208 ; offset = 48
sbci R17,255
xcall _eeprom_write_byte
.dbline 670
; }
L185:
.dbline 666
inc R20
L187:
.dbline 666
cpi R20,10
brlo L184
X39:
.dbline -2
L181:
.dbline 0 ; func end
adiw R28,26
ld R20,y+
ret
.dbsym l TestReadBuffer 16 A[10:10]c
.dbsym l TestWriteBuffer 6 A[10:10]c
.dbsym r i 20 c
.dbend
.area lit(rom, con, rel)
L189:
.byte 1,2
.byte 3,4
.byte 5,6
.byte 7,8
.byte 9,10
L190:
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.area text(rom, con, rel)
.dbfile E:\item\car\AT45DB041D\AT45DB041D.c
.dbfunc e Test_Flash_Buffer_Page_to_Page _Test_Flash_Buffer_Page_to_Page fV
; TestReadBuffer -> y+14
; TestWriteBuffer -> y+4
; i -> R20
.even
_Test_Flash_Buffer_Page_to_Page::
st -y,R20
sbiw R28,24
.dbline -1
.dbline 675
; }
;
; //Test_Flash_Buffer_Page_to_Page
; void Test_Flash_Buffer_Page_to_Page(void)
; {
.dbline 677
; unsigned char i;
; unsigned char TestWriteBuffer[10]={1,2,3,4,5,6,7,8,9,10};
ldi R24,<L189
ldi R25,>L189
movw R30,R28
adiw R30,4
ldi R16,10
ldi R17,0
st -y,R31
st -y,R30
st -y,R25
st -y,R24
xcall asgncblk
.dbline 678
; unsigned char TestReadBuffer[10] ={0,0,0,0,0,0,0,0,0,0};
ldi R24,<L190
ldi R25,>L190
movw R30,R28
adiw R30,14
ldi R16,10
ldi R17,0
st -y,R31
st -y,R30
st -y,R25
st -y,R24
xcall asgncblk
.dbline 680
; //寫(xiě)數(shù)據(jù)到Buffer中
; DF_Write_to_Buffer(Buffer1,0,TestWriteBuffer,10);
ldi R24,10
ldi R25,0
std y+3,R25
std y+2,R24
movw R24,R28
adiw R24,4
std y+1,R25
std y+0,R24
clr R18
clr R19
ldi R16,1
xcall _DF_Write_to_Buffer
.dbline 682
; //將Buffer中的數(shù)據(jù)寫(xiě)到DataFlash中
; DF_Write_Buffer_to_Page(Buffer1,0);
clr R18
clr R19
ldi R16,1
xcall _DF_Write_Buffer_to_Page
.dbline 685
; //讀出DataFlash中的數(shù)據(jù)
; //DF_Main_Memory_Page_Read(0,0,TestReadBuffer,10);
; DF_Continuous_Array_Read(0,0,TestReadBuffer,10);
ldi R24,10
ldi R25,0
std y+3,R25
std y+2,R24
movw R24,R28
adiw R24,14
std y+1,R25
std y+0,R24
clr R18
clr R16
clr R17
xcall _DF_Continuous_Array_Read
.dbline 687
;
; for(i=0;i<10;i++)//把要寫(xiě)入的和讀出的數(shù)據(jù)寫(xiě)入EEPROM用于比較
clr R20
xjmp L194
L191:
.dbline 688
; {
.dbline 689
; eeprom_write_byte((i+16*4),TestWriteBuffer[i]);
movw R24,R28
adiw R24,4
mov R30,R20
clr R31
add R30,R24
adc R31,R25
ldd R18,z+0
mov R16,R20
clr R17
subi R16,192 ; offset = 64
sbci R17,255
xcall _eeprom_write_byte
.dbline 690
; eeprom_write_byte((i+16*5),TestReadBuffer[i]);
movw R24,R28
adiw R24,14
mov R30,R20
clr R31
add R30,R24
adc R31,R25
ldd R18,z+0
mov R16,R20
clr R17
subi R16,176 ; offset = 80
sbci R17,255
xcall _eeprom_write_byte
.dbline 691
; }
L192:
.dbline 687
inc R20
L194:
.dbline 687
cpi R20,10
brlo L191
X40:
.dbline -2
L188:
.dbline 0 ; func end
adiw R28,24
ld R20,y+
ret
.dbsym l TestReadBuffer 14 A[10:10]c
.dbsym l TestWriteBuffer 4 A[10:10]c
.dbsym r i 20 c
.dbend
.area lit(rom, con, rel)
L196:
.byte 10,9
.byte 8,7
.byte 6,5
.byte 4,3
.byte 2,1
L197:
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.byte 0,0
.area text(rom, con, rel)
.dbfile E:\item\car\AT45DB041D\AT45DB041D.c
.dbfunc e Test_Flash_Buffer_Page_to_Page_Buffer _Test_Flash_Buffer_Page_to_Page_Buffer fV
; TestReadBuffer -> y+14
; TestWriteBuffer -> y+4
; i -> R20
.even
_Test_Flash_Buffer_Page_to_Page_Buffer::
st -y,R20
sbiw R28,24
.dbline -1
.dbline 696
; }
;
; //Test_Flash_Buffer_Page_to_Page_Buffer
; void Test_Flash_Buffer_Page_to_Page_Buffer(void)
; {
.dbline 698
; unsigned char i;
; unsigned char TestWriteBuffer[10]={10,9,8,7,6,5,4,3,2,1};
ldi R24,<L196
ldi R25,>L196
movw R30,R28
adiw R30,4
ldi R16,10
ldi R17,0
st -y,R31
st -y,R30
st -y,R25
st -y,R24
xcall asgncblk
.dbline 699
; unsigned char TestReadBuffer[10] ={0,0,0,0,0,0,0,0,0,0};
ldi R24,<L197
ldi R25,>L197
movw R30,R28
adiw R30,14
ldi R16,10
ldi R17,0
st -y,R31
st -y,R30
st -y,R25
st -y,R24
xcall asgncblk
.dbline 702
;
; //寫(xiě)數(shù)據(jù)到Buffer中
; DF_Write_to_Buffer(Buffer1,0,TestWriteBuffer,10);
ldi R24,10
ldi R25,0
std y+3,R25
std y+2,R24
movw R24,R28
adiw R24,4
std y+1,R25
std y+0,R24
clr R18
clr R19
ldi R16,1
xcall _DF_Write_to_Buffer
.dbline 704
; //將Buffer中的數(shù)據(jù)寫(xiě)到Page中
; DF_Write_Buffer_to_Page(Buffer1,0);
clr R18
clr R19
ldi R16,1
xcall _DF_Write_Buffer_to_Page
.dbline 706
; //從Page中讀取數(shù)據(jù)到Buffer中
; DF_Read_Buffer_from_Page(Buffer1,0);
clr R18
clr R19
ldi R16,1
xcall _DF_Read_Buffer_from_Page
.dbline 708
; //從Buffer中讀取數(shù)據(jù)
; DF_Read_from_Buffer(Buffer1,0,TestReadBuffer,10);
ldi R24,10
ldi R25,0
std y+3,R25
std y+2,R24
movw R24,R28
adiw R24,14
std y+1,R25
std y+0,R24
clr R18
clr R19
ldi R16,1
xcall _DF_Read_from_Buffer
.dbline 710
;
; for(i=0;i<10;i++)//把要寫(xiě)入的和讀出的數(shù)據(jù)寫(xiě)入EEPROM用于比較
clr R20
xjmp L201
L198:
.dbline 711
; {
.dbline 712
; eeprom_write_byte((i+16*6),TestWriteBuffer[i]);
movw R24,R28
adiw R24,4
mov R30,R20
clr R31
add R30,R24
adc R31,R25
ldd R18,z+0
mov R16,R20
clr R17
subi R16,160 ; offset = 96
sbci R17,255
xcall _eeprom_write_byte
.dbline 713
; eeprom_write_byte((i+16*7),TestReadBuffer[i]);
movw R24,R28
adiw R24,14
mov R30,R20
clr R31
add R30,R24
adc R31,R25
ldd R18,z+0
mov R16,R20
clr R17
subi R16,144 ; offset = 112
sbci R17,255
xcall _eeprom_write_byte
.dbline 714
; }
L199:
.dbline 710
inc R20
L201:
.dbline 710
cpi R20,10
brlo L198
X41:
.dbline -2
L195:
.dbline 0 ; func end
adiw R28,24
ld R20,y+
ret
.dbsym l TestReadBuffer 14 A[10:10]c
.dbsym l TestWriteBuffer 4 A[10:10]c
.dbsym r i 20 c
.dbend
.dbfunc e main _main fV
; Temp_Sector_Lockdown_Register -> y+0
; i -> <dead>
.even
_main::
sbiw R28,8
.dbline -1
.dbline 720
; }
; /************************************************************
; *主函數(shù)
; ************************************************************/
; void main(void)
; {
.dbline 723
; unsigned int i;
; unsigned char Temp_Sector_Lockdown_Register[8];
; DF_Delay(1000);
ldi R16,1000
ldi R17,3
xcall _DF_Delay
.dbline 724
; DDRA =0XFF;
ldi R24,255
out 0x1a,R24
.dbline 725
; PORTA=0X01; //指示燈起始狀態(tài)
ldi R24,1
out 0x1b,R24
.dbline 728
;
; //FLASH初始化(SPI初始化)
; DataFlash_Init();
xcall _DataFlash_Init
.dbline 730
; //wait for a moment
; DF_Delay(100);
ldi R16,100
ldi R17,0
xcall _DF_Delay
.dbline 732
; //Flash復(fù)位
; DF_Reset();
xcall _DF_Reset
.dbline 760
;
; //讀取FLASH內(nèi)部狀態(tài)寄存器
; //PORTA=DF_Read_status_Register();
;
; //讀取扇區(qū)加鎖寄存器
; //DF_Read_Sector_Lockdown_Register(Temp_Sector_Lockdown_Register);
; //for(i=0;i<8;i++)
; //{
; // eeprom_write_byte(i,Temp_Sector_Lockdown_Register[i]);
; //}
;
; //取消所有扇區(qū)保護(hù)
; //if(DF_Cancel_Sector_Protection()) PORTA=0X18;//OK
;
; //測(cè)試FLASH產(chǎn)家ID 讀到為0x1F才算正常
; //if(Test_Manufacturer_ID()) PORTA=0x1F;
;
; //使FLASH進(jìn)入Deep_Power_Down
; //DF_Deep_Power_Down();
;
; //使FLASH退出Deep_Power_Down
; //DF_Resume_from_Deep_Power_Down();
;
; //擦除FLASH全部?jī)?nèi)容
; //DF_Chip_Erase();
;
; //測(cè)試FLASH讀寫(xiě)
; Test_Flash_Buffer_to_Buffer(); //ok
xcall _Test_Flash_Buffer_to_Buffer
.dbline 761
; Test_Flash_Page_to_Page(); //ok
xcall _Test_Flash_Page_to_Page
.dbline 762
; Test_Flash_Buffer_Page_to_Page(); //ok
xcall _Test_Flash_Buffer_Page_to_Page
.dbline 763
; Test_Flash_Buffer_Page_to_Page_Buffer(); //ok
xcall _Test_Flash_Buffer_Page_to_Page_Buffer
.dbline 765
;
; PORTA=0X80; //程序執(zhí)行完成狀態(tài)
ldi R24,128
out 0x1b,R24
xjmp L204
L203:
.dbline 767
; while(1)
; {
.dbline 768
; asm("sei");
sei
.dbline 769
; }
L204:
.dbline 766
xjmp L203
X42:
.dbline -2
L202:
.dbline 0 ; func end
adiw R28,8
ret
.dbsym l Temp_Sector_Lockdown_Register 0 A[8:8]c
.dbsym l i 1 i
.dbend
; }
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -