Introduction

The world of digitally controlled switchmode power supplies has always held a certain allure for me: the idea that you could sample things like output voltage and current, apply some DSP techniques, and then based on that output a gate drive signal in real time, giving you whatever response you want out of your buck/boost converter just seems so… insanely cool.

That being said, a lot of times these require a good understanding of the control loop architecture and parameters of switchmode power supplies to be able to properly stabilize, which has proven to be quite the barrier to entry. See the Opamp Based Boost Converter project for a bit more on what could go wrong.

Well not this time.

The constant on time control loop literally requires no loop compensation at all, it really is just sampling the output voltage and firing off a pulse of fixed width (hence the constant on time) if the instantaneous voltage is below the setpoint.

Even the old and slow MSP430 has no problem handling it.

Schematic

SVG Image created as LED Dimmer.svg date 2024/01/25 10:41:20Image generated by Eeschema-SVG+3.3V+3.3VD104D104MEDMEDD105D105HIGHHIGHD102D102OFFOFFGNDGNDR104R1043k93k91122J102J102OUTOUTSW104SW104HIGHHIGHGNDGNDGNDGNDGNDGNDC108C1081u1uGNDGNDR109R1091k1kR111R1111k1kD101D101SS35SS35+3.3V+3.3VC101C1011n1nGNDGNDGNDGND+3.3V+3.3VVCCVCCR102R102470470R103R103470470GNDGNDGNDGNDVCCVCCSW102SW102LOWLOWR108R1081k1kR110R1101k1kVCCVCCR105R1051k1kC107C1071u1uGNDGND11223344J101J101SBWSBWGNDGND112233Q102Q102PXP015-30QLPXP015-30QLC102C102330u330uGNDGNDD103D103LOWLOWL101L10156u56uC103C103470u470uVOUTVOUT11GNDGND22VINVIN33U102U102AP2204RB-3.3AP2204RB-3.31122J103J103VINVINC106C1061u1uGNDGNDGNDGNDR106R1069k19k1R107R1071k1kGNDGNDVCCVCCGNDGNDC105C1051n1nVCCVCCR101R1011k1k112266Q103AQ103APBSS4240DPNPBSS4240DPN334455Q103BQ103BPBSS4240DPNPBSS4240DPNGNDGNDGNDGND112233Q101Q101PMBT4401PMBT4401DVCCDVCC11P2.2/TA1.1P2.2/TA1.11010P2.3/TA1.0P2.3/TA1.01111P2.4/TA1.2P2.4/TA1.21212P2.5/TA1.2P2.5/TA1.21313TDI/TCLK/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q103AQ103APBSS4240DPNPBSS4240DPN112266Q103BQ103BPBSS4240DPNPBSS4240DPN334455U101U101MSP430G2553IN20MSP430G2553IN20DVCCDVCC11P2.2/TA1.1P2.2/TA1.11010P2.3/TA1.0P2.3/TA1.01111P2.4/TA1.2P2.4/TA1.21212P2.5/TA1.2P2.5/TA1.21313TDI/TCLK/UCB0SOMI/UCB0SCL/TA0.1/CA6/A6/P1.6TDI/TCLK/UCB0SOMI/UCB0SCL/TA0.1/CA6/A6/P1.61414TDO/TDI/UCB0SIMO/UCB0SDA/CAOUT/CA7/A7/P1.7TDO/TDI/UCB0SIMO/UCB0SDA/CAOUT/CA7/A7/P1.71515~{RST}/NMI/SBWTDIO~{RST}/NMI/SBWTDIO1616TEST/SBWTCKTEST/SBWTCK1717P2.7/XOUTP2.7/XOUT1818P2.6/XIN/TA0.1P2.6/XIN/TA0.11919TA0CLK/ACLK/CA0/A0/P1.0TA0CLK/ACLK/CA0/A0/P1.022DVSSDVSS2020UCA0RXD/UCA0SOMI/TA0.0/CA1/A1/P1.1UCA0RXD/UCA0SOMI/TA0.0/CA1/A1/P1.133UCA0TXD/UCA0SIMO/TA0.1/CA2/A2/P1.2UCA0TXD/UCA0SIMO/TA0.1/CA2/A2/P1.244CAOUT/VREF-/VeREF-/CA3/A3/P1.3CAOUT/VREF-/VeREF-/CA3/A3/P1.355TCK/SMCLK/UCB0STE/UCA0CLK/VREF+/VeREF+/CA4/A4/P1.4TCK/SMCLK/UCB0STE/UCA0CLK/VREF+/VeREF+/CA4/A4/P1.466TMS/UCB0CLK/UCA0STE/TA0.0/CA5/A5/P1.5TMS/UCB0CLK/UCA0STE/TA0.0/CA5/A5/P1.577P2.0/TA1.0P2.0/TA1.088P2.1/TA1.1P2.1/TA1.199GNDGND

Full Schematic

SVG Image created as LED Dimmer.svg date 2024/01/25 10:41:20Image generated by Eeschema-SVGR104R1043k93k91122J102J102OUTOUTGNDGNDGNDGNDC108C1081u1uGNDGNDD101D101SS35SS35C101C1011n1nGNDGNDVCCVCCR102R102470470R103R103470470VCCVCCR105R1051k1k112233Q102Q102PXP015-30QLPXP015-30QLC102C102330u330uGNDGND