GC-03: Customizable RGB Pulse LED colors via TDM mixing#372
Open
iROOT wants to merge 1 commit intoGissio:mainfrom
Open
GC-03: Customizable RGB Pulse LED colors via TDM mixing#372iROOT wants to merge 1 commit intoGissio:mainfrom
iROOT wants to merge 1 commit intoGissio:mainfrom
Conversation
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.
Owner
|
Thanks for your PR! So EMFMETER_EN is actually GREEN_LED. Some questions:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
TIM8_UP_IRQHandlerfor mixed colors (Yellow, Cyan, Magenta, White).Implementation Details
PB14is shared between the Green LED andEMFMETER_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!