Skip to content

GC-03: Customizable RGB Pulse LED colors via TDM mixing#372

Open
iROOT wants to merge 1 commit intoGissio:mainfrom
iROOT:gc-03-led-color
Open

GC-03: Customizable RGB Pulse LED colors via TDM mixing#372
iROOT wants to merge 1 commit intoGissio:mainfrom
iROOT:gc-03-led-color

Conversation

@iROOT
Copy link
Contributor

@iROOT iROOT commented Mar 8, 2026

Hi @Gissio,

I've been working on enabling the RGB Pulse LED for the FNIRSI GC-03 and wanted to share this implementation for your review. Currently, the device is limited to a single color, but the hardware is capable of much more.

The Hardware Challenge

While testing, I noticed that the GC-03 seems to have a shared current-limiting resistor on the common anode. Because of the different forward voltages (Red ~1.8V vs Green/Blue ~3.0V), a standard GPIO high/low approach makes it impossible to mix colors—Red simply takes all the current.

The Solution: TDM Mixing

To get clean colors without hardware mods, I implemented a Time-Division Multiplexing (TDM) approach:

  • Static drive for primary R, G, B colors to maintain 100% brightness.
  • Pattern-based TDM via TIM8_UP_IRQHandler for mixed colors (Yellow, Cyan, Magenta, White).
  • By cycling the LEDs rapidly (~4 kHz), we bypass the resistor issue and get stable, balanced colors.

Implementation Details

  • Added a new "LED Color" menu under Pulse Indication.
  • Added 7 base colors + a "Rainbow" mode that cycles the color on every pulse.
  • Conflict Note: I found that PB14 is shared between the Green LED and EMFMETER_EN_PIN. I've kept the definitions for now, but this pinout conflict should probably be addressed (e.g., remapping the EMF enable pin) to make the green channel fully usable.

The concept is fully working on my device, but I’m very much open to your feedback, especially regarding the TDM architecture or the settings integration.

Thanks for all your work on Rad Pro!

Implemented customizable colors for the RGB Pulse LED on the FNIRSI GC-03.
Due to a hardware design limitation (likely a shared resistor on the common
anode), simultaneously enabling multiple color channels causes voltage drop
issues where the red LED dominates.

To solve this, a Time-Division Multiplexing (TDM) approach was introduced
using TIM8 interrupts. Mixed colors (Yellow, Cyan, Magenta, White) are
rendered using rapid sequential channel toggling (patterns), while primary
colors remain solid.

Changes:
- Added "LED Color" submenu in Settings -> Pulses -> Indication.
- Added 7 colors + "Rainbow" mode (cycles color on each pulse).
- Implemented TDM logic in stm32_led.c using TIM8_UP_IRQHandler.
- Updated gc03.h with respective R, G, B pins and timers.

Note: There is a known hardware definition conflict on PB14 between the
Green LED and EMFMETER_EN_PIN that needs to be addressed.
@Gissio
Copy link
Owner

Gissio commented Mar 9, 2026

Thanks for your PR! So EMFMETER_EN is actually GREEN_LED.

Some questions:

  • What color do you get with 50% red, 50% green?
  • What color do you get with 50% red, 25% green?
  • What red/green mix do you need for orange?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants