/* testing shell for biquad IIR filter for real data (input, output vectors stored in memory ... no IRQs) Analog Devices, Inc. DSP Applications P. O. Box 9106 Norwood, MA 02062 Chris Cavigioli 25-Jan-1990, modified 3-May-1990, 27-June-1990 modified 28-July-1990 for cascaded biquads modified 30-July-1990 for generic .ach description modified 7-Nov-1990 to use delayed branching on subroutine calls */ .extern __cascaded_biquad_, __cascaded_biquad_init_; .global coefs, dline; .precision=40; #define SAMPLES 300 #define SECTIONS 3 /* ADSP-21020 Interrupt Vector Table (No interrupts used) should map to: PM[0x00] . . PM[0xFF] jumps execution to "begin" (which is typically at PM[0x100]) */ .segment/pm IRQtable; Reserved_1: rti; nop; nop; nop; nop; nop; nop; nop; /* 0 non-maskable */ Chip_Reset: jump begin (db); nop; nop; nop; nop; nop; nop; nop; /* 1 non-maskable */ Reserved_2: rti; nop; nop; nop; nop; nop; nop; nop; /* 2 */ Stack_Error: rti; nop; nop; nop; nop; nop; nop; nop; /* 3 */ Timer_Hi_Prior: rti; nop; nop; nop; nop; nop; nop; nop; /* 4 */ IRQ3_Asserted: rti; nop; nop; nop; nop; nop; nop; nop; /* 5 */ IRQ2_Asserted: rti; nop; nop; nop; nop; nop; nop; nop; /* 6 */ IRQ1_Asserted: rti; nop; nop; nop; nop; nop; nop; nop; /* 7 */ IRQ0_Asserted: rti; nop; nop; nop; nop; nop; nop; nop; /* 8 */ Reserved_3: rti; nop; nop; nop; nop; nop; nop; nop; /* 9 */ Reserved_4: rti; nop; nop; nop; nop; nop; nop; nop; /* 10 */ Circ_Overfl_7: rti; nop; nop; nop; nop; nop; nop; nop; /* 11 */ Circ_Overfl_15: rti; nop; nop; nop; nop; nop; nop; nop; /* 12 */ Reserved_5: rti; nop; nop; nop; nop; nop; nop; nop; /* 13 */ Timer_Lo_Prior: rti; nop; nop; nop; nop; nop; nop; nop; /* 14 */ Fix_Pt_Overfl: rti; nop; nop; nop; nop; nop; nop; nop; /* 15 */ Flt_Pt_Overfl: rti; nop; nop; nop; nop; nop; nop; nop; /* 16 */ Flt_Pt_Underfl: rti; nop; nop; nop; nop; nop; nop; nop; /* 17 */ Flt_Pt_InvOp: rti; nop; nop; nop; nop; nop; nop; nop; /* 18 */ Reserved_6: rti; nop; nop; nop; nop; nop; nop; nop; /* 19 */ Reserved_7: rti; nop; nop; nop; nop; nop; nop; nop; /* 20 */ Reserved_8: rti; nop; nop; nop; nop; nop; nop; nop; /* 21 */ Reserved_9: rti; nop; nop; nop; nop; nop; nop; nop; /* 22 */ Reserved_10: rti; nop; nop; nop; nop; nop; nop; nop; /* 23 */ User_Softw_1: rti; nop; nop; nop; nop; nop; nop; nop; /* 24 */ User_Softw_2: rti; nop; nop; nop; nop; nop; nop; nop; /* 25 */ User_Softw_3: rti; nop; nop; nop; nop; nop; nop; nop; /* 26 */ User_Softw_4: rti; nop; nop; nop; nop; nop; nop; nop; /* 27 */ User_Softw_5: rti; nop; nop; nop; nop; nop; nop; nop; /* 28 */ User_Softw_6: rti; nop; nop; nop; nop; nop; nop; nop; /* 29 */ User_Softw_7: rti; nop; nop; nop; nop; nop; nop; nop; /* 30 */ User_Softw_8: rti; nop; nop; nop; nop; nop; nop; nop; /* 31 */ .endseg; .segment/dm dm_data; .var inbuf[SAMPLES] = 1.0, 0.0; /* input = unit impulse */ .var outbuf[SAMPLES]; /* should end up holding impulse response */ .var dline[SECTIONS*2]; /* w``, w`, NEXT w``, NEXT w`, ... */ .endseg; .segment/pm pm_data; .var coefs[SECTIONS*4]="iircoefs.dat"; /* a2, a1, b2, b1, NEXT a2, NEXT a1, ... */ .endseg; .segment/pm pm_code; begin: pmwait=0x0021; /* zero wait states for all of PM */ dmwait=0x8421; /* zero wait states for all of DM */ b3=inbuf; l3=0; b4=outbuf; l4=0; l0=0; l1=0; l8=0; m1=1; m8=1; call __cascaded_biquad_init_ (db); /* zero the delay line */ r0=SECTIONS; b0=dline; lcntr=SAMPLES, do filtering until lce; f8=dm(i3,1); call __cascaded_biquad_ (db); /* input=F8, output=F8 */ b0=dline; b8=coefs; filtering: dm(i4,1)=f8; done: idle; .endseg;