<div dir="ltr"><div>A lot will depend on the SOC or microcontroller you are using.</div><div>I'm playing with an stm32f303re (Nucleo board) at present and I see that Timer 2 is a 32 bit timer and can be clocked at 144MHz (i.e. system clock * 2).</div><div>Another approach I've used for generating interesting PWM shapes is to use an SPI MOSI output being given data under DMA from memory. The above mirco can do SPI at 18Mb/s. Set the DMA for circular operation and change the RAM data on the fly</div><div>Yet another method if you are straying into the analog domain with a PSU is to use a DAC - same micro, 2 12 bit DAC outputs, can be driven by DMA and a maximum rate of 1MS/s for single bit output change (I've been using one at 1.6MS/s and it seems fine!!). Linearity and offset might be an issue with the DAC with errors of up to 4 and 12 LSBs respectively with 12 bit codes.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Feb 11, 2024 at 8:49 PM Mark Atherton <<a href="mailto:markaren1@xtra.co.nz">markaren1@xtra.co.nz</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">The resolution of a digital based PWM is always(?) going to be limited <br>
by the associated highest available clock. You may be able to use <br>
additional switched delays to increase resolution. AFAIK similar work <br>
has been done in a similar vein by various extremely high resolution <br>
FPGA based time-to-digital converter designs.<br>
<br>
However in the analogue domain using a ramp generator, a voltage source <br>
and a comparator almost limitless resolution is available. Accuracy <br>
however will (likely) be limited by thermal drift etc.<br>
<br>
What are you hoping to achieve, prey tell ??<br>
<br>
-M<br>
<br>
<br>
On 2/11/2024 7:37 PM, Charles Manning wrote:<br>
> Hi All<br>
> <br>
> I have an idea I'd like to bounce around to see what others think.<br>
> <br>
> I want to get a high precision PWM going to drive a buck switch mode at <br>
> a high enough frequency.<br>
> Using a single PWM channel limits the precision I can get.<br>
> <br>
> So I was thinking: maybe there is a way I can combine two PWMs to <br>
> generate a single high precision signal.<br>
> <br>
> For example, maybe one PWM can run at a slower frequency and provide the <br>
> "most significant bits "and another can run at a faster frequency and <br>
> provide the least significant bits" and combine them with a flip flop or <br>
> such.<br>
> <br>
> Has anyone tried similar trickery in the past or have any other cunning <br>
> tricks?<br>
> <br>
> Thanks<br>
> <br>
> Charles<br>
> <br>
> <br>
> _______________________________________________<br>
> Chchrobotics mailing list <a href="mailto:Chchrobotics@lists.ourshack.com" target="_blank">Chchrobotics@lists.ourshack.com</a><br>
> <a href="https://lists.ourshack.com/mailman/listinfo/chchrobotics" rel="noreferrer" target="_blank">https://lists.ourshack.com/mailman/listinfo/chchrobotics</a><br>
> Mail Archives: <a href="http://lists.ourshack.com/pipermail/chchrobotics/" rel="noreferrer" target="_blank">http://lists.ourshack.com/pipermail/chchrobotics/</a><br>
> Meetings usually 3rd Monday each month. See <a href="http://kiwibots.org" rel="noreferrer" target="_blank">http://kiwibots.org</a> for venue, directions and dates.<br>
> When replying, please edit your Subject line to reflect new subjects.<br>
<br>
<br>
_______________________________________________<br>
Chchrobotics mailing list <a href="mailto:Chchrobotics@lists.ourshack.com" target="_blank">Chchrobotics@lists.ourshack.com</a><br>
<a href="https://lists.ourshack.com/mailman/listinfo/chchrobotics" rel="noreferrer" target="_blank">https://lists.ourshack.com/mailman/listinfo/chchrobotics</a><br>
Mail Archives: <a href="http://lists.ourshack.com/pipermail/chchrobotics/" rel="noreferrer" target="_blank">http://lists.ourshack.com/pipermail/chchrobotics/</a><br>
Meetings usually 3rd Monday each month. See <a href="http://kiwibots.org" rel="noreferrer" target="_blank">http://kiwibots.org</a> for venue, directions and dates.<br>
When replying, please edit your Subject line to reflect new subjects.</blockquote></div>