Full Version : FAST PWM
avr >>ASM PROGRAMMING (AVR) >>FAST PWM


GSecer- 06-11-2008
i want to use fast pwm mode in timer/counter0

this is my code following

.include "m64def.inc"
.org 0x0000 rjmp reset;
reset:
ldi r16,high(ramend); sp initializing
out sph,r16;
ldi r16,low(ramend);
out spl,r16;
rjmp config;
config:
clr r16; since i use oc0 portb selected as output
out ddrb,r16;
ldi r16,0x7f; i want to have %50 duty cycle pwm approximately
out ocr0,r16;
ldi r16,0x6a;
out tccr0,r16; fast pwm,prescaler=8,
rjmp main;
main:
nop; in main always nop cuz i want to see the change of oc0
rjmp main; actually

///End of code///

i see no changes on oc0 pin(pb4 i think)(as a detail,i simulate the code in avr studio).
Anybody who know why , tell me.I appreciate.


Forumer™ is Voted #1 Free Forum Hosting provider
Build your own community today with the largest message board hosting company.