AnsweredAssumed Answered

How to preserve circular buffers Bx, Ix, registers

Question asked by rockart on Jul 8, 2012
Latest reply on Jul 20, 2012 by rockart

Hello,

I am creating two Circ Buffers delay buffers with assigning to B2 and B3 registers (on ADSP-21479-EZ-KIT). The bufers sizes are defined below with D1 and D2 defines.

================

.section  /dm seg_sdram;
.var  w1[D1+1];                /* delay-1 buffer */
.var  w2[D2+1];               /* delay-2 buffer */

.endseg;

================

Stepping in the debug window, i see they I2 and I2, B2, B3 are zeroed out and not retained where in the delay function these are supposed to be used to go to the Dth-tap on the delay line.

I even add the mode1 CBUFEN.

Why is this basic function not working for me, i.e. once set B2 (and I2 gets set with it), I should be able to use I2 in any asm file and get to use the delay buffer as circbuf. ?

=====================

.section/pm seg_pmco

.global _Init_Delay_Buffers;
_Init_Delay_Buffers:
bit set mode1 CBUFEN;

B2 = w1; L2 = @w1;              /* delay-line buffer pointer and length */
B3 = w2; L3 = @w2;              /* delay-line buffer pointer and length *

m2 = 1; m3 = 1;

LCNTR = L2;       /* clear delay line buffer to zero */
    DO clrDline_1 UNTIL LCE;
clrDline_1:    dm(i2, m2) = 0;

LCNTR = L3;       /* clear delay line buffer to zero */
    DO clrDline_2 UNTIL LCE;
clrDline_2:    dm(i3, m3) = 0;

// dm(i2var) = I2;
// dm(i3var) = I3;
    leaf_exit;

_Init_Delay_Buffers.end:

==============

Calling the Init_Delay_Buffers() from main.c

void main()
{
// Only do this while debugging, loader kernel will do this in real application...

  initPLL_SDRAM();  //Initialize the PLL and SDRAM controller

    InitDAI();

    // This function will configure the AD1939 codec on the 21479 EZ-KIT
    Init1939viaSPI();  
     SinTableInit();

    // Turn on SPORT0 TX and SPORT1 RX for Multichannel Operation
enable_SPORT012_I2S_mode();
// Set up small delay buffer

    Init_Delay_Buffers();

// Unmask SPORT1 RX ISR Interrupt
interrupts(SIG_SP1, process_AD1939_samples);

 

for (;;)
   {
     asm("idle;");  
      }
}

Outcomes