multiple interrupts on one PWM period

Status
Not open for further replies.

sastro

Newbie level 4
Joined
Apr 18, 2007
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,326
pwm period

Dear all,

I want to know if it is possible to generate multiple interrupts at different times on one PWM period on an ATMega uC (ATMega8535 for example).

I made a program that will do that thing, I made the first interrupt to be executed in the nearest time, and at that interrupt I change the output compare register to the next time so that it will execute another interrupt at that next time, but I want to do it in one PWM period.

For example, first I set the output compare (OCR1B for example) on 30 (maximum is 256), so that it will generate an interrupt on 30 when counting up from bottom, then the interrupt change the output compare to 60 so it will generate an interrupt compare on 60 when it resumes counting.

I know that the output compare register will only be updated on TOP on the phase correct PWM mode on this chip. Is there any ways to update this register on other times than TOP?

thank you everybody! Need this to finish my school.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…