From 9858f5294bcbcb4b3aa899553951402df14dd784 Mon Sep 17 00:00:00 2001 From: "David A. Mellis" Date: Fri, 8 May 2009 11:05:41 +0000 Subject: Adding ATmega328 bootloader for the Pro and Pro Mini running at 8 MHz (3.3V). Uses the USART0 double speed mode, which according to Nathan from Sparkfun, is necessary to achieve reliable communication at 57600 baud. --- bootloaders/atmega/ATmegaBOOT_168.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'bootloaders/atmega/ATmegaBOOT_168.c') diff --git a/bootloaders/atmega/ATmegaBOOT_168.c b/bootloaders/atmega/ATmegaBOOT_168.c index 8ea1509..2b9fefa 100755 --- a/bootloaders/atmega/ATmegaBOOT_168.c +++ b/bootloaders/atmega/ATmegaBOOT_168.c @@ -370,8 +370,16 @@ int main(void) UCSRA = 0x00; UCSRB = _BV(TXEN)|_BV(RXEN); #elif defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__) + +#ifdef DOUBLE_SPEED + UCSR0A = (1<> 8; +#else UBRR0L = (uint8_t)(F_CPU/(BAUD_RATE*16L)-1); UBRR0H = (F_CPU/(BAUD_RATE*16L)-1) >> 8; +#endif + UCSR0B = (1<