Subversion Repositories svnkaklik

Rev

Rev 6 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 6 Rev 410
1
CCS PCW C Compiler, Version 3.110, 15448
1
CCS PCW C Compiler, Version 3.110, 15448
2
 
2
 
3
               Filename: d:\@kaklik\programy\pic_c\mereni\vyskomer_drak\main.LST
3
               Filename: d:\@kaklik\programy\pic_c\mereni\vyskomer_drak\main.LST
4
 
4
 
5
               ROM used: 54 (5%)
5
               ROM used: 54 (5%)
6
                         Largest free fragment is 970
6
                         Largest free fragment is 970
7
               RAM used: 5 (7%) at main() level
7
               RAM used: 5 (7%) at main() level
8
                         6 (9%) worst case
8
                         6 (9%) worst case
9
               Stack:    1 locations
9
               Stack:    1 locations
10
 
10
 
11
*
11
*
12
0000:  MOVLW  00
12
0000:  MOVLW  00
13
0001:  MOVWF  0A
13
0001:  MOVWF  0A
14
0002:  GOTO   019
14
0002:  GOTO   019
15
0003:  NOP
15
0003:  NOP
16
....................  #include "D:\@Kaklik\programy\PIC_C\mereni\vyskomer_drak\main.h" 
16
....................  #include "D:\@Kaklik\programy\PIC_C\mereni\vyskomer_drak\main.h" 
17
....................  #include <16F84.h> 
17
....................  #include <16F84.h> 
18
....................  //////// Standard Header file for the PIC16F84 device ////////////////  
18
....................  //////// Standard Header file for the PIC16F84 device ////////////////  
19
.................... #device PIC16F84  
19
.................... #device PIC16F84  
20
.................... #list  
20
.................... #list  
21
....................  
21
....................  
22
.................... #use delay(clock=4000000)  
22
.................... #use delay(clock=4000000)  
23
0004:  MOVLW  12
23
0004:  MOVLW  12
24
0005:  MOVWF  04
24
0005:  MOVWF  04
25
0006:  MOVF   00,W
25
0006:  MOVF   00,W
26
0007:  BTFSC  03.2
26
0007:  BTFSC  03.2
27
0008:  GOTO   018
27
0008:  GOTO   018
28
0009:  MOVLW  01
28
0009:  MOVLW  01
29
000A:  MOVWF  0D
29
000A:  MOVWF  0D
30
000B:  CLRF   0C
30
000B:  CLRF   0C
31
000C:  DECFSZ 0C,F
31
000C:  DECFSZ 0C,F
32
000D:  GOTO   00C
32
000D:  GOTO   00C
33
000E:  DECFSZ 0D,F
33
000E:  DECFSZ 0D,F
34
000F:  GOTO   00B
34
000F:  GOTO   00B
35
0010:  MOVLW  4A
35
0010:  MOVLW  4A
36
0011:  MOVWF  0C
36
0011:  MOVWF  0C
37
0012:  DECFSZ 0C,F
37
0012:  DECFSZ 0C,F
38
0013:  GOTO   012
38
0013:  GOTO   012
39
0014:  NOP
39
0014:  NOP
40
0015:  NOP
40
0015:  NOP
41
0016:  DECFSZ 00,F
41
0016:  DECFSZ 00,F
42
0017:  GOTO   009
42
0017:  GOTO   009
43
0018:  RETLW  00
43
0018:  RETLW  00
44
.................... #fuses XT,NOWDT  
44
.................... #fuses XT,NOWDT  
45
....................   
45
....................   
46
....................  
46
....................  
47
....................   
47
....................   
48
.................... #DEFINE  SCLK     PIN_A2  
48
.................... #DEFINE  SCLK     PIN_A2  
49
.................... #DEFINE  DOUT     PIN_A3  
49
.................... #DEFINE  DOUT     PIN_A3  
50
.................... #DEFINE  DIN      PIN_A1  
50
.................... #DEFINE  DIN      PIN_A1  
51
.................... #include "MS5534A.c" 
51
.................... #include "MS5534A.c" 
52
....................    
52
....................    
53
.................... #DEFINE  CLK         250  
53
.................... #DEFINE  CLK         250  
54
.................... #DEFINE  WORD1       0b111010101000  
54
.................... #DEFINE  WORD1       0b111010101000  
55
.................... #DEFINE  WORD2       0b111010110000  
55
.................... #DEFINE  WORD2       0b111010110000  
56
.................... #DEFINE  WORD3       0b111011001000  
56
.................... #DEFINE  WORD3       0b111011001000  
57
.................... #DEFINE  WORD4       0b111011010000  
57
.................... #DEFINE  WORD4       0b111011010000  
58
....................   
58
....................   
59
.................... void send_bit(bit)  
59
.................... void send_bit(bit)  
60
.................... {  
60
.................... {  
61
....................    output_bit(DIN,bit);  
61
....................    output_bit(DIN,bit);  
62
....................    output_high(SCLK);  
62
....................    output_high(SCLK);  
63
....................    Delay_us(CLK);  
63
....................    Delay_us(CLK);  
64
....................    output_low(SCLK);  
64
....................    output_low(SCLK);  
65
.................... }  
65
.................... }  
66
.................... int1 read_bit()  
66
.................... int1 read_bit()  
67
.................... {  
67
.................... {  
68
....................    output_high(SCLK);  
68
....................    output_high(SCLK);  
69
....................    Delay_us(CLK);  
69
....................    Delay_us(CLK);  
70
....................    output_low(SCLK);  
70
....................    output_low(SCLK);  
71
....................    if (input(DOUT)) return true;  
71
....................    if (input(DOUT)) return true;  
72
....................    if (!input(DOUT)) return false;  
72
....................    if (!input(DOUT)) return false;  
73
.................... }  
73
.................... }  
74
....................   
74
....................   
75
.................... void read_byte(*byte_r)  
75
.................... void read_byte(*byte_r)  
76
.................... {  
76
.................... {  
77
.................... int i;  
77
.................... int i;  
78
....................   
78
....................   
79
....................    for(i=0;i>=7;i++)  
79
....................    for(i=0;i>=7;i++)  
80
....................    {  
80
....................    {  
81
....................    *byte_r = read_bit();  
81
....................    *byte_r = read_bit();  
82
....................    *byte_r << 1;  
82
....................    *byte_r << 1;  
83
....................    }  
83
....................    }  
84
.................... }  
84
.................... }  
85
....................   
85
....................   
86
.................... void send_command(command,width)  
86
.................... void send_command(command,width)  
87
.................... {  
87
.................... {  
88
.................... int i;  
88
.................... int i;  
89
....................    for (i=width;i>=0;i--)  
89
....................    for (i=width;i>=0;i--)  
90
....................    {  
90
....................    {  
91
....................      send_bit(bit_test(command,0));  
91
....................      send_bit(bit_test(command,0));  
92
....................      command >>1;  
92
....................      command >>1;  
93
....................    }     
93
....................    }     
94
.................... }  
94
.................... }  
95
....................   
95
....................   
96
.................... void bar_reset()  
96
.................... void bar_reset()  
97
.................... {  
97
.................... {  
98
.................... int8 i;  
98
.................... int8 i;  
99
....................   
99
....................   
100
....................    for(i=0;i>=20;i++) send_bit(Bit_test(i,0));  
100
....................    for(i=0;i>=20;i++) send_bit(Bit_test(i,0));  
101
.................... }  
101
.................... }  
102
....................   
102
....................   
103
.................... int16 bar_con_pre()  
103
.................... int16 bar_con_pre()  
104
.................... {  
104
.................... {  
105
.................... int16 word;  
105
.................... int16 word;  
106
....................      
106
....................      
107
....................    send_command(0b1111010000,9);  
107
....................    send_command(0b1111010000,9);  
108
....................   
108
....................   
109
....................    Delay_ms(10);  
109
....................    Delay_ms(10);  
110
....................   
110
....................   
111
....................    While(input(DOUT)) Delay_us(100);  
111
....................    While(input(DOUT)) Delay_us(100);  
112
....................   
112
....................   
113
....................    read_byte(&word);  
113
....................    read_byte(&word);  
114
....................    word << 8;  
114
....................    word << 8;  
115
....................    read_byte(&word);  
115
....................    read_byte(&word);  
116
....................   
116
....................   
117
....................    return word;  
117
....................    return word;  
118
.................... }  
118
.................... }  
119
....................   
119
....................   
120
.................... int16 bar_con_term()  
120
.................... int16 bar_con_term()  
121
.................... {  
121
.................... {  
122
.................... int16 word;  
122
.................... int16 word;  
123
....................   
123
....................   
124
....................    send_command(0b1111001000,9);  
124
....................    send_command(0b1111001000,9);  
125
....................   
125
....................   
126
....................    Delay_ms(10);  
126
....................    Delay_ms(10);  
127
....................   
127
....................   
128
....................    While(input(DOUT)) Delay_us(100);  
128
....................    While(input(DOUT)) Delay_us(100);  
129
....................   
129
....................   
130
....................    read_byte(&word);  
130
....................    read_byte(&word);  
131
....................    word << 8;  
131
....................    word << 8;  
132
....................    read_byte(&word);  
132
....................    read_byte(&word);  
133
....................   
133
....................   
134
....................    return word;     
134
....................    return word;     
135
.................... }  
135
.................... }  
136
....................   
136
....................   
137
.................... int16 bar_read_cal(command)  
137
.................... int16 bar_read_cal(command)  
138
.................... {  
138
.................... {  
139
.................... int16 word;  
139
.................... int16 word;  
140
....................   
140
....................   
141
....................    send_command(command,11);  
141
....................    send_command(command,11);  
142
....................   
142
....................   
143
....................    Delay_ms(10);  
143
....................    Delay_ms(10);  
144
....................   
144
....................   
145
....................    While(input(DOUT)) Delay_us(100);  
145
....................    While(input(DOUT)) Delay_us(100);  
146
....................   
146
....................   
147
....................    read_byte(&word);  
147
....................    read_byte(&word);  
148
....................    word << 8;  
148
....................    word << 8;  
149
....................    read_byte(&word);  
149
....................    read_byte(&word);  
150
....................   
150
....................   
151
....................    return word;     
151
....................    return word;     
152
.................... }  
152
.................... }  
153
....................   
153
....................   
154
....................   
154
....................   
155
....................   
155
....................   
156
....................   
156
....................   
157
....................   
157
....................   
158
....................   
158
....................   
159
....................  
159
....................  
160
.................... void main()  
160
.................... void main()  
161
.................... {  
161
.................... {  
162
0019:  CLRF   04
162
0019:  CLRF   04
163
001A:  MOVLW  1F
163
001A:  MOVLW  1F
164
001B:  ANDWF  03,F
164
001B:  ANDWF  03,F
165
....................    output_high(pin_B2);  
165
....................    output_high(pin_B2);  
166
001C:  BSF    03.5
166
001C:  BSF    03.5
167
001D:  BCF    06.2
167
001D:  BCF    06.2
168
001E:  BCF    03.5
168
001E:  BCF    03.5
169
001F:  BSF    06.2
169
001F:  BSF    06.2
170
....................    while(true)  
170
....................    while(true)  
171
....................    {  
171
....................    {  
172
....................       while(!input(pin_B1))  
172
....................       while(!input(pin_B1))  
173
0020:  BSF    03.5
173
0020:  BSF    03.5
174
0021:  BSF    06.1
174
0021:  BSF    06.1
175
0022:  BCF    03.5
175
0022:  BCF    03.5
176
0023:  BTFSC  06.1
176
0023:  BTFSC  06.1
177
0024:  GOTO   02D
177
0024:  GOTO   02D
178
....................       {  
178
....................       {  
179
....................         output_high(pin_A3);  
179
....................         output_high(pin_A3);  
180
0025:  BSF    03.5
180
0025:  BSF    03.5
181
0026:  BCF    05.3
181
0026:  BCF    05.3
182
0027:  BCF    03.5
182
0027:  BCF    03.5
183
0028:  BSF    05.3
183
0028:  BSF    05.3
184
....................         Delay_ms(50);  
184
....................         Delay_ms(50);  
185
0029:  MOVLW  32
185
0029:  MOVLW  32
186
002A:  MOVWF  12
186
002A:  MOVWF  12
187
002B:  CALL   004
187
002B:  CALL   004
188
....................       }  
188
....................       }  
189
002C:  GOTO   020
189
002C:  GOTO   020
190
....................      output_low(pin_A3);  
190
....................      output_low(pin_A3);  
191
002D:  BSF    03.5
191
002D:  BSF    03.5
192
002E:  BCF    05.3
192
002E:  BCF    05.3
193
002F:  BCF    03.5
193
002F:  BCF    03.5
194
0030:  BCF    05.3
194
0030:  BCF    05.3
195
....................      Delay_ms(50);  
195
....................      Delay_ms(50);  
196
0031:  MOVLW  32
196
0031:  MOVLW  32
197
0032:  MOVWF  12
197
0032:  MOVWF  12
198
0033:  CALL   004
198
0033:  CALL   004
199
....................    }  
199
....................    }  
200
0034:  GOTO   020
200
0034:  GOTO   020
201
....................   
201
....................   
202
.................... }  
202
.................... }  
203
....................  
203
....................  
204
0035:  SLEEP
204
0035:  SLEEP