[sdiy] Wavetables
Matthew Smith
matt at smiffytech.com
Mon Jan 24 22:14:16 CET 2011
Quoth Paul Maddox at 25/01/11 06:05...
...
> Well, C is easy to read and more portable
Which I want, as I'm considering mixing families (I've got samples of
8051-derived devices from Dallas which take a high clock rate AND have a
decent amount of FLASH.) Also got some Freescale devices I might bring
into the equation as a) I have them on hand and b) there's plenty of FLASH.
> however, if you want best
> speed/performance, you'll need to use assembly.
This depends on the balance between a GOOD assembly coder and a GOOD
compiler - I'd sooner trust to avr-gcc with avr-libc than the bumblings
of someone picking up a new language for the first time!
> One key thing, you'll need to ensure that you update the output of
> your oscillator at regular intervals... If the C compiler you have
> will allow you to do that, all well and good.
Accounted for, as best I can. The only way I'd want to be doing this
type of timing is with hardware counters and interrupts.
Which reveals a flaw in my current code - I'm checking to see if my
pointer value has reached maximum (and duly resetting if it has)
*before* copying the value to the port. Need to shift that down to the
end of the function, after the pointer increment. That way, the copy
from the table to the port is executed FIRST in the ISR. (Current code
is looking for an external interrupt, but same would apply if I had the
code space to do this with an on-board counter.)
Cheers
M
--
Matthew Smith
Smiffytech - Technology Consulting & Web Application Development
Business: http://www.smiffytech.com/
Blog/personal: http://www.smiffysplace.com/
LinkedIn: http://www.linkedin.com/in/smiffy
Skype: msmiffy
Twitter: @smiffy
More information about the Synth-diy
mailing list