MCUdude / MegaCoreX

An Arduino hardware package for ATmega4809, ATmega4808, ATmega3209, ATmega3208, ATmega1609, ATmega1608, ATmega809 and ATmega808
GNU Lesser General Public License v2.1
239 stars 47 forks source link

Nano 4808 pinout vs. 32-pin standard pinout #153

Closed rspy76 closed 1 year ago

rspy76 commented 1 year ago

Hi

First of all, many thanks for your work! I'm starting with the Atmega4808 and I'm studying your library and pinouts. There is one thing which confuses me a bit. To start with, I will use a board such as the Thinary Nano Every which uses a Atmega 4808 but then I will like to move to a custom PCB with a Atmega4808 chip which I then will program with UPDI. So, when I program for the Thinary Nano Every, the Arduino pins are mapped differently to the Port names in comparison to the 32-pin standard pinout. I don't understand why this is.

For example:

Is there a reason you chose different arduino pin numbers in these two pinouts even though the Thinary Nano Every uses the 32 pin Atmega4808?

Many thanks and best regards

grafik grafik

SpenceKonde commented 1 year ago

It's because the standard pinout was chosen to make logical sense, it starts at PA0 and proceeds counterclockwise, and the ports and pins within the ports are in order, while the thinary one matches the numbers of the pinsprinted on the board. which were located and numbered to be more nano like, Unfortunately, the nano 3.0 puts pins in a dumb order. Like almost every other Arduino board :-/ I believe MCUDude's cores supply the PIN_Pxn macros, so you can refer to pins by port and bit and eliminate all ambiguity. I am trying to slowly reduce the presence of user visible numbers in my core documentation, move toward exclusively calling pins by the PIN_xn macros (eg, PIN PA1, PIN_PD7 etc) especially since oon modern full size AVRs, special functions almost never get moved around between families. Note that the PIN_An macros are something totally different. My cores go even further and expect analogRead() to be passed a digital pin number or a special constant for internal channels

On Fri, Jul 8, 2022 at 5:55 AM rspy76 @.***> wrote:

Hi

First of all, many thanks for your work! I'm starting with the Atmega4808 and I'm studying your library and pinouts. There is one thing which confuses me a bit. To start with, I will use a board such as the Thinary Nano Every which uses a Atmega 4808 but then I will like to move to a custom PCB with a Atmega4808 chip which I then will program with UPDI. So, when I program for the Thinary Nano Every, the Arduino pins are mapped differently to the Port names in comparison to the 32-pin standard pinout. I don't understand why this is.

For example:

  • On 32-pin standard pinout the PORT PIN PA3 is arduino pin 3.
  • On Nano 4808 pinout the PORT PIN PA3 is arduino pin 5

Is there a reason you chose different arduino pin numbers in these two pinouts even though the Thinary Nano Every uses the 32 pin Atmega4808?

Many thanks and best regards

[image: grafik] https://user-images.githubusercontent.com/108929454/177967273-b1ad98cb-c6df-477e-8da8-a3a1eb76c6e5.png [image: grafik] https://user-images.githubusercontent.com/108929454/177967341-dbc742de-9b43-4113-b5c4-58a0f95c5b6d.png

— Reply to this email directly, view it on GitHub https://github.com/MCUdude/MegaCoreX/issues/153, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTXEW2KPOPHESBWNYBU65TVS73K5ANCNFSM53AN3WKA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

--


Spence Konde Azzy’S Electronics

New products! Check them out at tindie.com/stores/DrAzzy GitHub: github.com/SpenceKonde ATTinyCore https://github.com/SpenceKonde/ATTinyCore: Arduino support for all pre-2016 tinyAVR with >2k flash! megaTinyCore https://github.com/SpenceKonde/megaTinyCore: Arduino support for all post-2016 tinyAVR parts! DxCore https://github.com/SpenceKonde/DxCore: Arduino support for the AVR Dx-series parts, the latest and greatest from Microchip! Contact: @.***

MCUdude commented 1 year ago

What @SpenceKonde wrote!