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

📄 lf_pwm.lst

📁 汽车无钥进入系统设计,基于PIC单片机16F639,包括电路图和源码
💻 LST
📖 第 1 页 / 共 5 页
字号:
                      00048 
                      00049 ;/*
                      00050 ;
                      00051 ;       This macro sends a clamp on command to the AFE by using the SPI-Bus.
                      00052 ;       The clamp on command switches the transistor at the LF-Input to low resistance.
                      00053 ;       So use this macro for LF-Talkback.
                      00054 ;
                      00055 ;
                      00056 ;       @example
                      00057 ;       AFE.SendCMDClampOn
                      00058 ;       @end-ex
                      00059 ;       @ex-desc This sends the command
                      00060 ;
                      00061 ;       @status Tested
                      00062 ;
                      00063 ;       @stacklevel /*/SPI.Write
                      00064 ;       @registers /*/SPI.Write
                      00065 ;       @calls SPI.Write /*/SPI.Write
                      00066 ;
                      00067 ;
                      00068 ;*/
                      00069 AFE.SendCMDClampON macro
                      00070         banksel SPI.BufferH
MPASM  5.14                        LF_PWM.ASM   9-26-2008  8:07:54         PAGE 10


LOC  OBJECT CODE     LINE SOURCE TEXT
  VALUE

                      00071         movlw   AFE.CMDClampOn
                      00072         movwf   SPI.BufferH
                      00073         call    SPI.Write
                      00074         endm
                      00075 
                      00076 ;/*
                      00077 ;
                      00078 ;       This macro sends a clamp off command to the AFE by using the SPI-Bus.
                      00079 ;       The clamp on command switches the transistor at the LF-Input to high resistance.
                      00080 ;       So use this macro for LF-Talkback.
                      00081 ;
                      00082 ;
                      00083 ;       @example
                      00084 ;       AFE.SendCMDClampOff
                      00085 ;       @end-ex
                      00086 ;       @ex-desc This sends the command
                      00087 ;
                      00088 ;       @status Tested
                      00089 ;
                      00090 ;       @stacklevel /*/SPI.Write
                      00091 ;       @registers /*/SPI.Write
                      00092 ;       @calls SPI.Write /*/SPI.Write
                      00093 ;
                      00094 ;
                      00095 ;*/
                      00096 AFE.SendCMDClampOFF macro
                      00097         banksel SPI.BufferH
                      00098         movlw   AFE.CMDClampOff
                      00099         movwf   SPI.BufferH
                      00100         call    SPI.Write
                      00101         endm
                      00102 
                      00103 ;/*
                      00104 ;
                      00105 ;       This macro sends a Sleep command to the AFE by using the SPI-Bus.
                      00106 ;       The AFE will enter the sleep mode.
                      00107 ;       It will wake up by the next transmission over the SPI-Bus.
                      00108 ;
                      00109 ;
                      00110 ;       @example
                      00111 ;       AFE.SendCMDSleep
                      00112 ;       @end-ex
                      00113 ;       @ex-desc This sends the command
                      00114 ;
                      00115 ;       @status Written
                      00116 ;
                      00117 ;       @stacklevel /*/SPI.Write
                      00118 ;       @registers /*/SPI.Write
                      00119 ;       @calls SPI.Write /*/SPI.Write
                      00120 ;
                      00121 ;
                      00122 ;*/
                      00123 AFE.SendCMDSleep macro
MPASM  5.14                        LF_PWM.ASM   9-26-2008  8:07:54         PAGE 11


LOC  OBJECT CODE     LINE SOURCE TEXT
  VALUE

                      00124         banksel SPI.BufferH
                      00125         movlw   AFE.CMDSleep
                      00126         movwf   SPI.BufferH
                      00127         call    SPI.Write
                      00128         endm
                      00129 
                      00130 ;/*
                      00131 ;
                      00132 ;       This macro sends a AGC Preserve On command to the AFE by using the SPI-Bus.
                      00133 ;
                      00134 ;
                      00135 ;       @example
                      00136 ;       AFE.SendCMDAGCPresON
                      00137 ;       @end-ex
                      00138 ;       @ex-desc This sends the command
                      00139 ;
                      00140 ;       @status Written
                      00141 ;
                      00142 ;       @stacklevel /*/SPI.Write
                      00143 ;       @registers /*/SPI.Write
                      00144 ;       @calls SPI.Write /*/SPI.Write
                      00145 ;
                      00146 ;
                      00147 ;*/
                      00148 AFE.SendCMDAGCPresON macro
                      00149         banksel SPI.BufferH
                      00150         movlw   AFE.CMDAGCOn
                      00151         movwf   SPI.BufferH
                      00152         call    SPI.Write
                      00153         endm
                      00154 
                      00155 ;/*
                      00156 ;
                      00157 ;       This macro sends a AGC Preserve Off command to the AFE by using the SPI-Bus.
                      00158 ;
                      00159 ;
                      00160 ;       @example
                      00161 ;       AFE.SendCMDAGCPresOFF
                      00162 ;       @end-ex
                      00163 ;       @ex-desc This sends the command
                      00164 ;
                      00165 ;       @status Tested
                      00166 ;
                      00167 ;       @stacklevel /*/SPI.Write
                      00168 ;       @registers /*/SPI.Write
                      00169 ;       @calls SPI.Write /*/SPI.Write
                      00170 ;
                      00171 ;
                      00172 ;*/
                      00173 AFE.SendCMDAGCPresOFF macro
                      00174         banksel SPI.BufferH
                      00175         movlw   AFE.CMDAGCOff
                      00176         movwf   SPI.BufferH
