From: Jon Kirwan on
On Wed, 14 Jul 2010 10:21:23 -0700 (PDT), john1987
<conphiloso(a)hotmail.com> wrote:

>in the light of what we have disscuseed so far, the following micro
>C8051F411's PWM section can generate PWM of 3 MHz. The PWM has 8 bit
>of resolution and master clock is 24MHz. Am I right?
>
>http://www.keil.com/dd/docs/datashts/silabs/c8051f41x.pdf

Nope. Not right. I think you've got internal state of mind
problems that need attending to first, before tackling your
project. 8 bit resolution doesn't mean "divide the frequency
by 8 to get PWM rate." It means divide by 2^(8).

Jon
From: john1987 on
Hi, So it means that I need a microcontroller of master clock
frequency of 128Mhz with 8 bit of resolution PWM to get 500kHz PWM
signal.

Thanks
John

From: Vladimir Vassilevsky on


Jim Thompson wrote:


>>You can play fractional-N aka noise shaping games to increase PWM
>>resolution. BUT by doing that you increase the high frequency content,
>>which modulates the carrier,
>
> I have in mind an application where I wouldn't care about high
> frequency content (really low frequencies).
>
> Can you point me to some papers on how to accomplish that?

A good review on PWM techniques is PhD thesis of K. Nielsen.


Vladimir Vassilevsky
DSP and Mixed Signal Design Consultant
http://www.abvolt.com
From: Phil Hobbs on
Tim Wescott wrote:
> On 07/14/2010 09:24 AM, John Larkin wrote:
>> On Wed, 14 Jul 2010 08:57:22 -0700 (PDT), john1987
>> <conphiloso(a)hotmail.com> wrote:
>>
>>> Hi,
>>>
>>> I need some advise on how to calculate that how fast a microcontroller
>>> can generate a sqaure wave. Calculations that involve oscillator
>>> frequency and how much an instruction will take to do it.
>>>
>>> And I also need to understand the calculation because I am trying to
>>> do pulse width modulation with frequency range between 300KHz to
>>> 500KHz. and I need to choose a microconroller.
>>>
>>> Thanks
>>> John
>>
>> Many/most uPs have a hardware PWM generator, so instruction execution
>> time isn't the issue. But a PWM output at 500 KHz, with 10-bit
>> resolution, implies a clock frequency of 500 MHz. I don't know of any
>> uP PWMs that work up that high.
>>
>> I vaguely recall an ARM that has a trick in its PWM that gets to
>> sub-clock resolution. I'll ask at work, maybe one of the guys recalls
>> it.
>
> Ooh -- that reminds me. TI's TMS320F283xx digital signal controllers
> have such PWM generators -- they run the PWM output through a selectable
> delay line that provides the last few bits of resolution.
>
> I haven't used one, but I have a customer who has.
>
> You can also get a more mundane PWM stage and dither the output with a
> sigma-delta modulator. This can work great if whatever the PWM is
> driving reacts slowly enough to filter the sigma-delta output.
>
> http://www.eetimes.com/design/audio-design/4006431/Sigma-delta-techniques-extend-DAC-resolution
>
>
The other approach is to use an interrupt to change the PWM modulus to
get extra bits. I use that to control RC airplane servos.

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs
Principal
ElectroOptical Innovations
55 Orchard Rd
Briarcliff Manor NY 10510
845-480-2058
hobbs at electrooptical dot net
http://electrooptical.net
From: Jon Kirwan on
On Wed, 14 Jul 2010 13:21:53 -0500, Vladimir Vassilevsky
<nospam(a)nowhere.com> wrote:

>Jim Thompson wrote:
>
>>>You can play fractional-N aka noise shaping games to increase PWM
>>>resolution. BUT by doing that you increase the high frequency content,
>>>which modulates the carrier,
>>
>> I have in mind an application where I wouldn't care about high
>> frequency content (really low frequencies).
>>
>> Can you point me to some papers on how to accomplish that?
>
>A good review on PWM techniques is PhD thesis of K. Nielsen.

http://www.jqiu.net/ftp/Karsten%20Nielsen%27s%20PhD%20Thesis/Volume_I_Title_and_preface.pdf

Jon