<div dir="ltr"><div><div>Thanks<br><br></div>Yes there are a few parts with high resolution timers out there. STM32G4 has an amazing 5.44GHz timer!<br><br></div><div>For what I needs, I think 144 or 150MHz will do.<br></div><div>To get, say, 25mV output resolution in a buck regulator from 50V requires 1/2000 resolution. With a 144MHz PWM frequency you can get that with a switching frequency of <br></div><div>144MHz/2000 = 72kHz. Should be fine for my needs.<br></div><div><br></div><div>Without getting into religious wars I won't be touching a PIC though.</div><div><br></div><div>Thanks</div><div><br></div><div>Charles</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Feb 12, 2024 at 6:29 PM David Burkitt <<a href="mailto:daveyboy17nz@gmail.com">daveyboy17nz@gmail.com</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"><div dir="ltr">We used a PIC33H micro a few years ago that had a high resolution PWM that ran off it's own PLL from the system clock.<div>Can't remember the actual part number, sorry.</div><div>Regards</div><div>Dave</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 12 Feb 2024 at 16:22, Charles Manning <<a href="mailto:cdhmanning@gmail.com" target="_blank">cdhmanning@gmail.com</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"><div dir="ltr"><div>Thanks all</div><div><br></div><div>I think the idea I had of trying to "overlap" two PWMs for better precision would only work if I was using a predivider to divide one dwon to a lower frequency. That won't work for my application as I want to drive with at least 30 to 40kHz (preferably more). I think the only way I can achieve a higher precision would be by going for a higher clock speed (ie. a PWM driven from at least 120MHz).<br><br></div><div>The other option might be to do some sort of dithering, but that will add lower frequency ripple.</div><div><br></div><div>I've been looking at various interesting micros recently. In STM32, there are the newer U5 series which run up to 160MHz which should give more resolution than I need as well as a few other features that look interesting for motor control etc (eg. proper security to stop people tampering).</div><div><br></div><div>At the other end, there are a bunch of RISC V micros coming out of China. 144MHz or faster, less than $1.<br><br></div><div>THanks</div><div><br></div><div>Regards</div><div><br></div><div>Charles<br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Feb 12, 2024 at 2:28 PM Robin Gilks <<a href="mailto:gb7ipd@gmail.com" target="_blank">gb7ipd@gmail.com</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"><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" target="_blank">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>
_______________________________________________<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>
_______________________________________________<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>
_______________________________________________<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>