| Electronic Components Datasheet Search |
|
AN540 Datasheet(PDF) 9 Page - Microchip Technology |
|
|
|||||||||||||||||||||||||||||
AN540 Datasheet(HTML) 9 Page - Microchip Technology |
|
9 / 17 page ![]() © 1993 Microchip Technology Inc. DS00540B-page 9 Implementing IIR Digital Filters 4 001C 0101 movwf fsr0 001D B00C movlw 6*FltStage NextClr 001E 2900 clrf indf0 001F 1700 decfsz wreg 0020 C01E goto NextClr ; 0021 0002 return ; ;******************************************************************* ; 1st Cascade Section ;******************************************************************* ; IIR_Filter ; ; Compute D(n) = X(n) + A1*D(n-1) + A2*D(n-2) ; Since the filter constants are computated in Q15 format, ; X(n) must be multiplied by 2**15 and then added to the ; other terms. ; ; Move Input to accumulator after proper scaling ; 0022 8804 bcf _carry 0023 1941 rrcf X+B1 0024 1940 rrcf X 0025 2900 clrf wreg ; Scale the input X 0026 1900 rrcf wreg 0027 0145 movwf ACC+B1 0028 6040 movfp X,wreg 0029 0146 movwf ACC+B2 002A 6041 movfp X+B1,wreg 002B 0147 movwf ACC+B3 ; ACC = scaled input : X*(2**15) ; ; 1st Biquad filter section ; BIQUAD A11,A12,B10,B11,Dn1,Dn1_1,Dn1_2,1 ; ; Compute A12*D(n-2) ; 002C 7C24 MOVFP Dn1_2+B0,AARG+B0 ; move Dn1_2(B0) to AARG(B0) 002D 7D25 MOVFP Dn1_2+B1,AARG+B1 ; move Dn1_2(B1) to AARG(B1) 002E 7E2E MOVFP A12+B0,BARG+B0 ; move A12(B0) to BARG(B0) 002F 7F2F MOVFP A12+B1,BARG+B1 ; move A12(B1) to BARG(B1) 0030 E0AF call DblMult ; (ACCd,ACCc) = A2*D(n-2) ; ; Add product to output of 1st section ; Save result in 32 bit Accumulator ; 0031 6018 MOVFP DPX+B0,WREG ; get lowest byte of DPX into w 0032 0F44 ADDWF ACC+B0 ; add lowest byte of ACC, save in ACC(B0) 0033 6019 MOVFP DPX+B1,WREG ; get 2nd byte of DPX into w 0034 1145 ADDWFC ACC+B1 ; add 2nd byte of ACC, save in ACC(B1) 0035 601A MOVFP DPX+B2,WREG ; get 3rd byte of DPX into w 0036 1146 ADDWFC ACC+B2 ; add 3rd byte of ACC, save in ACC(B2) 4-137 |
|
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |