Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flashing #10

Open
bepitama opened this issue Nov 27, 2023 · 2 comments
Open

flashing #10

bepitama opened this issue Nov 27, 2023 · 2 comments

Comments

@bepitama
Copy link

I tried to read the DMX data following the scheme inserted in the LXSAMD21DMX.h file on an Arduino M0 Pro and also on a MKR1000 but the incoming DMX value, also displayed on the Serial Monitor, continues to "dance" between the real one, sent by the DMX controller and the value 0 creating a flickering of the LED that I connected to PWM pin 8.
Is there something more to insert between the MAX485 and the Arduino, since there is 5V at the output and the Arduino runs at 3.3V?
My name is Giuseppe and I write from Italy. Thank you if you will help me.

@claudeheintz
Copy link
Owner

claudeheintz commented Nov 27, 2023

There are a number of possibilities for why this is happening.

One is that something in your sketch is taking too much time and the DMX driver is not able to fully keep up reading the incoming serial stream. You can you the example DMXInputTest which is very simple and should eliminate this possibility.

Another is that the DMX input needs termination. A 120 ohm resistor between the A and B inputs to the MAX485 should clean up reflections on the DMX serial input.

DMX can send 24-512 slots of data. The marker between successive packets is called a break. The DMX driver uses the SAMD21's hardware frame error to catch the break when it is received. It is possible that the controller you are using for input is sending less than the full 512 slots of data and the break detect is not working with its timing. There is a wide range of acceptable breaks in DMX and even so, not every controller outputs fully compatible DMX. To evaluate this possibility, it is necessary to use a multi-channel logic probe and look at the timing of the DMX signal against a pin that is turned on and off when the breakReceived() function is called. breakReceived() should be called around the time the break in the DMX signal ends and the "mark after break" starts. If breakReceived() is not being called either at all or not consistently in the same place in the DMX timing, then that is the problem. Another simpler way to check this might be to use a different DMX source and see if that makes a difference.

@bepitama
Copy link
Author

Thanks for the reply. I have too one my own work on Github even if I'm not at your level yet.
Previously I tried with an Arduino Nano using the DMXSerrial library and everything works. I'm using the DMXInputTest example.
The terminator was not there but even after putting the 120 ohm resistor nothing changes.
I tried both with a DMX controller and QLight + with KMTronic USB>DMX512 card and I get the same problem.
I would like to use a card with SAMD21 to simulate 10 bit PWM, with high power LEDs, both White and RGB and RGBW, the behavior of incandescent lamps without seeing the shots it makes with just 255 levels.
I'm using translator because I can't write in English so forgive me if you don't understand.
Thank you.

Giuseppe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants