Charlie said:
Well, if he needed to have these guys vary independently, then he can
use Advanced Analysis, and do a multi-parameter simulation. (I know
you haven't played with this, Jim, since it is sorta hard to do from
Schematics. There have to be a FEW advantages for using Capture and
Concept...
) However, in this case, they need to be linked, since
the pot value and the register value are linked, so he needs to just
have a defined relationship. I have often had a single parameter
defined in a PARAM, and have the second defined as an expression.
Since this is a register/counter/pot relationship, this implies an
analog to digital conversion, tricky in an expression. I would
probably build in a circuit to do the ADC for me, or DAC if setting
the register made more sense.
Charlie
Werll, heres an A/D
..SUBCKT Analog8BitAtoD_XN _ssi_pin_d8 _ssi_pin_d7 _ssi_pin_d6
_ssi_pin_d5 _ssi_pin_d4 _ssi_pin_d3 _ssi_pin_d2 _ssi_pin_d1 ain_p
_ssi_pin_aref _ssi_pin_dref
* _SS_Symbol [C:\Program Files\AnaSoft\SuperSpice\system\MixedMode.ssm]
[Analog8BitAtoD]
*
*This model can be distributed provided this notice remains
*copyright (c) Kevin Aylward, 2004,
[email protected]
*This is an analog A to D
* d0 is lsb. aref is the +/-vin range. dref is the digital output level
e.g. 5V supplies
* output and input is referanced to 0V.
*
boffset ain 0 v=v(ain_p)/2 + v(_ssi_pin_aref)/2
*
b1 _ssi_pin_d1 0 v=u(v(ain) - v(_ssi_pin_aref)/2 ) * v(_ssi_pin_dref)
b2p 2p 0 v=v(ain) - v(_ssi_pin_d1) *v(_ssi_pin_aref)/v(_ssi_pin_dref)/2
*
b2 _ssi_pin_d2 0 v=u( v(2p ) - v(_ssi_pin_aref)/4)*v(_ssi_pin_dref)
b3p 3p 0 v=v(2p) - v(_ssi_pin_d2) *v(_ssi_pin_aref)/v(_ssi_pin_dref)/4
*
b3 _ssi_pin_d3 0 v=u( v(3p ) - v(_ssi_pin_aref)/8)*v(_ssi_pin_dref)
b4p 4p 0 v=v(3p) - v(_ssi_pin_d3) *v(_ssi_pin_aref)/v(_ssi_pin_dref)/8
*
b4 _ssi_pin_d4 0 v=u( v(4p ) - v(_ssi_pin_aref)/16)*v(_ssi_pin_dref)
b5p 5p 0 v=v(4p) - v(_ssi_pin_d4) *v(_ssi_pin_aref)/v(_ssi_pin_dref)/16
*
b5 _ssi_pin_d5 0 v=u( v(5p ) - v(_ssi_pin_aref)/32)*v(_ssi_pin_dref)
b6p 6p 0 v=v(5p) - v(_ssi_pin_d5) *v(_ssi_pin_aref)/v(_ssi_pin_dref)/32
*
b6 _ssi_pin_d6 0 v=u( v(6p ) - v(_ssi_pin_aref)/64)*v(_ssi_pin_dref)
b7p 7p 0 v=v(6p) - v(_ssi_pin_d6) *v(_ssi_pin_aref)/v(_ssi_pin_dref)/64
b7 _ssi_pin_d7 0 v=u( v(7p ) - v(_ssi_pin_aref)/128)*v(_ssi_pin_dref)
b8p 8p 0 v=v(7p) - v(_ssi_pin_d7)
*v(_ssi_pin_aref)/v(_ssi_pin_dref)/128
*
b8 _ssi_pin_d8 0 v=u( v(8p ) - v(_ssi_pin_aref)/256)*v(_ssi_pin_dref)
*
..ends
Its a successive approximation without a clock.!
Tyhee is a working example in SS.
and the D/A
..SUBCKT Analog8BitDtoA_XN _ssi_pin_d0 _ssi_pin_d1 _ssi_pin_d2
_ssi_pin_d3 _ssi_pin_d4 _ssi_pin_d5 _ssi_pin_d6 _ssi_pin_d7 aout
_ssi_pin_aref _ssi_pin_dref
* _SS_Symbol [C:\Program Files\AnaSoft\SuperSpice\system\MixedMode.ssm]
[Analog8BitDtoA]
*
*This model can be distributed provided this notice remains
*copyright (c) Kevin Aylward, 2004,
[email protected]
*This is an analog D to A
* d0 is lsb. aref is the +/-vout range. dref is the digital switch
point, e.g. 2.5 on 5V supplies
* output and input is referanced to 0V.
* The 1/512 is 1/2 lsb offset to provide for symetrical swings etc...
*
b1 aout 0 v= 2*v(_ssi_pin_aref) *
+ ( (u( v(_ssi_pin_d0) - v(_ssi_pin_dref)) + u( v(_ssi_pin_d1) -
v(_ssi_pin_dref))*2 + u( v(_ssi_pin_d2) - v(_ssi_pin_dref))*4 + u(
v(_ssi_pin_d3) - v(_ssi_pin_dref))*8
+ + u( v(_ssi_pin_d4) - v(_ssi_pin_dref))*16 + u( v(_ssi_pin_d5) -
v(_ssi_pin_dref))*32 + u( v(_ssi_pin_d6) - v(_ssi_pin_dref))*64 + u(
v(_ssi_pin_d7) - v(_ssi_pin_dref))*128
+ ) /256 - 0.5 + 1/512)
..ends
Kevin Aylward
[email protected]
http://www.anasoft.co.uk
SuperSpice, a very affordable Mixed-Mode
Windows Simulator with Schematic Capture,
Waveform Display, FFT's and Filter Design.