PWM Atmego103

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

In reading the datasheet, it looks like just setting the registers will cause the pwm to operate, do I need to write code that acts out of interrupts, such as compare = .. ? I have seen a few different examples, and some have interrupt routines, others do not.

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

You don't.
But, if you want to do something special, yes, you do.

Dragos Popescu

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

TCCR2 = 0x64; PWM Enabled, O/P Disconnected Prescaler : CK/256
OCR2 = 0xAA; Compare value
TCNT2 = 0x00; Initial value .. .

what other bits do I need to set ?