S4223MD is a switch dimming and color adjustment controller with memory function. It integrates two open-drain output control ports P1/P2, which can control dual-channel/quad-channel power supplies to achieve three-segment power superimposed switch dimming and color adjustment (brightness changes when mixing colors) with memory. The chip internally sets the state switching window time TSW, with a typical value of 3.3S. If the light-off time is less than the state switching window time and then turning on the light, the color temperature is switched; if the light-off time exceeds the state switching window time, the chip will remember the state before turning off the light. When turning on the light next time, the state before turning off the light will be directly presented, increasing the convenience of use. S4223MD judges the on/off state by detecting AC signals and controls the start and shutdown of the back-end power supply according to internal logic to ensure logical consistency when multiple power supplies are applied simultaneously. The state can still be switched normally in case of leakage on the light source aluminum substrate.