Go Down

Topic: DMX reception issue with Max 485 (Read 1 time) previous topic - next topic

jogyt

Hi,

I'm trying to build a simple DMX receiver with an arduino nano 328p (old bootloader)) using a max485 board (https://www.dx.com/p/ttl-to-rs485-module-for-arduino-green-2020062.html).

max485 is powered by the nano 5V and GND,
a dmx connector is connected to A (pin3), B (pin 2) and ground( pin 1) on max485
DI,DE and RE max485 pins are connected to GND
RO pin is connected to the nano RX pin

i use an ENTTEC Open DMX usb module to send DMX with QLC+ via a 10m DMX cable

I use the DMXsimple library and a simple sketch thats not using serial library (to avoid interrupts conflicts with dmxsimple)
 
...and i'm not able to get any serial data

i tried different DI/DE/RE wirings, not improving anything

i used an oscilloscope to watch the signals , can see my dmx frames changes on the B pin , but nothing except noise on RO pin.
the strange thing is that A and B signals doesnt look inverted....
i tried also with a rs485 breakout and got the same results...

i'm thinking that the Open Dmx usb adapter may be the problem, but he works flawlessly with standart DMX lights...

any ideas? thanks in advance

Riva

A couple of things to try on the Arduino end.
Do not connect DI to GND, just ground DE/RE.
If you still not getting valid data then try swapping the A/B pin wires over.

Not a great deal of help here but the small Arduino Leonardo here with the 32U4 (not 328) microcontroller can use DMX and Serial at the same time without issue.
Don't PM me for help as I will ignore it.

jogyt

I tried to leave DI not connected or to Vcc, same behaviour.
I already tried also to swap A & B, i retried, still nothing.

i have an arduino pro micro that may do the job, but i dont need to use serial as i will use software serial

thanks for your suggestions

Riva

As you have 2x Arduino's do you have a spare MAX485 so you can test without using the ENTTEC?
Does the MAX485 have a terminating resistor across A-B.
Don't PM me for help as I will ignore it.

jogyt

#4
May 17, 2020, 05:31 pm Last Edit: May 17, 2020, 05:38 pm by jogyt
Looks there is already one 120 ohm terminating res on the max485 board.
I tried adding another one on the dmx connector, in case, you know lol, .... no result.

I don't have another max485 board but i got a rs 485 breakout (https://www.sparkfun.com/products/10124) .
I haven't try this solution as i fear this setup may induce new potential problems and i'm not yet enough desperate to involve myself in this lol (and i want to keep the entec to control all the lights)

The thing that keeps me really puzzled is that A & B lines dont look inverted on the scope.

Riva

#5
May 18, 2020, 10:27 am Last Edit: May 18, 2020, 10:28 am by Riva
The thing that keeps me really puzzled is that A & B lines dont look inverted on the scope.
Is this the output from the ENTEC and without it being connected to the RS485 converter?

I was suggesting you use 2x Arduino's with MAX485 converters to check the converters are happy with each other. I don't know the schematic of your dx.com RS485 converter but maybe it needs pullup/pulldown resistors on the A/B adding or removing.
The below image is of a home grown device I made to test DMX512 fixtures so the MAX485 is hard wired for output only but it should give an idea of the pullup & pulldown on A/B.
Don't PM me for help as I will ignore it.

jogyt

#6
May 18, 2020, 03:39 pm Last Edit: May 18, 2020, 03:39 pm by jogyt
Thank you for the reply.

So i checked the rs485 board with a multimeter and have almost the same wiring :
Same thing on R0/Re/De/Di except RE and DE are not connected together and have their respective pullup resistor R2 and R3, 10k. R4 is used for DI pullup, 10k also.
The R5 resistor between B and GND is 10k not 20k, but i think it may not be a problem.

The measurements i made with the scope were done with the ENTEC plugged to the rs485 board via a 10m 120ohm DMXcable, QLC+ active and sending DMX.

Riva

#7
May 19, 2020, 08:54 am Last Edit: May 19, 2020, 08:59 am by Riva
The measurements i made with the scope were done with the ENTEC plugged to the rs485 board via a 10m 120ohm DMXcable, QLC+ active and sending DMX.
Do the ENTEC signals look correct when you scope them without it being plugged into the RS485 module.
I wonder if the pullup/pulldown in the MAX485 module is causing the problems.

All the DMX hardware I have ever built was using components and have never had problems but I have seen a few people on here having issues with RS485 modules.
Don't PM me for help as I will ignore it.

jogyt

The signals look the same with or without the max485 module plugged.
I'im going to get a max485cpa+ chip in a few days to test it.

