if comparing these two codes, do they obtain similar signal? because as the first code there is 0<<COM1A0, since COM1A0 = 0, i just exclude it in the second code..i have to go to lab to use oscilloscope,but lab close after 5. if u dont mind, may i know is there any software u used to get the previous image result one..
1st code:
#include <avr/io.h>
#define F_CPU 16000000UL //set 16mhz crystal
int main (void)
{
DDRD |=0xFF;
//initialization for timer1
TCCR1A |= 1<<WGM11 | 1<<COM1A1 | 0<<COM1A0; // COM1A1=1,COM1A0=0,FOR NON INVERTED MODE...1:1 FOR INVERTED MODE
TCCR1B |= 1<<WGM12 | 1<<WGM13 | 1<<CS10 | 1<<ICNC1; //sebelum ni CS10 =1;ICNC1 =1 noise canceller
ICR1 = 7; //counter value utk 16MHZ
OCR1A = 3;
}
2nd code:
void setup() {
pinMode(9, OUTPUT);
TCCR1A = 0;
TCCR1B = 0;
TCCR1A |= _BV(WGM11) | _BV(COM1A1);
TCCR1B |= _BV(WGM12) | _BV(WGM13) | _BV(CS10) | _BV(ICNC1);
ICR1= 7;
OCR1A = 3;
}
void loop(){
}
btw, tq tq tq..