PB12 vs. PA12 ? (Zero and M0 Pro)

Sorry if this subject has already been brought up.

Looking into the Zero and M0 Pro schematics, pin 21 which is called PA12/I2C/EIC/SCOM2PAD0+/TC2 is connected to a wire named PB12_S4_SPI_MISO. The ATSAMD21G18A chip has no PB12, as far as I could tell, but does indeed have a PA12.

I have noticed several clones, from other companies, with the same "PB12" pin.

Is this some feature which I am failing to understand? Or is it that the SPI MISO has never been used by anyone (on planet Earth, I guess) before?

Hi bowzee,

SPI MISO is connected to PA12.

You're right, the SAMD21G microcontroller used on the Arduino Zero/M0 Pro doesn't have a PB12 pin. This pin is only available on its larger sibling, the 64-pin SAMD21J variant.

Hi MartinL,

Thanks for the reply and confirmation. For me it is hard to understand/follow this issue. Under variants/arduino_zero" (I did not check other variants) the definitions in variant.h are:

#define PIN_SPI_MISO (22u)
#define PIN_SPI_MOSI (23u)
#define PIN_SPI_SCK (24u)

corresponding to these lines in the g_APinDescription array definition in variant.cpp:

index 22 -> { PORTA, 12 ... // MISO: SERCOM4/PAD[0]
index 23 -> { PORTB, 10 ... // MOSI: SERCOM4/PAD[2]
index 24 -> { PORTB, 11 ... // SCK: SERCOM4/PAD[3]

so MISO seems to be on PORTA and pin 12 and therefore the typo did not propagate.

Probably the Arduino development team will correct the typo at some point.