B2 Spice A/D v5 Problems and Solutions


I just installed B2 Spice v5 on my Windows Vista/7 64-bit computer and I'm getting the error message "Database open failed with the default database in any mode."

The issue stems from the fact that some 64-bit Windows computers have already have their back-end database system configured with 64-bit drivers, which our program is not compatible with. But there is an easy fix.

Go to Start->(Control Panel)Administrative Tools->Data Sources (ODBC) From there, remove all instances of name="MS Access Database" from the User DSN, System DSN, and File DSN. Close that dialog then go to c:\windows\sysWOW64\ and run odbcad32.exe. From there, add a DSN that matches the following image for User DSN and System DSN: <click for image>

How do I convert PSpice's LIMIT function to work in B2 Spice v5?

PSpice's limit function places a lower and upper limit on a value but we haven’t implemented this in our program yet. However, you CAN use B2 Spice's nonlinear 'B' source's IF-THEN-ELSE function in place of the limit.

The LIMT function’s format is LIMIT(x, lower, upper), so the equivalent ITE expression is

if(x < lower, lower, if(x > upper, upper, x))

That’s just nesting two IF statements to mean

"if x < lower, then the value is lower. If x > upper, then the value is upper. Otherwise the value is x."

IF-THEN-ELSE functions can ONLY be used in the 'B' nonlinear source.

How do I display a timing diagram like the one shown in the digital
tutorial?

When the tutorial and manual were written, we had not actually implemented a timing diagram yet and there was an assumption that we would eventually. However that has not yet happened but it is still on the list of things to do. But to get a timing diagram, you can use a 'cheat'. Just set up a Transient test for a start time of 0 and a stop time of -1. When the Transient Test is run, the simulation will proceed indefinitely until you stop and reset it using the simulation toolbar. The circuit will still be interactive if you have digital inputs and outputs in it and digital traces will be displayed in the resulting graph.

Some of the tabs are cut off by other windows in the program and I don't have access to all the information in
those tabs.

This is usually due to the fact that Windows' screen fonts have been changed from the default "Small Fonts" to "Large Fonts". We're trying to find a solution to this problem because the font size is handled automatically and is out of our control. Until we get a fix for this, the workaround is to change Windows' screen font size back to "Small Fonts". To do so, go to the Control Panels->Display Properties->Settings->Advanced Button->General tab. In that dialog, there should be a Font Size box with a drop-down box. If it currently lists 'Large Fonts', change it to 'Small Fonts' and OK all the dialogs.

When I run the program, I get an error message saying "The ordinal 32 could not be located in the dynamic link library BDSP.DLL" and the program does not run.

For some reason, an invalid or non-working version of this DLL exists in your system or was installed incorrectly. Follow the these instructions to fix this:

Go to your C:\Windows\System32 directory and locate BDSP.DLL. Rename it to BDSP.BCK.

Download the following zip file: bdsp.zip and extract the BDSP.DLL in that zip file to the C:\Windows\System32 directory

Try starting up v5 and let us know if this does not solve the problem.

During installation,
I get an error message in the form of "*.tmp has generated errors
and will be terminated." What does this mean?
This is an error message generated by a sub-installer provided by Microsoft we have no control over it. This is safe to ignore and will not affect your installation.
How do I convert a PSpice model for use in B2 Spice?

A specific PSPICE specific conversion to look for is how PSPICE denotes resistors, capacitors, and inductors in the .model line. PSPICE uses RES, CAP, and IND where Berkeley SPICE uses R, C, and L respectively. For instance, a resistor model in PSPICE will be something like

.model rmod RES ...
whereas Berkeley SPICE will look like
.model rmod R ...

Also, PSPICE's dependent sources can use a VALUE= syntax and then an equation for the voltage or current. SPICE doesn't have this syntax but the conversion for this is to replace the device with a non-linear source, depending on the original PSPICE device type. For instance:

PSPICE:
EFB 12 OUT VALUE={8.822-.4024*V(13,5)+5.250E-3*V(13,5)*V(13,5) -.6667*V(13,5)*V(6,5)}

SPICE:
BEFB 12 OUT V = 8.822-.4024*V(13,5)+5.250E-3*V(13,5)*V(13,5) -.6667*V(13,5)*V(6,5)

The "VALUE =" with a "V=" to denote a voltage source because the original device was an "E" voltage controlled voltage source and the "V =" means "voltage equals". If the original device were a current source F or G type device, the instead of "V=", you would use "I ="

Also there are simply some model parameters that just have no SPICE equivalent and must be left out. I don't have a complete list of the non-SPICE syntax but our program will let you know if it doesn't recognize a parameter and then ignore it so really nothing has to be done. But it's worth keeping in mind that the effects of the omission are unknown and must be considered.

