📄 canshu.lst
字号:
C51 COMPILER V8.08 CANSHU 09/04/2007 19:56:27 PAGE 1
C51 COMPILER V8.08, COMPILATION OF MODULE CANSHU
OBJECT MODULE PLACED IN canshu.OBJ
COMPILER INVOKED BY: D:\Keil\C51\BIN\C51.EXE canshu.c BROWSE DEBUG OBJECTEXTEND
line level source
1 //2. MAX261参数f0,Q写入程序:
2 #include <REG51.H> /* special function register declarations */
3 /* for the intended AT89C2051 derivative */
4
5 #include <stdio.h> /* prototype declarations for I/O functions */
6
7 sbit P1_0=P1^0; /* /RESET connect to P1^0 */
8 sbit P1_2=P1^2; /* D1 connect to P1^2 */
9 sbit P1_3=P1^3; /* D0 connect to P1^3 */
10 sbit P1_4=P1^4; /* A3 connect to P1^4 */
11 sbit P1_5=P1^5; /* A2 connect to P1^5 */
12 sbit P1_6=P1^6; /* A1 connect to P1^6 */
13 sbit P1_7=P1^7; /* A0 connect to P1^7 */
14 sbit P3_7=P3^7; /* /WR connect to P3^7 */
15 /*------------------------------------------------
16 The main C function. Program execution starts
17 here after stack initialization.
18 ------------------------------------------------*/
19 void main (void) {
20 1 int i;
21 1 int a[8];
22 1 for(i=0;i<8;i++)
23 1 a[i]=i;
24 1 printf("please enter number 0 to 8 by order to set MAX261: ");
25 1 for(i=0;i<8;i++)
26 1 scanf("%d",&a[i]);
27 1 P1_0=1; // /RESET=1 to make 7555 oscillator work no
-rmally
28 1 P3_7=1;
29 1 /*------------------------------------------------
30 1 The following program section realize the function of setting f0A=1125.4HZ,
31 1 QA=90.5 of MAX261.
32 1 ------------------------------------------------*/
33 1 switch (a[i]) {
34 2
35 2 /*------------------------------------------------
36 2 The following program section realize the function of selecting mode2 to the filter A of MAX261
37 2 and setting F5aF4aF3aF2aF1aF0a=001000B,Q6aQ5aQ4aQ3aQ2aQ1aQ0a=1111111B
38 2 ------------------------------------------------*/
39 2 case '0':
40 2 P3_7=0; // the falling edge of /WR
41 2 //p1=0x08;
42 2 P1_2=0; //select mode 2,set M1a=0
43 2 P1_3=1; //set M0a=1
44 2 P1_4=0;
45 2 P1_5=0;
46 2 P1_6=0;
47 2 P1_7=0; //address A3 A2 A1 A0=0x0
48 2 P3_7=1;
49 2 case '1':
50 2 P3_7=0; //the falling edge of /WR
51 2 P1_2=0; //set F1a=0
-
52 2 P1_3=0; //set F0a=0
53 2 P1_4=0;
C51 COMPILER V8.08 CANSHU 09/04/2007 19:56:27 PAGE 2
54 2 P1_5=0;
55 2 P1_6=0;
56 2 P1_7=1; //address A3 A2 A1 A0=0x1
57 2 P3_7=1;
58 2
59 2 case '2':
60 2 P3_7=0; //the falling edge of /WR
61 2 P1_2=1; //set F3a=1
62 2 P1_3=0; //set F2a=0
63 2 P1_4=0;
64 2 P1_5=0;
65 2 P1_6=1;
66 2 P1_7=0; //address A3 A2 A1 A0=0x2
67 2 P3_7=1;
68 2
69 2 case '3':
70 2 P3_7=0; //the falling edge of /WR
71 2 P1_2=0; //set F5a=0
72 2 P1_3=0; //set F4a=0
73 2 P1_4=0;
74 2 P1_5=0;
75 2 P1_6=1;
76 2 P1_7=1; //address A3 A2 A1 A0=0x3
77 2 P3_7=1;
78 2
79 2 case '4':
80 2 P3_7=0; //the falling edge of /WR
81 2 P1_2=1; //set Q1a=1
82 2 P1_3=1; //set Q0a=1
83 2 P1_4=0;
84 2 P1_5=1;
85 2 P1_6=0;
86 2 P1_7=0; //address A3 A2 A1 A0=0x4
87 2 P3_7=1;
88 2
89 2 case '5':
90 2 P3_7=0; //the falling edge of /WR
91 2 P1_2=1; //set Q3a=1
92 2 P1_3=1; //set Q2a=1
93 2 P1_4=0;
94 2 P1_5=1;
95 2 P1_6=0;
96 2 P1_7=1; //address A3 A2 A1 A0=0x5
97 2 P3_7=1;
98 2
99 2
100 2 case '6':
101 2 P3_7=0; //the falling edge of /WR
102 2 P1_2=1; //set Q5a=1
103 2 P1_3=1; //set Q4a=1
104 2 P1_4=0;
105 2 P1_5=1;
106 2 P1_6=1;
107 2 P1_7=0; //address A3 A2 A1 A0=0x6
108 2 P3_7=1;
109 2
110 2
111 2 case '7':
112 2 P3_7=0; //the falling edge of /WR
113 2 P1_2=0;
114 2 P1_3=1; //set Q6a=1
115 2 P1_4=1;
C51 COMPILER V8.08 CANSHU 09/04/2007 19:56:27 PAGE 3
116 2 P1_5=0;
117 2 P1_6=0;
118 2 P1_7=0; //address A3 A2 A1 A0=0x7
119 2 P3_7=1;
120 2 }
121 1 }
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 289 ----
CONSTANT SIZE = 55 ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = ---- 18
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 + -