This is a general question regarding Atmega328P.

While I was reading the datasheet of Atmega328P, I see that it has Ports B, C, and D.

So, I'm surprised to see that there is no PortA.

Is there a specific reason for it?

Datasheet for Atmega328P: http://www.atmel.com/Images/doc8161.pdf

  • \$\begingroup\$ AVRs are available in different packages where a single core may be available in packages with different numbers of available pins. Depending on the number of available pins certain ports/functions may be available or not in otherwise identical microcontroller models. (DIP usually has the lowest pin count.) \$\endgroup\$ – JimmyB Jul 20 '14 at 12:22

When a chip manufacturer designs a family of chips they will often start with an all singing, all dancing design with all the bells and whistles. They will then create cut-down versions of the chip by removing portions of the design, or sometimes just not connecting pins up.

The internals of the 328P will be based on a larger chip which does have a port A (as well as other ports). The removal of port A as opposed to another port would have had two considerations:

  1. What functions are shared with which port, and which can we do away with
  2. How easy would it be to move any extra functions to other pins
  3. How easy would it be to remove the port from the design

I would surmise that port A had few extra functions shared with its pins, and the port was simple to remove from the design and leave the chip suitable for use in a low pin count package.

And yes, the port A reference in the ADC section should read port C.


It does, but isn't clearly mentioned in the datasheet. Port A is the ADC 'port'.

It shares most of the pins of Port C (some packages have two extra ADC pins though). I think Atmel uses the Port C moniker for the 'digital' inputs on those pins, and Port A for the analog input. I agree it is confusing.

From page 251 of the datasheet: "The ADC is connected to an 8-channel Analog Multiplexer which allows eight single-ended voltage inputs constructed from the pins of Port A."

As such, my guess is that Port A represents the internal 8 connections to the ADC.

I just had a look at the Atmega16 Datasheet (http://www.atmel.com/Images/doc2466.pdf). This does have Port A dedicated to the ADC. As such, I think the CPU core is similar but the external pins are multiplexed. I guess for the Atmega8 series they should have dropped the Port A moniker completely to avoid confusion, or maybe they did and the ADC chapter in the datasheet is a typo as you mentioned in the comments.

  • \$\begingroup\$ If Port A is the ADC port, how does it compare to Port C? \$\endgroup\$ – jippie Jul 20 '14 at 8:24
  • \$\begingroup\$ I suspect that reference to Port A is just a typo. Other ATmegas missing port A don't have corresponding language in their data sheets. \$\endgroup\$ – microtherion Jul 20 '14 at 8:52
  • \$\begingroup\$ Hmm, that's entirely possible. I wonder why the two extra ADC ports on the SMD versions aren's part of port C. \$\endgroup\$ – RJR Jul 20 '14 at 9:59
  • \$\begingroup\$ Ah now I see where you are going 'wrong'. Always download the most recent version of the datasheet. Yours is stamped 07/2010, this one is stamped revision G , updated: 02/2013. \$\endgroup\$ – jippie Jul 20 '14 at 21:03

Always download the most recent version of the datasheet from the vendor's website.

On the Atmel website you'll find:

ATmega48A/PA/88A/PA/168A/PA/328/P Complete
( file size: 35MB , 660 pages , revision G , updated: 02/2013 )
                                         ^            ^^^^^^^

where there is no reference to Port A made anywhere.

  • \$\begingroup\$ Good - seems like they fixed the Port A moniker completely. I think the ATMega16 datasheet - which does have a Port A, indicates nicely how it got there in the first place. \$\endgroup\$ – RJR Jul 21 '14 at 0:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.