Spectrum Software has released Micro-Cap 11, the eleventh generation of our
SPICE circuit simulator.
For users of previous Micro-Cap versions, check out the
new features available in the latest version. For those of you who are
new to Micro-Cap, take our
features tour to see what Micro-Cap has to offer.
Changing the Power Supplies of Digital Parts
....Adapted from an earlier Bill Steele article and updated for MC6
The default power supplies of all digital parts in MC6 is a battery whose value is set to 5V. In some applications, the supply must be changed. There are a few methods for changing the power supplies which are dependent on whether it is local or global, on what type of digital family that is to be changed, and on whether it is a digital primitive or a subcircuit. Currently, there are two power supply subcircuits contained in the DIGIO.LIB (digital input/output library): one for the 74/TTL families and one for the CD4000 family. One thing to keep in mind when changing the power supplies is that all of the components in the digital library have their propagation delays and constraint times defined in accordance with 5V operation. Editing the digital library may be a necessity if the delays or constraints are a factor in the simulation.
Changing the Default Power Supply
The two default power supply subcircuits are shown below as they appear in the DIGIO.LIB:
Editing these supplies is simple. Open the DIGIO.LIB file in the DATA subdirectory. Find the power supply subcircuits in the file. For the 74/TTL power supply subcircuit, you only need to edit the line that begins with '+ params:' and place in the appropriate value for the VOLTAGE parameter. The REFERENCE parameter is by default 0V and may also be changed. The new line should appear similar to:
+ params: VOLTAGE=3.3 REFERENCE=0
For the CD4000 power supply subcircuit, edit the lines that begin with '.param'. These two .param statements control the supply rails. CD4000_VDD controls the positive power supply and CD4000_VSS controls the ground or negative supply. The edit should appear similar to:
There are a couple of drawbacks to this method. The first one is that this changes the value used by all circuits that reference the default value. Any circuits that have been created previously would now use the new value which may not be desired. Using one of the older circuits would require changing the DIGIO.LIB back to its original values or to edit the circuit using one of the other methods mentioned in this article. The second drawback only occurs with the 74/TTL power supply subcircuit. Some of the families that reference this subcircuit, such as the LS family, are only designed to be run at 5V. Changing the power supply would cause these parts to run incorrectly when placed in a mixed mode configuration.
Changing the Power Supply for all CD4000 Parts in a Circuit
Instead of changing the default value, the CD4000 family offers a simple way to change the power supply of all CD4000 components in a single circuit. Notice how in the CD4000 power supply subcircuit there were the two '.param' statements. These statements set the default value in the DIGIO.LIB file. However, if a '.param' statement is present in the schematic, it will override the values present in the DIGIO.LIB file. Therefore, to change the power supply for the circuit, all one has to do is add the following statement either on a schematic page or in the text area.
All of the CD4000 components in this circuit would then use a single 10V supply.
Using Separate Power Supplies in a Circuit
Sometimes you may need separate power supplies for digital parts in one circuit. In this case, a new power supply subcircuit and a new I/O model statement will need to be created. The best way to do this is to copy the appropriate power supply subcircuit and I/O model to a new file, so that it won't be overwritten in the case of an upgrade. You can use these as shells to easily create new ones. This example creates a 3.3V power supply for the 74HC family.
The only changes made from the IO_HC model were the name of the model and the value of the parameter DIGPOWER. Note that the DIGPOWER parameter now contains the name of the power supply that was just created. Minor adjustments may need to be made in the impedances and the switching times, but the changes above will give you a solid model to work with.
Place the name of the new library in the NOM.LIB file, found in the DATA subdirectory, in the same format that all of the other libraries appear. You need to do this so that MC6 can access the library through its internal .lib statement. To use this new model, you would place IO_HC_3V into the I/O MODEL attribute of a digital primitive or if using one of the subcircuits from the digital library, you would replace all instances of IO_HC with IO_HC_3V throughout the subcircuit. Any other HC parts can still access the IO_HC model that would give them a 5V power supply.
Using an On Schematic Power Supply with a Digital Primitive
Having a digital primitive access a power supply that exists on the schematic is as simple as changing one of its attributes. Each primitive has two attributes that control the power supply nodes. The two attributes are POWER NODE and GROUND NODE. By default, these are set to $G_DPWR and $G_DGND which are the nodes that are produced by the 74/TTL power supply subcircuit. These attributes may be set to any nodes that exist in the schematic.
The node number itself may also be used in the attribute, but naming the node is a better procedure since the node numbers may change if the circuit is edited. The schematic in Figure 1 shows three similar digital inverters. The top one is a digital primitive that references the standard 5V supply. The middle one is a digital primitive that references the user-generated supply at MYVDD. The bottom inverter is a library part that references the user-generated supply at MYVDD. Figure 1 also shows how the POWER and GROUND attributes of the second inverter (the primitive)have been set to the schematic nodes MYVDD and MYGND.
Using an On Schematic Power Supply with a Digital Library Part
The power and ground nodes of all components in the digital library have been defined as optional nodes as exemplified in the following subcircuit.
The DPWR node is the power node and the DGND node is the ground node. The OPTIONAL keyword lets you add one or more nodes to the subcircuit call. If the nodes are included in the circuit, they override the default node values which in this case are derived the standard power supply subcircuit.
In order to include these nodes in a schematic, the pins DPWR and DGND must be added to the component in the Component Editor. Figure 2 displays the modified 7404_P part within the Component Editor. The shape for the 7404_P is the INV4 which explicitly provides the two power pins needed. Clicking in the Shape area of the Component Editor lets you add pins to the shape. The DPWR and DGND pins were added and specified as analog pins since the power supply subcircuit consists only of analog components. The power and ground nodes can now be connected in a schematic.
Figure 3 shows the transient analysis and displays the user power supply with a simulated ripple and plots the voltage waveform at the output of a standard digital gate, a digital primitive, and a digital library part. The waveforms from the circuits that use the MYVDD power supply show evidence of the its ripple.