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 years 6 months ago #17882

  • hop
  • hop's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 526
  • Thanks received: 46
What do you get when a STM32F103C8T6 board, a Rigol 1054Z, and a WS2812B strip walk into a bar?

Answer? Something speaking slurred SPI speech, something too drunk to see, and something else too drunk to listen.

Or so it would seem, although we are not in a bar, we are on my bench, and I am reading through the Rigol manual to learn again how to use my wonderful entry-level scope. FastLED (STM32 port) is serving the drinks I forgot to mention.

My modified Arduino IDE sketch using the STM32 version of fastled 3.1 is flashing the on-board LED and sending only one LED of SPI out to a connected WS2812B RGB LED and they are both flashing. The RGB LED is flashing the color I am sending it, so that part works just fine. It is getting more LED data to propagate from the first LED to the rest of the strip. That is not working.

I used a hack I discovered on Hack-a-Day to lower the supply voltage of the first WS2812B to 4.3v through a 1N4148 diode supplied by 5v. The voltage drop across the signal diode is .7v and the reason for this was to allow the RGB LED to be able to use a 3.3v logic level data stream. The rest of the LED strip/array is powered by 5v and is only connected to the first LED via the ground and data lines. The theory here is that the data stream is conditioned and presented with a higher logic level the 5v array can use.

To be honest, I actually do not know if all this voodoo is necessary as I had not tried connecting a strip powered by 5v directly. No worries to the STM32 board since it is reading and not writing data, although the SPI MOSI pin I selected for the data stream is 5v tolerant. I will try this scenario next.

Anyway, it occurred to me that I have this beast of a digital oscilloscope on my bench that I still do not fully understand and need to learn to use, and well, this is exactly why I bought it! But I had to do some reading to understand how to set a channel up to view a waveform and I am almost there. When done, I can examine and measure the signal coming out of the first 4.3v powered WS2812B. Who knows? The device (or my solder work) might be faulty!

For those intuitive chaps that are actually paying attention... yes... I did increase the LED count and sent more data down the line after my first LED test was a success.

Anyway, my beloved Rigol scope has a little window on the upper left region of the screen that shows some measurements and I have no idea how it got there. It's a feature I was playing with several months ago and forgot how I got that enabled. Playing with it after a few beers it seems. :P



SO, the lesson here is RTFM and do not drink while doing it. More when I know it!

The purpose of this project is to replace my numerously deployed ATMEGA328P Pro Mini boards in my holiday effects creations with this new STM32F103C8T6 board. And later, designing my own more specific board although not sure the need now... the "blue pill" board is so cheap, and everywhere! Once I get the code and the wiring right, I plan to pair a ESP8266 with my finished prototype so I can program the STM32 firmware using my LAN via WiFi and have sensor and control via MQTT. There is a port according to Roger Clark for the ESP that emulates the ST-Link protocol. That is VERY intriguing!!! Baby steps though. I have to be able to control an array of WS2812B devices first. And use my Rigol a LOT more! B)

Thank you for your time!
Last Edit: 2 years 6 months ago by hop. Reason: Clarification

STM32F103C8T6, WS2812B strip, and the Rigol 1054Z 2 years 6 months ago #17883

  • hop
  • hop's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 526
  • Thanks received: 46
Well I figured out a lot from just reading the effing manual, and although I have not figured out how to get the decoded data on the screen yet, it is clear that I have 3x8 bit (bytes) sent on the MOSI SPI pin from the STM32 board.

I changed the data I was sending slightly from 1,0,0 to 1,2,3 to 1,2,255 to see the changes and it shows up visually! WOOHOO!


EDIT: SIGH! I tried several times to include an image of my scope and while it worked on the first post, it would not work on the reply. I have no idea why.
EDIT AGAIN: It appears to work in Chrome, but not Firefox!!

I still cannot figure out how I can decode a long stream of data, but this little non-experienced revelation of mine shows me how I can see cause and effect on a signal, and even measure the frequency! I am going to LOVE this scope!!!!

Now I need to see if there is a signal on the other side of the first WS2812B, and see if level shifting is even necessary. Firing up the Hakko!
Last Edit: 2 years 6 months ago by hop. Reason: Discovery!

STM32F103C8T6, WS2812B strip, and the Rigol 1054Z 2 years 6 months ago #17884

  • Jon Chandler
  • Jon Chandler's Avatar
  • Offline
  • Moderator
  • Posts: 365
  • Thanks received: 352
You are doing some awesome stuff!
The following user(s) said Thank You: hop

STM32F103C8T6, WS2812B strip, and the Rigol 1054Z 2 years 6 months ago #17885

  • hop
  • hop's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 526
  • Thanks received: 46
Interesting fact I just discovered!

I was mad because I could not post an image from my scope, or rather, I could but it would not display. Well, it would not display in Firefox, but it will in Chrome! So not sure the reason, but if my posted scope images do not display, try the site in Chrome instead.

FYI

STM32F103C8T6, WS2812B strip, and the Rigol 1054Z 2 years 6 months ago #17886

  • Jon Chandler
  • Jon Chandler's Avatar
  • Offline
  • Moderator
  • Posts: 365
  • Thanks received: 352
I don't see an image in Firefox or Chrome.

STM32F103C8T6, WS2812B strip, and the Rigol 1054Z 2 years 6 months ago #17887

  • hop
  • hop's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 526
  • Thanks received: 46
How about internet exploiter er... sorry, internet explorer?

I sent an email to Graham. I wonder if there is another way to host images for the site. Heck! I would even consider using my site to do it. I do not have any restrictions that I know of.

For now, I am going to set my site up for me to upload images, then link them here. Then I will see if these problems persist.
  • Page:
  • 1
  • 2
Time to create page: 0.233 seconds