# 22_custom_sym: creating a custom symbol

## Scope

Create a custom diode symbol with an embedded (inline) model card.

## The schematics

Click the image to get the sch-rnd sheet; also requires this project.lht in the same directory

## Preparing for simulation

Draw the symbol the usual way, using lines, rectangles and {p t} for placing terminals; select the objects, convert selection to symbol; set the usual attributes (e.g. name on the symbol and on the terminals).

For spice simulation, set the following attributes:

- symbol attribute spice/prefix to D: for the simulation this is a diode; this attribute lets the sheet name the symbol U1 still show spice a D component by prefixing the name with D_.
- symbol attribute spice/model_card to .MODEL my_diode D (IS=2f RS=3.4 N=2.2): this is how the model is specified inline, within the symbol, not relying on external libs
- terminal attribute spice/pinnum; the positive (anode) terminal should be 1, the negative (cathode) should be 2.

The inline model card option is useful for one-off symbols or for an easy and quick way of tuning model parameters in test-bench schematics.

Simulation settings are similar to those used in 10_bjt_amp_tr, except for modifications: instead of using modifications, this circuit has a voltage source symbol.