206 Buck Controller Power Stage
206-buck-controller-power-stage.mc shows the more detailed alternative for a controller whose switching node and feedback input are external pins.
U_CTRL.SW drives SW_NODE. The power inductor connects SW_NODE to V5V, and D_CATCH is the asynchronous catch diode with its anode at GND and cathode at SW_NODE. C_OUT filters the output rail. The feedback divider uses 40 kΩ over 10 kΩ, so a controller with a 1 V feedback target regulates near 5 V:
VOUT = VFB * (1 + R_TOP / R_BOTTOM)
= 1 V * (1 + 40 kΩ / 10 kΩ)
= 5 VThis example defines a small local BUCK_CONTROLLER because the generic REG.BUCK library type exposes both OUTPUT and SW, which does not clearly choose between a complete module and a controller. A real design must still use the selected controller's datasheet to choose the inductor, diode, capacitors, feedback values, ratings, and compensation.
Parse 206-buck-controller-power-stage.mc:
eval "$(../mcc/scripts/mcc-slot.sh)"
MCC_SYSTEM_ROOT="$(cd .. && pwd)" "$MCC_BIN" --local parse 20-power-recipes/206-buck-controller-power-stage.mc --lib mcode --pass1 --pass2Generate HTML for 206-buck-controller-power-stage.mc:
eval "$(../mcc/scripts/mcc-slot.sh)"
MCC_SYSTEM_ROOT="$(cd .. && pwd)" "$MCC_BIN" --local parse 20-power-recipes/206-buck-controller-power-stage.mc --lib mcode --viz -o 20-power-recipes/206-buck-controller-power-stage.htmlSource
// Example: Buck Controller Power Stage
// Goal: Show the external power stage and feedback network of an asynchronous buck.
// Library focus: IND.POWER, DIO.SCH, RES, CAP, DC.
component BUCK_CONTROLLER(v_in::UV.VOLT, v_fb::UV.VOLT, f_sw::UV.HZ)
{
name = "Buck Controller"
spec = [
input_voltage = v_in
feedback_voltage = v_fb
switching_frequency = f_sw
]
pins = [
psnk [1,4] = [VIN, GND]
out 2 = SW
in 3 = FB
]
}
module main
{
io FB_NODE
io GND
io SW_NODE
io V12V
io V5V
DC.SRC PWR(12V, 2A)
BUCK_CONTROLLER U_CTRL(12V, 1V, 500kHz)
IND.POWER L_BUCK(10uH, 2A, 3A, 0.05R)
DIO.SCH D_CATCH(0.4V, 40V, 3A)
RES R_FB_TOP(40000R, 50V)
RES R_FB_BOTTOM(10000R, 50V)
CAP.MLCC C_IN(10uF, 25V)
CAP.MLCC C_OUT(22uF, 10V)
PWR.1 -> V12V
PWR.2 -> GND
V12V -> U_CTRL.VIN
U_CTRL.GND -> GND
U_CTRL.SW -> SW_NODE
SW_NODE -> L_BUCK -> V5V
GND -> D_CATCH.A
D_CATCH.K -> SW_NODE
V5V -> R_FB_TOP -> FB_NODE
FB_NODE -> R_FB_BOTTOM -> GND
FB_NODE -> U_CTRL.FB
V12V -> C_IN -> GND
V5V -> C_OUT -> GND
}