avr microcontrollers and how to get started coding init or main loop or timers or interrupts
The first thing one does in any microcontroller project is blink an LED; keep it blinking and give it a name ("Blinky"), too. It's the heart beat of your widget, and will always work so long as your program doesn't get stuck.
Commit to the local version control repository.
Next is to fly through the entire program in pseudo/crapcode, based on your program flow diagrams or whatever planning methods you've subscribed to. If something doesn't work or you just don't like it, comment it out but keep it there so you know to fix it later. If you don't know how to do something, write down what it's supposed to do in comments.
Commit to the local version control repository.
Time to fill in the blanks! Implement one function at a time, for example the timer, and test it. Your program should always compile and work as expected. I like to implement any user interface connections at this point, like UART -> RS232 -> PC links or LCD displays. Don't forget about Blinky.
Commit to the local version control repository.
Try to break your code with rigorous test routines; debug. Have others review your code; debug. Run your widget through its design parameters regularly, like temperature variations; debug.
Commit to the local version control repository.
Disconnect Blinky if you're a heartless fool, and ship.


AVRFreaks has an excellent tutorial written by Dean Camera (aka. abcminuser) called Modularizing C Code: Managing large projects. You may also be interested in reading State Machines for Microprocessors by James Wagner.