arduino / ArduinoCore-sam

81 stars 108 forks source link

SPI pins #98

Closed iddq closed 4 years ago

iddq commented 4 years ago

SPI0_NPCS0 is PA28 and that is PIN 111 on the 144 pins package

Why is it 77 here?

https://github.com/arduino/ArduinoCore-sam/blob/eed66e7977b4037f49bbcd832437d4bcf72c0f3f/variants/arduino_due_x/variant.h#L108

per1234 commented 4 years ago

77 is the Arduino pin number. This is just an arbitrary number used to refer to the pins in Arduino IO functions (e.g., pinMode, digitalRead, digitalWrite). Arduino pin numbers don't necessarily have any relation to the physical pin number.

iddq commented 4 years ago

Thanks. Can I find a schematic that uses this numbering? Can you please tell me which pin is used for SPI CS (Chip Select) by default if I'm not providing any pin number at SPI.begin() ?

per1234 commented 4 years ago

The Due's schematic and pin mapping table are both available on the "Documentation" tab of the Due's product page: https://store.arduino.cc/arduino-due

But this isn't the appropriate place for this sort of discussion. This issue tracker is meant to be used only for reporting bugs and submitting feature requests. For general assistance, the appropriate place is the Arduino Forum. We're happy to provide all the assistance you need over there.