Welcome, Guest
Username: Password: Secret Key Remember me
  • Page:
  • 1
  • 2

TOPIC: STM32F103C8T6, WS2812B strip, and the Rigol 1054Z

STM32F103C8T6, WS2812B strip, and the Rigol 1054Z 2 weeks 6 hours ago #17888

  • hop
  • hop's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 349
  • Thanks received: 45
OK! I did some wonderful things now that I can program my "blue board" and now also talk to it via USART at 115200kbps (or baud? lol).

I am not going to post this from my laptop however. I wrote up a nice post about these discoveries, but wouldn't you know it? My thumb grazed my touch pad and it was enough to send a click, and the mouse pointer was over the back arrow! End result? I lost the whole post! I was heart broken!!

More coming in a few after I am done in the garage. B)

STM32F103C8T6, WS2812B strip, and the Rigol 1054Z 2 weeks 4 hours ago #17889

  • Jon Chandler
  • Jon Chandler's Avatar
  • Online
  • Moderator
  • Posts: 300
  • Thanks received: 327
Oh crap! I've done that too :(

STM32F103C8T6, WS2812B strip, and the Rigol 1054Z 2 weeks 4 hours ago #17890

  • hop
  • hop's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 349
  • Thanks received: 45
Don't you hate that Jon? And there is a way it can be coded in the site to preserve what you have written when you "forward". I have done that on my home server, but it becomes somewhat convoluted when integrated into a forum site like this one.

So I write it in word then paste it from now on. LOL!

STM32F103C8T6, WS2812B strip, and the Rigol 1054Z 2 weeks 4 hours ago #17891

  • hop
  • hop's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 349
  • Thanks received: 45
This project/ thread is going to be about my journey into the STM32 (ARM M3 Cortex Line) from now on, but I discovered something cool that I will post separately. Coming soon, then back to this.

STM32F103C8T6, WS2812B strip, and the Rigol 1054Z 1 week 6 days ago #17893

  • hop
  • hop's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 349
  • Thanks received: 45
OK, things are progressing nicely with the STM32F103C8T6 development board. I am able to program it using the Arduino IDE for now using a STM32L Discovery board's SWD port as a STLink interface. I also connected a USB to serial interface (3.3v) to the STM32F using serial port 3 so I could see outputted USART messages from my code at 115200kbps.

As I stated before, I am using an isolated Arduino IDE version 1.6.12 with STM32 support installed. This allows the IDE to use STLink to program the board through a SWD interface. There is so much to do still, like explore bootloaders to be able to use the on-board USB interface to program it and communicate with it via USART serial. There are so many options!! I also would like to transition to Eclipse to write more advanced C++. For now though, this setup is adequate, albeit bulky, for experimenting with the interrupts, peripherals, and building a multiple module board for my holiday effects projects.

Right now I am using a special fork of Fastled to control the connected WS2812B devices in strings. It is a heavy library to use and consumes 22-27k of available 64k of flash memory. For now, this still leaves plenty of room for me to add support for the connected ESP8266 for MQTT control, interrupt handling, and some pretty cool effects processing. As the projects grow to the limits though, it will be necessary to write my own library that controls the WS2812B devices through a hardware SPI port. That is much later down the road though. I will stay focused on the prototype setup as it is for now.

I posted something in the Arduino area (wish there was a C++ area) about how I converted row and column data into a valid LED strip address for easier manipulation of LED effects. This is a clever function that uses bit masking and bitwise operators to achieve my goal, but it is too specific to the application for my driveway lantern effects project and will probably consider using a static indexed array for the addressing in the future. There are just too many different mapping layouts to figure out a function for addressing for each of them. Besides, static mapping is easier to load from my wireless network than a function is.

This is exciting but there is so much to do! I need to write, or improve what I already wrote, a communications handshake command protocol to handle communications between my home network and the devices on my prototype. Thankfully, all devices are 3.3v now and easier to interface without level shifting. The ESP8266 can handle all the network connection heavy lifting, and the MQTT handshaking. This STM32F board just needs to react to USART (for now) and giving status info.

UP NEXT: I will be using a ESP8266-12 development board to represent the ESP presence on my prototype. It will be replaced with a simplified version of the module after the code is finalized. The reason for this is that the ESP development board has a USB connector and built in 340G to make programming much easier. Once I perfect the code to allow firmware programming over WiFi, I can make the switch to the much smaller module. Eventually, my prototype will just include a USB connector, an SWD connector, a few jumpers, a STM32F103C8TB M3 Cortex processor, a plugged-in minimal ESP board, a 1a 3.3v regulator, and enough support components to utilize the desired peripherals from the STM32. About the size of a standard bic lighter. Then I will have a prototype I can put into just about anything that can read and relay sensor data, control connected devices, and all from my WiFi network. I am shooting for a cost price limit of about $15 USD.

Thank you for reading!

STM32F103C8T6, WS2812B strip, and the Rigol 1054Z 5 days 2 hours ago #17899

  • hop
  • hop's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 349
  • Thanks received: 45
Greets all!

Moving along with my prototype, I had a long list of things to accomplish today. It's been fun as I check each item off my list!

I am transitioning my PWM white LED light strip light controller (simple version) from the atmega328p arduino pro mini to my new STM32F103C8T6 platform. One thing that simplied the project straight away was the common 3.3v logic levels between the STM32 and the ESP8266. The STM32 board I have is tolerant of 5v logic on many of it's pins, but the ESP is not. For this reason, I had to use logic level translation between the pro mini and the ESP. I do not have to do that with the STM32 and the ESP which simplies the project quite a bit!

The LED's need 12v and are not the WS2812B's I like so much. They are a static wavelength. For this reason, I had to use a couple of voltage regulators to run off of a 12vdc supply. Actually, I am running 3... 12vdc to 5vdc, and then to 3.3vdc. I am not sure if the 5vdc regulator is needed now, and looking to eliminate it. After testing, the 2N2222 transitor I am using for the PWM control of the lightstrip seems to be working fine. I am not sure how that will work with a 3.3v logic level though and that part might have to be redesigned.

The MQTT Mosquito implementation is pretty simple. The ESP acts as the MQTT client, and communicates with the LED PWM handler which is now going to be the STM32F103C8T6. It use to be the pro mini. The communication is simple text commands and data via rs232 serial at 115200kbps. The MQTT server sends commands, the ESP handles them and responses, and then sends the text commands to the PWM handler. It works really well.

More when the transition to the STM32 is complete. Thanks!
  • Page:
  • 1
  • 2
Time to create page: 0.482 seconds