I would like to use the pin mux in the SAMD21 mcu, to set different pins for the USB peripheral. The datasheet makes it sound like it is possible, but is very confusing.

datasheet : https://cdn.sparkfun.com/datasheets/Dev/Arduino/Boards/Atmel-42181-SAM-D21_Datasheet.pdf

  • \$\begingroup\$ I haven't seen a device that can pin mux the USB, I don't believe the D21 is any different. Which variant are you using? \$\endgroup\$
    – Ron Beyer
    Apr 4, 2020 at 17:31
  • \$\begingroup\$ @RonBeyer pg 745 "31.5.1 I/O Lines The USB pins may be multiplexed with the I/O lines Controller. The user must first configure the I/O Controller to assign the USB pins to their peripheral functions." However, I think that just means sharing pins with other functions, not that you can select from multiple pins for USB. Because I saw no duplicate USB in the pinouts. \$\endgroup\$
    – DKNguyen
    Apr 4, 2020 at 17:39
  • \$\begingroup\$ as said on this very same question that you asked on DSP.SE, this needs to explain where you're stuck, and what your precise question is. \$\endgroup\$ Apr 4, 2020 at 18:03
  • \$\begingroup\$ @MarcusMüller Your comments at DSP.SE stated that someone certainly had achieved this. Are you not willing to share where you obtained that information? \$\endgroup\$ Apr 6, 2020 at 4:08
  • \$\begingroup\$ @Marchingband I know that someone achieved this, not how. Also, you're still not asking a precise question. \$\endgroup\$ Apr 6, 2020 at 4:36

1 Answer 1


You're probably referring to this paragraph:

enter image description here

Which means that you can use the USB lines as I/O lines (if you don't need USB).


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.