About PSoC 4
Sorry if this is looking like a hijack! - I will happily start a new PSoC 4 thread if people want, and move this and even my last post there - just let me know.
Getting more familiar with the part now, and more importantly perhaps, with PSoC Creator (its a lot different to PSoC designer that I know inside-out from PSoC 1).
There is a LOT in this chip, and I haven't scraped the surface yet - but on the issue of clocks (and that I couldn't seem to get 48MHz) this was because I was thinking in terms of PSoC 1 which had a 24MHz clock and a separate multiplied version of this at 48MHz - I was looking for this *2 clock and not finding it... In fact, with PSoC 4 one can set your master clock to any frequency (in 1MHz steps) up to 48MHz* - so there is no "x2" clock - by default the master clock is set to 24MHz, but can be changed up to 48MHz.
The options for creating derived clocks from this master are huge - I believe there are 4 independent divider banks each with 3 separate 16 bit dividers that can be chained if required, giving 12 possible clocks without consuming any UDB or other resources. AFAICS, one of these is capable of fractional division .. The bottom line though is that if you want a specific frequency clock in the design, you simply place a clock 'source' on the schematic and specify the frequency and whether you are allowing use of a fractional divider if needed - PSoC creator will then compute the divisor based on available clocks, and set it up for you, showing the divisor and any error to the closest match. Back with PSoC 1, you had a few clock divisors available, but needed to consume PWM resources if you needed more clocks.
The funny thing is that my experience with PSoC 1 is almost a disadvantage with the PSoC 4, as I have been using resources to implement things that are already implemented in the PSoC 4.
For the pedal application though, there is no problem.. 48MHz clocking a 10 bit PWM makes a simple adequate D/A.
Actually, I think 10 bit audio (un-attenuated waveform) with 10 bit D/A for external VCA could be good enough for a digital theremin - The Fairlight CMI used 8 bit waveforms with 8 bit VCA in its early incarnations! - In my view, it is the reduction of waveform resolution that occurs as volume decreases in conventional digital implementations that makes many sound horrible (particularly at low amplitude parts of the envelope) and 10 bit x 10 bit analogue multiplication could be greatly superior.
Fred.
*This is if using the internal clock, which has an accuracy of about 2% .. You can drive the chip with an external crystal oscillator for higher accuracy and stability, and would probably need to do this if using the PSoC clocks referencing theremin oscillators.. I would actually thinking about driving the master clock from a conventional LC reference oscillator multiplied up to ~48MHz for any high-end analogue theremin, but will see how stable the internal oscillator is first.