https://github.com/MicrochipTech/avr_insights
Are you wondering how to measure frequency or measure duty cycle of a PWM signal? Are you looking how to capture rising edges or falling edges of an input signal? Maybe you need to know how AVR® devices input capture?
This video explains what the input capture module is on AVR devices using the ATmega324PB. The input capture is triggered by the rising or falling edges of an input signal, and then the values are stored in an Input Capture Register (ICR). The resources below show how to measure frequency of PWM using input capture.
Documentation references
--------------------------------------------------------------
Atmel Tools Documentation:
https://mchp.us/2W1mGoH
AVR Libc reference manual:
https://mchp.us/2VZdtNr
ATmega324PB datasheet:
http://ww1.microchip.com/downloads/en/DeviceDoc/40001908A.pdf#page=139
ATmega324PB Xplained Pro User Guide:
http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-42633-ATmega324PB-Xplained-Pro_User-Guide.pdf
App note AVR135: Using Timer Capture to Measure PWM Duty Cycle on tinyAVR and megaAVR devices
http://www.microchip.com//wwwAppNotes/AppNotes.aspx?appnote=en591541
App note AVR205: Frequency measurement made easy with tinyAVR and megaAVR
http://www.microchip.com//wwwAppNotes/AppNotes.aspx?appnote=en591930
Keywords: input capture, input capture avr, input capture unit avr, input capture mode atmega16 program, avr input capture, AVR, MCU, ATmega324PB, mega324, mega, mega324PB, AVR example, xplained, xplain microcontroller, insights, insight, tinyAVR, megaAVR, timer input capture, capture falling edge, capture rising edge, calculate duty cycle, calculate frequency, measure pwm duty cycle, PWM signal waveform, TC microcontroller, counter, 16bit, ICR, hardware peripheral, interrupt pin, measure PWM frequency, event capture, input capture avr, input capture