Subversion Repositories svnkaklik

Rev

Rev 410 | Details | Compare with Previous | Last modification | View Log

Rev Author Line No. Line
6 kaklik 1
CCS PCM C Compiler, Version 3.221, 27853               14-VI-05 22:12
2
 
3
               Filename: D:\KAKLIK\programy\PIC_C\mereni\otmer\otmer.LST
4
 
5
               ROM used: 122 words (12%)
6
                         Largest free fragment is 902
7
               RAM used: 5 (7%) at main() level
8
                         8 (12%) worst case
9
               Stack:    1 locations
10
 
11
*
12
0000:  MOVLW  00
13
0001:  MOVWF  0A
14
0002:  GOTO   044
15
0003:  NOP
16
....................  #include "D:\KAKLIK\programy\PIC_C\mereni\otmer\otmer.h" 
17
....................  #include <16F84.h> 
18
....................  //////// Standard Header file for the PIC16F84 device ////////////////  
19
.................... #device PIC16F84  
20
.................... #list  
21
....................  
22
.................... #fuses NOWDT,XT, NOPUT, NOPROTECT  
23
.................... #use delay(clock=4000000)  
24
*
25
002F:  MOVLW  11
26
0030:  MOVWF  04
27
0031:  MOVF   00,W
28
0032:  BTFSC  03.2
29
0033:  GOTO   043
30
0034:  MOVLW  01
31
0035:  MOVWF  0D
32
0036:  CLRF   0C
33
0037:  DECFSZ 0C,F
34
0038:  GOTO   037
35
0039:  DECFSZ 0D,F
36
003A:  GOTO   036
37
003B:  MOVLW  4A
38
003C:  MOVWF  0C
39
003D:  DECFSZ 0C,F
40
003E:  GOTO   03D
41
003F:  NOP
42
0040:  NOP
43
0041:  DECFSZ 00,F
44
0042:  GOTO   034
45
0043:  RETLW  00
46
....................   
47
....................  
48
....................   
49
.................... #define DATA   PIN_A1  
50
.................... #define CP     PIN_A0  
51
.................... #define STROBE PIN_A2  
52
....................   
53
.................... #include "shift_reg.c" 
54
....................  ////////////////////////////////////////////////////////////////////////////////  
55
.................... //                   KNIHOVNA PRO OVLADANI POSUVNEHO REGISTRU  
56
.................... //  
57
.................... ////////////////////////////////////////////////////////////////////////////////  
58
.................... // definice  
59
.................... //#define DATA   PIN_A1  
60
.................... //#define CP     PIN_A0  
61
.................... //#define STROBE PIN_A2  
62
....................   
63
.................... void putreg(unsigned int8 out)   // zapise do registru 8bitovou promenou.  
64
.................... {  
65
.................... int8 i;  
66
....................    output_low(STROBE);  
67
*
68
0004:  BSF    03.5
69
0005:  BCF    05.2
70
0006:  BCF    03.5
71
0007:  BCF    05.2
72
....................      
73
....................    for(i=0;i<=7;i++)  
74
0008:  CLRF   13
75
0009:  MOVF   13,W
76
000A:  SUBLW  07
77
000B:  BTFSS  03.0
78
000C:  GOTO   02A
79
....................    {  
80
....................       output_bit(DATA,bit_test(out,7-i));  
81
000D:  MOVF   13,W
82
000E:  SUBLW  07
83
000F:  MOVWF  14
84
0010:  MOVF   12,W
85
0011:  MOVWF  0C
86
0012:  MOVF   14,W
87
0013:  MOVWF  0D
88
0014:  BTFSC  03.2
89
0015:  GOTO   01A
90
0016:  BCF    03.0
91
0017:  RRF    0C,F
92
0018:  DECFSZ 0D,F
93
0019:  GOTO   016
94
001A:  BTFSC  0C.0
95
001B:  GOTO   01E
96
001C:  BCF    05.1
97
001D:  GOTO   01F
98
001E:  BSF    05.1
99
001F:  BSF    03.5
100
0020:  BCF    05.1
101
....................       output_low(CP);  
102
0021:  BCF    05.0
103
0022:  BCF    03.5
104
0023:  BCF    05.0
105
....................       output_high(CP);  
106
0024:  BSF    03.5
107
0025:  BCF    05.0
108
0026:  BCF    03.5
109
0027:  BSF    05.0
110
....................    }  
111
0028:  INCF   13,F
112
0029:  GOTO   009
113
....................    output_high(STROBE);  
114
002A:  BSF    03.5
115
002B:  BCF    05.2
116
002C:  BCF    03.5
117
002D:  BSF    05.2
118
.................... }  
119
002E:  RETLW  00
120
.................... void reg_shift_left()  
121
.................... {  
122
.................... }  
123
.................... void reg_shift_right()  
124
.................... {  
125
.................... }  
126
....................  
127
....................   
128
.................... void main()  
129
.................... {  
130
*
131
0044:  CLRF   04
132
0045:  MOVLW  1F
133
0046:  ANDWF  03,F
134
.................... int n=0;  
135
0047:  CLRF   0F
136
.................... int i;  
137
....................    putreg(1);  
138
0048:  MOVLW  01
139
0049:  MOVWF  12
140
004A:  CALL   004
141
....................    while(true)  
142
....................    {  
143
....................       i=1;  
144
004B:  MOVLW  01
145
004C:  MOVWF  10
146
....................       for(n=0;n<=7;n++)  
147
004D:  CLRF   0F
148
004E:  MOVF   0F,W
149
004F:  SUBLW  07
150
0050:  BTFSS  03.0
151
0051:  GOTO   05C
152
....................       {  
153
....................          putreg(i);  
154
0052:  MOVF   10,W
155
0053:  MOVWF  12
156
0054:  CALL   004
157
....................          i=i<<1;  
158
0055:  BCF    03.0
159
0056:  RLF    10,F
160
....................          Delay_ms(50);  
161
0057:  MOVLW  32
162
0058:  MOVWF  11
163
0059:  CALL   02F
164
....................       };  
165
005A:  INCF   0F,F
166
005B:  GOTO   04E
167
....................       i=0x80;  
168
005C:  MOVLW  80
169
005D:  MOVWF  10
170
....................       for(n=0;n<=7;n++)  
171
005E:  CLRF   0F
172
005F:  MOVF   0F,W
173
0060:  SUBLW  07
174
0061:  BTFSS  03.0
175
0062:  GOTO   06D
176
....................       {  
177
....................          putreg(i);  
178
0063:  MOVF   10,W
179
0064:  MOVWF  12
180
0065:  CALL   004
181
....................          i=i>>1;  
182
0066:  BCF    03.0
183
0067:  RRF    10,F
184
....................          Delay_ms(50);  
185
0068:  MOVLW  32
186
0069:  MOVWF  11
187
006A:  CALL   02F
188
....................       };  
189
006B:  INCF   0F,F
190
006C:  GOTO   05F
191
....................    }  
192
006D:  GOTO   04B
193
....................   
194
....................    while(true)  
195
....................    {  
196
....................       putreg(~n);  
197
006E:  MOVF   0F,W
198
006F:  MOVWF  11
199
0070:  COMF   11,F
200
0071:  MOVF   11,W
201
0072:  MOVWF  12
202
0073:  CALL   004
203
....................       Delay_ms(100);  
204
0074:  MOVLW  64
205
0075:  MOVWF  11
206
0076:  CALL   02F
207
....................       n++;  
208
0077:  INCF   0F,F
209
....................    }  
210
0078:  GOTO   06E
211
.................... }  
212
....................  
213
0079:  SLEEP
214
 
215
Configuration Fuses:
216
   Word  1: 3FF9   XT NOWDT NOPUT NOPROTECT