Coefficient Range Error

Algorithm development and general DSP issues

Moderator: frank

Post Reply
Wldon
Posts: 1
Joined: Sun Feb 13, 2011 12:06 pm

Coefficient Range Error

Post by Wldon »

I'm a new user and am working through several existing sets of code to familarize myself with general instructions and structure.
I tried to modify the aliaser code that Frank developed a while back and am getting an error that I don't understand.
I'm reading a pot value and masking it to get a discrete value within a range that has step value of 1/32 for the aliaser ratio. Then I do the counter with the 0.03125 step value. The problem is that I keep getting a coefficent range error.
It must be something very basic that I just don't see. The code is below:

equ flopper reg0
equ lastval reg1
equ ratio reg2
rdax pot0,1
and %11111000_00000000_00000000 ; 32 divisions of pot input
wrax ratio,0
clr
rdax flopper,1.0 ;read counter
sof 1.0,-1/32 ; subtract 1
skp gez, outter ; if > 0 jump to output
rdax adcl,1 ; else get input
wrax lastval,0 ; write to out reg
sof 0,ratio ; reload counter
outter:
wrax flopper,0 ; save counter
clr
rdax lastval,1.0
wrax dacl,1.0
wrax dacr,0

Any suggestions? Thanks.
frank
Posts: 1244
Joined: Wed Oct 19, 2005 12:26 pm
Contact:

Post by frank »

The error is at the line:

sof 0,ratio ; reload counter

'sof' expects two values, not a register name like 'ratio'. Did you mean to use an rdax here to read ratio?
Frank Thomson
Experimental Noize
Post Reply