Author Topic: My LED controller project  (Read 287 times)

0 Members and 1 Guest are viewing this topic.

Offline zbrown

  • Newbie
  • Posts: 3
  • Country: us
My LED controller project
« on: September 04, 2019, 01:44:55 pm »
Hey All,
I've been working on a little pet project for a while. It's an STM32 based LED controller PCB that triggers animations on addressable LEDS through CAN bus for the FIRST robotics competition. I have a lot of experience with Arduino, FPV drones, and EE in general, but I've hit a wall with certain parts of this project. When it comes to the hardware, I think I have most things figured out, except for two things. First, I want to be able to program the animations to be cued somehow. My plan is to write a desktop or web application that allows you to design your animations and then write them through USB. My first headache came with the USB-C connector. There are so many different ways I can seemingly implement this, I want it do be simple, while keeping the advantages of USB-C. I really don't need high speed, only reversibility and the ability to put said animations on the chip.

My second problem is really about storing the animations. The STM32 has plenty of space, but the more I look at how to use its non-volatile memory, the more intimidating and hard to use it seems. I've thought about using an external EEPROM, but I can't really find many that are as big as I want in the price range I'm looking for. So, I've been toying with the idea of using an SD card or other flash card instead. I've looked at the application notes for using the STM32 with an SD card, and it doesn't look terribly difficult electrically speaking, but I just wanted to get some external opinions on the idea. It makes the board more complicated, but it makes the programming theoretically simpler.

I've also attached a screenshot of my initial schematic if you spot any egregious issues.


Offline sokoloff

  • Super Contributor
  • ***
  • Posts: 1397
  • Country: us
Re: My LED controller project
« Reply #1 on: September 04, 2019, 02:02:36 pm »
Why torture yourself with USB-C complications for something like this that has zero need of USB-C (at least not that I can see)?
Use legacy USB serial rather than USB-C.

Offline ledtester

  • Frequent Contributor
  • **
  • Posts: 535
  • Country: us
Re: My LED controller project
« Reply #2 on: September 04, 2019, 04:44:53 pm »
Using an SD card can simplify your problem of getting animation onto your board... just use your PC to write the them as files onto the SD card and pop the the new SD card into your STM32 board. Not as slick as uploading the data via USB (or even WiFi), but it's simple and it'll give you the ability to change the animations.

But then you'll have to implement file system reading routines for your STM32. Fortunately this is a common problem and there are many examples of how to do this on the web, eg:

and there are Arduino libraries available too if that's what you're using.

You'll also want to investigate ways of detecting when the SD card has been inserted and removed, eg:

Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo