📄 rs232.lst
字号:
C51 COMPILER V7.05 RS232 04/12/2005 09:13:15 PAGE 1
C51 COMPILER V7.05, COMPILATION OF MODULE RS232
OBJECT MODULE PLACED IN rs232.OBJ
COMPILER INVOKED BY: E:\Cygnal\IDEfiles\C51\BIN\C51.exe rs232.c DB OE
stmt level source
1 /***************************************************************************
2 RS232 communication
3 Write by dududu(Email:xx_xiong@163.com)
4 Data:2005-3
5 add I2C communication 2005-4-4
6 I2C:SDA-->P0.1,SCL-->P0.2
7 ***************************************************************************/
8
9 #define UART 0
10
11 #include "c8051F330.h"
12 #include "rs232.h"
13 void delay(int);
14 extern char rece,count_UART,count_UART1,Rec_OK,Tran_OK;
15 extern char Tran_Flag;
16 extern unsigned char xdata sRecComBuf[8];
17 extern char *pointer;
18 main(void)
19 {
20 1 unsigned int address;
21 1 unsigned char temp_char[11]; // temporary variable
22 1 PCA0MD &= ~0x40; // Disable Watchdog timer
23 1 Port_IO_Init();
24 1 Oscillator_Init();
25 1 UART_Init();
26 1 I2C_Init();
27 1 Timer3_Init();
28 1 EA = 1 ; //Enable all interrupt
29 1 #if UART
while(1)
{
//SBUF0=0x4c;
pointer=sRecComBuf;
count_UART=0;
count_UART1=0;
Tran_Flag=0;
Rec_OK=0;
Tran_OK=0;
while(Rec_OK!=0x23)
;
pointer=sRecComBuf;
while(Tran_OK!=0x45)
{
Tran_Flag=1;
SBUF0=*pointer++;
count_UART1++;
delay(100);
while(Tran_Flag)
;
}
}
#endif
53 1 while(1)
54 1 {
55 2 address = 0x0325;
C51 COMPILER V7.05 RS232 04/12/2005 09:13:15 PAGE 2
56 2 EEPROM_ByteWrite(address, 0x3e);// Read the value at location 0x0325 in the EEPROM
57 2 // delay(1000);
58 2 address++;
59 2 EEPROM_ByteWrite(address, 0x4e);// Read the value at location 0x0326 in the EEPROM
60 2 // delay(1000);
61 2 address++;
62 2 EEPROM_ByteWrite(address, 0x5e);// Read the value at location 0x0327 in the EEPROM
63 2 // delay(1000);
64 2 address++;
65 2 EEPROM_ByteWrite(address, 0x6e);// Read the value at location 0x0328 in the EEPROM
66 2 // delay(1000);
67 2 address++;
68 2 EEPROM_ByteWrite(address, 0x7e);// Read the value at location 0x0329 in the EEPROM
69 2 // delay(1000);
70 2 address++;
71 2 EEPROM_ByteWrite(address, 0x8e);// Read the value at location 0x032a in the EEPROM
72 2 // delay(1000);
73 2 address++;
74 2 EEPROM_ByteWrite(address, 0x9e);// Read the value at location 0x032b in the EEPROM
75 2 // delay(1000);
76 2 address++;
77 2 EEPROM_ByteWrite(address, 0xae);// Read the value at location 0x032c in the EEPROM
78 2 // delay(1000);
79 2 address++;
80 2 EEPROM_ByteWrite(address, 0xbe);// Read the value at location 0x032d in the EEPROM
81 2 // delay(1000);
82 2 address++;
83 2 EEPROM_ByteWrite(address, 0xce);// Read the value at location 0x032e in the EEPROM
84 2 // delay(1000);
85 2 address++;
86 2 EEPROM_ByteWrite(address, 0xde);// Read the value at location 0x032f in the EEPROM
87 2 // delay(1000);
88 2 address++;
89 2 temp_char[0] = EEPROM_ByteRead(0x0325);
90 2 // delay(1000);
91 2 temp_char[1] = EEPROM_ByteRead(0x0326);
92 2 // delay(1000);
93 2 temp_char[2] = EEPROM_ByteRead(0x0327);
94 2 // delay(1000);
95 2 temp_char[3] = EEPROM_ByteRead(0x0328);
96 2 // delay(1000);
97 2 temp_char[4] = EEPROM_ByteRead(0x0329);
98 2 // delay(1000);
99 2 temp_char[5] = EEPROM_ByteRead(0x032a);
100 2 // delay(1000);
101 2 temp_char[6] = EEPROM_ByteRead(0x032b);
102 2 // delay(1000);
103 2 temp_char[7] = EEPROM_ByteRead(0x032c);
104 2 // delay(1000);
105 2 temp_char[8] = EEPROM_ByteRead(0x032d);
106 2 // delay(1000);
107 2 temp_char[9] = EEPROM_ByteRead(0x032e);
108 2 // delay(1000);
109 2 temp_char[10] = EEPROM_ByteRead(0x032f);
110 2 delay(1000);
111 2 }
112 1 }
113
114
115
116 void delay (int i)
117 {
C51 COMPILER V7.05 RS232 04/12/2005 09:13:15 PAGE 3
118 1 int m;
119 1 for(m=0;m<i;m++)
120 1 ;
121 1 }
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 336 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = ---- 13
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 + -