⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 f6.lst

📁 用PIC单片机18F6520+ADE7755实现的一个大安培、锂离子电池的化程器。全部源码
💻 LST
📖 第 1 页 / 共 5 页
字号:
                      00154 
                      00155 ;>>>>   PORTB   <<<<
                      00156 ; //--------7756 control setup I/O--------------------------
                      00157 
                      00158 #define irqb            PORTB,0         ;IRQ Bit的意思, 波形寄存器满
                      00159 #define csb             PORTB,1         ;CS Bit的意思
                      00160 #define RedLed          PORTB,2         ;高亮   
                      00161 #define GreenLed        PORTB,3
                      00162 #define RST7756         PORTB,4
                      00163 ;//#define      CF              PORTB,5
                      00164 
                      00165 #define RST7756_TRIS    TRISB,4
                      00166 
  00000021            00167 PORTB_TRIS      equ     B'00100001'
  00000031            00168 PORTB_LATCH     equ     B'00110001'
                      00169 ;>>>>   PORTB   <<<<
                      00170 
                      00171 ;>>>>   PORTC   <<<<
                      00172 #define SDA             PORTC,0
                      00173 #define SCL             PORTC,1
                      00174 #define PWM             PORTC,2         ; CCP1用作PWM output
                      00175 #define SCK             PORTC,3
                      00176 #define SDI             PORTC,4
                      00177 #define SDO             PORTC,5
                      00178 #define TX              PORTC,6
                      00179 #define RX              PORTC,7
                      00180 
                      00181 #define SDA_TRIS        TRISC,0
                      00182 #define SCL_TRIS        TRISC,1
                      00183 #define PWM_TRIS        TRISC,2
                      00184 
  00000090            00185 PORTC_TRIS      equ     B'10010000'
  000000DB            00186 PORTC_LATCH     equ     B'11011011'
                      00187 ;////   PORTC   <<<<
                      00188 
                      00189 #define TRUE            1
                      00190 #define FALSE           0
                      00191 
                      00192 ; //--------------------------------------------------------------------------------------------
                      00193 ;                       Register File Variables
                      00194 
  00000020            00195 BFIIC   equ     0x20                    ; IIC数据缓冲区 20H--27H
                      00196 ; //--------------------------------------------------------------------------------
                      00197         CBLOCK  0x28                    ; EEPROM
  00000028            00198                 BYTES
  00000029            00199                 SourcePointer
  0000002A            00200                 DestPointer
  0000002B            00201                 SubAddress              ; sub-address of slave (used in I2C_HIGH.ASM)
  0000002C            00202                 EETEMP                  ; load this reg with the data to be transmitted
  0000002D            00203                 ByteNumber              ; 发送字节计数
  0000002E            00204                 tempCount               ; The bit number (0:7) transmitted or received
  0000002F            00205                 I                       ;
                      00206 ; ---------------------------------------------------------------------
  00000030            00207                 LoadOn                  ; 流程加载寄存器
  00000031            00208                 WorkFlag                ; 工作标志
  00000032            00209                 fCOMM                   ; 通信标志字节
  00000033            00210                 ByteReceived            ; 串行通信已收字节数
  00000034            00211                 RevTemp                 ; 发送时,因为关闭了接收中断,也可以调用
  00000035            00212                 OVERTIME
  00000036            00213                 SecsPassed              ; 流程已进行时间(满StartDelay秒之后再判截止电流)
  00000037            00214                 C_SEC                   ; 记满 SEC1divTimer是1秒
                      00215 ; ---------------------------------------------------------------------
  00000038            00216                 C_MIN                   ; 记满60是1分
  00000039            00217                 Minutes                 ; 分的累加器,静置用
  0000003A            00218                 PWRUP55                 ; registers to test at power up to
  0000003B            00219                 PWRUPAA                 ; see if warm start or cold start
  0000003C            00220                 spi                     ; spi reg data =0c hex 
  0000003D            00221                 wordlen                 ; word length for rotate 
  0000003E            00222                 VI_CSamp
  0000003F            00223                 I_sample_low            ; lsb
                      00224 ; ---------------------------------------------------------------------
  00000040            00225                 I_sample_middle         ; 
  00000041            00226                 I_sample_high           ; msb
  00000042            00227                 V_sample_low            ; lsb
  00000043            00228                 V_sample_middle         ; 
  00000044            00229                 V_sample_high           ; msb
  00000045            00230                 PWM_LOW                 ; New PWM1 duty cycle value
  00000046            00231                 PWM_HI                  ; New PWM1 duty cycle value
  00000047            00232                 DC_LOW
  00000048            00233                 KeepValue_MID
  00000049            00234                 DC_HI
  0000004A            00235                 ResistNet               ; 记录R46~R49的值
  0000004B            00236                 outd1                   ; out to 7756 1st byte (msb 1st) of word
  0000004C            00237                 outd2                   ; out to 7756 2st byte (msb 1st) of word        
  0000004D            00238                 insd1                   ; in from 7756 1st byte (msb 1st) of word
  0000004E            00239                 insd2                   ; in from 7756 2st byte (msb 1st) of word
  0000004F            00240                 insd3                   ; in from 7756 3st byte (msb 1st) of word
                      00241         ENDC
                      00242 ; ---------------------------------------------------------------------
                      00243         CBLOCK  0x50                    ;通讯缓冲区50H-6FH:32 bytes
  00000050            00244                 SERIALBUFFER            ;通讯缓冲区首地址
  00000051            00245                 A0                      ;从站地址low
  00000052            00246                 A1                      ;从站地址middle
  00000053            00247                 A2                      ;从站地址high
  00000054            00248                 CCODE                   ;控制码
  00000055            00249                 SBL                     ;数据长度
  00000056            00250                 DI0                     ;数据标识高位
  00000057            00251                 DI1                     ;数据标识高位
  00000058            00252                 SDATA                   ;有效数据区
                      00253         ENDC
                      00254 ; ---------------------------------------------------------------------
                      00255 
                      00256         CBLOCK  0x71                    ; EEPROM
  00000071            00257                 fFLAG                   ; 通用标志
  00000072            00258                 fFLAG2
  00000073            00259                 TEMP
  00000074            00260                 C_IVariety              ; 电流采样大于100mA的次数
  00000075            00261                 C_LowerTerm             ; 小于截止电流的次数
  00000076            00262                 T1use                   ; used in timer1 interrupt
  00000077            00263                 J
  00000078            00264                 M
  00000079            00265                 C_T
  0000007A            00266                 C_TermT_LOW             ; 充放电计时
  0000007B            00267                 C_TermT_HI
                      00268 ;不能超过7FH
                      00269         ENDC
                      00270 
                      00271 #define _Z      STATUS,Z
                      00272 #define _C      STATUS,C
                      00273 #define _BANK1  STATUS,RP0
                      00274 ;----- LoadOn Bits --------------------------------------------------------
                      00275 #define CMD_Charge      LoadOn,0
                      00276 #define CMD_DisCharge   LoadOn,1
                      00277 #define CMD_Standby     LoadOn,2
                      00278 ;#define        CMD_Start       LoadOn,3
                      00279 #define CMD_Stop        LoadOn,4
                      00280 
                      00281 ;----- WorkFlag Bits --------------------------------------------------------
                      00282 #define Charging        WorkFlag,0      ;正在充电
                      00283 #define disCharging     WorkFlag,1      ;正在放电
                      00284 #define Standing        WorkFlag,2
                      00285 
                      00286 ;----- fCOMM Bits --------------------------------------------------------
                      00287 
                      00288 #define Rise_Down       fCOMM,0         ;0/1:做上升波形/做下降波形
                      00289 #define RECEIVING       fCOMM,1
                      00290 #define Txmt_Success    fCOMM,2
                      00291 #define CommSuccess     fCOMM,3
                      00292 #define aFRAME          fCOMM,4         ;收到一帧
                      00293 #define RX9D_copy       fCOMM,5
                      00294 #define BattOn          fCOMM,6
                      00295 
                      00296 ;----- fFLAG Bits --------------------------------------------------------
                      00297 #define TimerArrived    fFLAG,0
                      00298 #define SEC1            fFLAG,1
                      00299 #define MIN1            fFLAG,2
                      00300 #define DetectBatt      fFLAG,3
                      00301 #define Pass_1s         fFLAG,4
                      00302 #define isCR_1OS        fFLAG,5         ;是对通道1的失调进行步进校准
                      00303 #define CorrCH2         fFLAG,6
                      00304 #define TopPoint        fFLAG,7
                      00305 ;----- fFLAG2 Bits --------------------------------------------------------
                      00306 
                      00307 #define ReadedCH1       fFLAG2,1
                      00308 #define ReadedCH2       fFLAG2,2
                      00309 #define Mode_0CH1_1CH2  fFLAG2,3
                      00310 
                      00311 #define OverCapacity    fFLAG2,6
                      00312 #define OverTermTime    fFLAG2,7
                      00313 
  00000020            00314 AARGB3          set     (BFIIC+0)
  00000021            00315 AARGB2          set     (BFIIC+1)
  00000020            00316 AARGB3          set     (BFIIC+0)
  00000021            00317 AARGB2          set     (BFIIC+1)
  00000022            00318 AARGB1          set     (BFIIC+2)
  00000023            00319 AARGB0          set     (BFIIC+3)               ;AARG MSB
  00000024            00320 BARGB1          set     (BFIIC+4)
  00000025            00321 BARGB0          set     (BFIIC+5)               ;BARG MSB
  00000026            00322 REMB1           set     (BFIIC+6)
  00000027            00323 REMB0           set     (BFIIC+7)               ;remainder MSB
  00000077            00324 LOOPCOUNT       set     J
                      00325 
                      00326 
                      00327         CBLOCK  0x7F
  0000007F            00328                 W_TEMP                  ; W 的临时备份寄存器
                      00329         ENDC
                      00330 
                      00331 ;//BANK1:A0--AFH:unused 
                      00332         CBLOCK  0xA0
                      00333 ;//预设参数区 -----------------------------------------------------
  000000A0            00334                 Current_LOW             ;充放电电流,3 bytes
  000000A1            00335                 Current_MID
  000000A2            00336                 Current_HI
                      00337 
  000000A3            00338                 ConstantV_LOW           ;截止/恒压电压,3 bytes
  000000A4            00339                 ConstantV_MID
  000000A5            00340                 ConstantV_HI
                      00341 
  000000A6            00342                 ChargeTermI_LOW         ;充电截止电流,3 bytes
  000000A7            00343                 ChargeTermI_MID
  000000A8            00344                 ChargeTermI_HI
                      00345 
  000000A9            00346                 TerminalT_LOW           ;充放电截止时长
  000000AA            00347                 TerminalT_HI
                      00348 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -