Pages: [1] 2   Go Down
Author Topic: Atmega328 vs Atmega328p....what are the differences?  (Read 10819 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 1
Posts: 36
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

title says it all, what are the differences?  i am thinking there would be an issue burning a bootloader to the 328 since it is probably expecting the 328p, and is the 328 newer or older than the 328p?  everything i have has a 328p in it but the 328 is $1 cheaper and that adds up quick in volume, so please let me know the difference.

bob
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 178
Posts: 12288
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


Looks like the P uses a bit less power and has a few more machine instructions.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I think this link would be useful
http://www.digitalmisery.com/2011/11/arduino-bootloader-with-atmega328-and-atmega328p/
Logged

South Texas
Offline Offline
Edison Member
*
Karma: 8
Posts: 1023
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The 2 devices have a different signature. I added the 328 to my Arduino and AVRDude files so that makes it easier to burn a bootloader. Once the bootloader is loaded they are interchangeable in the Uno board so the Uno config is sufficient to program them. I have a couple 328's that I have installed the bootloader on. they have all been in my arduino board and also in a wireless breadboard that has a MAX232 for a serial interface. Once the bootloader is loaded they all function the same with the ArduinoIDE.

Functionally I think the only real difference is in low power operation.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 443
Posts: 23837
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

In addition to the power usage difference and the signature byte difference:

There's a Brownout difference:

BOD disable only available in picoPower devices ATmega48PA/88PA/168PA/328P
BODS and BODSE only available for picoPower devices ATmega48PA/88PA/168PA/328P

There's a couple of instruction differences, see page 522:
BRANCH INSTRUCTIONS
 
Mnemonics       Operands      Description                   Operation      Flags      #Clocks
JMP(1)              k                   Direct Jump                  PC <-- k          None      3
CALL(1)             k                   Direct Subroutine Call   PC <-- k         None      4

Note: 1. These instructions are only available in ATmega168PA and ATmega328P.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

the land of sun+snow
Offline Offline
Faraday Member
**
Karma: 149
Posts: 2790
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Bob, on a slightly different tack, is there a difference, other than the chip-signature,
between using a 1284 versus 1284P chip with the Bobuino or other 1284P bootloader?

Also, what does the pins.ods file in the Bobuino variant directory do?
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 443
Posts: 23837
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Dan,
What you can is is browse the spec
http://www.atmel.com/Images/doc8272.pdf
(which I can't seem to download at the moment)
and search/find all occurrences of 'atmega2184p' which will find all the instances of uniquenesses of atmega1284p vs all the samenesses between 1284/p.
pico power, signature bytes, brownout detection might be 1 or 2 other things.

I don't know what pins.ods does, need to open when I get home & see.  maniacbug put all that together, the pins_arduino.h was modified for my board types, the other files are all likely the same.

I think the 1284 boards all point to same bootloader - check the boards.txt to confirm.
I can upload the one I am using, which flashes the SCK pin after the install. I think it is the same as what is on the github site.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 443
Posts: 23837
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Finally downloaded, the May 2012 complete version.
Page 62,63 - interrupt difference

For the charts that start at Section 28 & 29, you'd have to look at the two side by side to see the difference between non-Pico and Pico power.


Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 331
Posts: 16548
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Finally downloaded, the May 2012 complete version.
Page 62,63 - interrupt difference

For the charts that start at Section 28 & 29, you'd have to look at the two side by side to see the difference between non-Pico and Pico power.




Seems the P version has a timer3 that the non P doesn't, that's rather significant. Does manics port define and support timer 3?
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 331
Posts: 16548
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Dan,
What you can is is browse the spec
http://www.atmel.com/Images/doc8272.pdf
(which I can't seem to download at the moment)
and search/find all occurrences of 'atmega2184p' which will find all the instances of uniquenesses of atmega1284p vs all the samenesses between 1284/p.
pico power, signature bytes, brownout detection might be 1 or 2 other things.

I don't know what pins.ods does, need to open when I get home & see.  maniacbug put all that together, the pins_arduino.h was modified for my board types, the other files are all likely the same.

I think the 1284 boards all point to same bootloader - check the boards.txt to confirm.
I can upload the one I am using, which flashes the SCK pin after the install. I think it is the same as what is on the github site.

I opened a pins.ods file and it opened up into an open office spreadsheet, so perhaps it's just an aid/tool he uses to build his various custom pins_arduino.h file?

Lefty
Logged

the land of sun+snow
Offline Offline
Faraday Member
**
Karma: 149
Posts: 2790
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks, I looked at the 584 page d/s, and decided it was easier to ask the experts!

BTW, out of stupidity, I bought a couple of the atmega1284-PU chips instead of the
atmega1284P-PU chips, and to burn the bootloader, I found I had to track down the
avrdude.conf file and change to the chip-signature to that for the 1284. Then, it
burned the bootloader ok using the ArduinoISP sketch from a UNO chip.

However, to download sketches into the 1284 bootloader chip using the IDE, I then
had to change avrdude.conf back to the original 1284P chip-signature. Interesting.

Also, thanks for building the Bobuino bootloader. It's much more Arduino
pin-compatible than the others.
« Last Edit: January 11, 2013, 03:25:07 pm by oric_dan(333) » Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 443
Posts: 23837
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You're welcome. However:
I didn't build the bootloader, I just developed the pinout I wanted.
maniacbug did the software. I had something mangled together for IDE -0023, but the change for 1.0 was more than I was able to figure out.

I think you can copy the 1284P section in avrdude.conf, call it mega1284.
Then do the same in boards.txt, make a new section with new name and call out mega1284 vs mega1284p
Should let you have 2 versions and not have to switch back & forth.
Worth a shot anyway!
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 331
Posts: 16548
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Also, thanks for building the Bobuino bootloader. It's much more Arduino
pin-compatible than the others.

Again the bootloader used has nothing to do with the pin abstraction defined with the custom pins_arduino.h file used for a modified core. The bootloader used is reflected in the boards.txt entry of a specific board selection and tells the IDE the baudrate used for the bootloader as well as the memory size and the fuse and lock bit values used. The pins_arduino.h file is where one defines the abstracted arduino pin numbers to the physical port.pin numbers of the chip.

Lefty


Logged

vermont
Offline Offline
Sr. Member
****
Karma: 6
Posts: 267
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Seems the P version has a timer3 that the non P doesn't, that's rather significant. Does manics port define and support timer 3?

that is an error in the datasheets. there is no difference in timers between the two chips.
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 331
Posts: 16548
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Seems the P version has a timer3 that the non P doesn't, that's rather significant. Does manics port define and support timer 3?

that is an error in the datasheets. there is no difference in timers between the two chips.

I don't think so. I didn't even know there was a non-P version of the 1284 before today, but that latest datasheet showing a non-P chip version avalible is pretty consistent through out that the timer3 (of timer0 through timer3) in not applicable to the non-P chip. Even the front page summary has:

Quote
Peripheral Features
– Two 8-bit Timer/Counters with Separate Prescalers and Compare Modes
One/two 16-bit Timer/Counter with Separate Prescaler, Compare Mode, and Capture Mode

I take that to mean the 1284P has 2 8 bit timers and 2 16 bit times, where as the non-P has two 8 bit timers but only one 16 bit timer.

You disagree, if so why?

Edit: Interesting, if you look at the cover sheet page of a old data sheet it states:

Quote
• Peripheral Features
– Two 8-bit Timer/Counters with Separate Prescalers and Compare Modes
One 16-bit Timer/Counter with Separate Prescaler, Compare Mode, and Capture Mode

So comparing the two datasheets ( 8272A–AVR–01/10 Vs  8272D–AVR–05/12 ) it would seem that the 1284P gained a fourth timer rather then the non-P losing a timer it never had. Pretty confusing all in all.
Lefty
« Last Edit: January 11, 2013, 05:49:21 pm by retrolefty » Logged

Pages: [1] 2   Go Up
Jump to: