[sdiy] Reverse Sawtooth
Paul Maddox
paul.Maddox.mail-list at Synth.net
Mon Jan 24 23:22:14 CET 2011
Why would it create jitter?
if you use INT0 to perform your sample calculation (Acc = Acc + ptc)
and also to fetch a value from EEPROM/Flash and output it to the DAC,
it's constant, it happens *ONCE* everytime the interupt occurs.
The only caveat is that you've now limited your top end frequency
based on the speed of the interupt and that your code for calculating
and looking up the value needs to be shorter than the interupt timer.
I still think assembly is the way to go... With the monowave and Zira
the "main" loop is the oscillator calculation and wavetable lookup..
the interupt occurs when something is received in the UART... as long
as I don't update the oscillator pitch/wave too often, you don't
notice it!!
with Tempest, I got even sneakier, the oscillator did it's wave
calculation and lookup, then at the end of the loop it checked a
register.
This register was set when an IRQ had occurred (falling edge).
The routine would then read two ports, one had the command (for
example, oscillator pitch, osccilator wave number) and one had the
value.
These would then be read in and pushed to the right ram location.
A pin was then toggled on the AVR and the loop restarted.
this toggled pin was a signal to the control CPU that the oscillator
had received and processed a command.
if the register was NOT set, it jumped to a bit with a set of "NOP"
instructions that exactly matched the number of cycle it took to
process a command if it was set.
End result, a longer wave calculation time but absolutely no jitter.
There's a million and one ways to crack this nut, the trick is to try
something and see what works for you!
Paul
More information about the Synth-diy
mailing list