| Electronic Components Datasheet Search |
|
AN540 Datasheet(PDF) 11 Page - Microchip Technology |
|
|
|||||||||||||||||||||||||||||
AN540 Datasheet(HTML) 11 Page - Microchip Technology |
|
11 / 17 page ![]() © 1993 Microchip Technology Inc. DS00540B-page 11 Implementing IIR Digital Filters 4 else MOVFP16 B10,BARG MOVFP16 Dn1,AARG call DblMult ; B0*D(n) MOVPF32 DPX,ACC MOVFP16 Bx2,BARG MOVFP16 Dn1_2,AARG call DblMult ; B2*D(n-2) ADD32 DPX,ACC endif ; ; Shift down D(n-1) to D(n-2) after D(n-2) usage is no longer required. ; This way in the next iteration D(n-2) is equal to the present D(n-1) ; 0058 7C22 movfp Dn1_1,AARG+B0 0059 5C24 movpf AARG+B0,Dn1_2 ; Shift down D(n-1) 005A 7D23 movfp Dn1_1+B1,AARG+B1 005B 5D25 movpf AARG+B1,Dn1_2+B1 ; AARG = D(n-1) = multiplier 005C 7E32 MOVFP B11+B0,BARG+B0 ; move B11(B0) to BARG(B0) 005D 7F33 MOVFP B11+B1,BARG+B1 ; move B11(B1) to BARG(B1) 005E E0AF call DblMult ; (ACCd,ACCc) = B1*D(n-1) ; ; Compute Output Y = B1*D(n-1) + B2*D(n-2) + B0*D(n) ; = B1*D(n-1) + B0*[D(n) + D(n-2)] ; Since all multiplications are already done, simply perform a ; 32 bit addition ; 005F 6018 MOVFP DPX+B0,WREG ; get lowest byte of DPX into w 0060 0F44 ADDWF ACC+B0 ; add lowest byte of ACC, save in ACC(B0) 0061 6019 MOVFP DPX+B1,WREG ; get 2nd byte of DPX into w 0062 1145 ADDWFC ACC+B1 ; add 2nd byte of ACC, save in ACC(B1) 0063 601A MOVFP DPX+B2,WREG ; get 3rd byte of DPX into w 0064 1146 ADDWFC ACC+B2 ; add 3rd byte of ACC, save in ACC(B2) 0065 601B MOVFP DPX+B3,WREG ; get 4th byte of DPX into w 0066 1147 ADDWFC ACC+B3 ; add 4th byte of ACC, save in ACC(B3) ; ; Shift down D(n) to D(n-1) so that in the next iteration, the new ; D(n-1) is the present D(n) ; 0067 6020 MOVFP Dn1+B0,WREG ; get byte of Dn1 into w 0068 0122 MOVWF Dn1_1+B0 ; move to Dn1_1(B0) 0069 6021 MOVFP Dn1+B1,WREG ; get byte of Dn1 into w 006A 0123 MOVWF Dn1_1+B1 ; move to Dn1_1(B1) ; ; ; 2nd Biquad filter section ; BIQUAD A21,A22,B20,B21,Dn2,Dn2_1,Dn2_2,2 ; ; Compute A22*D(n-2) ; 006B 7C2A MOVFP Dn2_2+B0,AARG+B0 ; move Dn2_2(B0) to AARG(B0) 006C 7D2B MOVFP Dn2_2+B1,AARG+B1 ; move Dn2_2(B1) to AARG(B1) 006D 7E38 MOVFP A22+B0,BARG+B0 ; move A22(B0) to BARG(B0) 006E 7F39 MOVFP A22+B1,BARG+B1 ; move A22(B1) to BARG(B1) 006F E0AF call DblMult ; (ACCd,ACCc) = A2*D(n-2) ; ; Add product to output of 1st section ; Save result in 32 bit Accumulator ; 0070 6018 MOVFP DPX+B0,WREG ; get lowest byte of DPX into w 0071 0F44 ADDWF ACC+B0 ; add lowest byte of ACC, save in ACC(B0) 0072 6019 MOVFP DPX+B1,WREG ; get 2nd byte of DPX into w 0073 1145 ADDWFC ACC+B1 ; add 2nd byte of ACC, save in ACC(B1) 0074 601A MOVFP DPX+B2,WREG ; get 3rd byte of DPX into w 0075 1146 ADDWFC ACC+B2 ; add 3rd byte of ACC, save in ACC(B2) 0076 601B MOVFP DPX+B3,WREG ; get 4th byte of DPX into w 4-139 |
|
|
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 |