Giter Site home page Giter Site logo

Comments (6)

claudeheintz avatar claudeheintz commented on July 18, 2024

It looks like MKR WiFi 1010 uses sercom4 and sercom5. The sercom to use is selected by macros in LXSAMD21DMX.h. There are a number of pre-defined options. I just added an option for MKR 1010 that selects sercom2, pins 3 & 4. You can select other of the pre-defined options by uncommenting line 500 and changing the value of use_optional_sercom_macros. The variations are defined in lines 504-631. There are comments explaining the various options including what sercom/pins combination they use.

from lxsamd21dmx.

2788west avatar 2788west commented on July 18, 2024

Thanks for the quick response, this is really helpful!

from lxsamd21dmx.

bigdingoTECH avatar bigdingoTECH commented on July 18, 2024

I am also having this issue,

Have followed your instructions however I am using a MKR 1500 NB.

I chose macro 4

I am unsure of what to uncomment at line 500. This is what is at line 500 for me...

* This library uses a macro, use_optional_sercom_macros, to make the changes necessary

I commented out these

// Serial1
//Uart Serial1(&sercom5, PIN_SERIAL1_RX, PIN_SERIAL1_TX, PAD_SERIAL1_RX, PAD_SERIAL1_TX);
//void SERCOM5_Handler()
//{
//  Serial1.IrqHandler();
//}

However this is not working.

from lxsamd21dmx.

berchca avatar berchca commented on July 18, 2024

I am unsure of what to uncomment at line 500. This is what is at line 500 for me...

In the current version, the line to uncomment is 532. It looks like this:
// #define use_optional_sercom_macros 3

You change the '3' to the macro you wish to use.

I, too, am having this problem using a XIAO (which should allow me to access SERCOM4 on pins 6&7. I can't figure out what the conflict is, but if anyone has any good ideas, they'd be much appreciated.

from lxsamd21dmx.

berchca avatar berchca commented on July 18, 2024

Just to follow up, I did figure out how to use SERCOM4 (pins 6 & 7) on the XIAO. There were two steps. First was to create a new optional macro, as such:

#elif (use_optional_sercom_macros == 6)
//********************** optional sercom macros 6 **********************
// BtJ - SEEED XIAO M0 on pins 6 and 7 (SERCOM4)

#define PIN_DMX_RX (7ul)
#define PIN_DMX_TX (6ul)
#define PAD_DMX_RX SERCOM_RX_PAD_1
#define PAD_DMX_TX UART_TX_PAD_0

// Set to PIO_SERCOM or PIO_SERCOM_ALT
#define MUX_DMX_RX PIO_SERCOM_ALT
#define MUX_DMX_TX PIO_SERCOM_ALT

// SERCOM is pointer to memory address where SERCOM registers are located.
#define DMX_SERCOM SERCOM4

// sercom is C++ wrapper for SERCOMn (passed to UART constructor)
#define DMX_sercom sercom4

// sercom handler function
#define DMX_SERCOM_HANDLER_FUNC SERCOM4_Handler

#warning Using use_optional_sercom_macros = 6

And then I had to comment out (or delete) the following lines in the XIAO's variant.cpp:

void SERCOM4_Handler()
{
  Serial1.IrqHandler();
}

from lxsamd21dmx.

claudeheintz avatar claudeheintz commented on July 18, 2024

This is exaxtly what is required when a board definition has a sercom handler for Serial1 that is defined, for example:
void SERCOM4_Handler()
{
Serial1.IrqHandler();
}
and you need to define and use

void SERCOM4_Handler()

for the library to work.

Which might not be quickly obvious because of the library's use of macros which let you target different sercoms. See the header file LXSAMD21DMX.h for different sercom configurations.

from lxsamd21dmx.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.