This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

circular buffering

Hi

I am trying to implement a FIR on the C6748 processor using circular buffering.

I don't want to use TI's DSP-lib at the moment.

I am using HW interrupts, the FIR assembly code is activated for every sample.

The poblem is, I don't see the behaviour of the circular buffer. The pointer doesn't seem to 'circular back'

Here is part of my code:

I am using a 16 byte buffer

 

 

 

#pragma

 

 

DATA_ALIGN(DataInput,INPUT_BUFFER_SIZE);

int16_t DataInput[INPUT_BUFFER_SIZE];

The AMR is configured for a 16 byte buffer size using A5:

AMR=0x00030004; //A5 circular mode using BK0 size, BK0=3

Here is part of the assembly code:(which causes the problem)

;assign NewDataPtr address to A1 (NewDataPtr points to the buffer)

MVKL _NewDataPtr,A1

MVKH _NewDataPtr,A1

;assign Data input address to A5

LDW *A1,A5

 

 

NOP 4

LDW *A5++,A8   ;increment pointer

 

 

NOP 4

STW A5,*A1   ;store back pointer

 

 

NOP 4

 

 

B B3

 

 

NOP 4

after a while NewDataPtr goes well beyond the bounderies of the buffer

Is there a problem combining circular addressing with HWI?

Thanks in advance!

Ariel