Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Hardware
  3. Upgrade to ATMega328pb

Upgrade to ATMega328pb

Scheduled Pinned Locked Moved Hardware
8 Posts 4 Posters 14.3k Views 4 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • YveauxY Offline
    YveauxY Offline
    Yveaux
    Mod
    wrote on last edited by Yveaux
    #1

    Hey there!
    After reading this topic, I recently ordered an ATMega328pb, the successor of the ATMega328p.
    We all know the ATMega328p which is used on e.g. Arduino UNO & Pro-Mini boards.
    An extensive overview of all differences can be read here.
    In short, the new ATMega328pb has a lot of new features, it's footprint is nearly identical to the ATMega328p and it is binary compatible with its predecessor.
    This means you can download a regular ATMega328p binary to it and it will just run!

    As the proof is in the pudding, a single TQFP PB was ordered and it arrived safely at my desk.
    I took a 5V/16MHz Pro-Mini from China, and removed the ATMega328p using hot-air:

    0_1464369529883_2016-05-27 14.48.54.jpg

    As said, the footprint is nearly identical, except for power pins 3 & 6, which are used as IO pins on the PB. I don't feel happy feeding 5V into a pin configured as output, so I decided to simply remove pads 3 & 6 from the PCB (inside the red cicle).
    I soldered the new PB in place (not cleaned yet, and a bit misaligned ;-) ):

    0_1464369790835_2016-05-27 14.56.45.jpg

    Took out the JTAGICE3 ISP programmer, and it was recognized with the PB device signature 0x1E9516!

    Now there are two ways to go:

    1. Program a 'regular' ATMega328p Arduino bootloader (e.g. optiboot) and use the device from the Arduino IDE as a regular ATMega328P (UNO/Pro Mini/...)
    2. Program a specific ATMega328pb Arduino bootloader (e.g. modified optiboot) and use the device from the Arduino IDE as ATMega328PB (no Arduino boards yet -- but I think I just created one)

    Thanks to the guys at Watterott the optiboot bootloader for both configurations can be downloaded from here.
    They also created a board package for the PB version.
    Update Apparently Elektor also did their own board support and peripheral implementation (of course not compatible with Watterott...). More info can be found here.

    Following steps describe how to get things going (for now, May 27, 2016 as stuff probably develops rapidly), with Arduino IDE 1.6.9, on Windows:

    Use as 'regular' ATMega328p

    • Program the ATMega328p optiboot bootloader ('optiboot_m328p.hex') using ISP.
    • Set fuses to: Extended 0xF5, High 0xDA, Low 0xFF (for 16Mhz external crystal/resonator!)
    • Now the chip can be programmed from the Arduino IDE as if it were a regular ATMega328p based board!

    Use as ATMega328pb

    • Program the ATMega328pb optiboot bootloader ('optiboot_m328pb.hex') using ISP.
    • Set fuses to: Extended 0xF5, High 0xDA, Low 0xFF (for 16Mhz external crystal/resonator!)
    • Install the Watterott board location into the IDE (Preferences -> Additional board manager URLs. Add https://github.com/watterott/ATmega328PB-Testing/raw/master/package_m328pb_index.json)
    • Install Board support for ATmega328PB Boards (currently at revision 1.0.1)
    • Restart the IDE
    • Select e.g. the blink sketch, select Board 'Atmel ATmega328PB Crystal Clock', 16MHz
    • and upload the sketch!

    Support for all the extra peripherals in the PB is still ongoing. I expect it to get really up to speed the moment Arduino releases a PB based board. Watterott is already selling PB boards, as is Elektor, and probably others.

    Have fun!

    http://yveaux.blogspot.nl

    1 Reply Last reply
    3
    • AnticimexA Offline
      AnticimexA Offline
      Anticimex
      Contest Winner
      wrote on last edited by
      #2

      Cool stuff! I see one thing in particular; 9 byte unique serial. If you like, feel free to add to the software signing backend and the securitypersonalizer a way to use this as serial for whitelisting :)

      Do you feel secure today? No? Start requiring some signatures and feel better tomorrow ;)

      YveauxY 1 Reply Last reply
      0
      • AnticimexA Anticimex

        Cool stuff! I see one thing in particular; 9 byte unique serial. If you like, feel free to add to the software signing backend and the securitypersonalizer a way to use this as serial for whitelisting :)

        YveauxY Offline
        YveauxY Offline
        Yveaux
        Mod
        wrote on last edited by
        #3

        @Anticimex this feature also caught my eye. Up next is gaining control over these new features :sunglasses:

        http://yveaux.blogspot.nl

        AnticimexA 1 Reply Last reply
        0
        • YveauxY Yveaux

          @Anticimex this feature also caught my eye. Up next is gaining control over these new features :sunglasses:

          AnticimexA Offline
          AnticimexA Offline
          Anticimex
          Contest Winner
          wrote on last edited by
          #4

          @Yveaux Runtime detection can make it even simpler to use for the security :) but might be confusing if someone wants to use soft signing and set a soft serial :P

          Do you feel secure today? No? Start requiring some signatures and feel better tomorrow ;)

          YveauxY 1 Reply Last reply
          0
          • AnticimexA Anticimex

            @Yveaux Runtime detection can make it even simpler to use for the security :) but might be confusing if someone wants to use soft signing and set a soft serial :P

            YveauxY Offline
            YveauxY Offline
            Yveaux
            Mod
            wrote on last edited by
            #5

            @Anticimex quick experiment:

            #define DEVID0 _SFR_IO8(0xF0)
            #define DEVID1 _SFR_IO8(0xF1)
            #define DEVID2 _SFR_IO8(0xF2)
            #define DEVID3 _SFR_IO8(0xF3)
            #define DEVID4 _SFR_IO8(0xF4)
            #define DEVID5 _SFR_IO8(0xF5)
            #define DEVID6 _SFR_IO8(0xF6)
            #define DEVID7 _SFR_IO8(0xF7)
            #define DEVID8 _SFR_IO8(0xF8)
            
            void setup()
            {
              Serial.begin(115200);
              Serial.print(DEVID0, HEX); Serial.print(" ");
              Serial.print(DEVID1, HEX); Serial.print(" ");
              Serial.print(DEVID2, HEX); Serial.print(" ");
              Serial.print(DEVID3, HEX); Serial.print(" ");
              Serial.print(DEVID4, HEX); Serial.print(" ");
              Serial.print(DEVID5, HEX); Serial.print(" ");
              Serial.print(DEVID6, HEX); Serial.print(" ");
              Serial.print(DEVID7, HEX); Serial.print(" ");
              Serial.print(DEVID8, HEX); Serial.print(" ");
              Serial.println("");
            }
            
            void loop() {
            }
            

            Result:

            81 1 D A 0 6E 61 6E 0 
            

            Now I need another PB to see if it is different ;-)

            http://yveaux.blogspot.nl

            AnticimexA 1 Reply Last reply
            1
            • YveauxY Yveaux

              @Anticimex quick experiment:

              #define DEVID0 _SFR_IO8(0xF0)
              #define DEVID1 _SFR_IO8(0xF1)
              #define DEVID2 _SFR_IO8(0xF2)
              #define DEVID3 _SFR_IO8(0xF3)
              #define DEVID4 _SFR_IO8(0xF4)
              #define DEVID5 _SFR_IO8(0xF5)
              #define DEVID6 _SFR_IO8(0xF6)
              #define DEVID7 _SFR_IO8(0xF7)
              #define DEVID8 _SFR_IO8(0xF8)
              
              void setup()
              {
                Serial.begin(115200);
                Serial.print(DEVID0, HEX); Serial.print(" ");
                Serial.print(DEVID1, HEX); Serial.print(" ");
                Serial.print(DEVID2, HEX); Serial.print(" ");
                Serial.print(DEVID3, HEX); Serial.print(" ");
                Serial.print(DEVID4, HEX); Serial.print(" ");
                Serial.print(DEVID5, HEX); Serial.print(" ");
                Serial.print(DEVID6, HEX); Serial.print(" ");
                Serial.print(DEVID7, HEX); Serial.print(" ");
                Serial.print(DEVID8, HEX); Serial.print(" ");
                Serial.println("");
              }
              
              void loop() {
              }
              

              Result:

              81 1 D A 0 6E 61 6E 0 
              

              Now I need another PB to see if it is different ;-)

              AnticimexA Offline
              AnticimexA Offline
              Anticimex
              Contest Winner
              wrote on last edited by
              #6

              @Yveaux yeah, would be pretty embarrassing for Atmel if they turn out to be identical :)

              Do you feel secure today? No? Start requiring some signatures and feel better tomorrow ;)

              1 Reply Last reply
              0
              • NeverDieN Offline
                NeverDieN Offline
                NeverDie
                Hero Member
                wrote on last edited by NeverDie
                #7

                Great OP. Any updates?

                I'm frankly surprised that neither sparkfun nor adafruit nor arduino have come out with a board for it. What gives?

                1 Reply Last reply
                0
                • N Offline
                  N Offline
                  Nikhil R
                  Banned
                  wrote on last edited by
                  #8
                  This post is deleted!
                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  32

                  Online

                  11.7k

                  Users

                  11.2k

                  Topics

                  113.1k

                  Posts


                  Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • MySensors
                  • OpenHardware.io
                  • Categories
                  • Recent
                  • Tags
                  • Popular