Electronic Components Datasheet Search
  New Zealand  ▼
ALLDATASHEET.CO.NZ

X  

AN540 Datasheet(PDF) 13 Page - Microchip Technology

Part # AN540
Description  Implementing IIR Digital Filters
PDF  17 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  MICROCHIP [Microchip Technology]
Direct Link  http://www.microchip.com
Logo MICROCHIP - Microchip Technology

AN540 Datasheet(HTML) 13 Page - Microchip Technology

Back Button AN540 Datasheet HTML 9Page - Microchip Technology AN540 Datasheet HTML 10Page - Microchip Technology AN540 Datasheet HTML 11Page - Microchip Technology AN540 Datasheet HTML 12Page - Microchip Technology AN540 Datasheet HTML 13Page - Microchip Technology AN540 Datasheet HTML 14Page - Microchip Technology AN540 Datasheet HTML 15Page - Microchip Technology AN540 Datasheet HTML 16Page - Microchip Technology AN540 Datasheet HTML 17Page - Microchip Technology  
Zoom Inzoom in Zoom Outzoom out
 13 / 17 page
background image
© 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



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17


Datasheet Download

Go To PDF Page


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


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
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