AnsweredAssumed Answered

Help for coding an equation on DSP

Question asked by Maxime Dolberg on Oct 23, 2012
Latest reply on Oct 27, 2012 by Mark Hotchkiss

Hello ! I'm new here.

 

I try to write this equation for my DSP : Y(n) = 1/2 (X(n) + X(n-1)) . After assembling and lunch the code into the processor, there is no signal at the output of my DAC.

 

Below a part of the source code :

 

Code language : Assembler

Microprocessor : DSP 56374

 

 

with :

Y(n) : Output signal (TxBuffBase)

1/2 : Coefb0

X(n) : actual sample (Xn)

 

 

...

  move  #$0,b  ; Init X(n-1) for the first loop

AudioLoop

 

  jclr  #RightRx,x:LRFlag,*

  bclr  #RightRx,x:LRFlag

  move    x:RxBuffBase,a          ; <- ADC left input

; move    x:RxBuffBase+2,b        ; <- ADC right input  (not use for the moment ...)

 

  move  a,x:(r1)                    ;saving Xn for the next loop

  move  r1,x:Xn

  move  #coefb0,r0                  ; coefb0 declare as constant

  move  x:(r0),x1 

  add  b,a                          ; a=X(n)+X(n-1)

  move a,x0

  mpy  x0,x1,a                      ; a=1/2((X(n)+X(n-1))

  move  x:(Xn),b                    ; register b become X(n-1)

 

  move    a,x:TxBuffBase          ; -> DAC left output

; move    b,x:TxBuffBase+1        ; -> DAC right output (note use)

  jmp  AudioLoop

...

 

So what wrong with my code ? Does someone can help me pleas ?

 

note 1 : I'm a beginner.

note  2 : The complete source code is in the attachment.

 

 

 

Original Attachment has been moved to: LPFn1_cs.asm.zip

Outcomes