; Generated by JITX 2.25.0
#use-added-syntax(jitx)
defpackage main :
import jitx
import core
import jitx/commands
import ocdb/utils/generic-components
import helpers
import ocdb/modules/passive-circuits
; Define the shape/size of the board
val board-shape = RoundedRectangle(30.0, 18.5, 0.25)
pcb-module lm317a-regulator (output-voltage:Toleranced) :
pin vin
pin vout
pin gnd
pin adj
inst lm317a : ocdb/components/unisonic/LM317A/component
net (vin lm317a.input)
net (vout lm317a.output)
cap-strap(lm317a.input, gnd, 0.1e-6)
cap-strap(lm317a.output, gnd, 1.0e-6)
inst output-voltage-divider : voltage-divider(source-voltage = output-voltage,
divider-output = 1.25 +/- (15 %)
current = 5.0e-3 )
net (output-voltage-divider.in lm317a.output)
net (output-voltage-divider.out lm317a.adj adj)
net (output-voltage-divider.lo gnd)
; Module to run as a design
public pcb-module my-design :
val target-voltage = 3.30 +/- (10 %)
inst reg : lm317a-regulator(target-voltage)
; Write the board version on silkscreen
inst version-label : ocdb/artwork/board-text/version-silkscreen("Version 0.0")
place(version-label) at loc(0.0, height(board-shape) / 2.0 - 1.0) on Bottom
; Set the design name - a directory with this name will be generated under the "designs" directory
; the board - a Board object
; [optional] rules - the PCB design rules (if not givn default rules will be used)
; [optional] vendors - Strings or AuthorizedVendors (if not give default vendors will be used)
; [optional] quantity - Minimum stock quantity the vendor should carry (if not give default quantity will be used)
setup-design(
"jitx-design",
ocdb/utils/defaults/default-board(ocdb/manufacturers/stackups/jlcpcb-jlc2313, board-shape)
)
; Set the schematic sheet size
set-paper(ANSI-A)
; Set the top level module (the module to be compile into a schematic and PCB)
set-main-module(my-design)
; Use any helper function from helpers.stanza here
; run-check-on-design(my-design)
; View the results
view-board()
view-schematic()
view-design-explorer()