The hardest thing to convert is PSPICE's ability to use If-Then equations. There is a convoluted way to use logical syntax in SPICE and one of our users was kind enough to write up a guide on doing so: http://www.beigebag.com/case_logical_1.htm.

These are the most common problems when trying to convert PSpice to Berkeley SPICE and there will probably be more specific problems that are not covered here. PSPICE to Berkeley SPICE conversion is as much art as science and there's no set way to convert all cases of PSPICE to Berkeley SPICE. If you have problems, you can always submit it to us for help.

Is there any way to speed up my simulation?

There are a couple of things to try if you believe that the simulation that you're running is going slower than it should.

The first thing to try is to make sure that circuit state animation is turned off. One of the features of version 5 is the ability to show animated circuits, i.e., showing voltages and current flow with dynamic symbols and colors.  To see an example of this click here.  This feature, while very useful, does take up a significant amount of computing power as it redraws the circuit wires with each simulation interval.  If you value speed over visuals, make sure that all these options are turned off in the ANIMATIONS tab.

Also, if you have any virtual instruments showing, try collapsing the instrument window so the program does not need to update the instrument displays.

Another thing you can do is to try to change your simulation parameters. If you're running a Transient simulation, you can try increasing the step size if you don't mind losing a bit of resolution. Or if you have "use initial conditions" checked when you really don't need to, turn that off. Also in Transient simulation, you can try going to the Miscellaneous Options in the Simulation menu and playing with the minbreak parameter. One of our users reported good results using a value of 1n and increasing from there. Too large a value might result in convergence problems.

Finally, you can try altering the convergence options found under the "Simulations->Simulation Options" menu. By default, we have pre-set some parameters to avoid the most common convergence problems. However, you can try increasing the "reltol" parameter since we've set it to something finer than it needs to be. Try 1e-3 instead of the given 1e-4. But keep in mind that this might affect the accuracy of your simulation. You might need to change your step size to compensate.

I've just imported a model into the Database and everything went smoothly. When I place it in a circuit and run a simulation, I get an error saying "unrecognized parameter (parameter) - ignored". What's up?

This message means that the simulation engine encountered a model parameter that isn't recognized by Berkeley Spice. For instance, the following line will produce an error:
.MODEL Dbody D Is=125f N=1.023 Rs=1.281 Ikf=18.01 Cjo=46.3p M=.3423
+ Vj=.4519 Bv=60 Ibv=10u Tt=161.6n
>ERROR: unrecognized parameter (ikf) - ignored
This is because the IKF parameter is a PSPICE parameter and isn't a valid Berkeley SPICE parameter. B2 Spice will then ignore the parameter and proceed with the simulation. However, the effects of the ignored parameter is unknown and should be kept in mind. You can elect to remove these parameters permanently from the model by using the Database Editor to remove these parameters.

Another PSPICE notation that can cause problems is PSPICE's way of denoting resistors, capacitors, and inductors in the .MODEL line. PSPICE uses RES, CAP, and IND, respectively while Berkeley SPICE uses R, C, and L, respectively. Just make these changes and the model should import correctly. An example is below:
.model rt RES tc1=-0.006 (PSPICE)
.model rt R tc1=-0.006 (Berkeley SPICE)

However, the Database Editor can automatically fix these error automatically in the process of importing the model.

A part that I placed on the schematic is shown in red. What does that mean? I ran a simulation and the log says that part XXX doesn't have a simulation model. What does that mean?

Some parts in the database contain only symbols and no simulation data. These are the parts that are colored red in the schematic. If the part that you're using is shown in red and has the pins X'ed out then the part does not have a simulation model. Parts with no simulation model will also be flagged in the simulation log. The part will be left out of the simulation, which can produce unexpected results.

To get around this, just replace the parts with no simulation models with parts that have them. It might be that there isn't an equivalent part, in which case you'll have to find an alternate part. In the parts browser, you can filter out the non-simulating part by checking the "show only parts with simulation model" check box. This should filter out all the Eagle schematic parts.

When a simulation is run, an error message appears saying "Illegal type for token...".  What does this mean? This error message could mean a number of things, but the most common problem is that in the circuit a part's value is incorrectly stated, usually using the European convention for decimals.  For example, if you're using 4K3 to denote 4.3K, that would cause the error.  Just fix the notation and it should proceed without a problem.
I'm looking for a certain part and it just isn't in the database.  How do I get it? While we strive to have as many parts from as many manufacturers as we can, some parts just aren't available as Spice Models.  If you know a certain part from a certain manufacturer is available but isn't in our database, you can import it yourself.  Please refer the the help file and do a search for "Creating a Device from a Subcircuit Model Using the New Device from the Text File feature".  If you're having problems, let us know and we'll try to help.  If you're not sure or just curious if such a part exists, drop us an email asking so.  We'll look into it and get back to you.
I've imported a model using the Database Editor and have set it up correctly.  When I try to simulate how come I get "unknown parameter" errors in the log window?

