I just received my programming board,
copying and pasting bits of code, I come up with this program posted below.
It kind of works, but the problem here is that when I change delay pointer in "HOLD mode", the program keeps repeating ALL the delay ram..
It moves the read pointer, but that does not change the actual delay time,
(as it normally does when reading ADCL and writing it to delay RAM)
I can t figure out why it works like I described..
Any idea on how to fix this is welcome,
thanks in advance
Sandro
Code: Select all
;DELAY copied from eeprom prog5, with infinite loop
;no feedback and filter
;POT0 infinite repeat switch, when activated program does not write
;adcl to delay memory and keeps repeating its RAM content
;POT1 delay read pointer
mem delay 32767
equ pfil1 reg0
equ pfil2 reg1
equ nxtadd reg2
equ interp reg3
equ temp reg4
equ dout1 reg5
equ dout2 reg6
equ hold reg7
;check pot0 value to choose between "hold" or normal delay
clr
rdax pot0,1 ;read pot value
sof 0.1,-0.1 ;trimm pot0 range in order to use it with SKP GEZ
wrax hold,1 ;write hold register, keep in ACC
skp gez,3 ;skip next 3 lines if ACC is positive
;read input and write to delay:
clr
rdax adcl,1 ;read left input
wra delay,0 ;write result to delay
;prepare read pointer based on pot1 setting:
rdax pot1,1 ;read pot value
sof 0.98,0.02 ;limit delay range
rdfx pfil1,0.001 ;filter pot value
wrax pfil1,1 ;write filter register, keep in ACC
rdfx pfil2,0.001
wrax pfil2,1
wrax addr_ptr,0 ;load address pointer with first read position
rmpa 1 ;read memory from pointer position
wrax dout1,0 ;store first value, clear ACC
;now get second value:
or %00000000_00000001_00000000
rdax pfil2,1 ;get pointer back and add
wrax addr_ptr,0 ;load pointer again
rmpa 1
wrax dout2,0 ;store second value, clear accumulator
;now get an interpolation value:
rdax pfil2,1
and %00000000_00000000_11111111
sof -2,0
sof -2,0
sof -2,0
sof -2,0
sof -2,0
sof -2,0
sof -2,0
sof -2,0
sof -2,0
sof -2,0
sof -2,0
sof -2,0
sof -2,0
sof -2,0
sof 1.999,0 ;shift 15 paces
wrax interp,0 ;save in register
;now crossfade between delay read values using interp value:
rdax dout2,1
rdax dout1,-1
mulx interp ;crossfade with interp
rdax dout1,1
wrax dacl,1 ;write result to left DAC