Nano Every and Arduino DMX Library

Hello everyone,

Really grateful for the community. It's my first time posting, so please bare with me.

I am working through using a Nano Every to work with ArduinoDMX. I have been closely following ArduinoDMX Examples

The example states clearly that this ArduinoDMX library has been tested with a Nano Every. I get a bit leery when it says to use Serial1 which outputs TX on physical pin 16... from my calculations this is D13, also SCK and the corresponding RX on 17.. which is ARef on the Nano Every.

I can get DMX Simple to work in a Uno I have, but I need to use the Every. I am not finding many examples of Nano Every boards working with DMX. I know its possible. Most positive it has to do with the serial port configuration.

I have done a bit of digging in the header files for the avr boards. Everything seems to link properly.

/*
  DMX Fade

  This sketch fades the value of DMX channel 1 between 0 and 255 in steps to create a fade effect.
  All other slots are set to a value of 0.

  Circuit:
   - DMX light
   - MKR board
   - MKR 485 shield
     - ISO GND connected to DMX light GND (pin 1)
     - Y connected to DMX light Data + (pin 2)
     - Z connected to DMX light Data - (pin 3)
     - Jumper positions
       - Z \/\/ Y set to ON

  created 5 July 2018
  by Sandeep Mistry
*/

#include <ArduinoRS485.h>  // the ArduinoDMX library depends on ArduinoRS485
#include <ArduinoDMX.h>

const int universeSize = 6;

int brightness = 0;
int fadeAmount = 5;

void setup() {

  DMX.begin(universeSize);

}

void loop() {
  // set the value of channel 1
  DMX.beginTransmission();
  DMX.write(1, 255);
  DMX.endTransmission();

  delay(30);
}

With the light I have, channel 1 maps to brightness adjustment for the fixture. I expect this code to just turn the light on full level.

I have an oscilloscope connected and there is definitely no output happening. Currently connected to TX on Nano Every.

I think I need to port the serial out from serial to serial1 but I am not sure how to do this and it leads me to believe I'd have to write my own library to support it.

Suggestions, please.

Serial1 on the Nano Every is on the pins labeled Tx and Rx. It is a hardware serial port, and unlike the AT328 Classic Nano and Uno this is separated from USB serial which is addressed as Serial.
See the Nano Every pinout.

I get a bit leery when it says to use Serial1 which outputs TX on physical pin 16... from my calculations this is D13, also SCK and the corresponding RX on 17.. which is ARef on the Nano Every.

This is not correct, and where these pins are connected on the Atmega4809 is not really relevant. Using them will not conflict with any other functionality unless you wanted to use D0 and D1 as digital i/o.

I think I need to port the serial out from serial to serial1 but I am not sure how to do this and it leads me to believe I'd have to write my own library to support it.

No, just connect your TTL device to the Rx and Tx pins (cross connected Rx>Tx and Tx>Rx) and use Serial1.begin(baud rate).

Thank you for your reply and helping me better understand how serial works on the Every. I made some assumptions and you definitely cleared them up for me.

I ended up getting the DMXSerial Library to work in my application. I'm still testing through different nano setups and want to understand why DMXSerial is working and ArduinoDMX is not.

Stay tuned, hoping to bring clarity with test data. I'm further complicating the setups by using MAX485 breakouts vs standalone chips.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.