I can't seem to find the term ATmega328PB anywhere here, but are there people who have used the ATmega328PB and programmed it using the Arduino IDE / toolkit?
The ATmega328PB has in interesting feature that I am interested in: a second twi port. Other chips also offer that but I like the fact that it is basically an ATmega328 chip so I know the chip quite well already.
Hmm, okay - yeah, some parts of the datasheet list it, others don't...
The pin diagram doesn't, the chart does, the SPI description mentions two SPI's, but the TWI and serial sections don't, and the register descriptions don't list the register names.
the datasheet says... nothing about a second UART, SPI, or TWI interface.
It mentions them in the "features" section, in table 6-1 "Port Function Multiplexing", and section 15.11 "Power Reduction Register", but not in the individual TWI/USART sections, and the control registers do not appear in the "register summary"... There is no "iom328pb.h" file in the latest Atmel Toolchain that defines anything specific to the PB chip, and it does not appear as a selectable device in the current version of Atmel Studio.
The ATmega168PB, announced at a similar time (Nov, 2014) but more available, does not list extra serial controllers.
Disappointing.
None of the usual distributers have the chips (although several have the Xplained mini eval board.) This is more typical of Atmel; being very slow to ship announced parts. Usually their documentation is in better shape during the "I want that and I can't get it yet" phase.
http://www.atmel.com/tools/atmelstudio.aspx?tab=overview
... ATmega328PB Part Pack for Atmel Studio 6.2 (37.9 MB, updated July 2015)
This bundle adds support for ATmega328PB device in Atmel Studio 6.2.SP2. Please see attached word file for more details.
And related code defining the second UART and TWI interface, and etc. So I guess they're real.
(A bit messy. TWBR0 and TWBR1 used to be bits in the TWBR register (which was stupid, anyway.) Now they're the bitrate registers for the two TWI peripherals...) (similarly for the other TWI registers, I guess.) (This probably means that adding support for the 2nd TWI interface is not going to be very easy; the existing code all assumes a single TWI interface with fixed TWBR/TWSR/etc registers.)
TW0-SDA on pin 27
TW0-SCL on pin 28
TW1-SDA on pin 3
TW1-SCL on pin 6
So I don't understand DrAzzy why you can't find it, it is just a matter of reading it carefully isn't it?! That those are not listed in the initial pin mappings is understandable since they are already showing too many features per pin.
@westfw: thanks for the insight. I ordered some of those evaluation boards, so will try it when I have them. I think this chip will be great for a lot of applications that require to make modular units in one's system (like my applications do).
jopiek:
Great that they updated the datasheet! You could also rework an SMD one of course.
Hello, we are trying to do it with an arduino UNO smd. we replaced the mcu with the PB one but it need a lot of changes in software. new chip ID, avrdude needs to be patched, bootloader not working, the arduino files need to be updated to support the new PB registers. there's a lot of work to do.
crackn:
trying to do it with an arduino UNO smd. we replaced the mcu with the PB one
I suppose you would have to avoid soldering down MCU pins 3 and 6 so you can use those for input/output. Did you bend up those legs and solder wires to them directly or something like that? And since pins 19 and 22 aren't used on the Uno did you do the same thing with those pins?
Hi, you dont need to avoid those pins, since i will not use them (3/6 are 2nd i2c and 19/22 are 2nd SPI). the problems are that arduino ide dont know that uno PB has 2 uarts and 5 timers, 2 SPI, 2 i2c... the arvdude need to be configured by hand to support the new chip ID.. even atmel studio needs a patch to work with 328PB.
I received some Engineering samples from a friend that works at Atmel.
it need a lot of changes in software. new chip ID, avrdude needs to be patched, bootloader not working, the arduino files need to be updated to support the new PB registers.
the big problem at the moment is that the compiler doesn't support the 328pb. You need a "snapshot" from Atmel just to support it under Atmel Studio, and the arduino compiler doesn't have those changes yet.
It should be "easy" to use the 328pb AS a 328p. It should be a lot like using a 328 (non-p) - load up a lying copy of optiboot (ie the standard 328p version), and tell everything else that you have a 328p. (of course, this doesn't give you access to the new features, which would be "nice.") I didn't have to make any changes to optiboot to get it working on an Atmel Xplained Mini 328pb eval board, other than setting the speed to 57600 because the mEDBG chip doesn't seem to work at 115200bps. (although you need mEDBG 1.6+ firmware to get auto-reset, and putting optiboot onto the 328pb currently requires Atmel Studio or some other heroics.)