More often than not, the problem is that the model you've imported is not Berkeley Spice compatible.  The Database Editor can convert older Berkeley Spice format but it can't convert from PSpice, IBIS, and some other formats to Berkeley Spice.  So if you're having this kind of error, then email us about it and include the model text.   We'll see if we can't get something working for you.

It could also be that within the controlled-source line is a scientific notation type for a number, such as 1e3 or 1K. If this is the case, these numbers need to be replaced with decimal equivalents, e.g., 1000 for 1e3 or .001 for 1m.

How do I set up a time dependent switch? A time dependent switch has been added in A/D 2000 version 3.0.2.  You can upgrade from our tech support page at www.beigebag.com/tech.htm.  For users who haven't done so yet here's how to set up such a switch:

You will need to set up two circuits - one will be your main circuit containing the switch and the other (independent) circuit will contain a simple voltage source set up as a Piece-Wise Linear source and set the change time to whatever you wish and the change voltage to 1. 

In your main circuit, use a voltage controlled switch and set its controlling source as the PWL voltage source.  When the PWL changes to 1 volt, then the switch should close.

I’m getting "Timestep too small" errors in the log window. What am I doing wrong? The most common problem is that the transient simulator is giving up too easily. You need to increase the Upper Transient Iteration Limit (ITL4) in the Convergence Options dialog box from 10 to 100. If this doesn’t solve the problem, then try 1000 for itl4. If it still doesn’t work, then follow these steps.
  1. Get the operating point analysis to converge. To do this, you may need to modify convergence options. The relevant convergence options for operating point analysis are itl1, gmin, rshunt, and abstol. First, increase itl1 to 500. If the operating point analysis doesn’t converge, then increase itl1 to 2000. If it still doesn’t converge, then set gmin to 1e-12, and rshunt to 1G. If that doesn’t work, then set abstol to 1e-10. You can play increase gmin, decrease rshunt, and increase abstol until you get convergence, however, be aware that gmin must be small compared to any other conductance in the circuit (including internal transistor conductances) and rshunt must be large compared to any other resistance in the circuit, or else your results may become inaccurate.
  2. After the operating point analysis is working, then retry the transient analysis. If it fails, then you should increase itl4 up to 1000. Eventually, playing around with these convergence options should result in a successful simulation. As a last resort, increase the relative error tolerance (reltol) by a factor of 10, but this will reduce the accuracy of the simulation.
  3. See our user manual or help file for additional information on transient convergence and convergence options.
I’m getting "Iteration limit reached" errors in the log window. What can I do to fix it? See above- the same advice should help fix the problem.
I’m getting "Singular Matrix" errors in the log window. What can I do to fix it? See above- the same advice should help fix the problem.
I’m getting "GMIN/Source Stepping failed" errors in the log window. What can I do to fix it? See above- the advice for getting the operating point analysis to converge should help fix the problem.
I have an oscillating circuit that does not simulate properly. What can I do to fix it? First, set initial conditions in the circuit. You can do this in either of two ways. The recommended method is to place markers in the circuit and set the initial voltage of the markers by double clicking on the markers and entering values for initial voltage and then checking the box to use initial voltage. Some oscillating circuits require an initial state that is not symmetric. Also, in the transient simulation set-up window, check the box for Use Initial Conditions.

If this does not get the circuit to work, then follow the advice in the item above on getting the circuit with switches to simulate.

How do I perform a temperature sweep? Set up a DC Sweep and use temperature as the source name and leave the property name blank. However, not all parts are temperature dependent by default. For example, you must use temperature dependent resistors and set their TC1 and TC2 parameters in order for the resistor to vary with temperature. Also, leave the instance-specific temperature blank if you want the temperature of that instance to be swept. If you specify the temperature of a resistor, for example, then the program keeps the temperature of that resistor at that fixed value even while the temperature for the circuit is sweeping.

The same principals apply when performing parameterized transient and ac sweeps with temperature as the parameter.

How do I examine a specific component as it heats up? Perform a dc sweep analysis, a parameterized ac sweep, or a parameterized transient sweep depending on whether you want to observe the changes to the dc characteristics, ac characteristics, or transient characteristics of the circuit.

Use the device name whose temperature is to be swept for the source name and the parameter named "temp" if it is available for the property name. If you are sweeping a resistor’s temperature, then make sure that it is a temperature dependent resistor and give it TC1 (and possibly TC2) values.

The displayed sine wave signal looks choppy. Can I smooth the shape of it? Yes, using the Step Ceiling parameter in the transient simulation set-up window. The shape of the curve is influenced by the TMAX parameter. You can set the TMAX parameter as approximately 1/16 of period of a voltage or current source signal.