📄 ad985x.lst
字号:
C51 COMPILER V8.05a AD985X 05/09/2011 01:28:13 PAGE 1
C51 COMPILER V8.05a, COMPILATION OF MODULE AD985X
OBJECT MODULE PLACED IN ad985x.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE ad985x.c DEBUG OBJECTEXTEND
line level source
1 #include "AD985x.H"
2
3 double Con_Word_1_985x = 0x00;
4 double Con_Word_2_985x = 0x00;
5 unsigned long ConTrol_Word_985x = 0x00;
6
7 void delay_985x(long int n)
8 {
9 1 while(n!=0)
10 1 {
11 2 n--;
12 2 }
13 1 }
14 void Send_Control_Word_985x(unsigned long ConTrol_Word)
15 {
16 1 unsigned long ConTrol_Word_Temporary ;
17 1 unsigned char data_word ;
18 1 w_clk_985x = 0x00;
19 1 fqud_985x = 0x00;
20 1 data_word = 0x00;
21 1 dataport_985x = data_word;
22 1 w_clk_985x=1;
23 1 w_clk_985x=0;
24 1 ConTrol_Word_Temporary = ConTrol_Word;
25 1 ConTrol_Word = ConTrol_Word >> 24;
26 1 data_word = ConTrol_Word % 256;
27 1 dataport_985x = data_word;
28 1 w_clk_985x=1;
29 1 w_clk_985x=0;
30 1 ConTrol_Word = ConTrol_Word_Temporary;
31 1 ConTrol_Word = ConTrol_Word >> 16;
32 1 data_word = ConTrol_Word % 256;
33 1 dataport_985x = data_word;
34 1 w_clk_985x=1;
35 1 w_clk_985x=0;
36 1 ConTrol_Word = ConTrol_Word_Temporary;
37 1 ConTrol_Word = ConTrol_Word >> 8;
38 1 data_word = ConTrol_Word % 256;
39 1 dataport_985x = data_word;
40 1 w_clk_985x=1;
41 1 w_clk_985x=0;
42 1 ConTrol_Word = ConTrol_Word_Temporary;
43 1 data_word = ConTrol_Word % 256;
44 1 dataport_985x = data_word;
45 1 w_clk_985x=1;
46 1 w_clk_985x=0;
47 1 fqud_985x=1;
48 1
49 1 }
50
51 void Calculate_Control_Word_985x(unsigned long Frequency_Out_985x)
52 {
53 1 Con_Word_1_985x = Frequency_Out_985x * 34; //算出整数部分
54 1 Con_Word_2_985x = Frequency_Out_985x * 0.3597; //算出小数部分 (系数=2^32/CLK )
55 1 Con_Word_2_985x = Con_Word_2_985x + 0.5; //小数部分修正
C51 COMPILER V8.05a AD985X 05/09/2011 01:28:13 PAGE 2
56 1 Con_Word_1_985x = Con_Word_1_985x + Con_Word_2_985x; //整数+修正后的小数
57 1 ConTrol_Word_985x = Con_Word_1_985x / 1; //换成整型
58 1 }
59
60
61 void init_985x(void)
62 { reset_985x = 1;
63 1 delay_985x(10000);
64 1 reset_985x = 0;
65 1 }
66 void OutFre_985x(unsigned long Frequency_Out_985x)
67 {
68 1 Calculate_Control_Word_985x(Frequency_Out_985x);
69 1 Send_Control_Word_985x(ConTrol_Word_985x);
70 1 }
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 361 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = 12 16
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 + -