# 18_opamp_ac: 2 slot opamp

## Scope

A notch filter built with two opamps: this filter passes signals between DC and 100 kHz but filters out 1 kHz signals. Demonstrated using a slotted opamp with simulation.

## The schematics

Click the image to get the sch-rnd sheet

More info on the circuit: www.electronics-tutorials.ws

## Preparing for simulation

The lm358 contains two opamps in a single physical package. For the PCB workflow this is going to be a single footprint with 8 pins. For spice simulation, two separate components are exported, one per slot. The problem is: only slot 1's power terminals are connected! This is no problem for the PCB workflow, where a physical connection between slots exists within the package. For simulation, the trick is to set spice/shared on the power terminals on both slots (4 terminals total). This tells sch-rnd to share the connection between the same numbered terminals of different slots of the same symbol.

Other than this, everything else is pretty much the same as in 12_bjt_amp_ac.

### Raw spice commands

Same as in 12_bjt_amp_ac.

## Export and run ngspice

Running ngspice the usual way on the export yields the following graphs:

## Using other implementations

### gnucap

Gnucap throws errors: open circuit: internal node ...

Gnucap uses a different command syntax. Modify the spice command symbol's spice/command attribute to:

    print ac vdb(out) zp(out)
    op
    ac dec 10 1 1000k > plot.txt

After the export, write the single word spice in the first line of the file (e.g. using a text editor), otherwise gnucap won't know the file is in spice syntax. Then run gnucap 16_omapm_dc.cir and it will dump a text table to plot.txt that can be plotted using a suitable utility, e.g. gnuplot.

The gnucap-modified schematic is also available.

### xyce

TODO