?? adcpin.lst
字號:
C51 COMPILER V7.04 ADCPIN 09/30/2003 10:52:02 PAGE 1
C51 COMPILER V7.04, COMPILATION OF MODULE ADCPIN
OBJECT MODULE PLACED IN ADCPIN.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE ADCPIN.C BROWSE DEBUG OBJECTEXTEND
stmt level source
1 /*;********************************************************************
2 ;
3 ; Author : ADI - Apps www.analog.com/MicroConverter
4 ;
5 ; Date : October 2003
6 ;
7 ; File : ADCpin.asm
8 ;
9 ; Hardware : ADuC842
10 ;
11 ; Description : Performs hardware pin driven ADC conversions and
12 ; outputs results on UART. Continuously flashes
13 ; LED (independently of ADC routine) at approximately
14 ; 5Hz (assuming an 2.097152 MHz Mclk).
15 ;
16 ;*********************************************************************/
17
18 #include<stdio.h>
19 #include<aduc842.h>
20 void DELAY(int); // function prototype
21
22 void adc_int() interrupt 6{
23 1 printf("%02BX%02BX\n",ADCDATAH,ADCDATAL);
24 1 return;
25 1 }
26
27
28 sbit LED = 0x0B4; // P3.4
29
30 void main(void)
31 {
32 1 int CHAN = 0;
33 1
34 1 /*set up UART */
35 1 T3CON = 0x083;
36 1 T3FD = 0x02D;
37 1 SCON = 0x052;
38 1
39 1 /*PRECONFIGURE...*/
40 1
41 1 ADCCON1 = 0x080; // power up ADC
42 1 ADCCON2 = CHAN; // select channel to convert
43 1
44 1 /*LAUNCH CONTINUOUS CONVERSIONS...*/
45 1
46 1 EA = 1; // enable interrupts
47 1 EADC = 1; // enable ADC interrupt
48 1 ADCCON1 |= 0x01; // enable hardware CONVST pin
49 1
50 1 /*CONTINUE WITH OTHER CODE...*/
51 1
52 1 for(;;)
53 1 {
54 2 LED ^= 1;
55 2 DELAY(17000);
C51 COMPILER V7.04 ADCPIN 09/30/2003 10:52:02 PAGE 2
56 2 }
57 1
58 1 /*
59 1 the micro is free to continue with other tasks (flashing the LED in
60 1 this case) while the ADC is converting, synchronously to the
61 1 external CONVST pin. results are being handled by the ADC
62 1 interrupt service routine.*/
63 1 }
64
65 void DELAY(int length)
66 {
67 1 while (length >=0)
68 1 length--;
69 1 }
70
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 123 ----
CONSTANT SIZE = 12 ----
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 + -