Close

Enter the ATMega328PB

A project log for GPS Disciplined xCXO

A DIY GPS disciplined 10 MHz reference clock

nick-sayerNick Sayer 09/04/2016 at 20:390 Comments

ATmel really wants you to switch to the new B variant of the venerable ATMega328p. They're basically charging a 25% premium for the older part on DigiKey (T&R pricing, Q:2000).

To that end, this weekend I've updated my AVR toolchain to a variant that can support the 328pb and added support to the v4 firmware for it.

The current board should accept a 328pb with the updated firmware. Two of the otherwise unused port E bits are tied to either Vcc or GND because on the older part they were added supply pins. That should be harmless - the default configuration will make those pins inputs anyway. The next board will disconnect those pins, but there's no rush. First thing to do is buy a few 328PBs and try them out with the new code to make sure they work.

I'm still struggling with what to do about the FE5680A variant. I don't have a design for an upgraded version that takes the SkyTraq GPS module. The current design uses an ATTiny841, which has the ability to switch clock sources on the fly. This is necessary because before the 5680 obtains a physics lock, it's jittery enough that it upsets the 841 when it's used as a clock source. Neither the 328P nor 328PB have the ability to change clock sources other than with fuse changes. The 328PB has two serial ports, which is necessary for that variant, but it's unclear how it's going to work with the wonky pre-lock clock.

I could make a variant that keeps the ATTiny841 and simply replaces the GPS module, but there's no room in the flash for the code to perform the quantization error correction that we can get from that module.

EDIT: I got some 328PBs from DigiKey and they do work as a drop-in replacement for the 328P on the current versions of the boards. You can use the same firmware and fuse settings - all you have to do is add support to avrdude for the 328PB (it has a different device signature).

Discussions