Rev Author Line No. Line
179 helcl 1 CCS PCM C Compiler, Version 4.059d, 15399 02-IV-06 00:43
2  
3 Filename: mainpw2.lst
4  
5 ROM used: 109 words (5%)
6 Largest free fragment is 1939
7 RAM used: 8 (2%) at main() level
8 8 (2%) worst case
9 Stack: 0 locations
10  
11 *
12 0000: MOVLW 00
13 0001: MOVWF 0A
14 0002: GOTO 004
15 0003: NOP
16 .................... #include "C:\RS\kaki\try\mainpw2.h"
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 .................... {
42 0004: CLRF 04
43 0005: BCF 03.7
44 0006: MOVLW 1F
45 0007: ANDWF 03,F
46 0008: MOVLW 19
47 0009: BSF 03.5
48 000A: MOVWF 19
49 000B: MOVLW A6
50 000C: MOVWF 18
51 000D: MOVLW 90
52 000E: BCF 03.5
53 000F: MOVWF 18
54 0010: BSF 03.5
55 0011: BSF 1F.0
56 0012: BSF 1F.1
57 0013: BSF 1F.2
58 0014: BCF 1F.3
59 0015: MOVLW 07
60 0016: MOVWF 1C
61 .................... int8 delay;
62 .................... setup_adc_ports(AN0);
63 *
64 001A: BSF 03.5
65 001B: BCF 1F.0
66 001C: BSF 1F.1
67 001D: BSF 1F.2
68 001E: BSF 1F.3
69 .................... setup_adc(ADC_CLOCK_DIV_2);
70 001F: BCF 1F.6
71 0020: BCF 03.5
72 0021: BCF 1F.6
73 0022: BCF 1F.7
74 0023: BSF 03.5
75 0024: BCF 1F.7
76 0025: BCF 03.5
77 0026: BSF 1F.0
78 .................... setup_psp(PSP_DISABLED);
79 0027: BSF 03.5
80 0028: BCF 09.4
81 .................... setup_spi(SPI_SS_DISABLED);
82 *
83 0017: MOVLW FF
84 0018: BCF 03.5
85 0019: MOVWF 20
86 *
87 0029: BCF 03.5
88 002A: BCF 14.5
89 002B: BCF 20.5
90 002C: MOVF 20,W
91 002D: BSF 03.5
92 002E: MOVWF 07
93 002F: BCF 03.5
94 0030: BSF 20.4
95 0031: MOVF 20,W
96 0032: BSF 03.5
97 0033: MOVWF 07
98 0034: BCF 03.5
99 0035: BCF 20.3
100 0036: MOVF 20,W
101 0037: BSF 03.5
102 0038: MOVWF 07
103 0039: MOVLW 01
104 003A: BCF 03.5
105 003B: MOVWF 14
106 003C: MOVLW 00
107 003D: BSF 03.5
108 003E: MOVWF 14
109 .................... setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
110 003F: MOVF 01,W
111 0040: ANDLW C7
112 0041: IORLW 08
113 0042: MOVWF 01
114 .................... setup_timer_1(T1_DISABLED);
115 0043: BCF 03.5
116 0044: CLRF 10
117 .................... setup_timer_2(T2_DIV_BY_1,255,1);
118 0045: MOVLW 00
119 0046: MOVWF 78
120 0047: IORLW 04
121 0048: MOVWF 12
122 0049: MOVLW FF
123 004A: BSF 03.5
124 004B: MOVWF 12
125 .................... setup_ccp1(CCP_PWM);
126 004C: BCF 03.5
127 004D: BCF 20.2
128 004E: MOVF 20,W
129 004F: BSF 03.5
130 0050: MOVWF 07
131 0051: BCF 03.5
132 0052: BCF 07.2
133 0053: MOVLW 0C
134 0054: MOVWF 17
135 .................... set_pwm1_duty(0);
136 0055: CLRF 15
137 .................... setup_comparator(NC_NC_NC_NC);
138 0056: MOVLW 07
139 0057: BSF 03.5
140 0058: MOVWF 1C
141 0059: MOVF 05,W
142 005A: MOVLW 03
143 005B: MOVWF 77
144 005C: DECFSZ 77,F
145 005D: GOTO 05C
146 005E: MOVF 1C,W
147 005F: BCF 03.5
148 0060: BCF 0D.6
149 .................... setup_vref(FALSE);
150 0061: BSF 03.5
151 0062: CLRF 1D
152 ....................
153 .................... while(TRUE)
154 .................... {
155 .................... delay=read_adc();
156 0063: BCF 03.5
157 0064: BSF 1F.2
158 0065: BTFSC 1F.2
159 0066: GOTO 065
160 0067: MOVF 1E,W
161 0068: MOVWF 21
162 .................... set_pwm1_duty((delay));
163 0069: MOVF 21,W
164 006A: MOVWF 15
165 .................... }
166 006B: GOTO 064
167 .................... }
168 006C: SLEEP
169  
170 Configuration Fuses:
171 Word 1: 3939 XT NOWDT NOPUT NODEBUG NOPROTECT NOBROWNOUT NOLVP NOCPD WRT_50%