⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 at45db041d.lis

📁 用ATMEGA16的硬件SPI驱动AT45DB041D
💻 LIS
📖 第 1 页 / 共 5 页
字号:
 0134                   .dbline 200
 0134           ; 
 0134           ;   return 1;//正确返回 1
 0134 01E0              ldi R16,1
 0136                   .dbline -2
 0136           L53:
 0136                   .dbline 0 ; func end
 0136 2496              adiw R28,4
 0138 0895              ret
 013A                   .dbsym l Test_Buf 0 A[4:4]c
 013A                   .dbend
 013A                   .dbfunc e DF_Deep_Power_Down _DF_Deep_Power_Down fV
                        .even
 013A           _DF_Deep_Power_Down::
 013A                   .dbline -1
 013A                   .dbline 206
 013A           ; }
 013A           ; /************************************************************
 013A           ; *使FLASH进入Deep_Power_Down
 013A           ; ************************************************************/
 013A           ; void DF_Deep_Power_Down(void)
 013A           ; {
 013A                   .dbline 207
 013A           ;   DF_Check_Busy_State();
 013A CEDF              xcall _DF_Check_Busy_State
 013C                   .dbline 208
 013C           ;   Enable_DFLASH();
 013C A8DF              xcall _Enable_DFLASH
 013E                   .dbline 209
 013E           ;   SPI_Write_Byte(0xB9);//写Deep Power-down操作码
 013E 09EB              ldi R16,185
 0140 89DF              xcall _SPI_Write_Byte
 0142                   .dbline 210
 0142           ;   Disable_DFLASH();
 0142 ADDF              xcall _Disable_DFLASH
 0144                   .dbline -2
 0144           L56:
 0144                   .dbline 0 ; func end
 0144 0895              ret
 0146                   .dbend
 0146                   .dbfunc e DF_Resume_from_Deep_Power_Down _DF_Resume_from_Deep_Power_Down fV
                        .even
 0146           _DF_Resume_from_Deep_Power_Down::
 0146                   .dbline -1
 0146                   .dbline 216
 0146           ; }
 0146           ; /************************************************************
 0146           ; *使FLASH退出Deep_Power_Down
 0146           ; ************************************************************/
 0146           ; void DF_Resume_from_Deep_Power_Down(void)
 0146           ; {
 0146                   .dbline 217
 0146           ;   DF_Check_Busy_State();
 0146 C8DF              xcall _DF_Check_Busy_State
 0148                   .dbline 218
 0148           ;   Enable_DFLASH();
 0148 A2DF              xcall _Enable_DFLASH
 014A                   .dbline 219
 014A           ;   SPI_Write_Byte(0xAB);//写Resume from Deep Power-down操作码
 014A 0BEA              ldi R16,171
 014C 83DF              xcall _SPI_Write_Byte
 014E                   .dbline 220
 014E           ;   Disable_DFLASH();
 014E A7DF              xcall _Disable_DFLASH
 0150                   .dbline -2
 0150           L57:
 0150                   .dbline 0 ; func end
 0150 0895              ret
 0152                   .dbend
                        .area lit(rom, con, rel)
 0000           L59:
 0000 3D2A              .byte 61,42
 0002 7FA9              .byte 127,169
                        .area text(rom, con, rel)
 0152                   .dbfile E:\item\car\AT45DB041D\AT45DB041D.c
 0152                   .dbfunc e DF_Enable_Sector_Protection _DF_Enable_Sector_Protection fV
 0152           ; Enable_Sector_Protection_Command -> y+0
 0152           ;              i -> R20
                        .even
 0152           _DF_Enable_Sector_Protection::
 0152 4A93              st -y,R20
 0154 2497              sbiw R28,4
 0156                   .dbline -1
 0156                   .dbline 226
 0156           ; }
 0156           ; /************************************************************
 0156           ; *使能扇区保护
 0156           ; ************************************************************/
 0156           ; void DF_Enable_Sector_Protection(void)
 0156           ; {
 0156                   .dbline 227
 0156           ;   unsigned char Enable_Sector_Protection_Command[4]={0x3D,0x2A,0x7F,0xA9}; //使能扇区保护操作码
 0156 80E0              ldi R24,<L59
 0158 90E0              ldi R25,>L59
 015A FE01              movw R30,R28
 015C 04E0              ldi R16,4
 015E 10E0              ldi R17,0
 0160 FA93              st -y,R31
 0162 EA93              st -y,R30
 0164 9A93              st -y,R25
 0166 8A93              st -y,R24
 0168 0E940000          xcall asgncblk
 016C                   .dbline 230
 016C           ;   unsigned char i;
 016C           ; 
 016C           ;   DF_Check_Busy_State();
 016C B5DF              xcall _DF_Check_Busy_State
 016E                   .dbline 231
 016E           ;   Enable_DFLASH();
 016E 8FDF              xcall _Enable_DFLASH
 0170                   .dbline 232
 0170           ;   for(i=0;i<4;i++)
 0170 4427              clr R20
 0172 08C0              xjmp L63
 0174           L60:
 0174                   .dbline 233
 0174           ;   {
 0174                   .dbline 234
 0174           ;         SPI_Write_Byte(Enable_Sector_Protection_Command[i]);//写使能扇区保护操作码
 0174 CE01              movw R24,R28
 0176 E42F              mov R30,R20
 0178 FF27              clr R31
 017A E80F              add R30,R24
 017C F91F              adc R31,R25
 017E 0081              ldd R16,z+0
 0180 69DF              xcall _SPI_Write_Byte
 0182                   .dbline 235
 0182           ;   }
 0182           L61:
 0182                   .dbline 232
 0182 4395              inc R20
 0184           L63:
 0184                   .dbline 232
 0184 4430              cpi R20,4
 0186 B0F3              brlo L60
 0188           X13:
 0188                   .dbline 236
 0188           ;   Disable_DFLASH();
 0188 8ADF              xcall _Disable_DFLASH
 018A                   .dbline -2
 018A           L58:
 018A                   .dbline 0 ; func end
 018A 2496              adiw R28,4
 018C 4991              ld R20,y+
 018E 0895              ret
 0190                   .dbsym l Enable_Sector_Protection_Command 0 A[4:4]c
 0190                   .dbsym r i 20 c
 0190                   .dbend
                        .area lit(rom, con, rel)
 0004           L65:
 0004 3D2A              .byte 61,42
 0006 7F9A              .byte 127,154
                        .area text(rom, con, rel)
 0190                   .dbfile E:\item\car\AT45DB041D\AT45DB041D.c
 0190                   .dbfunc e DF_Disable_Sector_Protection _DF_Disable_Sector_Protection fV
 0190           ; Disable_Sector_Protection_Command -> y+0
 0190           ;              i -> R20
                        .even
 0190           _DF_Disable_Sector_Protection::
 0190 4A93              st -y,R20
 0192 2497              sbiw R28,4
 0194                   .dbline -1
 0194                   .dbline 242
 0194           ; }
 0194           ; /************************************************************
 0194           ; *禁止扇区保护
 0194           ; ************************************************************/
 0194           ; void DF_Disable_Sector_Protection(void)
 0194           ; {
 0194                   .dbline 243
 0194           ;   unsigned char Disable_Sector_Protection_Command[4]={0x3D,0x2A,0x7F,0x9A};//禁止扇区保护操作码
 0194 80E0              ldi R24,<L65
 0196 90E0              ldi R25,>L65
 0198 FE01              movw R30,R28
 019A 04E0              ldi R16,4
 019C 10E0              ldi R17,0
 019E FA93              st -y,R31
 01A0 EA93              st -y,R30
 01A2 9A93              st -y,R25
 01A4 8A93              st -y,R24
 01A6 0E940000          xcall asgncblk
 01AA                   .dbline 246
 01AA           ;   unsigned char i;
 01AA           ; 
 01AA           ;   DF_Check_Busy_State();
 01AA 96DF              xcall _DF_Check_Busy_State
 01AC                   .dbline 247
 01AC           ;   Enable_DFLASH();
 01AC 70DF              xcall _Enable_DFLASH
 01AE                   .dbline 248
 01AE           ;   for(i=0;i<4;i++)
 01AE 4427              clr R20
 01B0 08C0              xjmp L69
 01B2           L66:
 01B2                   .dbline 249
 01B2           ;   {
 01B2                   .dbline 250
 01B2           ;       SPI_Write_Byte(Disable_Sector_Protection_Command[i]);//写禁止扇区保护操作码
 01B2 CE01              movw R24,R28
 01B4 E42F              mov R30,R20
 01B6 FF27              clr R31
 01B8 E80F              add R30,R24
 01BA F91F              adc R31,R25
 01BC 0081              ldd R16,z+0
 01BE 4ADF              xcall _SPI_Write_Byte
 01C0                   .dbline 251
 01C0           ;   }
 01C0           L67:
 01C0                   .dbline 248
 01C0 4395              inc R20
 01C2           L69:
 01C2                   .dbline 248
 01C2 4430              cpi R20,4
 01C4 B0F3              brlo L66
 01C6           X14:
 01C6                   .dbline 252
 01C6           ;   Disable_DFLASH();
 01C6 6BDF              xcall _Disable_DFLASH
 01C8                   .dbline -2
 01C8           L64:
 01C8                   .dbline 0 ; func end
 01C8 2496              adiw R28,4
 01CA 4991              ld R20,y+
 01CC 0895              ret
 01CE                   .dbsym l Disable_Sector_Protection_Command 0 A[4:4]c
 01CE                   .dbsym r i 20 c
 01CE                   .dbend
                        .area lit(rom, con, rel)
 0008           L71:
 0008 3D2A              .byte 61,42
 000A 7FCF              .byte 127,207
                        .area text(rom, con, rel)
 01CE                   .dbfile E:\item\car\AT45DB041D\AT45DB041D.c
 01CE                   .dbfunc e DF_Erase_Sector_Protection_Register _DF_Erase_Sector_Protection_Register fV
 01CE           ; Erase_Sector_Protection_Command -> y+0
 01CE           ;              i -> R20
                        .even
 01CE           _DF_Erase_Sector_Protection_Register::
 01CE 4A93              st -y,R20
 01D0 2497              sbiw R28,4
 01D2                   .dbline -1
 01D2                   .dbline 258
 01D2           ; }
 01D2           ; /************************************************************
 01D2           ; *擦除扇区保护
 01D2           ; ************************************************************/
 01D2           ; void DF_Erase_Sector_Protection_Register(void)
 01D2           ; {
 01D2                   .dbline 259
 01D2           ;   unsigned char Erase_Sector_Protection_Command[4]={0x3D,0x2A,0x7F,0xCF};//擦除扇区保护操作码
 01D2 80E0              ldi R24,<L71
 01D4 90E0              ldi R25,>L71
 01D6 FE01              movw R30,R28
 01D8 04E0              ldi R16,4
 01DA 10E0              ldi R17,0
 01DC FA93              st -y,R31
 01DE EA93              st -y,R30
 01E0 9A93              st -y,R25
 01E2 8A93              st -y,R24
 01E4 0E940000          xcall asgncblk
 01E8                   .dbline 262
 01E8           ;   unsigned char i;
 01E8           ; 
 01E8           ;   DF_Check_Busy_State();
 01E8 77DF              xcall _DF_Check_Busy_State
 01EA                   .dbline 263
 01EA           ;   Enable_DFLASH();
 01EA 51DF              xcall _Enable_DFLASH
 01EC                   .dbline 264
 01EC           ;   for(i=0;i<4;i++)
 01EC 4427              clr R20
 01EE 08C0              xjmp L75
 01F0           L72:
 01F0                   .dbline 265
 01F0           ;   {
 01F0                   .dbline 266
 01F0           ;       SPI_Write_Byte(Erase_Sector_Protection_Command[i]);//写擦除扇区保护操作码
 01F0 CE01              movw R24,R28
 01F2 E42F              mov R30,R20
 01F4 FF27              clr R31
 01F6 E80F              add R30,R24
 01F8 F91F              adc R31,R25
 01FA 0081              ldd R16,z+0
 01FC 2BDF              xcall _SPI_Write_Byte
 01FE                   .dbline 267
 01FE           ;   }
 01FE           L73:
 01FE                   .dbline 264
 01FE 4395              inc R20
 0200           L75:
 0200                   .dbline 264
 0200 4430              cpi R20,4
 0202 B0F3              brlo L72
 0204           X15:
 0204                   .dbline 268
 0204           ;   Disable_DFLASH();
 0204 4CDF              xcall _Disable_DFLASH
 0206                   .dbline -2
 0206           L70:
 0206                   .dbline 0 ; func end
 0206 2496              adiw R28,4
 0208 4991              ld R20,y+
 020A 0895              ret
 020C                   .dbsym l Erase_Sector_Protection_Command 0 A[4:4]c
 020C                   .dbsym r i 20 c
 020C                   .dbend
                        .area lit(rom, con, rel)
 000C           L77:
 000C 3D2A              .byte 61,42
 000E 7FFC              .byte 127,252
                        .area text(rom, con, rel)
 020C                   .dbfile E:\item\car\AT45DB041D\AT45DB041D.c
 020C                   .dbfunc e DF_Program_Sector_Protection_Register _DF_Program_Sector_Protection_Register fV
 020C           ; Program_Sector_Protection_Command -> y+0
 020C           ;              i -> R20
 020C           ; Sector_Protection_Register -> R10,R11

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -