I saw some notes about this in the 328PB manual for it being code compatible with 328P, but I wonder if the same holds true for the 324PB. I didn't see it in the datasheet but perhaps I didn't search enough. Can the 324PB be a drop in replacement and use the same code as a 324P ?
324PB compatible with 324P ?
Can the 324PB be a drop in replacement ...
... and use the same code as a 324P ?
mega4809 is the follow-on to mega324PB.
AN_42769 AVR42769: Differences Between ATmega324 and ATmega324PB
via ATmega324PB - 8-bit PIC Microcontrollers
ATMEGA4809 - 8-bit AVR Microcontrollers - Microcontrollers and Processors
edit : mega3209 is sampling
ATMEGA3209 - 8-bit Microcontrollers
edit2 : https://new.microchipdirect.com/product/search/all/ATmega3209
I think it is similar to 328PB in that sense. I think existing 324 code will work on 324PB. I also thought that it could be a drop in replacement hardware-wise (as long as you don't use things like full swing crystal).
Edit: typo
Was there going to be a 644PB, but then the 0-series came along?
Who knows. There is no 164PB either (unlike 328PB, which was later followed by 168PB/88PB/48PB). Where the 0-series fit into this - no idea. It's a completely different thing altogether.
PB is PIN compatible.
PB is NOT oscillator compatible (PB has no full-swing oscillator). Have not checked what happens if you use a full-swing oscillator fuse setting on a PB.
For the features that are exactly in common between P and PB, register function appears identical and at the same memory addresses. This SHOULD make P code directly executable on PB.
PB has different signature than P.
PB, of course, has additional features compared to P. So, code written for PB will NOT be backward compatible if any of the new features are accessed.
Jim
Where the 0-series fit into this - no idea.
mega324PB has an automotive version whereas automotive has yet to arrive for megaAVR 0-series.
It's a completely different thing altogether.
edit : strikethru
automotive AVR :
- mega168PA
- mega32C1
- mega64C1
- XMEGA64D3
- tinyAVR 1-series (tiny416, tiny417, tiny816, tiny817, tiny1616, tiny1617)
edit2 : un-strikethru
- mega324PB (-ABT, -MBT)
edit3 : https://new.microchipdirect.com/product/ATMEGA324PB-AUTOMOTIVE
"0-series" ... "CPU's the same" - it looks that this is the only thing that is the same. The rest is different. So we basically have (at least) 3 very different series: the original AVR, XMEGA, 0-series.
... (as long as you don't use think like full swing crystal).
Epson Toyocom
TSX-3225 16.0000MF09Z-AC3
16MHz uXtal, 3.2 x 2.5 mm SMD, CL=9pF, 15PPM, ESR=80ohm(Max ...
CPU's the same, memory is unified, I/O is different, power may be reduced.
Actually, the differences are deep enough to consider the CPU is _not_ the same. AVR-0/1 uses the same instruction set, yes, but:
- registers are not memory mapped
- some instructions have different (usually faster) timings -> this one for sure means the CPU is different. The timings are similar to a xmega CPU.
I don't know about the 324 series, but the 328P and 328PB have different pinouts, so they are not really drop-in replacements. You could mount a 32 pin 328PB in place of a 32 pin 328P, but some power traces will be permanently connected to I/O pins, increasing the risk of something going very bad. A program error could cause a short.
edit: there is an appnote on 328P/PB differences http://www.microchip.com//wwwApp...
The timings are similar to a xmega CPU.
https://www.avrfreaks.net/forum/megaavr-0-series?page=3#comment-2597036
alank2,
when in doubt best is to compare the datasheets.
firs and most profound difference is that there are "extra" io pins and thus functionality. 2 power pins have been converted into IO lines and ADC lines have gotten IO functionality.
This means you need different IO configurations for both. not only IO line wise, but also for instance when using the ADC on these channels you most likely need to now disable the internal digital IO block to be able to do a good ADC reading ( have not checked beyond pinout differences)
So although they fit on the same footprint and in general seem to be "compatible" there are subtle changes/differences that will need effort and thus different code.
Did not catch the converted power pins. That makes PB a "migration" from P, but not truly pin compatible.
Jim