📄 led.lst
字号:
252 =2 #define DAC_PD1 0x02
253 =2 #define DAC_PD0 0x01
254 =2
255 =2 /* ADCCON1 */
C51 COMPILER V7.50 LED 12/19/2005 19:21:27 PAGE 6
256 =2 #define ADC_MD1 0x80
257 =2 #define ADC_EXT_REF 0x40
258 =2 #define ADC_CK1 0x20
259 =2 #define ADC_CK0 0x10
260 =2 #define ADC_AQ1 0x08
261 =2 #define ADC_AQ0 0x04
262 =2 #define ADC_T2C 0x02
263 =2 #define ADC_EXC 0x01
264 =2
265 =2 /* ADCCON2 */
266 =2 #define ADC_ADCI 0x80
267 =2 #define ADC_DMA 0x40
268 =2 #define ADC_CCONV 0x20
269 =2 #define ADC_SCONV 0x10
270 =2 #define ADC_CS3 0x08
271 =2 #define ADC_CS2 0x04
272 =2 #define ADC_CS1 0x02
273 =2 #define ADC_CS0 0x01
274 =2
275 =2 /* ADCCON3 */
276 =2 #define ADC_BUSY 0x80
277 =2 #define ADC_RSVD 0x40
278 =2 #define ADC_AVGS1 0x20
279 =2 #define ADC_AVGS0 0x10
280 =2 #define ADC_RSVD1 0x08
281 =2 #define ADC_RSVD0 0x04
282 =2 #define ADC_TYPICAL 0x02
283 =2 #define ADC_SCAL 0x01
284 =2
285 =2 /* CFG842 */
286 =2 #define CFG_EXSP 0x80
287 =2 #define CFG_PWPO 0x40
288 =2 #define CFG_DBUF 0x20
289 =2 #define CFG_EXTCLK 0x10
290 =2 #define CFG_RSVD1 0x08
291 =2 #define CFG_RSVD0 0x04
292 =2 #define CFG_MSPI 0x02
293 =2 #define CFG_XRAMEN 0x01
294 =2
295 =2 /* PLLCON */
296 =2 #define PLL_OSC_PD 0x80
297 =2 #define PLL_LOCK 0x40
298 =2 #define PLL_FINT 0x08
299 =2 #define PLL_CD2 0x04
300 =2 #define PLL_CD1 0x02
301 =2 #define PLL_CD0 0x01
302 =2
303 =2 /* PWMCON */
304 =2 #define PWM_SNGL 0x80
305 =2 #define PWM_MD2 0x40
306 =2 #define PWM_MD1 0x20
307 =2 #define PWM_MD0 0x10
308 =2 #define PWM_CDIV1 0x08
309 =2 #define PWM_CDIV0 0x04
310 =2 #define PWM_CSEL1 0x02
311 =2 #define PWM_CSEL0 0x01
312 =2
313 =2 /* SPICON */
314 =2 #define SPI_ISPI 0x80
315 =2 #define SPI_WCOL 0x40
316 =2 #define SPI_SPE 0x20
317 =2 #define SPI_SPIM 0x10
C51 COMPILER V7.50 LED 12/19/2005 19:21:27 PAGE 7
318 =2 #define SPI_CPOL 0x08
319 =2 #define SPI_CPHA 0x04
320 =2 #define SPI_SPR1 0x02
321 =2 #define SPI_SPR0 0x01
322 =2
323 =2 /* I2CCON MASTER MODE*/
324 =2 #define I2C_MDO 0x80
325 =2 #define I2C_MDE 0x40
326 =2 #define I2C_MCO 0x20
327 =2 #define I2C_MDI 0x10
328 =2 #define I2C_I2CM 0x08
329 =2
330 =2 /* I2CCON SLAVE MODE*/
331 =2 #define I2C_I2CSI 0x80
332 =2 #define I2C_I2CGC 0x40
333 =2 #define I2C_I2CID1 0x20
334 =2 #define I2C_I2CID0 0x10
335 =2 #define I2C_I2CM 0x08
336 =2 #define I2C_I2CRS 0x04
337 =2 #define I2C_I2CTX 0x02
338 =2 #define I2C_I2CI 0x01
339 =2
340 =2 /* DPCON */
341 =2 #define DP_DPT 0x40
342 =2 #define DP_DP1m1 0x20
343 =2 #define DP_DP1m0 0x10
344 =2 #define DP_DP0m1 0x08
345 =2 #define DP_DP0m0 0x04
346 =2 #define DP_DPSEL 0x01
347 =2
348 =2 /* PSMCON */
349 =2 #define PSM_CMPD 0x40
350 =2 #define PSM_PSMI 0x20
351 =2 #define PSM_TPD1 0x10
352 =2 #define PSM_TPD0 0x08
353 =2 #define PSM_PSMEN 0x01
354 =2
355 =2 /* WDCON */
356 =2 #define WD_PRE3 0x80
357 =2 #define WD_PRE2 0x40
358 =2 #define WD_PRE1 0x20
359 =2 #define WD_PRE0 0x10
360 =2 #define WD_WDIR 0x08
361 =2 #define WD_WDS 0x04
362 =2 #define WD_WDE 0x02
363 =2 #define WD_WDWR 0x01
364 =2
365 =2 /* TIMECON */
366 =2 #define TIC_TFH 0x40
367 =2 #define TIC_ITS1 0x20
368 =2 #define TIC_ITS0 0x10
369 =2 #define TIC_STI 0x08
370 =2 #define TIC_TII 0x04
371 =2 #define TIC_TIEN 0x02
372 =2 #define TIC_TCEN 0x01
373 =2
374 =2 /* TMOD */
375 =2 #define TMOD_GATE1 0x80
376 =2 #define TMOD_CT_T1 0x40
377 =2 #define TMOD_M1_T1 0x20
378 =2 #define TMOD_M0_T1 0x10
379 =2 #define TMOD_GATE0 0x08
C51 COMPILER V7.50 LED 12/19/2005 19:21:27 PAGE 8
380 =2 #define TMOD_CT_T0 0x04
381 =2 #define TMOD_M1_T0 0x02
382 =2 #define TMOD_M0_T0 0x01
383 =2
384 =2 /* TCON */
385 =2 #define TCON_TF1 0x80
386 =2 #define TCON_TR1 0x40
387 =2 #define TCON_TF0 0x20
388 =2 #define TCON_TR0 0x10
389 =2 #define TCON_IE1 0x08
390 =2 #define TCON_IT1 0x04
391 =2 #define TCON_IE0 0x02
392 =2 #define TCON_IT0 0x01
393 =2
394 =2 /* T2CON */
395 =2 #define TCON_TF2 0x80
396 =2 #define TCON_EXF2 0x40
397 =2 #define TCON_RCLK 0x20
398 =2 #define TCON_TCLK 0x10
399 =2 #define TCON_EXEN2 0x08
400 =2 #define TCON_TR2 0x04
401 =2 #define TCON_CNT2 0x02
402 =2 #define TCON_CAP2 0x01
403 =2
404 =2 /* T3CON */
405 =2 #define TCON_T3BAUDEN 0x80
406 =2 #define TCON_DIV2 0x04
407 =2 #define TCON_DIV1 0x02
408 =2 #define TCON_DIV0 0x01
409 =2
410 =2 /* SCON */
411 =2 #define UART_SM0 0x80
412 =2 #define UART_SM1 0x40
413 =2 #define UART_SM2 0x20
414 =2 #define UART_REN 0x10
415 =2 #define UART_TB8 0x08
416 =2 #define UART_RB8 0x04
417 =2 #define UART_TI 0x02
418 =2 #define UART_RI 0x01
419 =2
420 =2 /* IE */
421 =2 #define IE_EA 0x80
422 =2 #define IE_EADC 0x40
423 =2 #define IE_ET2 0x20
424 =2 #define IE_ES 0x10
425 =2 #define IE_ET1 0x08
426 =2 #define IE_EX1 0x04
427 =2 #define IE_ET0 0x02
428 =2 #define IE_EX0 0x01
429 =2
430 =2 /* IP */
431 =2 #define IP_PADC 0x40
432 =2 #define IP_PT2 0x20
433 =2 #define IP_PS 0x10
434 =2 #define IP_PT1 0x08
435 =2 #define IP_PX1 0x04
436 =2 #define IP_PT0 0x02
437 =2 #define IP_PX0 0x01
438 =2
439 =2 /* IEIP2 */
440 =2 #define IP_PTI 0x40
441 =2 #define IP_PPSM 0x20
C51 COMPILER V7.50 LED 12/19/2005 19:21:27 PAGE 9
442 =2 #define IP_PSI 0x10
443 =2 #define IP_ETI 0x04
444 =2 #define IP_EPSMI 0x02
445 =2 #define IP_ESI 0x01
446 =2
447 =2
2 =1
3 =1 sbit LED = P3^7;
4 =1 sbit RxD_USB = P1^7;
5 =1 sbit TxD_USB = P3^4;
6 =1 sbit CTS_USB = P3^5;
7 =1 sbit DSR_USB = P3^6;
8 =1
9 =1 extern void DelayUs(unsigned char count);
10 =1 extern void DelayUs2(void);
11 =1 extern signed int ReadByte(void);
12 =1 extern void SendByte(unsigned char data_byte);
4
5
6 sbit TEM = P2^0;
7 sbit ADXL_Y = P1^4;
8
9 unsigned char napis[22] = " Spuki jest debe渃iak ";
10
11
12 signed int i=0;
13 signed int s_data=0;
14 unsigned char c=0;
15
16
17 void delay(unsigned int length) {
18 1 while (length!=0) {
19 2 i = ReadByte();
20 2 if (i>=0) c = i&0xFF;
21 2 length--;
22 2 }
23 1 }
24
25
26 //void delayms(unsigned char length) { while (length!=0) length--; }
27 /*
28 void Timer2_Int () interrupt 5
29 {
30 LED = !LED;
31 TF2 = 0;
32 }
33 */
34
35
36 void main (void)
37 {
38 1 DelayUs(0x01); DelayUs2();
39 1 TxD_USB = 1; // Wysoki stan na linii nadawczej
40 1 P1 = 11101111; // Port P1.4 jako Analog Input;
41 1 PLLCON = 0x01; //PLL Clock config
42 1
43 1 //Timer2 config
44 1 // ET2 = 1;
45 1 // TH2 = 0x00; TL2 = 0x00;
46 1 // RCAP2H = 0xF0; RCAP2L = 0x00;
47 1 EA = 0;
48 1 // T2CON = 0x04;
C51 COMPILER V7.50 LED 12/19/2005 19:21:27 PAGE 10
49 1 napis[0] = 0xFF;
50 1 napis[21] = 0x00;
51 1
52 1 while(1) {
53 2 s_data = c;
54 2 SendByte(s_data >> 8);
55 2 SendByte(c);
56 2 SendByte(P0);
57 2 SendByte(P1);
58 2 SendByte(P2);
59 2 SendByte(P3);
60 2 delay(0x03FF);
61 2 }
62 1 }
C51 COMPILER V7.50 LED 12/19/2005 19:21:27 PAGE 11
NAME CLASS MSPACE TYPE OFFSET SIZE
==== ===== ====== ==== ====== ====
P0 . . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 0080H 1
P1 . . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 0090H 1
P2 . . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00A0H 1
_SendByte. . . . . . . . . . . . . . . EXTERN CODE PROC ----- -----
P3 . . . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00B0H 1
EA . . . . . . . . . . . . . . . . . . ABSBIT ----- BIT 00AFH 1
size_t . . . . . . . . . . . . . . . . TYPEDEF ----- U_INT ----- 2
ReadByte . . . . . . . . . . . . . . . EXTERN CODE PROC ----- -----
_DelayUs . . . . . . . . . . . . . . . EXTERN CODE PROC ----- -----
napis. . . . . . . . . . . . . . . . . PUBLIC DATA ARRAY 0000H 22
main . . . . . . . . . . . . . . . . . PUBLIC CODE PROC 0000H -----
PLLCON . . . . . . . . . . . . . . . . SFR DATA U_CHAR 00D7H 1
TxD_USB. . . . . . . . . . . . . . . . ABSBIT ----- BIT 00B4H 1
c. . . . . . . . . . . . . . . . . . . PUBLIC DATA U_CHAR 0016H 1
i. . . . . . . . . . . . . . . . . . . PUBLIC DATA INT 0017H 2
DelayUs2 . . . . . . . . . . . . . . . EXTERN CODE PROC ----- -----
s_data . . . . . . . . . . . . . . . . PUBLIC DATA INT 0019H 2
_delay . . . . . . . . . . . . . . . . PUBLIC CODE PROC 0000H -----
length?040 . . . . . . . . . . . . . AUTO DATA U_INT 0000H 2
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 113 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = 27 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 + -