I'm using a Philips P89C668 at 16MHz in 6-clock mode. I've got a piezo (with internal driver) on P1.3 (CEX0). I'd like to switch to a speaker and output PWM to get different tones. However, I can't find any good examples on how to vary the period (frequency). I've read the Intel PCA cookbook and their one example shows how to set it at the maximum frequency, but not how to vary it or how to use other PCA sources for PWM. I don't need to vary duty cycle. Here's the PCA init:
CMOD = 0x02; // OSC/2 (6-clk mode) CCAPM0 = 0x42; // Mod0 in 8-bit PWM CCAP0H = 0x80; // set 50% duty cycle CCAP0L = 0x00; // set 50% duty cycle CH = 0x00; CL = 0x00; CR = 1; // turn it on