i want to toggle the output of a pin using the output compare interrupt of atmega16 but i can't get it done.
i started the program by initializing PORTD as output. somewhere in my program, i set OCR1A to a certain value and then set COM1A1 = 1 and COM1A0 = 0 in TCCRA1 inorder to clear the pin on output compare and also set WGM12 = 1 and then set PORTD5 to high. as far as i understood from the datasheet, this will put the timer into a CTC mode, or clear timer on compare match and clears the pin on compare match.
my problem is that when i simulate it on AVRstudio 3.56, it only sets PORTD5 to high but doesn't clear the pin when there is a compare match interrupt.
when i tested the chip using a tester, i doesn't go to high even.
my code:
anyone can help?
thanks...
-jay
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway - Enter today