Pot skip with 16 options
Posted: Tue Dec 15, 2020 1:01 pm
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?
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!
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
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!