Arduino running at 8MHz internal clock with Optiboot bootloader
############################################################## |
############################################################## |
Using an Arduino board to burn the bootloader
If your ATMega8/ATmega328 already configured to use external clock, then wire up the Arduino board & microcontroller as show in figure 1, otherwise (microcontroller configured to use internal clock) you can follow either figure 1 or figure 2.
- Upload the ArduinoISP sketch onto your Arduino board.
- From Tools>Board menu, select ATmega328 Optiboot (8MHz internal clock) if you want to burn the bootloader on ATMega328 microcontroller
- From Tools>Board menu, select ATmega8 Optiboot (8MHz internal clock) if you want to burn the bootloader on ATMega8 microcontroller
- From Tools>Programmer> menu, select Arduino as ISP
- Select Burn Bootloader from Tools menu to start burning bootloader to microcontroller
Programming Arduino with an AVRISP MKII programmer

Identify which Arduino bootloader do I have
CRC 2048b @ 0x7800 = CD70
CRC 512b @ 0x7E00 = FD70
Boot loader: OptiBoot 4.4
// Detect which type of boot loader is present, using a fixed built-in table |
Arduino BIT manipulations
- x: the numeric variable whose bit to set
- n: which bit to set, starting at 0 for the least-significant (rightmost) bit
//initialized all pins to LOW |
- x: the numeric variable whose bit to clear
- n: which bit to clear, starting at 0 for the least-significant (rightmost) bit
//initialized all pins to HIGH //set the third pin LOW |
- x: the numeric variable to which to write
- n: which bit of the number to write, starting at 0 for the least-significant (rightmost) bit
- b: the value to write to the bit (0 or 1)
byte pinState= 0; //initialized all pins to LOW (B00000000)
bitWrite(pinState, 0, HIGH); //set first pin to HIGH, pinState = B00000001 bitWrite(pinState, 3, HIGH); //set third pin to HIGH, pinState = B00001001 bitWrite(pinState, 0, LOW); //set first pin to LOW, pinState = B00001000
|
-
x: the number from which to read
-
n: which bit to read, starting at 0 for the least-significant (rightmost) bit
byte pinState = B10101010;
for (int i=0; i<8; i++) {
theBit = bitRead(pinState, i);
}
|
Password access with Arduino using keypad

set(password)
Set the target password equal to password.
is(password)
Is the target password equal to password
append(character)
Append a character to the currently guessed password
reset()
Reset the currently guessed password
evaluate()
Is the guessed password equal to the target password?