📄 flash.lst
字号:
C51 COMPILER V7.05 FLASH 12/20/2004 15:31:08 PAGE 1
C51 COMPILER V7.05, COMPILATION OF MODULE FLASH
OBJECT MODULE PLACED IN flash.OBJ
COMPILER INVOKED BY: C:\KEIL\C51\BIN\C51.EXE flash.c DEBUG OBJECTEXTEND
stmt level source
1 #include "REG51F.H"
2 #include "flash.h"
3 #include "string.h"
4 #include "stdio.h"
5 #include "intrins.h"
6
7
8
9
10 /***********************************************************************
11 * Function name : Flash_Sector_Erase *
12 * Input : unsigned char, (Sector number selected) *
13 * Output : bit, (0->operation fail, 1->operation successful) *
14 * Description : This function will perform a sector erase on the *
15 * sector number (sec_no) of the selected (CS) flash *
16 * memory device. 1 sector is 64Kbytes The operation will *
17 * roughly take 2 seconds for 1 sector. All paging to the *
18 * CPLD is done in this function. *
19 * Caution! ; Do not perform this operation on program flash memory *
20 * while running program on the program flash. *
21 ************************************************************************/
22 bit Flash_Sector_Erase (unsigned char data sec_no)
23 {
24 1
25 1 unsigned int data addr;
26 1 addr=(unsigned int )sec_no*512;
27 1 ISPFD=0X55;
28 1 ISPFD=0XAA;
29 1 ISPFD=0X55;
30 1 SCONF=0X04; //OPEN ISP
31 1 ISPFAH=(addr&0xFF00)>>8;
32 1 ISPFAL=addr&0x00ff;
33 1 ISPC=0XA2;
34 1
35 1 return 1;
36 1
37 1 }
38 /************************************************************************
39 * Function name : Flash_Write *
40 * Input : union ADDRESS, (32bit address location) *
41 * unsigned char, (Data to be written *
42 * Output : bit, (0->operation fail, 1->operation successful) *
43 * Description : This function will perform a prgramming on the *
44 * selected (CS) flash memory device. 1 byte of data is *
45 * being written to the location (Address). All paging to *
46 * the CPLD is done in this function. *
47 * Caution! ; Make sure the location to be program is eraseed (0xFF) *
48 * before calling this function *
49 * Do not perform this operation on program flash memory *
50 * while running program on the program flash. *
51 ************************************************************************/
52 bit Flash_Write (unsigned int Address, unsigned char data *_data,unsigned char data len)
53 {
54 1 unsigned char data i;
55 1
C51 COMPILER V7.05 FLASH 12/20/2004 15:31:08 PAGE 2
56 1 ISPFD=0X55;
57 1 ISPFD=0XAA;
58 1 ISPFD=0X55;
59 1 SCONF=0X04; //OPEN ISP
60 1 ISPFAH=Address>>8;
61 1 ISPFAL= Address;
62 1 ISPFD=*_data;
63 1 ISPC=0XA0;
64 1 for(i=0;i<len;i++)
65 1 {
66 2 ISPFAH=Address>>8;
67 2 ISPFAL= Address;
68 2 ISPFD=*_data;
69 2 ISPC=0XA0;
70 2 Address++;
71 2 _data++;
72 2 }
73 1
74 1 return 1;
75 1 }
76
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 92 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = ---- 2
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -