0

M4 Muxing
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

M4 Muxing

by ewplayer3 on Mon Jul 01, 2019 1:51 pm

Just a quick question.... I'm working on replacing an older feather M0 proto on one of my projects with an itsy bitsy M4. On the M0, I currently have pins 13 and 11 set as RX and TX, in that order, for a second HW Serial interface using SERCOM1. I'm planning to do the same to the M4.

I see in the schematics on the M4 that the RX and TX pads are already tied to SERCOM1. I'll plan to use SERCOM0 as such, but I wanted to make sure that muxing still works the same on the M4; that being that .0 and .2 pads are TX only and all pads listed for a SERCOM can be RX? I didn't see a specific muxing guide for the M4. So, I want to be sure before I do anything.

Right now I'm looking at using a combination of A1 and A4 against SERCOM0 or A2 and A3 against SERCOM4.

ewplayer3
 
Posts: 34
Joined: Fri Mar 11, 2016 5:34 pm

Re: M4 Muxing

by adafruit_support_mike on Tue Jul 02, 2019 1:36 am

The SAMD51's SERCOMs are similar to the SAMD21's, but not identical. There are some additional quirks to deal with.

The biggest one is that SERCOM pins are collected in groups called IOSETs that work together. You can't combine pins from IOSETx and IOSETy, and only the pin identified as PAD0 in a given IOSET can work as a TX pin.

Those facts are helpfully located about 800 pages apart in the SAMD51 datashseet. IOSETs are listed in section 6.2.8 around page 36, and the PAD0 thing only shows up under the register settings for SERCOM UART control register A on page 873.

adafruit_support_mike
 
Posts: 63053
Joined: Thu Feb 11, 2010 2:51 pm

Re: M4 Muxing

by ewplayer3 on Tue Jul 02, 2019 11:04 am

Perfect! Thanks for pointing me in the right direction on this. I'll read those sections of the datasheet and get to doing code modification here soon.

ewplayer3
 
Posts: 34
Joined: Fri Mar 11, 2016 5:34 pm

Re: M4 Muxing

by ewplayer3 on Tue Jul 02, 2019 1:22 pm

Just for future reference to anyone that may read this thread looking to create additional 2-pin Serials on their ItsyBitsy M4, here are the 3 most viable pin reconfigurations to do so and their related information:

SERCOM0:
IOSET3 = PAD0, 1 = PA04, 05 = Pins A4, A1 = TX, RX

SERCOM3:
IOSET1 = PAD0, 1 = PA22, 23 = Pins D13, D12 = TX, RX

SERCOM4:
IOSET2 = PAD0, 1 = PB08, 09 = Pins A2, A3 = TX, RX

Hopefully this will be helpful to someone in the future. And, yes, the datasheet is very specific about PAD0 needing to be TX and not using PADs in different IOSETs under any circumstances.

ewplayer3
 
Posts: 34
Joined: Fri Mar 11, 2016 5:34 pm

Re: M4 Muxing

by adafruit_support_mike on Wed Jul 03, 2019 12:48 am

Glad to hear you got things working, and thanks for posting the follow-up!

adafruit_support_mike
 
Posts: 63053
Joined: Thu Feb 11, 2010 2:51 pm

Please be positive and constructive with your questions and comments.