| Os motores de busca de Datasheet de Componentes eletrônicos |
|
AN540 Folha de dados(PDF) 13 Page - Microchip Technology |
|
|
|||||||||||||||||||||||||||||
AN540 Folha de dados(HTML) 13 Page - Microchip Technology |
|
13 / 17 page ![]() © 1993 Microchip Technology Inc. DS00540B-page 13 Implementing IIR Digital Filters 4 MOVFP16 B20,BARG MOVFP16 Dn2,AARG call DblMult ; B0*D(n) MOVPF32 DPX,ACC MOVFP16 Bx2,BARG MOVFP16 Dn2_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) ; 0097 7C28 movfp Dn2_1,AARG+B0 0098 5C2A movpf AARG+B0,Dn2_2 ; Shift down D(n-1) 0099 7D29 movfp Dn2_1+B1,AARG+B1 009A 5D2B movpf AARG+B1,Dn2_2+B1 ; AARG = D(n-1) = multiplier 009B 7E3C MOVFP B21+B0,BARG+B0 ; move B21(B0) to BARG(B0) 009C 7F3D MOVFP B21+B1,BARG+B1 ; move B21(B1) to BARG(B1) 009D 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 ; 009E 6018 MOVFP DPX+B0,WREG ; get lowest byte of DPX into w 009F 0F44 ADDWF ACC+B0 ; add lowest byte of ACC, save in ACC(B0) 00A0 6019 MOVFP DPX+B1,WREG ; get 2nd byte of DPX into w 00A1 1145 ADDWFC ACC+B1 ; add 2nd byte of ACC, save in ACC(B1) 00A2 601A MOVFP DPX+B2,WREG ; get 3rd byte of DPX into w 00A3 1146 ADDWFC ACC+B2 ; add 3rd byte of ACC, save in ACC(B2) 00A4 601B MOVFP DPX+B3,WREG ; get 4th byte of DPX into w 00A5 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) ; 00A6 6026 MOVFP Dn2+B0,WREG ; get byte of Dn2 into w 00A7 0128 MOVWF Dn2_1+B0 ; move to Dn2_1(B0) 00A8 6027 MOVFP Dn2+B1,WREG ; get byte of Dn2 into w 00A9 0129 MOVWF Dn2_1+B1 ; move to Dn2_1(B1) ; ; ; The filter output is now computed ; Save the Upper 16 Bits of 32 bit Accumulator into Y after ; adjusting the decimal point ; MOV16 ACC+B2,Y 00AA 6046 MOVFP ACC+B2+B0,WREG ; get byte of ACC+B2 into w 00AB 0142 MOVWF Y+B0 ; move to Y(B0) 00AC 6047 MOVFP ACC+B2+B1,WREG ; get byte of ACC+B2 into w 00AD 0143 MOVWF Y+B1 ; move to Y(B1) ; 00AE 0002 return ; Output Y(n) computed ; ;******************************************************************* ; Set SIGNED/UNSIGNED Flag Before Including 17c42MPY.mac ; include “17c42MPY.mac” ;******************************************************************* ; Low Pass Filter Co-efficients ; ; 4-141 |
|
|
Ligação URL |
| ALLDATASHEET é útil para você? [ DONATE ] |
Sobre Alldatasheet | Publicidade | Contato conosco | Privacy Policy | Link para a ficha técnica | roca de Link | Lista de Fabricantes 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 |