Skip to content

012 RC Low-Pass Filter ​

012-rc-low-pass-filter.mc treats VIN and GND as connection points supplied by a larger design. R_FILTER lies between VIN and VOUT, while C_FILTER shunts VOUT to ground. With 1 kΩ and 100 nF, the cutoff frequency is about 1.6 kHz. A named net does not require a local source or pin declaration before it is used.

bash
eval "$(../mcc/scripts/mcc-slot.sh)"
MCC_SYSTEM_ROOT="$(cd .. && pwd)" "$MCC_BIN" --local parse 01-basic-circuits/012-rc-low-pass-filter.mc --lib mcode --pass1 --pass2
MCC_SYSTEM_ROOT="$(cd .. && pwd)" "$MCC_BIN" --local parse 01-basic-circuits/012-rc-low-pass-filter.mc --lib mcode --viz -o 01-basic-circuits/012-rc-low-pass-filter.html

Source ​

text
// Example: RC Low-Pass Filter
// Goal: Filter a signal with a series resistor and a shunt capacitor.
// Library focus: RES, CAP.

module main
{
    io GND
    io VIN
    io VOUT

    RES R_FILTER(1000R, 50V)
    CAP C_FILTER(100nF, 16V)

    VIN -> R_FILTER -> VOUT
    VOUT -> C_FILTER -> GND
}

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