📄 writeee.lst
字号:
00184 sublw LIT1
00185 btfsc STATUS, Z
00186 call WHERE
00187 endm
00188 ; *****************************************************************************
00189
00190 ; *** If FILE1 != LIT1 then Branch ********************************************
00191 cflcin macro FILE1, LIT1, WHERE
00192 movf FILE1, W
00193 sublw LIT1
00194 btfss STATUS, Z
MPASM 5.20 WRITEEE.ASM 11-3-2008 15:53:54 PAGE 5
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
00195 call WHERE
00196 endm
00197 ; *****************************************************************************
00198
00199 ; *****************************************************************************
00200 movff macro HERE, THERE
00201 movf HERE, W
00202 movwf THERE
00203 endm
00204 ; *****************************************************************************
00205
00206 ; *****************************************************************************
00207 movlf macro DAT, THERE
00208 movlw DAT
00209 movwf THERE
00210 endm
00211 ; *****************************************************************************
00212
00213 ; *** Add Literal to File *****************************************************
00214 addlf macro LIT1, FILE1, DIR
00215 movlw LIT1
00216 addwf FILE1, DIR
00217 endm
00218 ; *****************************************************************************
00219
00220 ; *** Subtract Literal from File **********************************************
00221 sublf macro LIT1, FILE1, DIR
00222 movlw LIT1
00223 subwf FILE1, DIR
00224 endm
00225 ; *****************************************************************************
00226
00227 ; *** Branch if Carry *********************************************************
00228 brc macro WHERE
00229 btfsc STATUS, C
00230 goto WHERE
00231 endm
00232 ; *****************************************************************************
00233
00234 ; *** Branch if No Carry ******************************************************
00235 brnc macro WHERE
00236 btfss STATUS, C
00237 goto WHERE
00238 endm
00239 ; *****************************************************************************
00240
00241 ; *** OR file w/ file *********************************************************
00242 iorff macro FILE1, FILE2, DIR
00243 movf FILE2, W
00244 iorwf FILE1, DIR
00245 endm
00246 ; *****************************************************************************
00247
MPASM 5.20 WRITEEE.ASM 11-3-2008 15:53:54 PAGE 6
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
00248
00016 #include user_mac.inc ; Bring in application specific instructions
00001 #define dvron bsf PORTB, 3
00002 #define dvroff bcf PORTB, 3
00003
00004
00005 ; *****************************************************************************
00006 txdali macro MYREGH, MYREGL
00007 movff MYREGH, DALI_H
00008 movff MYREGL, DALI_L
00009 call SendData
00010 endm
00011 ; *****************************************************************************
00012
00013
00014 ; *****************************************************************************
00015 rxdali macro
00016 call RecvData
00017 endm
00018 ; *****************************************************************************
00019
00020
00021 ; *****************************************************************************
00022 tx macro MYREG
00023 movff MYREG, TXREG
00024 endm
00025 ; *****************************************************************************
00026
00027
00028 ; *****************************************************************************
00029 delay macro MYLIT
00030 movlf high MYLIT, TMR1H
00031 movlf low MYLIT, TMR1L
00032 call DelayCyclesT1
00033 endm
00034 ; *****************************************************************************
00035
00036
00037 ; *****************************************************************************
00038 delayf macro MYFILE_H, MYFILE_L
00039 movff MYFILE_H, TMR1H
00040 movff MYFILE_L, TMR1L
00041 call DelayCyclesT1
00042 endm
00043 ; *****************************************************************************
00044
00045
00046 ; *** Set DALI Bus High *******************************************************
00047 outhi macro
00048 bcf PORTB, 4 ; Turn off clamp
00049 goto $ + 1
00050 bsf PORTB, 5 ; Turn on output
00051 ; goto $ + 1
MPASM 5.20 WRITEEE.ASM 11-3-2008 15:53:54 PAGE 7
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
00052 ; goto $ + 1
00053 endm
00054 ; *****************************************************************************
00055
00056
00057 ; *** Set DALI Bus Low ********************************************************
00058 outlo macro
00059 bcf PORTB, 5 ; Turn off output driver
00060 goto $ + 1 ; Wait a little for gate discharge
00061 bsf PORTB, 4 ; Turn on clamp
00062 ; goto $ + 1
00063 endm
00064 ; *****************************************************************************
00065
00066
00067 ; *** Emergency Shutdown ******************************************************
00068 esdwn macro WHERE
00069 bcf PORTB, 3 ; Turn off output driver
00070 goto WHERE
00071 endm
00072 ; *****************************************************************************
00073
00074
00075 ; *****************************************************************************
00076 wrtee macro MYREG
00077 banksel EEADR
00078 movwf EEDATA ; Init the first values
00079 movlw TX_EDGE_DELAY_H
00080 sublw MYREG
00081 movwf EEADR
00082 call WriteEEData
00083 endm
00084 ; *****************************************************************************
00085
00086
00017 ; *****************************************************************************
00018
00019
00020 ; *****************************************************************************
00021 ; EXTERN
00022 ; *****************************************************************************
00023
00024
00025 ; *****************************************************************************
00026 WRITE_EE_DATA CODE
00027 ; *****************************************************************************
0000 00028 WriteEEData
0000 138B 00029 bcf INTCON, GIE
Message[302]: Register in operand not in bank 0. Ensure that bank bits are correct.
0001 151C 00030 bsf EECON1, WREN ; Write data to EE Data Memory
00031 movlf 0x55, EECON2
0002 3055 M movlw 0x55
Message[302]: Register in operand not in bank 0. Ensure that bank bits are correct.
MPASM 5.20 WRITEEE.ASM 11-3-2008 15:53:54 PAGE 8
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
0003 009D M movwf EECON2
00032 movlf 0xAA, EECON2
0004 30AA M movlw 0xAA
Message[302]: Register in operand not in bank 0. Ensure that bank bits are correct.
0005 009D M movwf EECON2
Message[302]: Register in operand not in bank 0. Ensure that bank bits are correct.
0006 149C 00033 bsf EECON1, WR
0007 178B 00034 bsf INTCON, GIE
00035
00036 Lp1 brset EECON1, WR, Lp1
Message[302]: Register in operand not in bank 0. Ensure that bank bits are correct.
0008 189C M btfsc EECON1, WR
0009 2??? M goto Lp1
Message[302]: Register in operand not in bank 0. Ensure that bank bits are correct.
000A 111C 00037 bcf EECON1, WREN ; Disable EE Data Write
00038
000B 1283 1303 00039 banksel PIR1 ; Back to bank 0
000D 0008 00040 return
00041
0000 00042 GLOBAL WriteEEData
00043 ; *****************************************************************************
00044
00045 END
MPASM 5.20 WRITEEE.ASM 11-3-2008 15:53:54 PAGE 9
SYMBOL TABLE
LABEL VALUE
ADEN 00000003
BRGH 00000002
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -