I would like to be able to generate DTMF tones using PWM. I am very familiar with the process, having written code to do this several times on other devices. The DTMF will NOT be required while a soft device is running - the two are mutually exclusive. However, I have been reading up on PWM generation with the nRF51822, and I am coming to the realization that this may not be possible, because of the shortcomings of the hardware. This is my understanding so far:
a) It is not possible to have a LOTOHI task and a HITOLO task that target the same pin, so I have to rely on the TOGGLE task. This is not ideal, but may not be fatal.
b) There is no double buffering on the counter compare registers, so it is advised to stop the counter, change the compare value, and restart the counter. This, I believe will make for a glitchy, noisy waveform that probably won't be acceptable.
c) The highest possible frequency at 8 bit resolution in 31.25kHz. I don't understand this, as 16MHz / 256 is 62.5kHz.
So I am wondering if it would be possible to reduce the effective resolution(and range) ot the PWM signal, such that the duty cycle is never more than 80%, for example. If I generate an IRQ on that first compare(the one that determines the end of the PWM high period), might it be possible to update the CC register in that IRQ(even if it involves having to disable the compare match, write the new value, and re-enable the match), without problems? The essence of this idea is that there will be some "dead time" after the IRQ fires but before the max count. I guess for this to work I need to know if the counter compare is an "==" function, rather than a ">=" function.