Created
November 29, 2014 11:11
-
-
Save petrihakkinen/c598f1daa6df8fcfbffb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// stop CPU clock in high state | |
void stopClock() { | |
// wait for clock to go low | |
while((PIND & CPU_CLOCK) != 0) {} | |
// wait for clock to go high | |
// must check that WE is high, otherwise CPU may be writing to memory | |
while((PIND & (CPU_CLOCK|SRAM_WE)) == 0) {} | |
TCCR2B = 0; // stop timer by setting prescaler to 0 | |
TCCR2A = 0; // disable timer so that we can control PD7 manually | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment