Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for AVR-USB-MCU-families ATmegaXYu2/4/6 and AT90USBXYZ6/7 eg. Arduino Uno USB-MCU / Micro #327

Merged
merged 10 commits into from
Oct 4, 2021
Merged
Prev Previous commit
Next Next commit
Correct transposed digits in UART register definitions for USB-MCUs
  • Loading branch information
Virtual-Java committed Oct 3, 2021
commit b82e1f3f9853c0e9570a2c58253c518c22b98f99
4 changes: 2 additions & 2 deletions optiboot/bootloaders/optiboot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -681,8 +681,8 @@ include Makefile.1284
include Makefile.custom
include Makefile.2560
include Makefile.tiny
include Makefile.MCUdude
include Makefile.USBMCUs
include Makefile.mcudude
include Makefile.usbmcus

BAUDCHECK=
ifndef PRODUCTION
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

HELPTEXT += "target atmega8/16/32u2, atmega16/32u4 - newer 32/44pin AVR-USB-MCUs \n"


#-----------------------
# ATmega 8u2
#-----------------------
Expand All @@ -25,10 +26,20 @@ atmega8u2atUART: AVR_FREQ ?= 16000000L
atmega8u2atUART: LDSECTIONS = -Wl,--section-start=.text=0x1e00 -Wl,--section-start=.version=0x1ffe
atmega8u2atUART: $(PROGRAM)_atmega8u2_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).hex
ifndef PRODUCTION
atmega8u2atUART1: $(PROGRAM)_atmega8u2_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).lst
atmega8u2atUART: $(PROGRAM)_atmega8u2_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).lst
endif
atmega8u2:
"$(MAKE)" atmega8u2atUART BAUD_RATE=115200 UART=1
"$(MAKE)" atmega8u2atUART UART=1

atmega8u2_isp: atmega8u2
atmega8u2_isp: TARGET = atmega8u2
atmega8u2_isp: MCU_TARGET = atmega8u2
atmega8u2_isp: HFUSE ?= DE # 512 byte boot, JTAG disabled
atmega8u2_isp: LFUSE ?= FF # Full Swing xtal (16MHz) 16KCK/14CK+65ms
atmega8u2_isp: EFUSE ?= FE # 2.7V brownout
atmega8u2_isp: LOCK ?= 2F # APP protect mode 1, BL protect mode 2
atmega8u2_isp: isp


#-----------------------
# ATmega 16u2
Expand All @@ -46,6 +57,16 @@ endif
atmega16u2:
"$(MAKE)" atmega16u2atUART UART=1

atmega16u2_isp: atmega16u2
atmega16u2_isp: TARGET = atmega16u2
atmega16u2_isp: MCU_TARGET = atmega16u2
atmega16u2_isp: HFUSE ?= DE # 512 byte boot, JTAG disabled
atmega16u2_isp: LFUSE ?= FF # Full Swing xtal (16MHz) 16KCK/14CK+65ms
atmega16u2_isp: EFUSE ?= FE # 2.7V brownout
atmega16u2_isp: LOCK ?= 2F # APP protect mode 1, BL protect mode 2
atmega16u2_isp: isp


#-----------------------
# ATmega 32u2
#-----------------------
Expand All @@ -62,6 +83,16 @@ endif
atmega32u2:
"$(MAKE)" atmega32u2atUART UART=1

atmega32u2_isp: atmega32u2
atmega32u2_isp: TARGET = atmega32u2
atmega32u2_isp: MCU_TARGET = atmega32u2
atmega32u2_isp: HFUSE ?= DE # 512 byte boot, JTAG disabled
atmega32u2_isp: LFUSE ?= FF # Full Swing xtal (16MHz) 16KCK/14CK+65ms
atmega32u2_isp: EFUSE ?= FE # 2.7V brownout
atmega32u2_isp: LOCK ?= 2F # APP protect mode 1, BL protect mode 2
atmega32u2_isp: isp


#-----------------------
# ATmega 16u4
#-----------------------
Expand All @@ -79,6 +110,16 @@ atmega16u4:
# disable blinking the LED to make the bootloader to fit in 512 Bytes Bootsection
"$(MAKE)" atmega16u4atUART UART=1

atmega16u4_isp: atmega16u4
atmega16u4_isp: TARGET = atmega16u4
atmega16u4_isp: MCU_TARGET = atmega16u4
atmega16u4_isp: HFUSE ?= DE # 512 byte boot, JTAG disabled
atmega16u4_isp: LFUSE ?= FF # Full Swing xtal (16MHz) 16KCK/14CK+65ms
atmega16u4_isp: EFUSE ?= FB # 2.6V brownout
atmega16u4_isp: LOCK ?= 2F # APP protect mode 1, BL protect mode 2
atmega16u4_isp: isp


#-----------------------
# ATmega 32u4
#-----------------------
Expand Down
16 changes: 8 additions & 8 deletions optiboot/bootloaders/optiboot/pin_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -501,20 +501,20 @@

#define TXB80 TXB81
#define RXB80 RXB81
#define UCSZ02 UCSZ21
#define UCSZ02 UCSZ12
#define TXEN0 TXEN1
#define RXEN0 RXEN1
#define UDRIE0 UDRIE1
#define TXCIE0 TXCIE1
#define RXCIE0 RXCIE1

#define UCPOL0 UCPOL1
#define UCSZ00 UCSZ01
#define UCSZ00 UCSZ10
#define UCSZ01 UCSZ11
#define USBS0 USBS1
#define UPM00 UPM01
#define UPM00 UPM10
#define UPM01 UPM11
#define UMSEL00 UMSEL01
#define UMSEL00 UMSEL10
#define UMSEL01 UMSEL11

/* Ports for soft UART */
Expand Down Expand Up @@ -547,20 +547,20 @@

#define TXB80 TXB81
#define RXB80 RXB81
#define UCSZ02 UCSZ21
#define UCSZ02 UCSZ12
#define TXEN0 TXEN1
#define RXEN0 RXEN1
#define UDRIE0 UDRIE1
#define TXCIE0 TXCIE1
#define RXCIE0 RXCIE1

#define UCPOL0 UCPOL1
#define UCSZ00 UCSZ01
#define UCSZ00 UCSZ10
#define UCSZ01 UCSZ11
#define USBS0 USBS1
#define UPM00 UPM01
#define UPM00 UPM10
#define UPM01 UPM11
#define UMSEL00 UMSEL01
#define UMSEL00 UMSEL10
#define UMSEL01 UMSEL11

/* Ports for soft UART */
Expand Down