I'm running a custom firmware on the ATmega16U2 (Switch-Fightstick). Is it possible to access the digital pins of the UNO from the ATmega16U2?

2 Answers 2


No, only the ATmega328P has access to the external pins of the Uno. You would need to write code for both the '328P and the '16U2 to communicate the pin values and changes over serial since that is the only channel connecting the MCUs.

  • that is not entirely true ... four of the pins are available
    – jsotola
    Commented Dec 30, 2017 at 19:40
  • @jsotola: True, but none of them are the "digital" (i.e. Dn) pins of the Uno. Commented Dec 30, 2017 at 20:22
  • they are digital pins of the UNO ... use a jumper
    – jsotola
    Commented Dec 30, 2017 at 22:48

There is a 4-pin header JP2 on the board that brings out the following pins from the '16U2

PB4, PB5, PB6, PB7

and the ICSP connector

PB1, PB2, PB3
  • Thank you for letting me know, although the accepted answer better suits my question. It's a bit of a hassle though that they are filled with solder by default on the UNO...
    – skiilaa
    Commented Dec 31, 2017 at 11:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.