From 919606b3abe571bcbda7d87ac3b8370cc94aed84 Mon Sep 17 00:00:00 2001 From: Olaf Rempel Date: Mon, 1 May 2006 19:20:40 +0200 Subject: [PATCH] Version 0.75 --- chipdef.h | 3 ++- main.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++++------ makefile | 55 ++++++++++++++++++++++++++++---------------- readme.txt | 22 +++++++++++++++++- 4 files changed, 119 insertions(+), 28 deletions(-) diff --git a/chipdef.h b/chipdef.h index 6a58686..40f1e94 100644 --- a/chipdef.h +++ b/chipdef.h @@ -72,7 +72,8 @@ #define sig_byte2 0x93 #define sig_byte1 0x07 - #define devtype 0x77 // Mega8 boot device code + //#define devtype 0x77 // Mega8 boot device code + #define devtype 0x76 // Mega8 boot device code // #define PAGESIZE 64 // Size in Bytes diff --git a/main.c b/main.c index 7631a37..788fd92 100644 --- a/main.c +++ b/main.c @@ -1,7 +1,7 @@ /***************************************************************************** * * AVRPROG compatible boot-loader -* Version : 0.7 (Feb. 2005) +* Version : 0.75 (Feb. 2006) * Compiler : avr-gcc 3.4.1 / avr-libc 1.0.2 * size : depends on features and startup ( minmal features < 512 words) * by : Martin Thomas, Kaiserslautern, Germany @@ -12,7 +12,12 @@ * owners in source-code and documentation of derived * work. No warranty. * -* Tested with ATmega8, ATmega16, ATmega32, ATmega128 +* Additional code and improvements contributed by: +* - Uwe Bonnes +* - Bjoern Riemer +* +* +* Tested with ATmega8, ATmega16, ATmega32, ATmega128, AT90CAN128 * * - based on the Butterfly Bootloader-Code * Copyright (C) 1996-1998 Atmel Corporation @@ -133,9 +138,9 @@ int main(void) cli(); - MCUCR = (1< 1ms + #if (((F_OSC / 8 / 1000)*MY_WAIT) < 65535) + #warning Information: setting prescaler to 8 + #define WAIT_VALUE ((F_OSC / 8 / 1000)*MY_WAIT) + TCCR1B |= _BV(CS01); + #elif ((((F_OSC / 64 / 1000)*MY_WAIT) < 65535)) + #warning Information: setting prescaler to 64 + #define WAIT_VALUE ((F_OSC / 64 / 1000)*MY_WAIT) + TCCR1B |= _BV(CS01)| _BV(CS00); + #elif ((((F_OSC / 256 / 1000)*MY_WAIT) < 65535)) + #warning Information: setting prescaler to 256 + #define WAIT_VALUE ((F_OSC / 256 / 1000)*MY_WAIT) + TCCR1B |= _BV(CS02); + #else //((((F_OSC / 1024 / 1000)*MY_WAIT) < 65535)) + #warning Information: setting prescaler to 1024 + #define WAIT_VALUE ((F_OSC / 1024 / 1000)*MY_WAIT) + TCCR1B |= _BV(CS00) |_BV(CS02); //1024 prescaler + #endif + + while(1){ + if(UART0_STATUS & (1<= WAIT_VALUE){ + BLPORT &= ~(1<