AVR code to do PM