📄 stc_eeprom.lst
字号:
C51 COMPILER V7.50 STC_EEPROM 09/17/2007 09:47:26 PAGE 1
C51 COMPILER V7.50, COMPILATION OF MODULE STC_EEPROM
OBJECT MODULE PLACED IN stc_eeprom.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE stc_eeprom.c BROWSE DEBUG OBJECTEXTEND
line level source
1
2 #include "io.h"
3 #define stc_eeprom_c
4 sfr isp_data=0xe2;
5 sfr isp_addrh=0xe3;
6 sfr isp_addrl=0xe4;
7 sfr isp_cmd=0xe5;
8 sfr isp_trig=0xe6;
9 sfr isp_contr=0xe7;
10
11
12 unsigned char eeprom_read(unsigned int addres);
13 void eeprom_write(unsigned int address,unsigned char wdata);
14 void eeprom_eares(unsigned int addres);
15
16 //****************************************************
17 //function:
18 //input :无
19 //output :无
20 //modify :2007-9-11
21 //*****************************************************
22 void eeprom_eares(unsigned int addres)
23 {
24 1 unsigned i;
25 1 isp_addrh=(uchar)(addres>>8);
26 1 isp_addrl=(uchar)addres;
27 1 isp_contr=0x01;
28 1 isp_contr=isp_contr|0x80;
29 1 isp_cmd=0x03;
30 1 EA=0;
31 1 isp_trig=0x46;
32 1 isp_trig=0xb9;
33 1 for(i=0;i<3;i++);
34 1 EA=1;
35 1 isp_addrl=0xff;
36 1 isp_addrh=0xff;
37 1 isp_contr=0x00;
38 1 isp_cmd=0x00;
39 1 isp_trig=0x00;
40 1
41 1 }
42
43 //****************************************************
44 //function:
45 //input :无
46 //output :无
47 //modify :2007-9-11
48 //*****************************************************
49 void eeprom_write(unsigned int addres,unsigned char write_data)
50 {unsigned char i;
51 1 isp_data=write_data;
52 1 isp_addrh=addres>>8;
53 1 isp_addrl=addres;
54 1 isp_contr=0x01;
55 1 isp_contr=isp_contr|0x80;
C51 COMPILER V7.50 STC_EEPROM 09/17/2007 09:47:26 PAGE 2
56 1 isp_cmd=0x02;
57 1 EA=0;
58 1 isp_trig=0x46;
59 1 isp_trig=0xb9;
60 1 for(i=0;i<3;i++);
61 1 EA=1;
62 1 isp_addrl=0xff;
63 1 isp_addrh=0xff;
64 1 isp_contr=0x00;
65 1 isp_cmd=0x00;
66 1 isp_trig=0x00;
67 1 }
68
69 //****************************************************
70 //function:
71 //input :无
72 //output :无
73 //modify :2007-9-11
74 //*****************************************************
75 unsigned char eeprom_read(unsigned int addres)
76 {unsigned char i,z;
77 1 isp_addrh=addres>>8;
78 1 isp_addrl=addres;
79 1 isp_contr=0x01;
80 1 isp_contr=isp_contr|0x80;
81 1 isp_cmd=0x01;
82 1 EA=0;
83 1 isp_trig=0x46;
84 1 isp_trig=0xb9;
85 1 for(i=0;i<3;i++);
86 1 isp_addrl=0xff;
87 1 isp_addrh=0xff;
88 1 isp_contr=0x00;
89 1 isp_cmd=0x00;
90 1 isp_trig=0x00;
91 1 z=isp_data;
92 1 EA=1;
93 1 return(z);
94 1
95 1
96 1 }
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 153 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = ---- ----
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 + -