Thank you, Frank

So far, I think I found the formulas for this ramp and sin DDS.
For ramp:
T[s] = [4194303/((1536 * potX) + 8 )]/R
And for sin:
T[s] = (2 * pi) / (potX * R)
potX - pot input, range 0 to 1
R - sample rate
But I found an issue too. Look at my example:
Code: Select all
; Normal program starts here
rdax c, 1 ;Read COS
sof 0.00028095, 0
rdax s, 1 ;SIN + freq*COS
wrax s, -1 ;Save SIN and mult by -1
sof 0.00028095, 0
rdax c, 1 ;COS - freq*SIN
wrax c, 1 ;Save COS
It should generate sinus of ~469ms period, but it generates ~540ms. But, if I change the coefficient multiplying to something like this, it works correct:
Code: Select all
rdax c, 1 ;Read COS
sof 0.28095, 0
sof 0.1, 0
sof 0.1, 0
sof 0.1, 0
rdax s, 1 ;SIN + freq*COS
What's wrong?