The scope and debugger show The OC0A pin set high the first compare match TCNT0=OCR0B and then clears it at top=OCR0A and never sets it again although at OCR0A it reverses and goes back to Bottom so the phase correct going up and down is working.
OCR0B should be going high on compare match TCNT0=OCR0B when going up and clearing when going down.
My code, what am i doing wrong here?
Mode 1 with WGM02=0 works fine.
Tiny45, 10MHZ resonator 5V supply
;COM0A0 = 1 Phase correct PWM mode set OC0B going up, clear going down ;COM0A1 = 1 ;WGM00 = 1 Phase correct PWM mode 5 OCRA is top ;WGM02 = 1 ;CS00 = 1 No prescale ldi r16,0b000000011 ;data direction OC0B (and OC0A) out ddrb,r16 ldi r16,(1<<COM0A0)|(1<<COM0A1)|(0<<WGM01)|(1<<WGM00) out TCCR0A,r16 ldi r16,10 out OCR0A,r16 ;top ldi r16,6 out OCR0B,r16 ldi r16,(1<<WGM02)|(1<<CS00) out TCCR0B,r16
I tried a tiny2313 as well with PWM waveform mode 5 and I get the same result. I can set the frequency of the timer to bounce back and forth between Bottom and OCR0A but I can't get the pin to toggle.