element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Embedded and Microcontrollers
  • Technologies
  • More
Embedded and Microcontrollers
Embedded Forum STM32L4 With DMX512
  • Blog
  • Forum
  • Documents
  • Quiz
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Embedded and Microcontrollers to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 31 replies
  • Answers 11 answers
  • Subscribers 464 subscribers
  • Views 9246 views
  • Users 0 members are here
  • dmx512
  • stm32l4
Related

STM32L4 With DMX512

p.congre
p.congre over 3 years ago

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é

  • Sign in to reply
  • Cancel

Top Replies

  • michaelkellett
    michaelkellett over 3 years ago in reply to p.congre +1 suggested
    In xxx_project.h, #ifndef __C459_PROJECT_H #define __C459_PROJECT_H // INCLUDES #include "stm32f0xx.h" #include <stdio.h> #include <stdbool.h> #include <stdint.h> // DEFINES #define VERSION 100 #define…
  • jc2048
    0 jc2048 over 3 years ago

    This might help get you started

     

    http://www.emcu.it/STM32/Lighting-Control-using-DMX512-protocol-on-STM32/DOC/UM1004%20DMX%20512%20based%20LED%20lighting%20solution.pdf

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • jc2048
    0 jc2048 over 3 years ago

    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

    DMX diagnostics tool - running out of time

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • shabaz
    0 shabaz over 3 years ago in reply to jc2048

    Interesting.. just noticed that DMX post has > 60k views. I thought it was a fairly niche blog post, but just goes to show all sorts of things interest people.

    image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • p.congre
    0 p.congre over 3 years ago in reply to jc2048

    Hello Jon Clift,

     

    Thank you for your response, I will keep you posted if I am successful.

     

    Best regard

     

    P.Congré

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • jc2048
    0 jc2048 over 3 years ago in reply to shabaz

    It probably ranks very well on a search engine as original content. You aren't simply rehashing content from elsewhere - you've written your own text, done your own illustrations, and the outgoing links are on-topic and relevant.

     

    If I do a search on Bing for "DMX512", your blog comes up on the second page of results. That's a good result considering all the other quality material from manufacturers, standards bodies, and on-line reference sources that appears.

     

    You might also give element14 a little of the credit as, beyond any SEO that they might be doing in the background, we're all also benefitting from being associated with a group of people who are producing quite technical material and that probably gives us all a few extra 'bonus points'.

     

    I'm intrigued - I'm going to have a look at some of my old ones.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • shabaz
    0 shabaz over 3 years ago in reply to jc2048

    Hi Jon,

     

    Interesting points, you're right, the search engine reputation of element14 links must be extremely high for technical posts. I was wondering, one other factor to add to the list might be if (say) the industries that work with it (e.g. lighting firms) don't tend to publish much interworking detail maybe. Surprising what combination of things worked there... partially it may even be that I used wording that newcomers to DMX512 many use and search for, because I was a newcomer to it too. I'm going to re-read that post, see if I can glean anything unusual that may have occurred.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • p.congre
    0 p.congre over 3 years ago in reply to jc2048

    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é

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • jc2048
    0 jc2048 over 3 years ago in reply to p.congre

    Sorry, I don't have any code I can give you.

     

    Can't you port what you're doing with the Arduino to the STM32L4? It shouldn't be too difficult to send serial characters, so the tricky bit will be the break as that depends very much on what the particular serial peripheral can do. It might allow you to do it directly. Or you might be able to see a way to do it indirectly (by, for instance, enabling and disabling the peripheral so that it moves back to being an IO pin for a time, or by flipping the sense of the output pin if it can be changed from positive true to negative true). If you can't see a way to do it in the processor, you could always add an external logic gate to switch between serial and the break state. You'll probably need to use a timer to get the break period, so you'll have to work out how to do that too (I'm sure there's plenty of material on how to do that kind of thing).

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • p.congre
    0 p.congre over 3 years ago in reply to jc2048

    Hello Jon,

     

    There is no communication between the arduino and the STM32L4, and i can't port yhe arduino code to the stm32.

    With the arduino, I managed to control my LED strip with DMX protocol (the LED strip has a USC512C4 IC).

    Now I want to control the LED strip with my STM32L4 but it is quite difficult.

     

    I use an RS-485 to create the DMX communication. I found some codes on the internet but it doesn't work.

     

    https://github.com/aleksandrgilfanov/stm32f4-dmx-transmitter/blob/master/Src/main.c

    https://github.com/carl3721/stm32-dmx512/blob/master/dmx-p103/src/main.c 

     

    Best regard.

     

    P.Congré

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • jc2048
    0 jc2048 over 3 years ago in reply to p.congre

    The project at the first link you give appears to be based on some modified ST code. Perhaps you could ask ST for the original code if you can't find it on their website. It's very unlikely they would issue anything that didn't work.

     

    Is there a reason why you can't just use the Arduino, since you have that working?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube