Added Runbootloader example

Alternative way to the USB-Serial Bridge
This commit is contained in:
Nico 2015-02-20 14:33:11 +01:00
parent f6a19cff3d
commit 0e738a08d9

View file

@ -0,0 +1,33 @@
/*
Copyright (c) 2015 NicoHood
See the readme for credit to other people.
HoodLoader2 Run Bootloader example
Starts Bootloader mode.
This is useful if you only want to use
the USB-Serial bridge again.
You could delete the program with avrdude,
but this sketch is way simpler to upload.
It forces a watchdog reset,
meaning the bootloader is started completely indipendant.
*/
#include <avr/wdt.h>
void setup() {
// close interrupts
cli();
// write magic key to ram
*(uint8_t *)0x0280 = 0x77;
// watchdog reset
wdt_enable(WDTO_120MS);
}
void loop() {
// wait for reset
}