I want to change my PWM duty cycle from 20% to say 70%. Although while I change my OCR1AL value. The duty cycle remains the same. Why is that? Should I change something else? As far as I understand while OCR1A shows the top value, it is the only parameter (register) that I can use in order to change the duty cycle.
.include "m16def.inc"
.cseg
PWM:
;input
ldi r16, 0x00
out DDRA, r16
;output
ldi r16, 0xff
out DDRD, r16
out PORTD, r16
ldi r20, 0xc1
out TCCR1A, r20
ldi r20, 0x01
out TCCR1B, r20
ldi r20, 0x00
out OCR1AH, r20
ldi r20, 0x33
out OCR1AL , r20
in r22, TIFR
andi r22, 0b00000100
out PORTD, r22
SW0:
in r23, PINA
cpi r23, 0b11111110
brne SW0
ldi r16, 0x82
in r17, OCR1AL
ADD r16,r17
out OCR1AL, r16
jmp SW0
ldi r16, 0x00
out PORTD, r16
I am using AVR ATmega16 at 4MHz