📄 usb.lst
字号:
C51 COMPILER V7.07 USB 03/31/2004 00:03:19 PAGE 1
C51 COMPILER V7.07, COMPILATION OF MODULE USB
OBJECT MODULE PLACED IN usb.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE usb.c OPTIMIZE(9,SPEED) REGFILE(.\usb.ORC) BROWSE DEBUG OBJECTEXTEND
stmt level source
1 //#include <ADuC842.h>
2 #include <stdio.h>
3 #include <rs_usb.h>
4
5 sbit TEM = P2^0;
6 sbit ADXL_Y = P1^4;
7
8
9 signed long int i=0;
10 signed int s_data=-1;
11 unsigned char c=0;
12 unsigned int data_adc=0x3000;
13 unsigned char volume=1;
14 unsigned int DAC_Data=0;
15
16
17 void delay(unsigned long int length) { while(length--) s_data = ReadByte(); }
18
19
20 void adc_int() interrupt 6 {
21 1 DAC0 = ((ADCDATA&0x0FFF)-volume);
22 1 // DAC0 = ~DAC0;
23 1 /* SendByte(SEC);
24 1 SendByte(MIN);
25 1
26 1 if (ADCDATA>(data_adc+100)) data_adc = data_adc+100; else
27 1 if (ADCDATA<(data_adc-100)) data_adc = data_adc-100; else
28 1 if (ADCDATA>data_adc) data_adc++; else
29 1 if (ADCDATA<data_adc) data_adc--;
30 1
31 1 SendByte(data_adc>>8);
32 1 SendByte(data_adc&0xFF);
33 1
34 1 SendByte(i<<24);
35 1 SendByte((i<<16)&0xFF);
36 1 SendByte((i<<8)&0xFF);
37 1 SendByte(i&0xFF);
38 1
39 1 SendByte(P0);
40 1 SendByte(P1);
41 1 SendByte(P2);
42 1 SendByte(P3);
43 1 delay(0x00FF);
44 1 LED = !LED;*/
45 1 return;
46 1 }
47
48
49 void main (void)
50 {
51 1 TxD_USB = 1; // Wysoki stan na linii nadawczej
52 1 DSR_USB = 0; // Niski stan na linii gotowo渃i odbioru
53 1 PLLCON = 0x01; //PLL Clock config
54 1 P1 = 0x7F; // Port P1.7 jako Digital Input;
55 1
C51 COMPILER V7.07 USB 03/31/2004 00:03:19 PAGE 2
56 1 DelayUs(0x01);
57 1
58 1 ADCCON1 = 0x8C;
59 1 ADCCON2 = 0x0B;
60 1 ADCCON3 = 0x25;
61 1 ADCCON2 = 0x0C;
62 1 ADCCON3 = 0x27;
63 1
64 1 ADCCON1 = B10100000;// power up ADC /8 + 4 acq clock
65 1 ADCCON2 = B00100011;// select channel to convert
66 1
67 1 DACCON = B01111111;
68 1 // EA = 1; // enable interrupts
69 1 // EADC = 1; // enable ADC interrupt
70 1 // CCONV = 1; // begin continuous conversions
71 1
72 1
73 1 while (1) {
74 2 while(!ADCI);
75 2 // DAC_Data = ADCDATA&0x0FFF;
76 2 DAC0 = (ADCDATA&0x0FFF)/volume;
77 2 // if (DAC_Data>0) DAC0 = (DAC_Data>>volume)+0x0800;
78 2 // if (DAC_Data<0) DAC0 = (-((-DAC_Data)>>volume))+0x0800;
79 2 if (!INT0) volume=3;
80 2 if (!INT1) volume=2;
81 2
82 2 }
83 1
84 1 }
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 144 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = 12 4
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 + -