⚙️⚙️⚙️ 𝐍𝐞𝐨𝐩𝐢𝐱𝐞𝐥 𝐝𝐫𝐢𝐯𝐞𝐫 𝐟𝐨𝐫 𝐒𝐓𝐌𝟑𝟐𝐋𝟎𝐱𝟏 𝐢𝐬 𝐫𝐞𝐚𝐝𝐲
I listed my TODO list of tasks on the Wearable project a few days ago.
Now, I have full support for programmable RGB LEDs in my STM32L051 firmware pack.
1️⃣ A timer with an Output compare function and a propagated output channel is needed. The timer will work in PWM mode.
2️⃣ A DMA channel connected to the timer is needed. ⚠️ Not each timer can be used.
3️⃣ A bit containing buffer in SRAM is needed. Each bit of the sequence is represented by a byte in memory.
𝐇𝐨𝐰 𝐝𝐨𝐞𝐬 𝐢𝐭 𝐰𝐨𝐫𝐤? The DMA channel fetches a new Output compare value to the OC Register. The new PWM period is the pulse we need to control the programmable LED.
🟢 High logical value as 75% duty
🔴 Low logical value as 25% duty
The PWM period is as the particular programmable LED needs—about 1.2 μs.