# How To Use Micro-Cap

Article by:
WARNING
This page is in notes format, and may not be of the same quality as other pages on this site.

## Overview

Micro-Cap is a powerful SPICE-based electronics simulator GUI which runs on the Windows operating system. It is used to cost money, but since it is no longer maintained the author has released it to use for free. Even without any new development, as of 2023 it still remains a powerful software package for simulation.

## Digital Simulation

### Digital Stimulus

You can’t use normal voltage or current sources to power and control digital circuits (I learnt this the hard way). Instead, you need to use Digital Stimulus. They can be found in the Components Browser under Digital Primitives -> Stimulus Generators.

Once you have placed a Digital Stimulus on your circuit, you configure it by double-clicking it and then enter in logic level transitions in the large text box. Example syntax is shown in the image below:

The above settings gives the following waveform if we perform a transient analysis:

There are four preset timings you can choose from to help you get started. These are 1MHzClk, Clear, Set and Train. The “1MHzClk” preset inserts the following text:

 1 2 3 4 5 6  .define _1MHzClk +0ns 0 +label=start +500n 1 +1u 0 +1.5u goto start -1 times 

### Initial Conditions

Initial conditions let you specify starting values for various simulation parameters.

.IC

EXAMPLE

One such example when initial conditions are needed is to construct and simulate a NAND-based JK flip-flop. The schematic looks like this:

Without specifying initial conditions, Q and nQ will always stay in an indeterminate state. This is because one of R or S of the SR latch needs to go to 0 for the latch to be set into a valid state. But you can’t get R or S into the 0 state without one of the outputs being 1, as they are fed back as feedback into the front-end NAND gates. The simulator does not care about indeterminate states if one of the NAND gates inputs is 0, because it can become a “don’t care” signal and the simulator can set the output to 1. But for the output of a NAND gate to be 0, ALL of the inputs have to be 1.

We add the following initial conditions in the Text tab of the Micro-Cap “circuit” simulation:

 1  .IC D(NQ)=1 D(Q)=0 

A screenshot of the initial conditions added to the Micro-Cap simulation is shown below:

Now the outputs start in a determinate state, and the simulation works as expected:

### More Examples

For more examples of digital simulation in Micro-Cap, see the Latches and Flip-flops page.

## Authors

### Geoffrey Hunter

Dude making stuff.