707 |
kaklik |
1 |
CCS PCM C Compiler, Version 4.106, 47914 29-IX-12 21:44 |
179 |
helcl |
2 |
|
707 |
kaklik |
3 |
Filename: D:\MLAB_E\projekty\GM_counter\SW\converter\mainpw2.lst |
179 |
helcl |
4 |
|
707 |
kaklik |
5 |
ROM used: 110 words (1%) |
|
|
6 |
Largest free fragment is 2048 |
|
|
7 |
RAM used: 7 (2%) at main() level |
|
|
8 |
7 (2%) worst case |
179 |
helcl |
9 |
Stack: 0 locations |
|
|
10 |
|
|
|
11 |
* |
|
|
12 |
0000: MOVLW 00 |
|
|
13 |
0001: MOVWF 0A |
|
|
14 |
0002: GOTO 004 |
|
|
15 |
0003: NOP |
707 |
kaklik |
16 |
.................... #include "mainpw2.h" |
179 |
helcl |
17 |
.................... #include <16F877A.h> |
|
|
18 |
.................... //////// Standard Header file for the PIC16F877A device //////////////// |
|
|
19 |
.................... #device PIC16F877A |
|
|
20 |
.................... #list |
|
|
21 |
.................... |
|
|
22 |
.................... #device adc=8 |
|
|
23 |
.................... |
|
|
24 |
.................... #FUSES NOWDT //No Watch Dog Timer |
|
|
25 |
.................... #FUSES XT //Crystal osc <= 4mhz |
|
|
26 |
.................... #FUSES NOPUT //No Power Up Timer |
|
|
27 |
.................... #FUSES NOPROTECT //Code not protected from reading |
|
|
28 |
.................... #FUSES NODEBUG //No Debug mode for ICD |
|
|
29 |
.................... #FUSES NOBROWNOUT //No brownout reset |
|
|
30 |
.................... #FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O |
|
|
31 |
.................... #FUSES NOCPD //No EE protection |
|
|
32 |
.................... #FUSES WRT_50% //Lower half of Program Memory is Write Protected |
|
|
33 |
.................... |
|
|
34 |
.................... #use delay(clock=4000000) |
|
|
35 |
.................... #use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8) |
|
|
36 |
.................... |
|
|
37 |
.................... |
|
|
38 |
.................... |
|
|
39 |
.................... |
|
|
40 |
.................... void main() |
|
|
41 |
.................... { |
707 |
kaklik |
42 |
* |
179 |
helcl |
43 |
0004: CLRF 04 |
|
|
44 |
0005: BCF 03.7 |
|
|
45 |
0006: MOVLW 1F |
|
|
46 |
0007: ANDWF 03,F |
|
|
47 |
0008: MOVLW 19 |
|
|
48 |
0009: BSF 03.5 |
|
|
49 |
000A: MOVWF 19 |
|
|
50 |
000B: MOVLW A6 |
|
|
51 |
000C: MOVWF 18 |
|
|
52 |
000D: MOVLW 90 |
|
|
53 |
000E: BCF 03.5 |
|
|
54 |
000F: MOVWF 18 |
|
|
55 |
0010: BSF 03.5 |
|
|
56 |
0011: BSF 1F.0 |
|
|
57 |
0012: BSF 1F.1 |
|
|
58 |
0013: BSF 1F.2 |
|
|
59 |
0014: BCF 1F.3 |
|
|
60 |
0015: MOVLW 07 |
|
|
61 |
0016: MOVWF 1C |
|
|
62 |
.................... int8 delay; |
|
|
63 |
.................... setup_adc_ports(AN0); |
|
|
64 |
* |
|
|
65 |
001A: BSF 03.5 |
|
|
66 |
001B: BCF 1F.0 |
|
|
67 |
001C: BSF 1F.1 |
|
|
68 |
001D: BSF 1F.2 |
|
|
69 |
001E: BSF 1F.3 |
|
|
70 |
.................... setup_adc(ADC_CLOCK_DIV_2); |
|
|
71 |
001F: BCF 1F.6 |
|
|
72 |
0020: BCF 03.5 |
|
|
73 |
0021: BCF 1F.6 |
|
|
74 |
0022: BCF 1F.7 |
|
|
75 |
0023: BSF 03.5 |
|
|
76 |
0024: BCF 1F.7 |
|
|
77 |
0025: BCF 03.5 |
|
|
78 |
0026: BSF 1F.0 |
|
|
79 |
.................... setup_psp(PSP_DISABLED); |
|
|
80 |
0027: BSF 03.5 |
|
|
81 |
0028: BCF 09.4 |
|
|
82 |
.................... setup_spi(SPI_SS_DISABLED); |
|
|
83 |
0029: BCF 03.5 |
|
|
84 |
002A: BCF 14.5 |
|
|
85 |
002B: BCF 20.5 |
|
|
86 |
002C: MOVF 20,W |
|
|
87 |
002D: BSF 03.5 |
|
|
88 |
002E: MOVWF 07 |
|
|
89 |
002F: BCF 03.5 |
|
|
90 |
0030: BSF 20.4 |
|
|
91 |
0031: MOVF 20,W |
|
|
92 |
0032: BSF 03.5 |
|
|
93 |
0033: MOVWF 07 |
|
|
94 |
0034: BCF 03.5 |
|
|
95 |
0035: BCF 20.3 |
|
|
96 |
0036: MOVF 20,W |
|
|
97 |
0037: BSF 03.5 |
|
|
98 |
0038: MOVWF 07 |
|
|
99 |
0039: MOVLW 01 |
|
|
100 |
003A: BCF 03.5 |
|
|
101 |
003B: MOVWF 14 |
|
|
102 |
003C: MOVLW 00 |
|
|
103 |
003D: BSF 03.5 |
|
|
104 |
003E: MOVWF 14 |
|
|
105 |
.................... setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
|
|
106 |
003F: MOVF 01,W |
|
|
107 |
0040: ANDLW C7 |
|
|
108 |
0041: IORLW 08 |
|
|
109 |
0042: MOVWF 01 |
|
|
110 |
.................... setup_timer_1(T1_DISABLED); |
|
|
111 |
0043: BCF 03.5 |
|
|
112 |
0044: CLRF 10 |
|
|
113 |
.................... setup_timer_2(T2_DIV_BY_1,255,1); |
|
|
114 |
0045: MOVLW 00 |
|
|
115 |
0046: MOVWF 78 |
|
|
116 |
0047: IORLW 04 |
|
|
117 |
0048: MOVWF 12 |
|
|
118 |
0049: MOVLW FF |
|
|
119 |
004A: BSF 03.5 |
|
|
120 |
004B: MOVWF 12 |
|
|
121 |
.................... setup_ccp1(CCP_PWM); |
|
|
122 |
004C: BCF 03.5 |
|
|
123 |
004D: BCF 20.2 |
|
|
124 |
004E: MOVF 20,W |
|
|
125 |
004F: BSF 03.5 |
|
|
126 |
0050: MOVWF 07 |
|
|
127 |
0051: BCF 03.5 |
|
|
128 |
0052: BCF 07.2 |
|
|
129 |
0053: MOVLW 0C |
|
|
130 |
0054: MOVWF 17 |
|
|
131 |
.................... set_pwm1_duty(0); |
|
|
132 |
0055: CLRF 15 |
|
|
133 |
.................... setup_comparator(NC_NC_NC_NC); |
|
|
134 |
0056: MOVLW 07 |
|
|
135 |
0057: BSF 03.5 |
|
|
136 |
0058: MOVWF 1C |
|
|
137 |
0059: MOVF 05,W |
707 |
kaklik |
138 |
005A: MOVWF 05 |
|
|
139 |
005B: MOVLW 03 |
|
|
140 |
005C: MOVWF 77 |
|
|
141 |
005D: DECFSZ 77,F |
|
|
142 |
005E: GOTO 05D |
|
|
143 |
005F: MOVF 1C,W |
|
|
144 |
0060: BCF 03.5 |
|
|
145 |
0061: BCF 0D.6 |
179 |
helcl |
146 |
.................... setup_vref(FALSE); |
707 |
kaklik |
147 |
0062: BSF 03.5 |
|
|
148 |
0063: CLRF 1D |
179 |
helcl |
149 |
.................... |
|
|
150 |
.................... while(TRUE) |
|
|
151 |
.................... { |
|
|
152 |
.................... delay=read_adc(); |
707 |
kaklik |
153 |
0064: BCF 03.5 |
|
|
154 |
0065: BSF 1F.2 |
|
|
155 |
0066: BTFSC 1F.2 |
|
|
156 |
0067: GOTO 066 |
|
|
157 |
0068: MOVF 1E,W |
|
|
158 |
0069: MOVWF 21 |
179 |
helcl |
159 |
.................... set_pwm1_duty((delay)); |
707 |
kaklik |
160 |
006A: MOVF 21,W |
|
|
161 |
006B: MOVWF 15 |
179 |
helcl |
162 |
.................... } |
707 |
kaklik |
163 |
006C: GOTO 065 |
179 |
helcl |
164 |
.................... } |
707 |
kaklik |
165 |
006D: SLEEP |
179 |
helcl |
166 |
|
|
|
167 |
Configuration Fuses: |
|
|
168 |
Word 1: 3939 XT NOWDT NOPUT NODEBUG NOPROTECT NOBROWNOUT NOLVP NOCPD WRT_50% |