Pot skip with 16 options

Software questions and issues with the FV-1

Moderator: frank

Post Reply
kevs27
Posts: 3
Joined: Tue Dec 15, 2020 12:47 pm

Pot skip with 16 options

Post by kevs27 »

Hello! I am trying to expand the coding example of the POT skip routine on the spin website. It shows switching between 4 reverbs.

I have used this code in my own program to sum different registers together with success, but I would like to choose between 16 options. I know I need to mask the POT register with 4 bits, but I am a little confused. My stab at it is it would be something like?

Code: Select all

rdax pot0,1
and %01111000_00000000_00000000

skp zro, sum1

sof 1, -0.0625
skp zro, sum2

sof 1, -0.0625
skp zro, sum3

...

sof 1,-0,0625
skp zrp, sum16

clr
I do use microcontrollers a lot so I was planning on using an external DAC to set the voltage between the 16 threshold points. Usually, on an MCU, I just bit shift the pot ADC value to the right to get the 16 selections. But I am kind of confused with the ADC being 9 bits on the FV1, and the AND operation being 24bit and how it's working.

Any help on what bits to AND and what number to subtract to get 16 combinations would be great! I tried expanding the code to 8 combinations to get started but it wasn't working as expected so I think I'm not understanding the fundamentals fully on this one...

Thanks!
frank
Posts: 1244
Joined: Wed Oct 19, 2005 12:26 pm
Contact:

Re: Pot skip with 16 options

Post by frank »

Logic is good but in the world of audio DSP we have to assume there are also bits bouncing in the LSBs so a better way to attack it is:

Read in POT
Put put through a low-pass filter, get rid of noise in the LSBs
Mask off the top bits just like you did but save a jump by:

jmp zro, sum1

sof 1,-0.0625
jmp zro, sum2
.
.
sof 1,-0.0625
jmp zro, sum15

; put the sum16 routine here since if it wasn't one of the previous 15 it must be the sum16 so saves a jump instruction
Frank Thomson
Experimental Noize
kevs27
Posts: 3
Joined: Tue Dec 15, 2020 12:47 pm

Re: Pot skip with 16 options

Post by kevs27 »

Thank you Frank, it worked! :D
Post Reply