Implementing Neural Networks on the “10-cent” RISC-V MCU without Multiplier

I have been meaning for a while to establish a setup to implement neural network based algorithms on smaller microcontrollers. After reviewing existing solutions, I felt there is no solution that I really felt comfortable with. One obvious issue is that often flexibility is traded for overhead. As always, for a really optimized solution you have to roll your own. So I did. You can find the project here and a detailed writeup here.

It is always easier to work with a clear challenge: I picked the CH32V003 as my target platform. This is the smallest RISC-V microcontroller on the market right now, addressing a $0.10 price point. It sports 2kb of SRAM and 16kb of flash. It is somewhat unique in implementing the RV32EC instruction set architecture, which does not even support multiplications. In other words, for many purposes this controller is less capable than an Arduino UNO.

Continue reading “Implementing Neural Networks on the “10-cent” RISC-V MCU without Multiplier”

Analysis of the Gen2 Addressable RGB LED Protocol

The WS2812 has been around for a decade and remains highly popular, alongside its numerous clones. The protocol and fundamental features of the device have only undergone minimal changes during that time.

However, during the last few years a new technology dubbed “Gen2 ARGB” emerged for use in RGB-Illumination for PC, which is backed by the biggest motherboard manufacturers in Taiwan. This extension to the WS2812 protocol allows connecting multiple strings in parallel to the same controller in addition to diagnostic read out of the LED string.

Not too much is known about the protocol and the supporting LED. However, recently some LEDs that support a subset of the Gen2 functionality became available as “SK6112”.

I finally got around summarizing the information I compiled during the last two years. You can find the full documentation on Github linked here.

Revisiting Candle Flicker-LEDs: Now with integrated Timer

Years ago I spent some time analyzing Candle-Flicker LEDs that contain an integrated circuit to mimic the flickering nature of real candles. Artificial candles have evolved quite a bit since then, now including magnetically actuated “flames”, an even better candle-emulation. However, at the low end, there are still simple candles with candle-flicker LEDs to emulate tea-lights.

I was recently tipped off to an upgraded variant that includes a timer that turns off the candle after it was active for 6h and turns it on again 18h later. E.g. when you turn it on at 7 pm on one day, it would stay active till 1 am and deactive itself until 7 pm on the next day. Seems quite useful, actually. The question is, how is it implemented? I bought a couple of these tea lights and took a closer look.

Continue reading “Revisiting Candle Flicker-LEDs: Now with integrated Timer”

Does the WS2812 have integrated Gamma-Correction?

A while ago, I used transient current analysis to understand the behavior of the WS2812 a bit better (and to play around with my new oscilloscope). One intersting finding was that the translation of the 8 bit input value for the PWM register is mapped in a nonlinear way to the output duty cycle. This behavior is not documented in the data sheet or anywhere else. Reason enough to revisit this topic.

Measured PWM duty cycle vs. set value for WS2812S
Continue reading “Does the WS2812 have integrated Gamma-Correction?”

Analyzing a Copper String Light with unusual Phosphor Converted LEDs

After being amazed about finding a really clever implementation of powerline controlled LEDs in a low cost RGB “copper string light”, I bought a few other products in hope to find more LEDs with integrated ICs. At less than $4.00 including shipping, this was by far the cheapest LED string I bought. This one did not have any ICs inside, but I was still surprised about finding rather unusual phosphor converted LED technology in it.

Continue reading “Analyzing a Copper String Light with unusual Phosphor Converted LEDs”

Controlling RGB LEDs With Only the Powerlines: Anatomy of a Christmas Light String

The RGB curtain predictably turns into a mess of wires when not used according to instructions.

As should be obvious from this blog, I am somewhat drawn to clever and minimalistic implementations of consumer electronics. Sometimes quite a bit of ingeniosity is going into making something “cheap”. The festive season is a boon to that, as we are bestowed with the latest innovation in animated RGB Christmas lights. I was obviously intrigued, when I learned from a comment on GitHub about a new type of RGB light chain that was controlled using only the power lines. I managed to score a similar product to analyze it.

Continue reading “Controlling RGB LEDs With Only the Powerlines: Anatomy of a Christmas Light String”

Ultra Low Power LED Flasher using the Padauk PFS154

Flashing a LED is certainly among the first set of problems any burgeoning electronics specialist is tackling, may it be by using an ancient NE555 or, more recently, a microcontroller to control the LED. As it turns out, we can turn any trivial problem into a harder one by changing its constraints.

Continue reading “Ultra Low Power LED Flasher using the Padauk PFS154”

Power Analysis: Probing WS2812 RGB LEDs

Power analysis is a technique to probe the inner workings of an integrated circuit by measuring changes in the supply current. Whenever a logic gate switches, it will cause a tiny current spike that can be measured externally. By inspecting the temporal variation, especially in reaction to an external signal, it is often possible to deduce information about the construction of the IC.

A few years ago I used a logic analyzer to investigate the protocol of the, then new, WS2812 RGB LED. So, why not revisit this topic to test my newly acquired deep sampling oscilloscope?

Continue reading “Power Analysis: Probing WS2812 RGB LEDs”

Building a Chaotic Oscillator from Common Components

Sometimes you find things you have not even been looking for…

A chaotic oscillator is an electronic circuit that can exhibit “chaotic“, nonperiodic behavior. A commonly cited example is Chua’s circuit, but there are many others. I always regarded these as carefully designed, rather academic, examples. So I was a bit surprised to observe apparently chaotic behavior in a completely unrelated experiment.

Continue reading “Building a Chaotic Oscillator from Common Components”