/* fuses:
* avrdude -p atmega1284p -P usb -c avrispmkii -U lfuse:w:0xff:m -U hfuse:w:0x91:m -U efuse:w:0xff:m
* -> it failed but I answered y, then make reset and it was ok
+ *
+ * with bootloader:
+ * avrdude -p atmega1284p -P usb -c avrispmkii -U lfuse:w:0xff:m -U hfuse:w:0x90:m -U efuse:w:0xff:m
*/
#include <aversive.h>
void bootloader(void)
{
-#define BOOTLOADER_ADDR 0x3f000
+#define BOOTLOADER_ADDR 0x1e000
if (pgm_read_byte_far(BOOTLOADER_ADDR) == 0xff) {
printf_P(PSTR("Bootloader is not present\r\n"));
return;
ACSR = 0;
ADCSRA = 0;
- /* XXX */
- /* __asm__ __volatile__ ("ldi r31,0xf8\n"); */
- /* __asm__ __volatile__ ("ldi r30,0x00\n"); */
- /* __asm__ __volatile__ ("eijmp\n"); */
+ __asm__ __volatile__ ("ldi r30,0x00\n");
+ __asm__ __volatile__ ("ldi r31,0xf0\n");
+ //__asm__ __volatile__ ("eijmp\n");
+ __asm__ __volatile__ ("ijmp\n");
}
/* return time in milliseconds on unsigned 16 bits */