jogyt

OK so i got a MAX485CPA chip without any pcb and plugged it using the same schematic as you shown
The RX led on the arduino nano is now bliking, but whit less intensity as power and L leds.

So now i'm wondering if it's not a problem to have the max48 chip power supply with the 5V pin of the arduino.

And problem may also be caused by the code/library i'm using.
I use the DMXserial library with a simple for loop scanning the first 3 DMX addresses. if any is greater than 0 onboard led is lit for 1 second.

Thank you for you help

Riva

OK so i got a MAX485CPA chip without any pcb and plugged it using the same schematic as you shown
The RX led on the arduino nano is now bliking, but whit less intensity as power and L leds.

So now i'm wondering if it's not a problem to have the max48 chip power supply with the 5V pin of the arduino.

And problem may also be caused by the code/library i'm using.
I use the DMXserial library with a simple for loop scanning the first 3 DMX addresses. if any is greater than 0 onboard led is lit for 1 second.
The RX LED could be blinking so fast continually receiving universe data that it just seems dim.

Are you using the 'DmxSerialRecv.ino' from the examples folder of the DMXSerial library.
Don't PM me for help as I will ignore it.

jogyt

Concerning the led, i can actually see the same behaviour with lower output frequency of the ENTEC box set to 1Hz (defaut 30Hz).Maybe as the baud rate being high, i should also expect this...but still not able to get any other value from DMXseral.read different from zero.

I'm not using the DmxSerialRecv.ino example, i tried actually to use it just replacing the led pwm part with a simple if condition that lits onboard led if channel 1 value  is more than zero.

I now use this simple code, changing values of all channels on QLC+, and expecting (desperately lol) to see the onboard led getting ON

#include <DMXSerial.h>
int outPin =    13;  //
 
void setup () {

  DMXSerial.init(DMXReceiver);
  pinMode(outPin,  OUTPUT);

  digitalWrite(outPin,HIGH);delay(50);digitalWrite(outPin,LOW);delay(50);
  digitalWrite(outPin,HIGH);delay(50);digitalWrite(outPin,LOW);delay(50);
}
 
void loop() {

 for(int i = 1; i < 3; i++) {
   if (DMXSerial.read(i)> 0) {
    digitalWrite(outPin,HIGH);
   } else {
    digitalWrite(outPin,LOW);
   }
   delay(1000);
 }
 digitalWrite(outPin,HIGH);delay(50);digitalWrite(outPin,LOW);delay(50);
 digitalWrite(outPin,HIGH);delay(50);digitalWrite(outPin,LOW);delay(50);
 
}

Riva

Start by confirming your receiving anything at all with code like this...
Code: [Select]

#include <DMXSerial.h>

void setup ()
{
  DMXSerial.init(DMXReceiver);
 
  pinMode(LED_BUILTIN, OUTPUT);
  digitalWrite(LED_BUILTIN, LOW);
 
  DMXSerial.resetUpdated();
}


void loop()
{
  if(DMXSerial.dataUpdated())
  {
    digitalWrite(LED_BUILTIN, HIGH);
    delay(500);
    digitalWrite(LED_BUILTIN, LOW);
    DMXSerial.resetUpdated();
  }
}


If you have tied the RE/DE pins together and connected them to the UNO then this need to be (default) pin 2 OR you alter the sketch to define the mode pin in the DMXSerial.init(DMXReceiver, DMXmodePin);

The LED (pin 13 on UNO) should light when a universe is received, if not then try swapping the wires going into pins 0/1 of the UNO and try again. If you get data then the next thing is to start with just one channel being set to a known value from the DMX desk that lights the LED on the UNO.
Don't PM me for help as I will ignore it.

jogyt

Thanks for you reply.
Actually i forgot to mention that DE/RE signal is wired to pin D2 on the nano.

I tried your code, still no led lit.

Pins 0/1 are uart RX/TX pins right? inverting doesnt make the led blink, and it's kind of expected as now the Tx led blinks on the arduino nano, and Rx led off.

Riva

Pins 0/1 are uart RX/TX pins right? inverting doesnt make the led blink, and it's kind of expected as now the Tx led blinks on the arduino nano, and Rx led off.
I'm running out of ideas here apart from suggesting you connect the ~RE/DE pins of the MAX485 chip directly to GND instead of relying on the DMXSerial library direction control.

Over the last few years I worked (retired now), I designed and built a few different Arduino projects using MAX485 chips and they all worked without issue. I cannot understand why this one is being so stubborn.
Maybe someone else can offer suggestions as to why this is not working as expected.
Don't PM me for help as I will ignore it.

Go Up