CTC-DRA-10-R2 Shield at Mega 2560 - DMX reception only works once after update

hey folks,

I have a problem with the Arduino Mega in combination with the CTC-DRA-10-R2 Shield. The source code actually works fine. As soon as the power is disconnected and then switched on again, the Arduino no longer “starts”. LEDs on the board light up etc.

When I briefly disconnect the RX-io jumper (or the cable between RX0 and PIN 3) it continues to run normally and the LED strip lights up again.

What I mean by that is, as long as I send DMX signals during the “start up”, the Arduino hangs in a kind of interrupt.

I am relatively new in the matter, as thanks for your help in advance:)
… and sorry for my bad English

#include <Conceptinetics.h>
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>
#endif

#define RXEN_PIN    3
#define DMX_SLAVE_CHANNELS 512
#define NUMPIXELS      108

DMX_Slave dmx_slave ( DMX_SLAVE_CHANNELS );

const int ledPin = 8;
Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUMPIXELS, ledPin, NEO_GRBW + NEO_KHZ800);

void setup() {
strip.begin();
strip.show(); // Initialize all pixels to 'off'
pinMode ( ledPin, OUTPUT );
dmx_slave.setStartAddress (1);
dmx_slave.enable ();
}

vhttps://www.google.de/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0ahUKEwjcpLCd9pvXAhWoC5oKHXWNDZAQFggpMAA&url=https%3A%2F%2Fforum.arduino.cc%2Findex.php%3Ftopic%3D507988.0&usg=AOvVaw2V0EZvjkaxixy9r8q9nZyEoid loop()
{
for (int16_t i = 0; i < NUMPIXELS; i++) {
  strip.setPixelColor(i, dmx_slave.getChannelValue (1), dmx_slave.getChannelValue (2), dmx_slave.getChannelValue (3), dmx_slave.getChannelValue (4));
  // strip.setPixelColor(i, 50, 50, 50, 50);
  strip.show();
  delay (50);
}
}

I have a problem with the Arduino Mega

We know what that is.

in combination with the CTC-DRA-10-R2 Shield

Only you know what that is, or what is connected to it.

#define DMX_SLAVE_CHANNELS 512

Why do you reserve space for 512 channels when you are not sending (or at least not using) anywhere near that number?

Hi,

the CTC-DRA-10-R2 Shield is a DMX-Shield.
[http://image.dfrobot.com/image/data/DFR0260/DMX%20Shield%20User%20manual.pdf](http://"http://image.dfrobot.com/image/data/DFR0260/DMX Shield User manual.pdf")

of course, I can also send on fewer channels. Later on, the program should control all LEDs (and more than now) with 4 channels each.

I believe that the problem is on this line:

DMX_Slave dmx_slave (DMX_SLAVE_CHANNELS);

Here it drives into a kind of interrupt as long as it receives DMX signals.

Hi,

I have now used a different library. Instead of Conceptinetics. h I now use the DMXSerial.h.

I have now used a different library. Instead of Conceptinetics. h I now use the DMXSerial. h. The problem remains. As long as I send DMX signals, it is probably the serial interface in some kind of interrupt.

#include <DMXSerial.h>
#include <Adafruit_NeoPixel.h>

#define NUMPIXELS      108

const int ledPin = 8;
Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUMPIXELS, ledPin, NEO_GRBW);

void setup () {
  DMXSerial.init(DMXReceiver);
  
  DMXSerial.write(1, 0);
  DMXSerial.write(2, 0);
  DMXSerial.write(3, 0);

  // enable pwm outputs
  pinMode (ledPin, OUTPUT);
}

void loop() {
  // Calculate how long no data backet was received
  unsigned long lastPacket = DMXSerial.noDataSince();

  if (lastPacket < 5000) {

    for (int16_t i = 0; i < NUMPIXELS; i++) {
      strip.setPixelColor(i - 1, DMXSerial.read(1), DMXSerial.read(2), DMXSerial.read(3), 0);
    }
    strip.show();
    delay(50);
    
  } else {
    // Show pure red color, when no data was received since 5 seconds or more.

    for (int16_t i = 0; i < NUMPIXELS; i++) {
      strip.setPixelColor(i - 1, 0, 0, 0, 10);
      strip.show();
      delay(50);
    }
  } 
}

Hi

Did you ever solve this. I have an almost identical problem

Andy