maggots
Member level 4
atmega8535 pwm
pwm output in atmega8535
hi guys
i want to ask another dummy question...
common program but still i dont get it right...arrggghhh
my problem is no output in OC1A(PD5) dan OC1B(PD4)...
in my simulation in avr studio ...
TCNT1 is counting but no effect in PORTD but there is change in PIND.4 and PIND.5 ...
i already set the output is inverted. but still there is no output..??!!
please help me
here is the code in code vision avr
thanks for your help
pwm output in atmega8535
hi guys
i want to ask another dummy question...
common program but still i dont get it right...arrggghhh
my problem is no output in OC1A(PD5) dan OC1B(PD4)...
in my simulation in avr studio ...
TCNT1 is counting but no effect in PORTD but there is change in PIND.4 and PIND.5 ...
i already set the output is inverted. but still there is no output..??!!
please help me
here is the code in code vision avr
Code:
#include <mega8535.h>
void main()
{
DDRD =0xFF;
// Timer/Counter 1 initialization
// Clock source: System Clock
// Clock value: Timer 1 Stopped
// Mode: Ph. correct PWM top=00FFh
// OC1A output: Non-Inv.
// OC1B output: Non-Inv.
// Noise Canceler: Off
// Input Capture on Falling Edge
// Timer 1 Overflow Interrupt: Off
// Input Capture Interrupt: Off
// Compare A Match Interrupt: Off
// Compare B Match Interrupt: Off
TCCR1A=0xA1;
TCCR1B=0x0A;
TCNT1H=0x00;
TCNT1L=0x00;
ICR1H=0x00;
ICR1L=0x00;
OCR1AH=0x00;
OCR1AL=0x00;
OCR1BH=0x00;
OCR1BL=0x00;
while(1)
{
OCR1AL = 100;
OCR1BL = 100;
};
}
thanks for your help