AVR Timer Calculator

System Clock Frequency (Hz):   Calculate Using …
Timer Resolution:
Prescaler:
Total Timer Ticks:
Overflow Count:
Remainder Timer Ticks:
Real Time (sec):
New Freq (Hz):

Credit to Frank Zhao for written this.

I just wanted a copy so that my fellas and I wouldn’t need to whip out the good ol’ Casio if his website goes down.

Arduino Nano Pinout (ATMEGA328P)

1280px-Arduino-nano-pinout

Credit to Wikimedia Commons.

Debouncing


void button_press()
{
    int tempbuttonstate = PINC & (1<<PC3);    //Button input
	
    if(tempbuttonstate == 0)     //if PINC3 is LOW,  the button will be considered pushed
    {
        _delay_ms(20);    //20ms wait to avoid button bouncing
        if(((PINC & (1<<PC3)) == tempbuttonstate))    //confirm button state !change
        {
            buttonpushed = 1;   //Button has been pressed once
        }
    }
}
//Add 'buttonpushed = 0;' later in code to reset

Useful Links

Useful Code

Arduino to Nano Tool Argument #1:
C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude.exe
-C"C:\Program Files (x86)\Arduino\hardware\tools\avr\etc\avrdude.conf" -v -patmega328p -carduino -PCOM4 -b57600 -D -U flash:w:$(ProjectDir)\Debug\$(TargetName).hex:i

Arduino to Nano Tool Argument #2:

C:\avrdude\nano-download.bat
COM4 "$(ProjectDir)Debug\$(TargetName).hex"

Look in Code from Labs/Project for the avrdude files 🙂