I've got a very specific application, where I must to generate a 200 ~ 250 kHz PWM signal with a 16-bit duty cycle resolution.My question is, how can I find the best hardware specification for it? I never worked with ARM before, only with PIC MCU's.
I was reading some data-sheets but they're not clear to me wether the resolution decreases according to the ClockFreq / PWMFreq relation or if it remains the same.
Can someone give me a direction, please?
With a 250 kHz carrier frequency, the total time for one cycle is 4 microseconds.
For 16 bit duty cycle resolution, each 1 LSB equals 1/65536th of that time, or approx 61 ps. That "ps" is picoseconds! Consider 1 ns is the cycle time for 1 GHz. Impractical as picoseconds may seem, there are some chips with PWM peripherals claiming really high res PWM timing. For example, the NXP KV5 chips claim to have 260 ps timing resolution. That's not the 61 ps you're requesting, but still pretty amazing.
Kinetis KV5x Real-time Control|Cortex-M7|32-bit MCU|NXP
Perhaps the best answer to your question would be another question: Why? Why are you asking for 16 bit resolution for such a high frequency carrier? Maybe you have an excellent reason for a very unusual, very demanding application? But maybe the thing you're trying to do could be much better accomplished some other way? Often that's the case when people request extreme specs without any explanation for their rationale.
For example, I've seen many requests for 16 bit PWM that were based on a misunderstanding that such a waveform could be utilized for high quality audio or other precise analog output, if low-pass filtered. However, many troublesome analog problems occur when using PWM as a "poor man's" digital to analog converter, which ultimately limits the performance to much lower than 16 bit resolution. One of the hardest is the fact that the signal isn't based on a stable low-noise reference voltage. The noisy digital power supply voltage and (perhaps noisy) digital ground become the signals high and low level reference. Slew rate, variability in slew rate, non-ideal effects in the filters, and other issues also all conspire to give the output much higher harmonic and intermodulation distortion than you'd expect from a quality DAC. That's in addition to the power supply noise!
But maybe analog isn't your goal. You're going to drive a H-bridge or some other switching circuit? Maybe something else? Who knows? When you ask a narrowly defined technical question without providing any context, at best you can get only a narrow technical answer. That's quite a waste of the opportunity to hear insightful answers that really apply to your needs.
Also ST has some parts with high resolution 16-bit timer - 217 ps:
STM32F334R8 - Analog and DSP with FPU ARM Cortex-M4 MCU with 64 Kbytes Flash, 72 MHz CPU, CCM, 12-bit ADC 5 MSPS, compar…