Why there are differentnt indications in pin assignments in Arduino Uno?

Hi, I am a beginner at Arduino. Sometimes I see statements like "PC[0..5] of ATMEL are the pins D[14..19] of Arduino", I am confused by different pin indications, and what does ATMEL mean in the statement? As the picture shows, PC0 is also indicated as A0, D14, or ADC[0], why is it?

Best regards

Fundamentally, it is because the Arduino IDE is meant to support many different processors. Each processor has its own pin numbering scheme. So the actual processor pins are connected to standard board pin numbers, so that projects can be moved easily between different boards (because the pin numbers don't have to change). It also helps support shields by following a fixed form factor - but shields aren't really used all that much by most experimenters.

ATMEL is a trade name used by the IC company MicroChip, that manufactures the ICs that are mostly used in Arduino boards (especially the "classic" ones - Nano, Uno, Mega...).

1 Like

That's only true for ATmega328p based Arduinos. In the Arduino world only the D[14..19] names are relevant, you don't have to care for what MCU pin name that's connected to.

The pin PC0 on the MCU is connected to the A0 pin of the board. D14 isn't official, it's just a result of the internal organization. The ADC[0] just shows (one of) the functionality(ies) the pins might have. This pinout picture isn't complete in that part so it's quite stupid to show that functionality but hide all the others (my opinion).

1 Like

Can I say PCx, PBx, PDx is the standard way of indicating the pins regardless of the type of board I am using, as in Arduino programming, there's PORTC, PORTB etc.

No, you can't say that, it's not true. Read a few processor data sheets and find out. But those are all mnenonics that actually refer only to specific bits in the MCU register array.

1 Like

No. Those names are only used for the "AVR" style microprocessors and only when using Direct Register Access. When you use Arduino functions: pinMode(), digitalRead(), digitalWrite(), analogRead(), analogWrite() you MUST use the Arduino pin names/numbers. Usually, the names/numbers printed on the board will work best.

For example on an ATmega328P Arduino UNO:
PB0 has the value 0 but matches to Arduino Pin 8.
PC0 also has the value 0 but matches to Arduino pin A0.
PD0 also has the value 0 but matches to Arduino pin 0.

They all have the value 0 because they are all the low-order bit of their respective PORT.

1 Like

Not always -- only during the execution of the following codes:

pinMode();
digitalWrite();

A0 is connected with Ch-0 of the internal ADC when the following code is executed:

analogRead(A0);
1 Like

Bullshit. The pin PC0 of the MCU is always connected to the A0 pin of the board on ATmega328p based Arduinos. It doesn't depend on the code being executed because the code executed doesn't change the PCB routing.

@pylon

1. Hopefully, the Fig-1 will bring some light to your door. By default SW1 is at closed position; as a result, A0-pin of the edge connector of UNO is connected with PC0-pin of Port-C to support digitalWrite(), digitalRead(), and pinMode() instructions.

PC0-ADC0
Figure-1:

2. After the execution of analogRead(A0) instruction, SW1 (Fig-1) gets opened and SW2 (Fig-1) gets closed; as a result, A0-pin is connected with ADC0-pin (Ch-0) of the ADC Module (Fig-1).

3. That's why the official pin diagram of ATmega328P is like Fig-2; where, pin-23 is shown to have alternate functions -- PC0 or ADC0 or PCINT8.

atmega328pPicture
Figure-2:

4. Self quiz -- To close SW3 of Fig-1, what instructions are to be executed by the user?

I have no problems with light. Check it yourself, Arduino UNO pin A0 is always connected to pin 23 of the DIP case of the ATmega328p. As you can see on the picture you posted that pin is called PC0. Quod erat demonstrandum.

The above saying is not right.

Fig-1 of post #9 shows that A0-pin has isolation from PC0-pin via SW1.

Pin-23 is not associated with any signal until we assign so which could be PC0 or ADC0 or PCINT8.

It is not a PC0-pin like Pin-21 which is a AREF-pin (Fig-2 of post #9).

Bullshit! Were talking about pins here, not functionality!
A0 is connected to pin PC0.

Don't confuse beginners with wrong information that is only relevant if someone uses register-direct programming and not the Arduino libraries.

Pin 23 of the DIL case is called "PC0" (see datasheet). It doesn't matter that one functionality of that pin is bit 0 of port C (often also called PC0) the pins has the name "PC0" to have a common name for all case variants.

We may read the data sheets that talk about alternate functions of the physical pins of the ATmega328P MCU and only then we will be able to understand that PC0 signal belongs to Port-C Register and not to Pin-23. We assign PC0 name to pin-23 when we select alternate function of pin-23 to work as IO pin. Similarly, we assign ADC0 name to pin-23 when we select alternate function of pin-23 to work as analog pin.

Pin PC0 is pin 23 for the DIL casing,for the MLF28 casing it's pin 19. You have have to insist on your opinion and confuse beginners with irrelevant information.

I repeat: Pin A0 of the UNO board is always connected to pin PC0 of the processor, no matter which casing the processor uses.

That's why people spend a lot of time to study what are called:
Internal Architecture and
External Architecture

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.