Spectrum Software
Industrial Strength Simulation




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.




Importing PWL Data From A File


The piecewise linear capability of the Voltage Source component is useful for defining waveforms that do not adhere to any standard expressions. The PWL function uses time versus voltage data pairs in order to define the waveform of the source. Typically, the data is typed directly into the VALUE attribute of the Voltage Source component. However, if there is a lot of data to be entered, this can be time consuming. Micro-Cap has a File keyword that can be used within the PWL definition which provides a method to retrieve the time versus voltage data directly from a file. The syntax for the File keyword is as follows:


This statement can be typed directly into the PWL text field within the Attribute dialog box of the Voltage Source as shown in the figure below.

PWL file defined for a voltage source

In this example, the PWL data is stored in a file called PSK2.CSV. Since no path has been specified for the file, the PSK2.CSV file would need to be located in the Data path that is specified in Micro-Cap. The Data path can be defined by selecting the Paths command under the File menu and editing the Data field in the Paths dialog box that comes up. This path defaults to the Data folder when Micro-Cap is first installed. A path can also be specified within the File keyword definition such as:


The file being referenced must contain only the time versus voltage data points. Each line in the file should have just a single data point. The PSK2.CSV file contains the following information:


This file contains 8158 data points which would have been taken an excessively long amount of time to enter manually. CSV files such as these can easily be created in programs such as Excel.

The resulting transient analysis is shown in the figure below. The PWL voltage source is producing 80us of a PSK modulated waveform.

PWL file output

One other advantage to using the File keyword is that the waveform data can be modified by third party programs at any time without having to change the circuit in Micro-Cap. Simply run the transient analysis again to view how the modified waveform works with the circuit.

The PWL file feature is also available within the Current Source component.

Download Winter 2011 Circuit Files
Return to the main Newsletter page