Skip to content

Instantly share code, notes, and snippets.

@colesnicov
Forked from goncalor/atmega328pb.markdown
Created December 6, 2020 13:52
Show Gist options
  • Save colesnicov/22be7acea79373c8b5ed47a6044bb1b8 to your computer and use it in GitHub Desktop.
Save colesnicov/22be7acea79373c8b5ed47a6044bb1b8 to your computer and use it in GitHub Desktop.
How to add support for ATmega328PB to arv-gcc and avrdude

Adding support for ATmega328PB to arv-gcc and avrdude

avr-gcc

  1. Download ATmega's support pack from Microchip's website

  2. Unzip the relevant files

     unzip -j Atmel.ATmega_DFP.x.y.zzz.atpack \
     gcc/dev/atmega328pb/avr5/crtatmega328pb.o \
     gcc/dev/atmega328pb/avr5/libatmega328pb.a \
     include/avr/iom328pb.h
    
  3. Place the .o and .a files in /usr/avr/lib/avr5/

  4. Place the .h file in /usr/avr/include/avr/

  5. Add the following to /usr/avr/include/avr/io.h

     #elif defined (__AVR_ATmega328PB__) || defined (__AVR_ATmega328__)
     #  include <avr/iom328pb.h>
    

All set. Ready to compile.

avrdude

Add the following to /etc/avrdude.conf, right below the definition for ATmega328P.

part parent "m328"
	id          = "m328pb";
	desc        = "ATmega328PB";
	signature   = 0x1e 0x95 0x16;

	ocdrev      = 1;
;

Happy flashing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment