Introduction

UPS is a dedicated peripheral for AC dimming and synchronous control scenarios, with its core functionality implementing multi-channel trigger source signal conditioning and precise trigger pulse generation. Through source selection, digital filtering, and logic synthesis, it outputs configurable trigger signals to drive the dimmer. The entire process requires no CPU intervention, ensuring the stability and real-time performance of the drive signal.

Features

  • Configurable signal source

  • Configurable input reverse

  • Rising edge detection

  • Various dimming input signal types

Block Diagram

RTL8721Dx:

The following figure shows the block diagram of the UPS module.

../../../_images/ups_block_diagram.svg
  • Multi-channel Trigger Source Conditioning

    The module supports multiple types of trigger source inputs, including external GPIO zero-crossing detection signals and timer overflow signals. The trigger source can be flexibly switched through the source selection interface. After polarity inversion configuration and digital debounce filtering, the input signals have external signal noise and glitches removed, generating stable valid trigger signals that provide a reliable trigger foundation for dimming synchronization.

  • Dual-channel Trigger Output and Dimming Synchronization Logic

    The stabilized trigger signal is output in two paths, directly supporting the core principle of AC dimming:

    One path generates a trigger pulse through edge detection, driving the back-end timer to start counting and realizing the first trigger from an external zero-crossing event. This corresponds to the zero-crossing synchronization node of the AC mains cycle, anchoring the reference for dimming pulse output.

    The other path performs OR logic synthesis of the stable trigger signal with the timer overflow feedback signal, outputting a comprehensive trigger signal to drive the PWM module. This both responds to the external zero-crossing first trigger to generate a dimming pulse, and triggers the PWM a second time after the timer expires, generating a second dimming pulse. This precisely matches the dual-pulse control requirement of AC dimming: “zero-crossing synchronization + delayed dimming.”

  • Core Dimming Principle

    The core of AC dimming is to control the phase of the pulse output, adjusting the conduction time within the half-cycle of the mains, thereby changing the average voltage at the load side to achieve brightness adjustment. The UPS module serves as the trigger core, using the AC mains zero-crossing signal as a reference, precisely controlling the delay through the timer, and cooperating with PWM to generate two dimming pulses. This precisely locks the dimming phase interval, ensuring brightness adjustment is completed within the mains synchronization cycle while avoiding light flicker caused by zero-crossing interference, guaranteeing smooth and stable dimming performance.