The first type of op amp circuit is a square-wave generator, or also called an RC relaxation oscillator. We do this by operating the op amp as a comparator. A comparator's output toggles between +Vcc and -Vcc at a frequency dependent on the charge/discharge rate of a capacitor through a feedback resistor. When the output is high the capacitor charges. Once the voltage across the capacitor reaches a certain positive reference voltage, the output is driven negative. Once the capacitor charges to the negative reference voltage, the output is driven high. With positive feedback, this cycle continues and we see a square wave oscillation on the output. The frequency of the oscillation is f = 1/(2RC).
Next we will create an integrator, which performs the mathematical operation of integration with respect to time. How could we use an integrator to create different waveform shapes for our function generator?
The integrator works by passing a current that charges or discharges a capacitor in the negative feedback loop. To analyze an integrator, first assume that the opamp is ideal. The integrator looks like this: