Close

Compiling for Atmega328PB

A project log for *uino Mini Super (Atmega328PB)

Next Gen Arduino Mini Pro with Atmega328PB

Andre MoehlAndre Moehl 01/24/2016 at 22:182 Comments

I will start to describe the problem to compiling software for the Atmega328PB.

As most people know, the Atmega328P is a very often used and older IC, which is supported by the gcc since a while. This chip is also used on a lot of Arduino Boards.

Atmel and also Arduino uses the gcc for compiling the sources. If you use the latest Atmel Studio under Windows you can compile a firmware for that chip.

IMHO: I don't recommend the Atmel Studio 7 as development tool. 
It is very, very slow and has a very weird menu structure. 
Completely unusable.

October 2015 Atmel send a patch to gcc which should add the support of these IC ( and some other more). But the problem is, it is a patch for the gcc 6.0.0 (gcc patch). Arduino itself uses the gcc 4.8.1, even in the latest IDE version 1.6.7.

So what I did till now:

I look deeper and found a Atmel Website with a Atmel Pack, which contains even the Atmega328PB xml file, the header and some other stuff.

I even found the Atmel Toolchain script. But also there is a helpful information, how to build the avr toolchain at the avrlibc website.

Later I will describe the toolchain build, why the Atmel script doesn't work for me and how I found a way to use Arduino.


Discussions

Alex wrote 01/27/2016 at 21:09 point

I am looking forward to see how you did connect this with the Arduino IDE. 

Is Atmel Studio 7 worse than 6.5? With 6.5 I did not had any problems yet. ( but I did not tested it for compiling code for a 328PB yet) .

  Are you sure? yes | no

Alex wrote 01/27/2016 at 22:18 point

So I did it checked for myself. I did installed Atmel Studio 7.0 and did compile some old project originally written for a Atmega238P for a ATmega328PB just by changing the target device. And I could not see any difference in speed. Of curse there are more menus than in the Ardunino IDE. But it is also much more advanced. 

  Are you sure? yes | no