SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By freecookies
#87140
The fastest the Arduino can go is around 62Khz or so. If you're building a buck(-boost) converter, that required a pretty large inductor at that frequency. The size of the inductor goes as the inverse of the frequency, so if you can up the PWM frequency to 500Khz or so, the inductor gets significantly smaller.

I've seen lots of schematics for PWM generators using a 555. I have some questions:

1.) Can the typical 555 chip do 500Khz?
2.) The width is controlled by a pot - would it be possible to use a BJT as a ghetto pot? Take the PWM signal from the arduino and smooth it out with some caps and a series resistor or two and then feed that to the BJT base-emitter? Or am I just spiralling into outer space here?
3.) Should I be thinking about a 555 at all or is there some better chip out there that does it better?
User avatar
By leon_heller
#87143
Have a look at the dsPICs.

Leon
User avatar
By leon_heller
#87144
Have a look at the Microchip PIC24 and dsPIC.

Leon
By waltr
#87162
Look at chips made for a switching power supply like the LT1950.
Linear Tech, as well as other manufacturers, makes a number of chips that work very well and at the high frequencies you are looking for.
By mikeselectricstuff
#87192
You can get higher frequencies at lower resolution, which is still generally adequate for PSU applications. If necessary you can also use cycle-to-cycle 'jitter' to increase the effective resolution at lower resolutions.
Read the AVR datasheet for details.
By Vraz
#87228
The fastest the Arduino can go is around 62Khz or so.
62khz is the fastest PWM rate assuming a full 8-bits of resolution @ 16mhz (16000000/256). You can increase the rate either by increasing the AVR crystal (16mhz to 20mhz depending on the AVR) and/or lowering the counter limit in PWM mode. For example, using a 20mhz AVR with a counter limit of 40 will give you 500khz (20000000/40). However, you can only alter the duty cycle in increments of 2.5% (100/40). As the previous posted noted, you can get additional resolution by dynamically changing either the duty cycle or the overall cycle length. To key missing parameter is how much duty cycle resolution you need. Your existing 16mhz Arduino can do 500khz assuming duty cycle adjustments of 3.1% are acceptable.
By freecookies
#87236
I think I could live with a few less bits of rez. Even a 2x or a 4x increase on frequency would be cool even without upping the clock crystal. That would mean an inductor that's 1/2 or 1/4 the value I'm using now :)

So what do you need to frob to, say, get the PWM pin to oscillate at 125kHz?
By Vraz
#87243
So what do you need to frob to, say, get the PWM pin to oscillate at 125kHz?
16mhz / 125khz = 16000000 / 125000 = 128. So you will want to use the fast PWM mode on the 8-bit timer with TOP set to 128. You will use the OCR register to select the duty cycle with 64 being 50% (128 * 50% = 64).