1 Drive the led
Normally, led can be driven with MCU directly, for some industrial MCU, 50mA can be achieved. But this is not applicable for this case ,since led in series leads to more power consumption and damage the MCU easily.
In fact, for most ports or pins, it shall be limited to 1mA to output
2 Drive led with arduino zero
2.1 Core Architecture & Key Hardware Features
Components Needed:
- Arduino Zero
- LED (any color)
- 220Ω resistor (to limit current)
- Breadboard and jumper wires
- Connect the long leg (anode) of the LED to one end of the 220Ω resistor.
- Connect the other end of the resistor to a digital pin on the Arduino Zero.
- Connect the short leg (cathode) of the LED to the GND pin on the Arduino Zero.
2.2 Codes to drive the led
const int ledPin = 13;
void setup() {
// Initialize the LED pin as an output
pinMode(ledPin, OUTPUT);
}
void loop() {
// Turn the LED on (HIGH means 3.3V on Arduino Zero)
digitalWrite(ledPin, HIGH);
delay(1000); // Wait for 1 second (1000 milliseconds)
// Turn the LED off
digitalWrite(ledPin, LOW);
delay(1000); // Wait for 1 second
}
2.3 Arduino Zero Output Current Limits
- Maximum current per GPIO pin: 7 mA (recommended continuous current)
- Absolute maximum current per pin: 15 mA (exceeding this can damage the pin)
- Total current from all GPIO pins combined: 100 mA (to avoid overloading the board's voltage regulator)
3 Introduction to TLD4020-3ET Chip

3.1 Core Architecture & Key Hardware Features
1.1 Microcontroller (MCU) Subsystem
- Adopts a "one clock per machine cycle" architecture for fast instruction execution.
- Integrates a single-cycle multiplier and hardware divider, enabling quick mathematical computations (critical for real-time LED current/PWM control).
1.2 On-Chip Memory
- 32 kB Flash Memory: Includes 1000-cycle endurance (1000 TP) memory for critical data storage (e.g., calibration parameters).
- 576 Bytes 1000 TP Memory: Additional dedicated memory with high endurance for frequent read/write tasks.
- 3 kB SRAM: For temporary data storage during runtime (e.g., real-time lighting control variables).
- Boot ROM: Preloaded with startup firmware and Flash programming routines, simplifying initialization and in-system updates.
1.3 On-Chip Peripherals & Debug Support
- Oscillator: On-chip oscillator eliminates the need for external clock components, reducing system BOM (Bill of Materials) cost.
- Debug Interface: Supports 2-wire SWD (Serial Wire Debug) for efficient debugging and firmware development.
- GPIO Pins: 2 general-purpose input/output pins (GPIO0, GPIO1/SWCLK) for flexible interaction with external components (e.g., sensors, switches).
3.2 LED Driver Capabilities
- Current Capacity: Each channel can drive up to 51.5 mA (absolute maximum: 56.65 mA) to power individual LEDs.
- Parallel Configuration: Power stages can be paralleled to support higher load currents (for brighter lighting or multiple LEDs in series).
- Precise Current Control: Each channel’s current is configurable via a 5-bit set value, enabling fine-grained brightness adjustment.
- Independent PWM: 3 independent PWM (Pulse-Width Modulation) configurations, allowing dynamic light pattern control (e.g., dimming, color mixing for RGB LEDs).
3.3 Communication Interface(Not used in this design)
- Programming: Supports firmware updates via the LIN interface (using a bootloader), eliminating the need for dedicated programming ports.
- Control: Receives lighting commands (e.g., "turn on contour lighting") from the LIN master (e.g., vehicle ECU).
- Diagnostics: Sends feedback (e.g., LED fault status, current levels) to the master, enabling predictive maintenance and system monitoring.
3.4 Automotive-Grade Reliability & Compliance
- AEC-Q100 Qualification: Grade 1 compliance, meaning it operates reliably across a junction temperature range of -40°C to +150°C (ambient temperature: -40°C to +125°C).
- Robust Electrical Protection:
- Supply voltage (VS) tolerance: -0.3 V to 40 V (supports suppressed load dump per ISO 16750-2).
- ESD Susceptibility: 2 kV (HBM, all pins), 8 kV (HBM, LIN vs GND), and 500 V (CDM, all pins) – protecting against electrostatic discharge.
- RoHS Compliance: Lead-free (Pb-free) finish on leads, suitable for Pb-free soldering (per IPC/JEDEC J-STD-020), meeting global environmental regulations.
3.5 Typical Applications
- RGB LED control for ambient or mood lighting.
- Contour lighting (single light source with constant/slowly changing patterns).
- Functional lighting (e.g., dashboard indicators, door handle illumination).
- Surface lighting requiring single LEDs (e.g., center console backlighting).
3.6 Drive the RGB led in three channels
Once power up, the TLD4020 runs to drive the RGB led

3.7 Coding with Keil 5.28
Here is the code for this simple blinking
sint32 main(void)
{
sint8 s8_returnCode;
sint32 s32_counter;
sint8 s8_ledIndex;
sint8 s8_onState;
/* Main watchdog service */
(void)PMU_serviceWatchdog();
/* Initialization of hardware modules based on Config Wizard configuration */
s8_returnCode = Device_init();
if (s8_returnCode != ERR_LOG_SUCCESS)
{
/* Place your code here to handle an initialization error */
for (;;)
;
}
/*****************************************************************************
** Place your application code here **
*****************************************************************************/
#define MAX_BRIGHTNESS 0x0FFF
#define MIN_BRIGHTNESS 0x0000
#define MAX_COUNTER 100000
#define RED_LED 0 /* Red LED is connected to channel 0 */
#define BLUE_LED 1 /* Blue LED is connected to channel 1 */
#define GREEN_LED 2 /* Grenn LED is connected to channel 2 */
s32_counter = 0;
s8_ledIndex = 0;
s8_onState = 0;
/*****************************************************************************
** Main endless loop **
*****************************************************************************/
for (;;)
{
/* Main watchdog service */
(void)PMU_serviceWatchdog();
/***************************************************************************
** Place your application code here **
***************************************************************************/
if (s32_counter++ > MAX_COUNTER)
{
if (s8_onState == 0)
{
LDRV->PWM_DC_CFG0.reg = (s8_ledIndex == RED_LED) ? MAX_BRIGHTNESS : MIN_BRIGHTNESS;
LDRV->PWM_DC_CFG1.reg = (s8_ledIndex == BLUE_LED) ? MAX_BRIGHTNESS : MIN_BRIGHTNESS;
LDRV->PWM_DC_CFG2.reg = (s8_ledIndex == GREEN_LED) ? MAX_BRIGHTNESS : MIN_BRIGHTNESS;
if (++s8_ledIndex > GREEN_LED)
s8_ledIndex = RED_LED;
s8_onState = 1;
}
else
{
LDRV->PWM_DC_CFG0.reg = MIN_BRIGHTNESS;
LDRV->PWM_DC_CFG1.reg = MIN_BRIGHTNESS;
LDRV->PWM_DC_CFG2.reg = MIN_BRIGHTNESS;
s8_onState = 0;
}
s32_counter = 0;
}
}
}
4 Summary
Here is some comparation of how to drive the led in this project.
Then, how to drive Würth Elektronik SMD size WL-ICLEDs would be more challenging. Of course , more interesting as well.