vancegroup-mirrors / avr-libc

Automated svn2git mirror of avr-libc - link goes to upstream
98 stars 200 forks source link

PA0 == PB0 == PC0 == PD0 ? #1

Closed Sod-Almighty closed 5 years ago

Sod-Almighty commented 7 years ago

Shouldn't PAx, PBx, PCx and PDx be mapped to the Arduino pin numbers? They are in every other package. PA0 should not equal PB0.

ghost commented 5 years ago

@Sod-Almighty What do you mean "mapped to the Arduino pin numbers"? Why would that make sense?

Also, of course PA0 == PB0 == PC0 == PD0. They are all macros for 0.

Sod-Almighty commented 5 years ago

Well, it was two years ago, but presumably I meant it would be helpful if PB0 meant "whatever damn arbitrary number Arduino assigns to pin PB0".

After all, how is anyone supposed to know which pin "6" maps to on any given chip? You have to google it. And if it's not mentioned anywhere, you're screwed. I tried looking in the hardware folder for some kind of definition, but didn't find anything. Where are they defined? What is pin 4 on an ATtiny85, for instance?

rpavlik commented 5 years ago

Well, the meanings of those are set out in the datasheet (pa0 means GPIO port A, bit/pin 0 - it's a datasheet concept not an Arduino one, the Arduino pin numbers are indeed somewhat arbitrary so they are in a nice order on original Arduino boards), but that's neither here nor there. (And actually many of these files are generated automatically by atmel/microchip from their internal docs...)

I made this repo literally as just a "mirror" - copy with history - of the upstream avr-libc project (used by Arduino and others) so I could interact with a git repo instead of svn. Unfortunately at that time I couldn't disable issues on a repo. However, it's been years since this has been updated, issues can now be disabled, and I'd strongly recommend looking at upstream docs (search for avr-libc in your preferred search engine) if you're still having issues: it is very in depth though also fairly advanced. Code examples by others should also be helpful and hopefully easy to find - there is a lot of avr sample code out there, even for the attiny chips.

Good luck!