📄 f6.lst
字号:
M
M
005E 3003 M movlw 0x03
005F 00A8 M movwf BYTES
0060 3020 M movlw BFIIC
0061 00AA M movwf DestPointer
0062 3033 M movlw AT_ConstantV
0063 00AB M movwf SubAddress
0064 2??? M call R24C02
M
0065 3020 00202 movlw BFIIC
0066 00AF 00203 movwf I
0067 30A3 00204 movlw ConstantV_LOW
0068 00F7 00205 movwf J
0069 3003 00206 movlw D'3'
006A 00AE 00207 movwf tempCount
006B 2??? 00208 call S0_S1
00209
00210 ; -------------------------------------------------------------
00211 I2C_READ_SUB 0x03, BFIIC, AT_ChargeTermI
M
M
M
006C 3003 M movlw 0x03
006D 00A8 M movwf BYTES
006E 3020 M movlw BFIIC
006F 00AA M movwf DestPointer
0070 3036 M movlw AT_ChargeTermI
0071 00AB M movwf SubAddress
0072 2??? M call R24C02
M
0073 3020 00212 movlw BFIIC
0074 00AF 00213 movwf I
0075 30A6 00214 movlw ChargeTermI_LOW
0076 00F7 00215 movwf J
0077 3003 00216 movlw D'3'
0078 00AE 00217 movwf tempCount
0079 2??? 00218 call S0_S1
00219
00220 ; -------------------------------------------------------------
00221 I2C_READ_SUB 0x02, BFIIC, AT_TerminalT
M
M
M
007A 3002 M movlw 0x02
007B 00A8 M movwf BYTES
007C 3020 M movlw BFIIC
007D 00AA M movwf DestPointer
007E 3039 M movlw AT_TerminalT
007F 00AB M movwf SubAddress
0080 2??? M call R24C02
M
0081 3020 00222 movlw BFIIC
0082 00AF 00223 movwf I
0083 30A9 00224 movlw TerminalT_LOW
0084 00F7 00225 movwf J
0085 3002 00226 movlw D'2'
0086 00AE 00227 movwf tempCount
0087 2??? 00228 call S0_S1
00229
00230 ; -------------------------------------------------------------
00231 I2C_READ_SUB 0x03, BFIIC, AT_DisCHTermV
M
M
M
0088 3003 M movlw 0x03
0089 00A8 M movwf BYTES
008A 3020 M movlw BFIIC
008B 00AA M movwf DestPointer
008C 3040 M movlw AT_DisCHTermV
008D 00AB M movwf SubAddress
008E 2??? M call R24C02
M
008F 3020 00232 movlw BFIIC
0090 00AF 00233 movwf I
0091 30AB 00234 movlw DisCHTermV_LOW
0092 00F7 00235 movwf J
0093 3003 00236 movlw D'3'
0094 00AE 00237 movwf tempCount
0095 2??? 00238 call S0_S1
00239
00240 I2C_READ_SUB 0x01, BFIIC, AT_HandleTime
M
M
M
0096 3001 M movlw 0x01
0097 00A8 M movwf BYTES
0098 3020 M movlw BFIIC
0099 00AA M movwf DestPointer
009A 3048 M movlw AT_HandleTime
009B 00AB M movwf SubAddress
009C 2??? M call R24C02
M
009D 0820 00241 movf BFIIC,W
009E 1683 00242 bsf STATUS,RP0
009F 00AE 00243 movwf StandBy
00A0 1283 00244 bcf STATUS,RP0
00245
00A1 00246 IV_OUT:
00A1 2??? 00247 CALL KWH ; recall calibration values from eeprom and write to ADE7756 reg
isters
00248
00A2 0008 00249 return
00250
00251 ;*******************************************************************************************************
***
00252 ;
00253 ; Main program
00254 ;
00255 ;*******************************************************************************************************
***
00256
00A3 00257 MainLoop:
00258 ;;;
00A3 158A 00259 bsf PCLATH,3 ; Prog page 1
00A4 2??? 00260 call FXM3216S
00A5 118A 00261 bcf PCLATH,3 ; Prog page 0
00262 ;;;
00A6 0064 00263 clrwdt
00264 ;保证总中断开放
00265 ifdef PIC16F73
00266 bsf INTCON,GIE ; 保证总中断开放
00267 endif
00268 ;再次定义重要端口
00A7 1683 00269 bsf STATUS,RP0 ; bank 1
00A8 1605 00270 bsf BUTTON_TRIS ; MOT re_set to output
00A9 1283 00271 bcf STATUS,RP0 ; bank 0
00AA 1605 00272 bsf BUTTON
00273
00AB 1CB0 00274 btfss CMD_DisCharge
00AC 2??? 00275 goto ML2
00AD 158A 00276 bsf PCLATH,3 ; Prog page 1
00AE 2??? 00277 call P_DisChar
00AF 118A 00278 bcf PCLATH,3 ; Prog page 0
00B0 00279 ML2:
00B0 1C30 00280 btfss CMD_Charge
00B1 2??? 00281 goto ML0
00B2 158A 00282 bsf PCLATH,3 ; Prog page 1
00B3 2??? 00283 call P_Charge
00B4 118A 00284 bcf PCLATH,3 ; Prog page 0
00B5 00285 ML0:
00B5 1C71 00286 btfss TimerArrived
00B6 2??? 00287 goto ML4
00B7 158A 00288 bsf PCLATH,3 ; Prog page 1
00B8 2??? 00289 call P_TIMER
00B9 118A 00290 bcf PCLATH,3 ; Prog page 0
00291
00BA 00292 ML4:
00BA 18F1 00293 btfsc SEC1
00BB 2??? 00294 call P_SEC
00295
00BC 1971 00296 btfsc MIN1
00BD 2??? 00297 call P_MIN
00298
00299 ; 主程序中不能读SPI,CMD子程序中在没电池的情况下可以读SPI,回送巡采命令的数据时,
00300 ; 是从内存中取;万一要读,可先关闭定时器中断。
00BE 1A32 00301 btfsc aFRAME
00BF 2??? 00302 call CMD ; 帧处理
00303
00C0 2??? 00304 call DETECT
00305
00C1 1C98 00306 BTFSS RCSTA,OERR
00C2 2??? 00307 goto MainLoop
00C3 1218 00308 BCF RCSTA,CREN
00C4 1098 00309 BCF RCSTA,OERR
00C5 1618 00310 BSF RCSTA,CREN
00C6 2??? 00311 goto MainLoop
00312 ;----------------------------------------------------------------------------------------------
00C7 00313 DETECT:
00C7 1F32 00314 btfss BattOn
00C8 2??? 00315 goto DE2
00C9 0831 00316 movf WorkFlag,W
00CA 1D03 00317 btfss _Z
00CB 0008 00318 return
00CC 158A 00319 bsf PCLATH,3 ; Prog page 1
00CD 2??? 00320 call ClosePWM ; 没有流程,暂关PWM
00CE 118A 00321 bcf PCLATH,3 ; Prog page 0
00CF 0008 00322 return
00D0 00323 DE2:
00D0 19F1 00324 btfsc DetectBatt
00D1 0008 00325 return
00D2 15F1 00326 bsf DetectBatt
00D3 1410 00327 bsf T1CON,TMR1ON
00D4 1105 00328 bcf CH
00329
00D5 3000 00330 movlw CCPR1L_INIT ; 8 bits of DC
00D6 0095 00331 movwf CCPR1L ; Duty Cycle is 50% of PWM Period
00D7 300C 00332 movlw CCP1CON_INIT ; PWM mode, 2 LSbs of Duty cycle = 00
00D8 0097 00333 movwf CCP1CON ; Duty Cycle is 00% of PWM Period
00D9 108C 00334 BCF PIR1, TMR2IF ; Clear the TRM2 = PR2 flag
00DA 3000 00335 movlw T2CON_INIT
00DB 0092 00336 movwf T2CO
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -