For one of the three Lab Assignments in the Embedded Systems class I took I had to set up timers using various methods on the Atmega1284.
The code is available on GitHub.
Here is a short video I put together for the “experiment 2” portion of that lab: