Skip to content

221 UART Debug Header ​

221-uart-debug-header.mc describes a small UART debug connector.

MCU_UART is a tiny local component that exposes one UART.TTL interface plus plain VCC and GND pins. J_DEBUG is a three-pin header. The MCU transmit signal U_MCU.UART0.TX goes to header pin 1, the receive signal U_MCU.UART0.RX goes to header pin 2, and GND goes to header pin 3. This matches the common TX, RX, GND debug-header pattern.

Parse 221-uart-debug-header.mc:

bash
eval "$(../mcc/scripts/mcc-slot.sh)"
MCC_SYSTEM_ROOT="$(cd .. && pwd)" "$MCC_BIN" --local parse 22-interface-recipes/221-uart-debug-header.mc --lib mcode --pass1 --pass2

Generate HTML for 221-uart-debug-header.mc:

bash
eval "$(../mcc/scripts/mcc-slot.sh)"
MCC_SYSTEM_ROOT="$(cd .. && pwd)" "$MCC_BIN" --local parse 22-interface-recipes/221-uart-debug-header.mc --lib mcode --viz -o 22-interface-recipes/221-uart-debug-header.html

Source ​

text
// Example: UART Debug Header
// Goal: Expose UART signals through a header.
// Library focus: UART, HDR, DC.

component MCU_UART
{
    name = "MCU with UART"
    pins = [
        io 1:2 = UART0::UART.TTL(DCE)
        psnk [3,4] = [VCC, GND]
    ]
}

module main
{
    io GND
    io V3V3

    DC.SRC PWR(3.3V, 100mA)
    MCU_UART U_MCU
    HDR.1X3 J_DEBUG

    PWR.1 -> V3V3
    PWR.2 -> GND

    V3V3 -> U_MCU.VCC
    U_MCU.GND -> GND

    U_MCU.UART0.TX -> J_DEBUG.1
    U_MCU.UART0.RX -> J_DEBUG.2
    GND -> J_DEBUG.3
}

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