MPASM  5.14                        LF_PWM.ASM   9-26-2008  8:07:54         PAGE 12


LOC  OBJECT CODE     LINE SOURCE TEXT
  VALUE

                      00177         call    SPI.Write
                      00178         endm
                      00179 
                      00180 ;/*
                      00181 ;
                      00182 ;       This macro sends a SoftReset on command to the AFE by using the SPI-Bus.
                      00183 ;
                      00184 ;       @example
                      00185 ;       AFE.SendCMDSoftReset
                      00186 ;       @end-ex
                      00187 ;       @ex-desc This sends the command
                      00188 ;
                      00189 ;       @status Tested
                      00190 ;
                      00191 ;       @stacklevel /*/SPI.Write
                      00192 ;       @registers /*/SPI.Write
                      00193 ;       @calls SPI.Write /*/SPI.Write
                      00194 ;
                      00195 ;
                      00196 ;*/
                      00197 AFE.SendCMDSoftReset macro
                      00198         banksel SPI.BufferH
                      00199         movlw   AFE.CMDSR
                      00200         movwf   SPI.BufferH
                      00201         call    SPI.Write
                      00202         endm
                      00203 
                      00204 
                      00205 ;/*
                      00206 ;
                      00207 ;       This macro enables the LF Channel X at the AFE.
                      00208 ;
                      00209 ;       @example
                      00210 ;       AFE.EnableChannelX
                      00211 ;       @end-ex
                      00212 ;       @ex-desc This enables Channel X
                      00213 ;
                      00214 ;       @status Written
                      00215 ;
                      00216 ;       @stacklevel /*/AFE.WriteRegister /*/AFE.updateColumnParity
                      00217 ;       @registers /*/AFE.WriteRegister /*/AFE.updateColumnParity
                      00218 ;       @calls AFE.WriteRegister /*/AFE.WriteRegister AFE.updateColumnParity /*/AFE.updateColumnParity
                      00219 ;
                      00220 ;
                      00221 ;*/
                      00222 AFE.EnableChannelX macro
                      00223         banksel AFE.ConfMap
                      00224         movf    AFE.ConfMap,w
                      00225         andlw   b'11111110'
                      00226         movwf   AFE.ConfMap
                      00227         movlw   0x00
                      00228         call    AFE.WriteRegister
                      00229         AFE.updateColumnParity
MPASM  5.14                        LF_PWM.ASM   9-26-2008  8:07:54         PAGE 13


LOC  OBJECT CODE     LINE SOURCE TEXT
  VALUE

                      00230         endm
                      00231 
                      00232 ;/*
                      00233 ;
                      00234 ;       This macro enables the LF Channel Y at the AFE.
                      00235 ;
                      00236 ;       @example
                      00237 ;       AFE.EnableChannelY
                      00238 ;       @end-ex
                      00239 ;       @ex-desc This enables Channel Y
                      00240 ;
                      00241 ;       @status Written
                      00242 ;
                      00243 ;       @stacklevel /*/AFE.WriteRegister /*/AFE.updateColumnParity
                      00244 ;       @registers /*/AFE.WriteRegister /*/AFE.updateColumnParity
                      00245 ;       @calls AFE.WriteRegister /*/AFE.WriteRegister AFE.updateColumnParity /*/AFE.updateColumnParity
                      00246 ;
                      00247 ;
                      00248 ;*/
                      00249 AFE.EnableChannelY macro
                      00250         banksel AFE.ConfMap
                      00251         movf    AFE.ConfMap,w
                      00252         andlw   b'11111101'
                      00253         movwf   AFE.ConfMap
                      00254         movlw   0x00
                      00255         call    AFE.WriteRegister
                      00256         AFE.updateColumnParity
                      00257         endm
                      00258 
                      00259 
                      00260 ;/*
                      00261 ;
                      00262 ;       This macro enables the LF Channel Z at the AFE.
                      00263 ;
                      00264 ;       @example
                      00265 ;       AFE.EnableChannelZ
                      00266 ;       @end-ex
                      00267 ;       @ex-desc This enables Channel Z
                      00268 ;
                      00269 ;       @status Written
                      00270 ;
                      00271 ;       @stacklevel /*/AFE.WriteRegister /*/AFE.updateColumnParity
                      00272 ;       @registers /*/AFE.WriteRegister /*/AFE.updateColumnParity
                      00273 ;       @calls AFE.WriteRegister /*/AFE.WriteRegister AFE.updateColumnParity /*/AFE.updateColumnParity
                      00274 ;
                      00275 ;
                      00276 ;*/
                      00277 AFE.EnableChannelZ macro

⌨️ 快捷键说明

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