First pass at an Atmel AVR version.