I found this library for DMX: https://github.com/claudeheintz/LXSAMD21DMX
I have tried to use it on the D21G board as a DMX receiver. It compiles OK but I do not receive any data. The library is designed to use SERCOM4. If I understand the board description the RS458 interface is connected to Serial (that should be replaced by the DMX driver) using SERCOM1, but I'm not sure I have undertood how to do the mapping correctly. There is an instruction at the end of the header file that I tried to follow. The changes I have done is:
// +++ Test for SERCOM1
#define PIN_DMX_RX (0ul)
#define PIN_DMX_TX (1ul)
#define PAD_DMX_RX SERCOM_RX_PAD_3
#define PAD_DMX_TX UART_TX_PAD_2
// Set to PIO_SERCOM or PIO_SERCOM_ALT
#define MUX_DMX_RX PIO_SERCOM_ALT
#define MUX_DMX_TX PIO_SERCOM_ALT
// SERCOMn is pointer to memory address where SERCOM registers are located.
#define DMX_SERCOM SERCOM1
// sercomN is C++ wrapper for SERCOMn (passed to UART constructor)
#define DMX_sercom sercom1
Is this the correct settings for the RS485 interface or have I missed something?
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!