element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino Projects
  • Products
  • Arduino
  • Arduino Projects
  • More
  • Cancel
Arduino Projects
Blog NexGen: Arduino Mega: Ports vs Pin Numbers
  • Blog
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino Projects to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: phoenixcomm
  • Date Created: 26 Sep 2020 3:53 PM Date Created
  • Views 5939 views
  • Likes 2 likes
  • Comments 0 comments
  • flight simulator
  • nexgen
  • arduino programing
  • arduino port manipulation
  • arduino mega
Related
Recommended

NexGen: Arduino Mega: Ports vs Pin Numbers

phoenixcomm
phoenixcomm
26 Sep 2020
PINPORTsFunction
22 .PORTA 0
23  .PORTA 1
24   .PORTA 2
25   .PORTA 3
26  .PORTA 4
27   .PORTA 5
28  .PORTA 6
29   .PORTA 7
53.PORTB 0SPI_SS
52.PORTB 1SPI_SCK
51.PORTB 2SPI_MOSI
50.PORTB 3SPI_MISO
10  .PORTB 4
11   .PORTB 5
12   .PORTB 6
13   .PORTB 7
37  .PORTC 0
36   .PORTC 1
35   .PORTC 2
34   .PORTC 3
33   .PORTC 4
32   .PORTC 5
31   .PORTC 6
30   .PORTC 7
21   .PORTD 0SCL
20   .PORTD 1SDA
19   .PORTD 2USART1_RX
18   .PORTD 3USART1_TX
38 .PORTD 7
PINPORTsFunction
21   .PORTD 0SCL
20   .PORTD 1SDA
19   .PORTD 2USART1_RX
18   .PORTD 3USART1_TX
38 .PORTD 7
0  .PORTE 0USART0_RX
1   .PORTE 1USART0_TX
5PORTE 3
2   .PORTE 4PWM2
3  .PORTE 5PWM3
41PORTG 0
40 .PORTG 1
39 .PORTG 2
4     .PORTG 5
17.PORTH 0USART2_RX
16.PORTH 1USART2_TX
6   .PORTH 3PWM6
7   .PORTH 4PWM7
8   .PORTH 5PWM8
9   .PORTH 6PWM9
15   .PORTJ 0USART3_TX
14   .PORTJ 1USART3_RX
49 .PORTL 0
48  .PORTL 1
47 .PORTL 2
46   .PORTL 3
45 .PORTL 4
44  .PORTL 5
43 .PORTL 6
42 .PORTL 7

I built this table from https://github.com/arduino/ArduinoCore-avr/blob/master/variants/mega/pins_arduino.h, this table makes it easier to see the port  numbers and they are grouped PORTx0 -> PORTxnimage

 

~~Cris H.

  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube