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...
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.
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 (SparkFun Transceiver Breakout - RS-485 - BOB-10124 - SparkFun Electronics) .
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.
jogyt:
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.
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.
jogyt:
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.
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.
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.
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.
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
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.
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.
jogyt:
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.
I already tried to connect RE/DE pins directly to GND.not better
Inverting A & B inputs on the MAX485 increased a lot the intensity of the Rx onboard led of the arduino, closer to the "nominal" intensity, similar to serial comm' with the computer via USB
...but it did not help me to read DMX values other than zero.
Thank you a lot for all suggestions you provided, as a test//measurement technician i already tried a majority of them, but you helped me to ensure i wasn't completely wrong ....
I'm about to try to use a level translator between Ro output and arduino's serial IN, but i don't know which reference voltage i should wire on the RO side..will update if i found anything interesting.
Removing the 10 meter DMX cable made the code working! shame i didnt try it before.
I am even more suprised to see that with a mic-xlr standart cable, i still dont have the attenuation that disables the max485 to tx serial data to the arduino.
jogyt:
Removing the 10 meter DMX cable made the code working! shame i didnt try it before.
Glad you got the problem sorted in the end. I'm surprised the DMX cable to be the cause of the fault though I have seen some questionable soldering in commercial cables.
As it's a proper DMX cable (at least sold as is) and almost brand new, maybe its 120 ohm resistance may weaken too much the signal for the MAX to be able to convert it to serial.
The intensity of the RX led on the arduino being higher with a 70 ohm xlr cable, i think thats the problem.
As im doing tests with my DIY device plugged alone, it works so far but i fear shht will happen with other lights plugged.
Would you have an idea to raise the signal amp on the receiver side?