increasing pwm resolution

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello

I am using the tiny26 with approx 8 bit pwm resoution (25KHz PWM, 8MHz clock). I am interested in increasing the resolution up to 10 bits. Are there any tricks that have been tried or might work?. It seems that some secondary interrupt manipulating (dithering) the 8 bit pwm value settings (say at 100Khz) might give a little better (average) resolution.

any thoughts or examples of this technique?

Hoyt

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Seems like if you just used the timer compare int to increment tics, reset the pwm out every 1024 tics, turn it on when tics=pwm value, you could do the pwm in sw and have any number of bits.

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Someone here earlier mentioned a clever idea, using two pwm channels
with outputs summed together in a weighted fashion. This method can
be used to increase resolution and/or frequency.

Tom Pappano
Tulsa, Oklahoma

Tom Pappano
Tulsa, Oklahoma

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks Bob-

I certainly could try a software approach, except that I want to use the non-overlapping pwm mode (which could still be done in software, tho more complicated) & most imporatantly I need 25Khz. At that rate there is a lot of software time being "burned up"...compared to "none" used by the pure hardware pwm generator.

In fact, I had been thinking about my original post & realized that I want to dither the pwm value at a LOW freq, say 2KHz. This is much less of a software load. Say 'm at a nominal 8bit 25KHz pwm value of "155". At 1 khz I could change the value to this sequence: 155, 155, 155, 156 & repeat. Or 155, 156,155,156, repeat. Thus the average PWM resolution would be increaed by 2 bits. Since I'm running a motor it will apply an advanced smoothing algorithm (its inertia) My only concern is the generation of a beat frequency, but I'll have to investigate this.

Time for some code!

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

this is akin to divide by N ... divide by ( N+1) strategy used in PLL design.. it ought to work