Hi need help for pwm in 300khz 500khz pwm with variable duty.

Hi all,

I am new to arduino but i have a basic understanding of C from university.
I want to see if i can program an arduino board to do two thing.

  1. Set a pwm at ~500khz or less
  2. do it by comunicating via the serial port.c;).

I have done the pwm via picmicro but i find dificult to do it there and arduino seem to do more :).

Can someone point me in the right direction and suggest wich board can fullfill this job.

Thanks to all,

Timi

check - Arduino Playground - PwmFrequency -

Hi,

Thanks for the help. I noticed that the max frequency is "o The base frequency for pins 5 and 6 is 62500 Hz." Can i achive more than 62khz ???
can i use inline assembler code to do the pwm for 500khz like these page i found Arduino Playground - AVR does the new galileo board pwm around 500khz or i can used a cheaper one 'prefered' ;):).

I have a lot of question cause i need to decide on a board to do this tasks. :wink:

Thanks a lot,
Timi

does the new galileo board pwm around 500khz

No.

For a 16MHz processor a frequency of 500KHz represents only 32 clock pulses. For 8 bits of PWM you require 256 times the clock rate. 500KHz * 256 = 128 MHz clock so it is not possible to have a PWM frequency this high with any arduino.

Hi,

Thanks alot for your help, can i achive this goal with something connected to an arduino then ??? :cold_sweat:

Timi

Hi all again,

I just checked and the intelgalileo run from an intel 400mhz frequency, can it do the pwm of 500khz. It looks like it can theoretically achive 400,000,000รท256=1,562,500 ???? Can someone advice on this.

Thank to all,

Timi

The problem with that processor is that while it is fast the I/O is very slow, because it goes through a 100KHz I2C bus.
I think there might be one pin that can output directly but I am not sure it is that fast.

  1. Set a pwm at ~500khz or less
  2. do it by comunicating via the serial port.c;).

Arduino Due ---> 168 PWM width control at 500 kHz.
CPLD @ 200 MHz ---> 400 PWM width control at 500 kHz.
Any Arduino Serial ---> CPLD/FPGA ---> PWM

HI thanks for the reply,

i was looking at the Arduino Due ---> 168 PWM width control at 500 kHz. it is a 32 bit 84Mhz. i wanted the pwm to be part of a variable boost converter that i am trying to figure out and learn a few things on my spare time. or if i cannot make it to the boost in a satisfactory way to reuse the board for other things also. What do you guys advice.

Timi

I suggest researching the Due forum, the SAM3X pdf, Atmel, GitHub and elsewhere for more information. I don't believe you'll find a PWM library that will meet your needs, it would more than likely require register level programming and advanced level code development.

Aliaj00:
i wanted the pwm to be part of a variable boost converter that i am trying to figure out

It is the wrong approach to the project. Don't use a processor at all. This is a job for a very cheap dedicated switching circuit rather than a very expensive embedded processor.
The only thing you will learn is that this is the wrong approach.

hi guys,

thanks a lot for your support. will try to use a boost controller chip. while writing the reply to you. i tried to check for a cheap chip to do the variable boost controller and found this one:

LT3757AEDD#PBF Boost, Flyback, SEPIC, and Inverting Controller DFN 10 $2.94

its NOT expensive and from the preliminary data has the option to synchronize the clock externally making it configurable from any arduino with ad8950 or ad8951, for boost buck and fly-back. so it seem to be perfect candidate for arduino in numerous application/ more like experiments :stuck_out_tongue: i may try it :). i also got the datasheet for chip used for the arduino due board thanks to the link from "dlloyd" that will surely help a lot.

will go with arduino due as soon as i can :stuck_out_tongue: :slight_smile:

thanks again for you help guys,

Timi