diff --git a/README.md b/README.md index 6f27f25..31978b6 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ For controlling the MCP2515 a modified version of the [Arduino MCP2515 CAN inter * [ATmega32](http://ww1.microchip.com/downloads/en/devicedoc/doc2503.pdf) * [ATmega328P](http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-7810-Automotive-Microcontrollers-ATmega328P_Datasheet.pdf) +* [ATmega328PB](https://ww1.microchip.com/downloads/en/DeviceDoc/40001906A.pdf) * [ATmega32U4](https://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-7766-8-bit-AVR-ATmega16U4-32U4_Datasheet.pdf) * [ATmega64](http://ww1.microchip.com/downloads/en/DeviceDoc/atmel-2490-8-bit-avr-microcontroller-atmega64-l_datasheet.pdf) * [ATmega644P](https://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-42744-ATmega644P_Datasheet.pdf) @@ -361,6 +362,10 @@ Additionally a *start app* command may be send at any time by the flash applicat ## Changelog +## 1.4.1 (2024-08-12) + +* Added support for _ATmega328PB_ + ## 1.4.0 (2023-06-12) * Added support for _ATmega32U4_ diff --git a/platformio.ini b/platformio.ini index 039e060..5d03cde 100644 --- a/platformio.ini +++ b/platformio.ini @@ -69,6 +69,15 @@ build_flags = ;board_fuses.hfuse = 0xD8 ;board_fuses.efuse = 0xFC +[env:ATmega328PB] +board = ATmega328PB +build_flags = + ${env.build_flags} + -Wl,--section-start=.text=0x7000 ; 2048 words bootloader, 0x3800 * 2 + +;board_fuses.lfuse = 0xFF +;board_fuses.hfuse = 0xD8 +;board_fuses.efuse = 0xFC [env:ATmega64] board = ATmega64 diff --git a/src/controllers.h b/src/controllers.h index 583a601..f9a2ccd 100644 --- a/src/controllers.h +++ b/src/controllers.h @@ -48,7 +48,7 @@ #define SPI_MISO 3 #define SPI_SCK 1 -#elif defined(__AVR_ATmega328P__) +#elif defined(__AVR_ATmega328P__) || defined(__AVR_ATmega328PB__) #define IV_REG MCUCR #define SPI_DDR DDRB