-
Notifications
You must be signed in to change notification settings - Fork 1
/
unit_12_00_gracefullDegradation_hlvd.lst
284 lines (283 loc) · 10.7 KB
/
unit_12_00_gracefullDegradation_hlvd.lst
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
; LST file generated by mikroListExporter - v.2.0
; Date/Time: 26/12/2019 10:54:36
;----------------------------------------------
;Address Opcode ASM
0x0000 0xF000EF44 GOTO 136
_INTERRUPCAO_HIGH:
;unit_12_00_gracefullDegradation_hlvd.c,26 :: void INTERRUPCAO_HIGH() iv 0x0008 ics ICS_AUTO {
0x0008 0xF015C000 MOVFF R0, 21
;unit_12_00_gracefullDegradation_hlvd.c,27 :: if(HLVDIF_bit == 1)
0x000C 0xA4A1 BTFSS HLVDIF_bit, BitPos(HLVDIF_bit+0)
0x000E 0xD005 BRA L_INTERRUPCAO_HIGH0
;unit_12_00_gracefullDegradation_hlvd.c,29 :: EEPROM_Write(0, count); // Variable LED's state change count saved in eeprom at interruptions routine only :)
0x0010 0x6A19 CLRF FARG_EEPROM_Write_address
0x0012 0xF01AC016 MOVFF _count, FARG_EEPROM_Write_data_
0x0016 0xD80C RCALL _EEPROM_Write
;unit_12_00_gracefullDegradation_hlvd.c,31 :: HLVDIF_bit = 0;
0x0018 0x94A1 BCF HLVDIF_bit, BitPos(HLVDIF_bit+0)
;unit_12_00_gracefullDegradation_hlvd.c,32 :: }
L_INTERRUPCAO_HIGH0:
;unit_12_00_gracefullDegradation_hlvd.c,33 :: }
L_end_INTERRUPCAO_HIGH:
L__INTERRUPCAO_HIGH6:
0x001A 0xF000C015 MOVFF 21, R0
0x001E 0x0011 RETFIE 1
; end of _INTERRUPCAO_HIGH
_EEPROM_Read:
;__Lib_EEPROM_256.c,7 ::
;__Lib_EEPROM_256.c,9 ::
0x0020 0x9CA6 BCF EECON1, 6
;__Lib_EEPROM_256.c,10 ::
0x0022 0xFFA9C018 MOVFF FARG_EEPROM_Read_address, EEADR
;__Lib_EEPROM_256.c,11 ::
0x0026 0x9EA6 BCF EECON1, 7
;__Lib_EEPROM_256.c,12 ::
0x0028 0x80A6 BSF EECON1, 0
;__Lib_EEPROM_256.c,14 ::
0x002A 0xF000CFA8 MOVFF EEDATA, R0
;__Lib_EEPROM_256.c,16 ::
L_end_EEPROM_Read:
0x002E 0x0012 RETURN 0
; end of _EEPROM_Read
_EEPROM_Write:
;__Lib_EEPROM_256.c,21 ::
;__Lib_EEPROM_256.c,24 ::
L_EEPROM_Write0:
0x0030 0xA2A6 BTFSS EECON1, 1
0x0032 0xD002 BRA L_EEPROM_Write1
;__Lib_EEPROM_256.c,25 ::
0x0034 0x0000 NOP
0x0036 0xD7FC BRA L_EEPROM_Write0
L_EEPROM_Write1:
;__Lib_EEPROM_256.c,26 ::
0x0038 0x9CA6 BCF EECON1, 6
;__Lib_EEPROM_256.c,27 ::
0x003A 0xFFA9C019 MOVFF FARG_EEPROM_Write_address, EEADR
;__Lib_EEPROM_256.c,28 ::
0x003E 0xFFA8C01A MOVFF FARG_EEPROM_Write_data_, EEDATA
;__Lib_EEPROM_256.c,29 ::
0x0042 0x9EA6 BCF EECON1, 7
;__Lib_EEPROM_256.c,30 ::
0x0044 0x84A6 BSF EECON1, 2
;__Lib_EEPROM_256.c,32 ::
0x0046 0xF000CFF2 MOVFF INTCON, R0
;__Lib_EEPROM_256.c,35 ::
0x004A 0x9EF2 BCF INTCON, 7
;__Lib_EEPROM_256.c,36 ::
0x004C 0x0E55 MOVLW 85
0x004E 0x6EA7 MOVWF EECON2
;__Lib_EEPROM_256.c,37 ::
0x0050 0x0EAA MOVLW 170
0x0052 0x6EA7 MOVWF EECON2
;__Lib_EEPROM_256.c,38 ::
0x0054 0x82A6 BSF EECON1, 1
;__Lib_EEPROM_256.c,42 ::
0x0056 0xBE00 BTFSC R0, 7
0x0058 0xD002 BRA L__EEPROM_Write6
0x005A 0x9EF2 BCF INTCON, 7
0x005C 0xD001 BRA L__EEPROM_Write7
L__EEPROM_Write6:
0x005E 0x8EF2 BSF INTCON, 7
L__EEPROM_Write7:
;__Lib_EEPROM_256.c,44 ::
0x0060 0x94A6 BCF EECON1, 2
;__Lib_EEPROM_256.c,46 ::
L_EEPROM_Write2:
0x0062 0xB8A1 BTFSC PIR2, 4
0x0064 0xD002 BRA L_EEPROM_Write3
;__Lib_EEPROM_256.c,47 ::
0x0066 0x0000 NOP
0x0068 0xD7FC BRA L_EEPROM_Write2
L_EEPROM_Write3:
;__Lib_EEPROM_256.c,49 ::
0x006A 0x98A1 BCF PIR2, 4
;__Lib_EEPROM_256.c,50 ::
L_end_EEPROM_Write:
0x006C 0x0012 RETURN 0
; end of _EEPROM_Write
_ConfigMCU:
;unit_12_00_gracefullDegradation_hlvd.c,35 :: void ConfigMCU()
;unit_12_00_gracefullDegradation_hlvd.c,40 :: ADCON1 |= 0X0F;
0x006E 0x0E0F MOVLW 15
0x0070 0x12C1 IORWF ADCON1, 1
;unit_12_00_gracefullDegradation_hlvd.c,43 :: TRISD = 0;
0x0072 0x6A95 CLRF TRISD
;unit_12_00_gracefullDegradation_hlvd.c,44 :: PORTD = 0;
0x0074 0x6A83 CLRF PORTD
;unit_12_00_gracefullDegradation_hlvd.c,45 :: }
L_end_ConfigMCU:
0x0076 0x0012 RETURN 0
; end of _ConfigMCU
___CC2DW:
;__Lib_System.c,21 ::
;__Lib_System.c,23 ::
_CC2DL_Loop1:
;__Lib_System.c,24 ::
0x0078 0x0009 TBLRD*+
;__Lib_System.c,25 ::
0x007A 0xFFE6CFF5 MOVFF TABLAT, POSTINC1
;__Lib_System.c,26 ::
0x007E 0x0600 DECF R0, 1, 0
;__Lib_System.c,27 ::
0x0080 0xE1FB BNZ _CC2DL_Loop1
;__Lib_System.c,28 ::
0x0082 0x0601 DECF R1, 1, 0
;__Lib_System.c,29 ::
0x0084 0xE1F9 BNZ _CC2DL_Loop1
;__Lib_System.c,31 ::
L_end___CC2DW:
0x0086 0x0012 RETURN 0
; end of ___CC2DW
_main:
0x0088 0x6A16 CLRF _count
0x008A 0x6A17 CLRF 23
;unit_12_00_gracefullDegradation_hlvd.c,46 :: void main() {
;unit_12_00_gracefullDegradation_hlvd.c,47 :: ConfigMCU();
0x008C 0xDFF0 RCALL _ConfigMCU
;unit_12_00_gracefullDegradation_hlvd.c,48 :: count = EEPROM_Read(0); // As soon as the power is back, read eeprom and save in PORTD
0x008E 0x6A18 CLRF FARG_EEPROM_Read_address
0x0090 0xDFC7 RCALL _EEPROM_Read
0x0092 0xF016C000 MOVFF R0, _count
0x0096 0x0E00 MOVLW 0
0x0098 0x6E17 MOVWF _count+1
;unit_12_00_gracefullDegradation_hlvd.c,49 :: PORTD = count;
0x009A 0xFF83C016 MOVFF _count, PORTD
;unit_12_00_gracefullDegradation_hlvd.c,50 :: GIEH_bit = 1; // Enable high priority interruptions
0x009E 0x8EF2 BSF GIEH_bit, BitPos(GIEH_bit+0)
;unit_12_00_gracefullDegradation_hlvd.c,51 :: GIEL_bit = 1;
0x00A0 0x8CF2 BSF GIEL_bit, BitPos(GIEL_bit+0)
;unit_12_00_gracefullDegradation_hlvd.c,52 :: IPEN_bit = 1;
0x00A2 0x8ED0 BSF IPEN_bit, BitPos(IPEN_bit+0)
;unit_12_00_gracefullDegradation_hlvd.c,54 :: HLVDIF_bit = 0; // Config HLVD peripheral (clears flag, High priority, HLVD's INT enable)
0x00A4 0x94A1 BCF HLVDIF_bit, BitPos(HLVDIF_bit+0)
;unit_12_00_gracefullDegradation_hlvd.c,55 :: HLVDIP_bit = 1;
0x00A6 0x84A2 BSF HLVDIP_bit, BitPos(HLVDIP_bit+0)
;unit_12_00_gracefullDegradation_hlvd.c,56 :: HLVDIE_bit = 1; // See datasheet (pg.341) Table 26-4 for specifications: HLVD<7,6,5,4,3,2,1,0>
0x00A8 0x84A0 BSF HLVDIE_bit, BitPos(HLVDIE_bit+0)
;unit_12_00_gracefullDegradation_hlvd.c,57 :: HLVDCON = 0B00011110; // Event occurs when voltage equals or falls below trip point HLVDL<7> = 0
0x00AA 0x0E1E MOVLW 30
0x00AC 0x6ED2 MOVWF HLVDCON
;unit_12_00_gracefullDegradation_hlvd.c,65 :: Delay_ms(2000); // Delay for eeprom operation & system stabilization
0x00AE 0x0E15 MOVLW 21
0x00B0 0x6E0B MOVWF R11, 0
0x00B2 0x0E4B MOVLW 75
0x00B4 0x6E0C MOVWF R12, 0
0x00B6 0x0EBE MOVLW 190
0x00B8 0x6E0D MOVWF R13, 0
L_main1:
0x00BA 0x2E0D DECFSZ R13, 1, 0
0x00BC 0xD7FE BRA L_main1
0x00BE 0x2E0C DECFSZ R12, 1, 0
0x00C0 0xD7FC BRA L_main1
0x00C2 0x2E0B DECFSZ R11, 1, 0
0x00C4 0xD7FA BRA L_main1
0x00C6 0x0000 NOP
;unit_12_00_gracefullDegradation_hlvd.c,66 :: while(1) {
L_main2:
;unit_12_00_gracefullDegradation_hlvd.c,67 :: PORTD = count++;
0x00C8 0xFF83C016 MOVFF _count, PORTD
0x00CC 0x0E01 MOVLW 1
0x00CE 0x2416 ADDWF _count, 0
0x00D0 0x6E00 MOVWF R0
0x00D2 0x0E00 MOVLW 0
0x00D4 0x2017 ADDWFC _count+1, 0
0x00D6 0x6E01 MOVWF R1
0x00D8 0xF016C000 MOVFF R0, _count
0x00DC 0xF017C001 MOVFF R1, _count+1
;unit_12_00_gracefullDegradation_hlvd.c,69 :: Delay_ms(1000); // DO NOT MAKE IT IN PRODUCTION or you will decrease the life cycle or your eeprom :/
0x00E0 0x0E0B MOVLW 11
0x00E2 0x6E0B MOVWF R11, 0
0x00E4 0x0E26 MOVLW 38
0x00E6 0x6E0C MOVWF R12, 0
0x00E8 0x0E5D MOVLW 93
0x00EA 0x6E0D MOVWF R13, 0
L_main4:
0x00EC 0x2E0D DECFSZ R13, 1, 0
0x00EE 0xD7FE BRA L_main4
0x00F0 0x2E0C DECFSZ R12, 1, 0
0x00F2 0xD7FC BRA L_main4
0x00F4 0x2E0B DECFSZ R11, 1, 0
0x00F6 0xD7FA BRA L_main4
0x00F8 0x0000 NOP
0x00FA 0x0000 NOP
;unit_12_00_gracefullDegradation_hlvd.c,70 :: } // Use interruptions instead :)
0x00FC 0xD7E5 BRA L_main2
;unit_12_00_gracefullDegradation_hlvd.c,71 :: }
L_end_main:
0x00FE 0xD7FF BRA $+0
; end of _main
Symbol List:
//** Routines locations **
//ADDRESS SIZE PROCEDURE
//----------------------------------------------
0x0008 [24] _INTERRUPCAO_HIGH
0x0020 [16] _EEPROM_Read
0x0030 [62] _EEPROM_Write
0x006E [10] _ConfigMCU
0x0078 [16] ___CC2DW
0x0088 [120] _main
//** Variables locations **
//ADDRESS SIZE VARIABLE
//----------------------------------------------
0x0000 [1] R0
0x0000 [1] EEPROM_Write_SaveINTCON_L0
0x0001 [1] R1
0x0002 [1] R2
0x0003 [1] R3
0x0004 [1] R4
0x0005 [1] R5
0x0006 [1] R6
0x0007 [1] R7
0x0008 [1] R8
0x0009 [1] R9
0x000A [1] R10
0x000B [1] R11
0x000C [1] R12
0x000D [1] R13
0x000E [1] R14
0x000F [1] R15
0x0010 [1] R16
0x0011 [1] R17
0x0012 [1] R18
0x0013 [1] R19
0x0014 [1] R20
0x0016 [2] _count
0x0018 [1] FARG_EEPROM_Read_address
0x0019 [1] FARG_EEPROM_Write_address
0x001A [1] FARG_EEPROM_Write_data_
0x0F83 [1] PORTD
0x0F95 [1] TRISD
0x0FA0 [0] HLVDIE_bit
0x0FA1 [0] HLVDIF_bit
0x0FA1 [1] PIR2
0x0FA2 [0] HLVDIP_bit
0x0FA6 [1] EECON1
0x0FA7 [1] EECON2
0x0FA8 [1] EEDATA
0x0FA9 [1] EEADR
0x0FC1 [1] ADCON1
0x0FD0 [0] IPEN_bit
0x0FD2 [1] HLVDCON
0x0FD8 [1] STATUS
0x0FD9 [1] FSR2L
0x0FDA [1] FSR2H
0x0FDE [1] POSTINC2
0x0FE0 [1] BSR
0x0FE1 [1] FSR1L
0x0FE2 [1] FSR1H
0x0FE4 [1] PREINC1
0x0FE6 [1] POSTINC1
0x0FE7 [1] INDF1
0x0FE8 [1] WREG
0x0FE9 [1] FSR0L
0x0FEA [1] FSR0H
0x0FEE [1] POSTINC0
0x0FF2 [0] GIEH_bit
0x0FF2 [1] INTCON
0x0FF2 [0] GIEL_bit
0x0FF3 [1] PRODL
0x0FF4 [1] PRODH
0x0FF5 [1] TABLAT
0x0FF6 [1] TBLPTRL
0x0FF7 [1] TBLPTRH
0x0FF8 [1] TBLPTRU