Using LXSAMD21DMX with Adafruit Feather M0

LXSeries open source projects are hosted on github.
Post Reply
ariherzig
Posts: 3
Joined: Fri Feb 22, 2019 3:05 am

Using LXSAMD21DMX with Adafruit Feather M0

Post by ariherzig »

Hello,
I'm looking to try and use your library with an Adafruit Feather M0. I'm a little confused by what pins on the Feather that I should be using. I'm not sure if the pins I need are exposed on the Feather, and if not I'm a bit confused as to how to set them up. I'd appreciate any help you can give.
Thanks,
Ari
admin
Site Admin
Posts: 1643
Joined: Mon Nov 05, 2007 1:26 am
Contact:

Post by admin »

Can you post a link to the exact board that you are asking about? There are now quite a few Feathers that have an SAMD21 M0 processor.

The MCU pins may be brought out differently depending on the design of the board. That, in turn, determines which SERCOM module you might want to use. Each SECOM can have its TX (and RX) assigned to one of two pins. Conveniently, Adafruit has an article about how this works: https://learn.adafruit.com/using-atsamd ... new-serial

The header for the LXSAMD21DMX library has an optional macro towards the bottom of the file that switches between SERCOM4 (the default) and SERCOM2. The default uses Arduino pins 4 and 5, TX/RX. The alternate SERCOM2 uses 4 and 3.

The MCU's SERCOM modules are not only used by UART type serial communication but also for SPI, I2C, etc. So, an additional consideration is if you are using a library that needs a specific SERCOM for one of these as well.
ariherzig
Posts: 3
Joined: Fri Feb 22, 2019 3:05 am

Post by ariherzig »

I'm using the Adafruit Feather M0 Basic Proto - ATSAMD21 Cortex M0 https://www.adafruit.com/product/2772

I'm new to going this deep into the board config, but from what I can tell, I don't have access to pins 3 and 4. Would I be able to configure it to use SERCOM 1 and use pins 10 and 11?

I'm using the Adafruit Motor Shield V2 library to control two steppers. I think it only uses Arduino pins 20 and 21 for I2C.

Thank you for your help.
admin
Site Admin
Posts: 1643
Joined: Mon Nov 05, 2007 1:26 am
Contact:

Post by admin »

I added optional macro definitions for SERCOM1 pins 10 and 11. I don't have an Adafruit board to test these. But, you can try and let me know. To use the optional macros, uncomment line 521 of src/LXSAMD21DMX.h, setting use_optional_sercom_macros to 2.
ariherzig
Posts: 3
Joined: Fri Feb 22, 2019 3:05 am

Post by ariherzig »

It works! Thank you so much for your help with this. It's people like you that remind me that there are good people out there.
Post Reply