202 USB 5 V Input
202-usb-5v-input.mc describes a USB Micro-B connector used only as a 5 V power input.
J_USB.1 is the USB VBUS pin and feeds VBUS_5V through the resettable fuse F_USB. J_USB.5 is tied to GND. D_VBUS is a TVS clamp with its cathode on VBUS_5V and its anode on GND, and C_VBUS connects from VBUS_5V to GND as an input bypass capacitor.
Parse 202-usb-5v-input.mc:
bash
eval "$(../mcc/scripts/mcc-slot.sh)"
MCC_SYSTEM_ROOT="$(cd .. && pwd)" "$MCC_BIN" --local parse 20-power-recipes/202-usb-5v-input.mc --lib mcode --pass1 --pass2Generate HTML for 202-usb-5v-input.mc:
bash
eval "$(../mcc/scripts/mcc-slot.sh)"
MCC_SYSTEM_ROOT="$(cd .. && pwd)" "$MCC_BIN" --local parse 20-power-recipes/202-usb-5v-input.mc --lib mcode --viz -o 20-power-recipes/202-usb-5v-input.htmlSource
text
// Example: USB 5 V Input
// Goal: Use a USB connector as a 5 V power input.
// Library focus: USB.SOCK_MICROB, FUSE.PTC, DIO.TVS, CAP.
module main
{
io GND
io VBUS_5V
USB.SOCK_MICROB J_USB
FUSE.PTC F_USB(0.5A, 6V, 1A)
DIO.TVS D_VBUS(6V, 12V, 600W)
CAP.MLCC C_VBUS(10uF, 10V)
J_USB.1 -> F_USB -> VBUS_5V
J_USB.5 -> GND
VBUS_5V -> D_VBUS.K
D_VBUS.A -> GND
VBUS_5V -> C_VBUS -> GND
}