Skip to content

022 TVS Input Protection Branch ​

022-tvs-input-protection.mc uses the same branch pattern with a DIO.TVS transient suppressor. A small resistor separates INPUT_RAW from INPUT_PROTECTED; the reverse-biased TVS provides a path toward ground during a voltage spike. Its voltage and wattage arguments describe the protection device rather than adding new connection syntax.

bash
eval "$(../mcc/scripts/mcc-slot.sh)"
MCC_SYSTEM_ROOT="$(cd .. && pwd)" "$MCC_BIN" --local parse 02-circuits-with-branches/022-tvs-input-protection.mc --lib mcode --pass1 --pass2
MCC_SYSTEM_ROOT="$(cd .. && pwd)" "$MCC_BIN" --local parse 02-circuits-with-branches/022-tvs-input-protection.mc --lib mcode --viz -o 02-circuits-with-branches/022-tvs-input-protection.html

Source ​

text
// Example: TVS Input Protection Branch
// Goal: Add a protection branch on an external input node.
// Library focus: DIO.TVS, RES.

module main
{
    io GND
    io INPUT_EXT
    io INPUT_PROTECTED

    RES R_INPUT(100R, 50V)
    DIO.TVS D_PROTECT(6V, 12V, 600W)

    INPUT_EXT -> R_INPUT -> INPUT_PROTECTED
    // The TVS branch carries a voltage spike toward ground.
    INPUT_PROTECTED -> D_PROTECT.K
    D_PROTECT.A -> GND
}

MCode Bench is the public face of the MCode stack. Closed capabilities are served through the MCode gateway.