Timer/counter1 Input capture


Timer/counter1 Input capture

#ATMEGA128 #SampleCode #AVRSTUDIO Timer3의 PWM(PE3에서 발생)파형을 Timer1의 Inputcature(PD4로 입력)에 넣어서 주파수 계산하는 Code Timer3의 PWM출력 port의 파형(40ms)을 Timer1의 Inputcature(PD4로 입력받고 Inputcature의 주기는 64us마다 카운팅)에 넣어서 읽은 값을 7Senment에 display하는 code(결과는 40ms를 64us로 카운팅하면 625가 나) 7segment에 625확인하였고 오실로스코프로 PE3과 PG0파형을 확인하여 PE3 rising edge마다 PG0가 반전되는 것을 확인함 #include <avr/io.h> #include <avr/interrupt.h> char number[10] = {0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x67}; unsigned char gucPWMValue = 200;...


#ATMEGA128 #AVRSTUDIO #SampleCode

원문링크 : Timer/counter1 Input capture