Hello there,
I am trying to control 2 LED strips (one with a WS2811 LED driver and one with a USC512C4 LED driver) with my STM32L4 with integrated RS485.
Do you have any idea how to do this?
Best regard.
P.Congré
Hello there,
I am trying to control 2 LED strips (one with a WS2811 LED driver and one with a USC512C4 LED driver) with my STM32L4 with integrated RS485.
Do you have any idea how to do this?
Best regard.
P.Congré
I should have added that there's also useful material about DMX512 here on the community. Here are a couple of good examples from shabaz and from genebren
DMX Explained; DMX512 and RS-485 Protocol Detail for Lighting Applications
DMX diagnostic tool - Getting started
DMX diagnostic tool - Sending and Receiving Data
Hello Jon,
I managed to control my LED strip with the USC512C4 IC with my arduino, but I need to do it with my STM32L4 but I can't find anywhere how to do it.
Do you have a code example for an STM32L4?
Best regard.
P.Congré
I can see the waveform of my TX PIN when I send 513 times a "U".
The 485 chip matches the IO voltage, I checked it and I can also see the waveform of the A and B output.
I double checked the cable connection for the LED strip.
I know it's not hardware but rather software, I couldn't create a correct code to control the LEDs.
Best regard.
P.Congré
^ Great debugging tips from Jon.
Right now I'm trying to get hardware and software working. I did not create the hardware nor the software, but I won't raise a case until I've:
1. Verified connections and voltages
2. Connected a 'scope or attached a logic analyzer (they cost less than $20) and examined if the interface signals are what I expect
3. Grabbed debug from the code
4. Tried different hardware and software combinations to try to narrow down the problem
5. Sketch a diagram or take photos or video to show precisely what I'm doing
6. Supply any configurations or log file content
For your scenario, maybe point 2 and 4 are also relevant, since you could compare the working scenario (Arduino) with the non-working scenario, and compare the signals, to see what the difference is.
Here are a couple of things to check:
Good luck!
That's good. You're not far off a working system.
Do you see the break, after the frame of data is sent, present in the DMX waveform?
I've never used the devices on the LED strip, but they probably depend on the subsequent break as part of their operation.
It's also part of the DMX spec that you have to keep sending the break and the frame repetitively. I don't think the spec says what the receiver should do if the DMX disappears, but I think it implies the designer of the receiver should do something for what is then considered to be a fault condition if it disappears for more than a second or two [for a lamp in a theatre setting, the normal thing would be for it to shut down on loss of DMX to stop it interferring with the rest of a lighting rig].
The problem is that I don't really know what line to follow to create the code, I know I need to set up a uart communication with 250000 bauderate.
I know the DMX protocol but I don't know how to implement it in my stm32.
The code for the arduino is an example that I modified to create different animations.
best regard.
P.Congré
Paul,
I do not have much (if any) experience with STM32, but I did find this code that might help you along:
https://github.com/carl3721/stm32-dmx512/blob/master/dmx-p103/src/main.c
It was an easy search of "stm32 dmx example", which seem to have lots of results.
I take from all of this that is very new to you. I have found that Google is your friend, and you will likely find lots of help there (and here). You really need to break it down into little pieces when you are looking for help. DMX has been around for quite a while, but there are not many examples, as a lot of people are buying solutions from a small handful of suppliers, that wrap all of the messy stuff up into libraries or standalone hardware.
Gene
Hello Gene,
I've already tried this git repository, it's only used to receive data, I'm trying to send data to the control light.
Best regard.
P.Congré
The two links to code that you posted are both code bases for STM32F10x processors - you are using an STM32L4xxx which will be different.
I can't guess all the things (if any) which will be wrong without:
1) Your code
2) A schematic or detailed block diagram of your set up
3) A pin list showing which processor pins are used for what
It would also help if you told us what software and debugging tools you are using (including do you have a scope or logic analyser).
Pictures often help as well.
MK
Good point Michael!
In addition it would be helpful to understand your level of understanding with coding on the STM32 products (and/or coding in general). If you are looking for code that you can just drop in, your are not likely to find a perfect solution. If you have the proper experience you should be able to find all you need to know from the documentation available from STM to take the concepts that you used on the Arduino and port them to the STM part.
genebren wrote:
... If you have the proper experience you should be able to find all you need to know from the documentation available from STM to take the concepts that you used on the Arduino and port them to the STM part.
Porting existing knowing-to-work code to the platform you're learning is an excellent way to get the experience.
You have the luxury to see everything working and know that there's no defects. When stuck, you can always go back to the working example and compare.
I've written a blog here on my approach to port a library between platforms. I'll search for it ...
edit: found: Educational BoosterPack and Hercules LaunchPad: LCD Driver - Part 3: SPI Works
genebren wrote:
... If you have the proper experience you should be able to find all you need to know from the documentation available from STM to take the concepts that you used on the Arduino and port them to the STM part.
Porting existing knowing-to-work code to the platform you're learning is an excellent way to get the experience.
You have the luxury to see everything working and know that there's no defects. When stuck, you can always go back to the working example and compare.
I've written a blog here on my approach to port a library between platforms. I'll search for it ...
edit: found: Educational BoosterPack and Hercules LaunchPad: LCD Driver - Part 3: SPI Works