📄 dac.lst
字号:
C51 COMPILER V7.06 DAC 06/25/2008 15:44:08 PAGE 1
C51 COMPILER V7.06, COMPILATION OF MODULE DAC
OBJECT MODULE PLACED IN DAC.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\c51.exe DAC.C DB OE
stmt level source
1 //********************************************************************************************************
-******************
2 #include <c8051F020.h>
3 #include "HEAD.H"
4 //********************************************************************************************************
-******************
5 void DAC_Init(void)
6 {
7 1 DAC0CN = 0x80;
8 1 DAC1CN = 0x80;
9 1 REF0CN = 0x03;
10 1 }
11 //********************************************************************************************************
-******************
12 void DAC_OUT_1(unsigned int dat)
13 {
14 1 xdata unsigned int temp;
15 1 xdata float tempf;
16 1
17 1 if(dat > 5000) //容错
18 1 dat = 5000;
19 1
20 1 tempf=(float)dat;
21 1 tempf=tempf/5000*4095;
22 1 temp=(unsigned int)tempf;
23 1
24 1 DAC0L = temp;
25 1 DAC0H = temp>>8;
26 1
27 1 }
28 //********************************************************************************************************
-******************
29 void DAC_OUT_2(unsigned int dat)
30 {
31 1 xdata unsigned int temp;
32 1 xdata float tempf;
33 1
34 1 if(dat > 5000) //容错
35 1 dat = 5000;
36 1
37 1 tempf=(float)dat;
38 1 tempf=tempf/5000*4095;
39 1 temp=(unsigned int)tempf;
40 1
41 1 DAC1L = temp;
42 1 DAC1H = temp>>8;
43 1
44 1 }
45 //********************************************************************************************************
-******************
46 // The End
47 //********************************************************************************************************
-******************
48
49
C51 COMPILER V7.06 DAC 06/25/2008 15:44:08 PAGE 2
50
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 218 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- 12
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 + -