?? stc89c58_eeprom.lst
字號:
C51 COMPILER V7.06 STC89C58_EEPROM 06/12/2008 11:00:05 PAGE 1
C51 COMPILER V7.06, COMPILATION OF MODULE STC89C58_EEPROM
OBJECT MODULE PLACED IN stc89c58_eeprom.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE stc89c58_eeprom.c LARGE BROWSE DEBUG OBJECTEXTEND
stmt level source
1 //********************************
2 // stc89c51 eeprom program
3 // 2007.9.26
4 // lp
5 //********************************
6 #include <at89x52.h>
7 #include "stc89c58_eeprom.h"
8 #define uchar unsigned char
9 #define uint unsigned int
10 sfr isp_data = 0xe2;
11 sfr isp_addrh = 0xe3;
12 sfr isp_addrl = 0xe4;
13 sfr isp_cmd = 0xe5;
14 sfr isp_trig = 0xe6;
15 sfr isp_contr = 0xe7;
16 bit temp;
17 //********************************
18 //fun: eeprom start
19 //********************************
20 static void eeprom_start()
21 {
22 1 temp=EA; // save EA
23 1 EA=0;
24 1 isp_contr=0x81;
25 1 isp_trig=0x46;
26 1 isp_trig=0xb9;
27 1 }
28 //********************************
29 //fun: eeprom_end
30 //********************************
31 static void eeprom_stop()
32 {
33 1 isp_contr=0;
34 1 isp_cmd=0;
35 1 isp_trig=0;
36 1 isp_addrh=0;
37 1 isp_addrl=0;
38 1 EA=temp;
39 1 }
40 //********************************
41 //fun:read eeprom subprogram
42 //********************************
43 char read_eeprom(int addr)
44 {
45 1 uchar byte_data;
46 1
47 1 isp_addrh=addr>>8;
48 1 isp_addrl=addr&0xff;
49 1 isp_cmd=1;
50 1 eeprom_start();
51 1 // null();
52 1 eeprom_stop();
53 1 byte_data=isp_data;
54 1 return(byte_data);
55 1 }
C51 COMPILER V7.06 STC89C58_EEPROM 06/12/2008 11:00:05 PAGE 2
56 //********************************
57 //fun:write eeprom subprogram
58 //********************************
59 void write_eeprom(int addr,char byte_data)
60 {
61 1
62 1 isp_data=byte_data;
63 1 isp_addrh=addr>>8;
64 1 isp_addrl=addr&0xff;
65 1 isp_cmd=2;
66 1 eeprom_start();
67 1 // null();
68 1 eeprom_stop();
69 1 }
70 //********************************
71 //fun:wipe eeprom subprogram
72 //********************************
73 void wipe_eeprom(int addr)
74 {
75 1
76 1 isp_addrh=addr>>8;
77 1 isp_addrl=addr&0xff;
78 1 isp_cmd=3 ;
79 1 eeprom_start();
80 1 // null();
81 1 eeprom_stop();
82 1 }
83 //********************************
84 /*
85 main_loop()
86 {
87 wipe_eeprom(0x8000);
88 write_eeprom(0x8000,0xf9);
89 TI=0;
90 SBUF=read_eeprom(0x8000);
91 while(!TI);
92 TI=0;
93 for(;;)
94 {
95
96 }
97 }
98 */
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 99 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = ---- ----
IDATA SIZE = ---- ----
BIT SIZE = 1 ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -