avr: Add support for atmega328p

The atmega328p is basically the same as the atmega328 - add explicit
support for it so that avrdude doesn't complain while flashing.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2018-10-29 11:55:15 -04:00
parent 90bc3be6a0
commit 8432f6f40c
3 changed files with 11 additions and 6 deletions

View File

@ -38,7 +38,8 @@ def beaglebone_pins():
return gpios return gpios
MCU_PINS = { MCU_PINS = {
"atmega168": port_pins(5), "atmega328": port_pins(5), "atmega168": port_pins(5),
"atmega328": port_pins(5), "atmega328p": port_pins(5),
"atmega644p": port_pins(4), "atmega1284p": port_pins(4), "atmega644p": port_pins(4), "atmega1284p": port_pins(4),
"at90usb1286": port_pins(6), "at90usb646": port_pins(6), "at90usb1286": port_pins(6), "at90usb646": port_pins(6),
"atmega1280": port_pins(12), "atmega2560": port_pins(12), "atmega1280": port_pins(12), "atmega2560": port_pins(12),
@ -107,6 +108,7 @@ Arduino_Due_analog = [
Arduino_from_mcu = { Arduino_from_mcu = {
"atmega168": (Arduino_standard, Arduino_analog_standard), "atmega168": (Arduino_standard, Arduino_analog_standard),
"atmega328": (Arduino_standard, Arduino_analog_standard), "atmega328": (Arduino_standard, Arduino_analog_standard),
"atmega328p": (Arduino_standard, Arduino_analog_standard),
"atmega644p": (Sanguino, Sanguino_analog), "atmega644p": (Sanguino, Sanguino_analog),
"atmega1280": (Arduino_mega, Arduino_analog_mega), "atmega1280": (Arduino_mega, Arduino_analog_mega),
"atmega2560": (Arduino_mega, Arduino_analog_mega), "atmega2560": (Arduino_mega, Arduino_analog_mega),

View File

@ -30,6 +30,8 @@ choice
bool "atmega1284p" bool "atmega1284p"
config MACH_atmega644p config MACH_atmega644p
bool "atmega644p" bool "atmega644p"
config MACH_atmega328p
bool "atmega328p"
config MACH_atmega328 config MACH_atmega328
bool "atmega328" bool "atmega328"
config MACH_atmega168 config MACH_atmega168
@ -40,6 +42,7 @@ config MCU
string string
default "atmega168" if MACH_atmega168 default "atmega168" if MACH_atmega168
default "atmega328" if MACH_atmega328 default "atmega328" if MACH_atmega328
default "atmega328p" if MACH_atmega328p
default "atmega1284p" if MACH_atmega1284p default "atmega1284p" if MACH_atmega1284p
default "atmega644p" if MACH_atmega644p default "atmega644p" if MACH_atmega644p
default "at90usb1286" if MACH_at90usb1286 default "at90usb1286" if MACH_at90usb1286
@ -58,7 +61,7 @@ choice
prompt "Processor speed" prompt "Processor speed"
config AVR_FREQ_20000000 config AVR_FREQ_20000000
bool "20Mhz" bool "20Mhz"
depends on MACH_atmega168 || MACH_atmega328 || MACH_atmega644p || MACH_atmega1284p depends on MACH_atmega168 || MACH_atmega328 || MACH_atmega328p || MACH_atmega644p || MACH_atmega1284p
config AVR_FREQ_16000000 config AVR_FREQ_16000000
bool "16Mhz" bool "16Mhz"
config AVR_FREQ_8000000 config AVR_FREQ_8000000
@ -133,7 +136,7 @@ config SERIAL_PORT
default 0 default 0
config SIMULAVR config SIMULAVR
depends on MACH_atmega168 || MACH_atmega328 || MACH_atmega644p || MACH_atmega1284p depends on MACH_atmega168 || MACH_atmega328 || MACH_atmega328p || MACH_atmega644p || MACH_atmega1284p
bool "Compile for simulavr software emulation" bool "Compile for simulavr software emulation"
default n default n
help help

View File

@ -159,7 +159,7 @@ static const struct gpio_pwm_info pwm_regs[] PROGMEM = {
}; };
static const uint8_t pwm_pins[ARRAY_SIZE(pwm_regs)] PROGMEM = { static const uint8_t pwm_pins[ARRAY_SIZE(pwm_regs)] PROGMEM = {
#if CONFIG_MACH_atmega168 || CONFIG_MACH_atmega328 #if CONFIG_MACH_atmega168 || CONFIG_MACH_atmega328 || CONFIG_MACH_atmega328p
GPIO('D', 6), GPIO('D', 5), GPIO('D', 6), GPIO('D', 5),
GPIO('B', 1), GPIO('B', 2), GPIO('B', 1), GPIO('B', 2),
GPIO('B', 3), GPIO('D', 3), GPIO('B', 3), GPIO('D', 3),
@ -264,7 +264,7 @@ gpio_pwm_write(struct gpio_pwm g, uint8_t val)
****************************************************************/ ****************************************************************/
static const uint8_t adc_pins[] PROGMEM = { static const uint8_t adc_pins[] PROGMEM = {
#if CONFIG_MACH_atmega168 || CONFIG_MACH_atmega328 #if CONFIG_MACH_atmega168 || CONFIG_MACH_atmega328 || CONFIG_MACH_atmega328p
GPIO('C', 0), GPIO('C', 1), GPIO('C', 2), GPIO('C', 3), GPIO('C', 0), GPIO('C', 1), GPIO('C', 2), GPIO('C', 3),
GPIO('C', 4), GPIO('C', 5), GPIO('E', 0), GPIO('E', 1), GPIO('C', 4), GPIO('C', 5), GPIO('E', 0), GPIO('E', 1),
#elif CONFIG_MACH_atmega644p || CONFIG_MACH_atmega1284p #elif CONFIG_MACH_atmega644p || CONFIG_MACH_atmega1284p
@ -369,7 +369,7 @@ gpio_adc_cancel_sample(struct gpio_adc g)
* Serial Peripheral Interface (SPI) hardware * Serial Peripheral Interface (SPI) hardware
****************************************************************/ ****************************************************************/
#if CONFIG_MACH_atmega168 || CONFIG_MACH_atmega328 #if CONFIG_MACH_atmega168 || CONFIG_MACH_atmega328 || CONFIG_MACH_atmega328p
static const uint8_t SS = GPIO('B', 2), SCK = GPIO('B', 5); static const uint8_t SS = GPIO('B', 2), SCK = GPIO('B', 5);
static const uint8_t MOSI = GPIO('B', 3), MISO = GPIO('B', 4); static const uint8_t MOSI = GPIO('B', 3), MISO = GPIO('B', 4);
#elif CONFIG_MACH_atmega644p || CONFIG_MACH_atmega1284p #elif CONFIG_MACH_atmega644p || CONFIG_MACH_atmega1284p