diff -Naur src/platform/avr/Makefile ../p14p/src/platform/avr/Makefile --- src/platform/avr/Makefile 2012-09-14 11:26:42.000000000 +0200 +++ src/platform/avr/Makefile 2012-08-30 15:02:21.000000000 +0200 @@ -17,10 +17,10 @@ # Platform Configuration -MCU = atmega103 +MCU = atmega1284p FORMAT = ihex TARGET = main -F_CPU = 4000000UL +F_CPU = 16000000UL SRC = $(TARGET).c plat.c $(TARGET)_nat.c $(TARGET)_img.c ASRC = OPT = s @@ -98,8 +98,9 @@ # Programming support using avrdude. Settings and variables. -AVRDUDE_PROGRAMMER = stk500v2 -AVRDUDE_PORT = /dev/cu.Pololu +AVRDUDE_PROGRAMMER = stk500v1 +AVRDUDE_PORT ?= /dev/tty.usbmodem* +AVRDUDE_BAUDRATE = 57600 AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex #AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep @@ -119,7 +120,7 @@ # to submit bug reports. #AVRDUDE_VERBOSE = -v -v -AVRDUDE_BASIC = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) +AVRDUDE_BASIC = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) -b $(AVRDUDE_BAUDRATE) AVRDUDE_FLAGS = $(AVRDUDE_BASIC) $(AVRDUDE_NO_VERIFY) $(AVRDUDE_VERBOSE) $(AVRDUDE_ERASE_COUNTER) diff -Naur src/platform/avr/pmfeatures.py ../p14p/src/platform/avr/pmfeatures.py --- src/platform/avr/pmfeatures.py 2012-09-14 11:26:42.000000000 +0200 +++ src/platform/avr/pmfeatures.py 2012-08-30 14:33:27.000000000 +0200 @@ -18,13 +18,13 @@ "HAVE_IMPORTS": True, "HAVE_DEFAULTARGS": True, "HAVE_REPLICATION": True, - "HAVE_CLASSES": False, - "HAVE_ASSERT": False, - "HAVE_GENERATORS": False, + "HAVE_CLASSES": True, + "HAVE_ASSERT": True, + "HAVE_GENERATORS": True, "HAVE_BACKTICK": True, "HAVE_STRING_FORMAT": True, - "HAVE_CLOSURES": False, + "HAVE_CLOSURES": True, "HAVE_BYTEARRAY": False, - "HAVE_DEBUG_INFO": False, + "HAVE_DEBUG_INFO": True, "HAVE_SNPRINTF_FORMAT": False, } diff -Naur src/platform/avr/plat.c ../p14p/src/platform/avr/plat.c --- src/platform/avr/plat.c 2012-09-14 11:26:42.000000000 +0200 +++ src/platform/avr/plat.c 2012-08-30 15:17:57.000000000 +0200 @@ -67,11 +67,21 @@ { /* PORT BEGIN: Set these UART/USART SFRs properly for your AVR */ +#if (__AVR_ATmega1284P__) + /* Set the baud rate register */ + UBRR0 = (F_CPU / (16UL * UART_BAUD)) - 1; + /* Set mode -- Asynch, 8-N-1 */ + UCSR0C = _BV(UCSZ01) | _BV(UCSZ00); + /* Enable the transmit and receive pins */ + UCSR0B = _BV(TXEN0) | _BV(RXEN0); +#elif (__AVR_ATmega103__) || (__AVR_ATmega128__) /* Set the baud rate register */ UBRR = (F_CPU / (16UL * UART_BAUD)) - 1; - /* Enable the transmit and receive pins */ UCR = _BV(TXEN) | _BV(RXEN); +#else +#error No USART configuration is implemented for this AVR. +#endif stdin = stdout = stderr = &avr_uart; /* PORT END */ @@ -80,18 +90,23 @@ /* PORT BEGIN: Configure a timer that fits your needs. */ /* Use T/C0 in synchronous mode, aim for a tick rate of * several hundred Hz */ -#if (TARGET_MCU == atmega103) || (TARGET_MCU == atmega128) +#if (__AVR_ATmega103__) || (__AVR_ATmega128__) /* set T/C0 to use synchronous clock */ ASSR &= ~(1<