========ANALOG
ART===================
1) Productivity
Tools and Templates
In Electronics there always seems to be opportunity to spend time to
save time.
Some times it is far easier to just create yourself
a tool in order to save a lot of work.
A) Recording Reverse Polish calculator
B) R_C_F calculator
C) R_C_L_F
calculator
D) Formula
_calculator
E) 3D_FFT_calculator
F) Other Javascript Calculators
Getting
something to work often requires far more attention to detail
than the help files provide.
Working examples need to have all the required details in
place just to work.
The following "work in progress" organized working examples intended
for cut and paste use.
A) macspice/winspice Template web page
B) SIMetrix
Template web page
C)
javascript
Template web page
D) Perl
Template web page
E) Ccode
Template web page
F) Xcode
Template web page
G) Web Page
Template web page
H)
Icarus Verilog Template web page
I) LabView
Template web page
J) ICEDIT
Template web page
K) Quartz
Template web page
L) MacUnix
Template web page
M) FINK
Template web page
N) XCircuit
Template
web page
N) Excel
Template
web page
O) AquaTerm
Template
web page
P) Dynagraph
Template
web page
Q) GnuPlot
Template
web page
R) GerberView
Template web page
S) Mathomatic
Template web page
T) Open
Old Mac Files Template web page
U) SciLab
Template web page
V) Arduino
Template web page
W) SVG
Template web page
X) MS_WORD
Template web page
2) Free Spice
Several free or semi-free versions of spice are
available off the web.
SIMetrix is a cadence/pspice
like limited free version
for
windows.
Macspice is a spice-standard
free version
for
OS X which allows scripting.
Winspice is the spice-standard free
version
for windows which almost works
using the same code.
This simple little PLL transient simulation runs off the exact
same code.
3) Spice Models QA
The design engineer using a model is the really the one responsible for
the model being accurate.
Sometimes the TC of a diode needs to be sanity checked
in order to design a bandgap reference.
Matching a model to a curve tracer
is typically the first thing to do.
The extended bipolar dynamic range of
today's BiCMOS makes a Gummel Poon
Plot more critical.
4) Spice Scripting
Designing something like an Op Amp requires testing a circuit
over all the "corners".
Many permutations need to be tested because a
design will typically fail at a subtle "corner condition".
The permutations typically involves
3 temperatures, 2 supply voltages, multi-applications, and several
"process corners".
A scripting ability in Spice allow the changing of
its internal simulation conditions on the fly.
This enable a single
multi dimensional simulation to effectively test
everything.
The results can be stored in a text file which can
be further processing by a perl program.
Simulators such as Macspice/Winspice and cadence
(Ocean)
and SIMetrix(not_free) allows
scripting.
The scripting resource can be used to do
customized testing of things like THD,
capacitance, and F_tau.
5) BSIM4 simplified
The latest BSIM4 manual off the web
describes about 300 model parameters.
If one downloads the following 180nm to 22nm
BSIM files off the web.
That adds up
3300
BSIM model parameters which may or not may be critical .
It would be convenient if all the data could be
reorganized as a table.
Acrobat Pro allows the
conversion of a pdf file to the following
text file which has been slightly cleaned up.
A
simple perl program can dump all
the model files into
a single
text file.
Another perl program can use
the previous two text files to create a
table of all parameters versus process.
The
table can further be color coded
to view the trends.
6) PERL and text files
Production test data for an Analog IC is usually available as a text
file.
The previous BSIM4
simplified example shows how perl can read and reorder text
data
such as a data log.
This feature can also come in handy for the previous Spice Automatic Testing example.
The previous perl program that combines
directories into a single text file gets a lot of use.
Another handy program can reorganize
the data within a single text file.
7) The Most Beautiful
Equation in the World.
Euler identity
has been described by some as "the Most Beautiful Equation in the
World".
A FFT is really just mapping analog signal to Euler identity.
This can be better seen when the results of
a FFT is plotted in 3D.
A javascript calculator as been
developed which can also do the 3D plotting.
8) Transient Noise Simulations
Spice programs like SIMetrix
allow noise to be simulated in transient analysis
.
For spice programs like Macspice/Winspice, a RandomPWL javascript can created
the data.
SPICE can read the PWL file and simulate and plot both
transient and spectrum results.
Using a Noise Transient Analysis, it is possible
to see how two noise sources add together.
9) THD Simulation using Sprectrum Analysis
Simulating THD in
transient analysis shows the
actual distorted waveforms.
Selected elements of the spectrum output
can be mathematically processed to get THD .
The classical
distortion over
temperature of a differential input is a good place to start.
Adjustments of area ratios for distortion cancellation
for an alternative input can also be viewed.
The distortion profile of differential input stages all track
absolute temperature.
10) Extremely Easy Ways to Generate Spice
Waveforms
By making a voltage ramp that tracks time, waveforms can be generated
using equations.
Some examples are Triangle waves, Square waves, and Ramp
waveforms .
This can be extended to making PWM waves that can also be made to be in sync .
Equations for Amplitude
Modulation and Phase modulation also work.
But this makes it real easy to Sweep
Parameters of the Input Signal over time.
11) Play with Transmission Line Reflections
The EDN
trade
magazine has written some good articles about Time-domain reflectometry.
Modeling transmission lines as LC subcircuits
may give some vision as
to what is happening .
The various impedance mismatches
can be all simulated.
The results are all the same but all
internal node voltages and currents are visible.
The cable speed appears to simply
track the time constants of resonance elements.
Identifying and tweeking out cable discontinuities
can also be played with.
12) Watch Noise Cancellation Work Inside
an
Op Amp.
In negative feedback, an amplifier will try to cancel out all internal
noise sources.
A Noise Transient Analysis applied to an
Amplifier
can show everything working .
Modeling an accurate Audio frequency Noise waveform
can be very useful .
Transistor
subcircuits can then be modeled to have their noise properly
track bias current.
Observing how current noise can be modeled
as input noise voltage is a good sanity check.
Noise
operating in an Operational Transconductance Amplifier
can also be observed.
13) Simulate a Pinch Resistor.
A subcircuit can be made to follow the equations of a pinch resistor.
14) The Balanced Low Voltage BandGap.
Need an accurate low voltage bandgap that works down to 900mV over temperature?
The age old design technique of balancing out errors
still works .
But balancing is only as good as it is possible
to know all the errors.
15) State Variable Filters Map Equations
to Circuit Components.
Relating the equations to the simple term of Q is a good
starting point.
The Q terms in the equation maps
to feedback in State Variable Filters.
The frequency terms map independently to the
integrator terms.
The equation works on
resistor ratios and not absolute values.
Operational
Transconductance Amplifier can replace the integrators
This allows voltage to
control the frequency of a State Variable
Filter.
It also allows complete IC integration of
analog audio frequency filters.
The mapping comes in handy making Butterworth and Bessel filters
16) FFT Your Company's Stock Using Spice
It is always nice to add REAL
Input Signal to a Spice Simulation.
It only requires a spreadsheet
and a text editor to input any data.
Software is being written to convert computers into oscilloscopes.
The line-in port can be used to digitize Audio frequency waveforms.
And USB hardware is being developed
to digitize higher frequencies.
17) Make Some Pretty Waveforms.
Generating Lissajous waveforms involves
using the X/Y features of spice.
Another X/Y oscilliscope
application is for BH curves.
18) Measure Stray Capacitance Within Spice.
The scripting features in Spice can be used to measure and print out capacitance.
This feature extends to measuring all
the strays capacitance's within a MOS
device.
The feature further extends into making
a CV plot of gate capacitance.
19) Investigate f_tau Parameters using
Spice scripting.
Page 72 of the
Gummel-Poon Toolkit describes
the f-tau situation.
Observes the effects of changing TF or CJE or IKF or ITF or VTF or XTF.
20) Voltage Controlled Filters
State Variable
filters can vary their frequency if made using gm_C stages.
The Low Phase distortion of a Bessel filter will hold over all
VCF frequencies.
The flat pass band response for a Butterworth will hold as well.
The Phase distortion of a Butterworth
does change with VCF frequency.
21) Group Delay on Phase Distortion.
The
Bessel filter shows why good
group delay means low phase distortion.
The
Butterworth filter shows the
source of phase distortion.
22) New Thermal Concerns.
Silicon Oxide has
one tenth the thermal conductivity of silicon.
Oxide Isolation thermally isolates transistors.
This simulation investigates real lab measured thermal
self heating.
23) Simple Logic Functions in Spice.
Sometimes simple
logic
functions can be defined with a single spice line.
A folded ADC method can be used to do an ADC function.
Easy ways if decoder or flipflop functions are needed.
24) Interesting Effects of Distortion in
Filters
Distortion with feedback allows filter operation under multiple states
Chaos type plots can show these
effects in active filters.
Distortion also
can generate a
"hang on" and
"snap back" effect
25) Generating FM In Spice May Be Easy By Using PM
Frequency
Modulation in Spice is really Phase Modulation
And Phase Modulation is really
Double Frequency
Modulation.
An alternative way of generating a
FM
signal is through PM
Or view
an
FM
Spectrum
as a Polar to Rectangular Conversion.
The
FM Spectrum can be fully
visualized in this way.
26) Automotive Power Amplifier Design
How a Full Automotive Amplifier was
built using only 5 leads
The
AB_Bias versus
CrossOver
Distortion tradeoffs.
Bottom
side output stage saturation and top
side
hang on.
Bottom
side Fuzzies.
Why the
short lead rule.
Top side composite stablity
and the
Invention that addresses it.
Chrysler thermal shut
down problem.
Output transistor
IR drop
and transistor layout.
27) An AB_Biased
Operational Transconductive Input Stage
It is
possible to lower noise and offset while also lowering distortion.
A
differential Bipolar Input stage's distortion
tracks
absolute temperature.
A
dual differential Bipolar
Input stage can reduce distortion.
The distortion of a dual differential
Bipolar Input stage
also tracks absolute
temperature.
A new
AB_Biased Input has
adjustable cross over distortion.
And it has an
adjustable
current gain over its DC current.
And the distortion
also tracks absolute
temperature.
To
compare to a LM3080
architecture, offset, distortion and noise needs to be simulated.
The comparision is made by putting the
AB_Biased input
stage in a LM3080 application.
28) Plotting a Root Locus Using Spice
Spices's Pole/Zero analysis can be sanity checked against
a
plotted a Root Locus.
29) Bipolar and CMOS Noise Parameters
An attempt to match the
Noise Voltage and
Noise Current of a LM394 .
The Noise voltage for a
BiCMOS NPN is as expected.
But
1/f Noise for a CMOS transistor
may be getting interesting.
30) Bipolar RRIO Operational Amplifier
Design
The
LM324 leads to the RRIO Op Amps.
Bipolar
input requirements and Supply Voltage.
Preferred
input steering and
using vertical pnps.
The need for
input clamp diodes.
A
clamp
to slew rate invention.
An
AB
Bias Dual Input Turnaround.
Shortening
the signal path.
Balancing
out beta loading.
GraceFull
death at the output stage.
Shortening the signal path at the output.
Saturation
current limit.
31) A Perfect RRIO Operational
Amplifier
Design
Chopper Amplifiers frequency
shifts both offset and 1/f noise.
This however can lead to an
input
aliasing problem.
The aliasing problem is
commonly
fixed using spread spectrum.
An
FM
limiter gain stage shows how to take a lot of gain.
This same gain can be
done
using an on chip capacitor.
The DC offset is cancelled out using
a subHertz integerator.
The chopper signal gain stage
tends
to remove offset and 1/f noise anyway.
A similar gain stage can be
used to quietly spreadspectrum an
oscillator.
If the chopper signal is integrated,
it becomes a low frequency precision Op Amp.
This precision Op Amp can extend the
gain
of another Op Amp.
Together the two Op Amps can compose
a
composite Op Amp.
An the
composite
Op can bury both offset and noise.
It may also be possible
to
reduce noise input current as well.
32) Different Spectrum Formats
Using the
Euler Format may be the most
precise.
But
SPICE may need to
use a
different format.
The
format
MacSpice uses is as such.
Spectrums can and may need to be formatted as
pure
AM or PM.
33) Simple Math Processing in SPICE
Things like
a RMS value can be
calculated from any waveform.
Specific points in a spectrum
can be printed out.
A spectrum printout may be required to
see
AM from PM sidebands.
34) Jitter Analysis in SPICE
Jitter analysis can show
edge timing over time.
Jitter plots can be formatted as
either
timing period or phase shift.
35) Pulse Width Modulation without Phase
Modulation?
Spectrum analysis says that
a
balanced PWM has no Phase shift.
A bandpass filter and an
inverter
verifies that fact.
Jitter Analysis shows how
jitter can happen with zero Phase shift.
36) Some Noise Surprises in Transient
Analysis
The
difference between rms and magnitude
can create confusion.
How to
lower the bandwidth of noise while keeping
the same rms.
37) Oscillator Phase Noise in Transient Analysis
Import a noise file into a
free running oscillator's spectrum.
Export jitter from a noisy free
running oscillator.
Phase modulate a signal
to match a free running oscillator's spectrum.
Predict how white noise will
appear on a free running oscillator's spectrum.
38) Mathematically process SPICE's Output
waveforms within Spice.
Extract and plot
prop
delays vs supply voltage applied to CMOS inverters.
Extracted and
average time periods to
precisely measure a crystal oscillator's frequency.
The frequency of a crystal can be
mathematically extrapolate from an AC
simulation.
How a varactor can
vary the frequency of crystal oscillator
can be precisely measured.
Removing SPICE's phase wrap around
can makes viewing a crystal's phase easier.
39) Digital
filter simulations using behavioral models in Spice.
A behavioral model to meet the need for
a
two phase clock.
Behavioral Models using switches
show the theoretical limitations.
Two phase clock
switching
of a capacitor behaves like resistors.
Two sample and hold stages makes
an analog delay element.
Analog delay elements are the
basic building blocks in digital filters.
Low pass filters
average
what happens in the past with the present.
High pass filter
compare
differences between the past and present.
Delayed analog signals in feed back
behave like analog filters.
40) Eye
Diagram Simulation resources in Spice.
Spice has the resources to
plot a Eye Diagram using random
digital signals.
Viewing
how an Eye Diagram is actually being
degraded can be be intuitive.
41) Different
architectures for CMOS current mirrors.
How does a
pure cascode CMOS current mirror
compare to a BiCMOS mirror?
Some mirrors use CMOS transistors like
degeneration resistors.
A
self cascode architecture has
its features as well.
42) Perfect
Logic versus Real Logic in SPICE.
Using Behavioral Logic in most cases
does not present a problem.
Some Behavioral Flip-Flops will converge
if care is taken to
hold all inputs stationary.
A
Behavioral Flip-Flop used in a counter
application does require a time delay to converge.
43) Load
Sweeping Transient Analysis.
Sometimes it might be useful to sweep
the load current of
a Charge Pump over a
large dynamic range.
Sweeping the load current with time can
verify the output impedance of
a Voltage Multiplier.
44) Duty
Cycle Sweeping Transient Analysis.
Transient analysis can provide an easy
to graph the Output of a
Buck Converter versus Duty Cycle.
Output Voltage versus Duty Cycle
versus Output Resistance can be plotted for a
Buck Converter .
The same can be done for a
Boost Converter, a
Boost Buck Converter , and a
SEPIC Converter.
45) More
Spice Features
Having working examples of what
all the
Waveform processing function do
leaves nothing out.
The
waveform Sort Function is
powerful but not straight forward on how to use it.
Transient
timing is
not consistent for things like square waves.
Sine waves that are
sampled close to nyquist appear
to have an attentuation
compared to normal.
Piece Wise Linear wave forms have
inconsistent timing which can be
fixed with a linearize statement.
If a version of Spice has funny blanking for
X/Y plots, it is
due to the curve tracer application.
It is possible to build an
Arbitrary
WaveForm Generator in SPICE.
46) FFT
Windowing Fun
Windowing divides up signal into
time frames while
reducing Spectrum Leakage at the
same time.
Windowing typically converts a
sine wave into
a Classical AM spectrum located
at three frequency bins.
The Spectrum leakage is reduced when
input signal is converted into
Window Distortion Harmonics.
Sometimes
adding
2nd and 3rd harmonic distortion to the window can reduce
Spectrum leakage
.
Testing of all the Windowing
functions
can be automated.
There are ways to plot all of
the Windowing function results
on a single plot.
When we remember we are all mad, the mysteries disappear and life
stands explained.
- Mark Twain
Don Sauer... DSauerSanJose@Aol.com