Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > sci.electronics.design > #454318 > unrolled thread

Make LTSpice report an error

Started bySylvia Else <sylvia@not.at.this.address>
First post2017-03-31 12:09 +1100
Last post2017-03-31 09:34 -0700
Articles 5 — 3 participants

Back to article view | Back to sci.electronics.design


Contents

  Make LTSpice report an error Sylvia Else <sylvia@not.at.this.address> - 2017-03-31 12:09 +1100
    Re: Make LTSpice report an error rickman <gnuarm@gmail.com> - 2017-03-30 23:53 -0400
      Re: Make LTSpice report an error Sylvia Else <sylvia@not.at.this.address> - 2017-03-31 17:32 +1100
        Re: Make LTSpice report an error rickman <gnuarm@gmail.com> - 2017-03-31 06:08 -0400
    Re: Make LTSpice report an error Jim Thompson <To-Email-Use-The-Envelope-Icon@On-My-Web-Site.com> - 2017-03-31 09:34 -0700

#454318 — Make LTSpice report an error

FromSylvia Else <sylvia@not.at.this.address>
Date2017-03-31 12:09 +1100
SubjectMake LTSpice report an error
Message-ID<ek5oj2F4877U1@mid.individual.net>
I'd like a way to make LTSpice report an error if one of my sub-circuits 
detects an invalid condition. For example, I often simulate a PIC by 
representing it as a sub-circuit that applies signals to its pins in 
accordance with the way I intend to program it. I'd like that 
sub-circuit to check, for example, that it has the correct voltage on 
its power and ground pins, and flag an error if not.

Anyone have a way of doing that?

Sylvia.

[toc] | [next] | [standalone]


#454331

Fromrickman <gnuarm@gmail.com>
Date2017-03-30 23:53 -0400
Message-ID<obkjle$1du$1@dont-email.me>
In reply to#454318
On 3/30/2017 9:09 PM, Sylvia Else wrote:
> I'd like a way to make LTSpice report an error if one of my sub-circuits
> detects an invalid condition. For example, I often simulate a PIC by
> representing it as a sub-circuit that applies signals to its pins in
> accordance with the way I intend to program it. I'd like that
> sub-circuit to check, for example, that it has the correct voltage on
> its power and ground pins, and flag an error if not.
>
> Anyone have a way of doing that?

LTspice will report the results of measurements which can contain 
calculations.  If you have a value called "VoltageTooLow" and calculate 
it by dividing by a value which would be exactly zero when your error 
condition occurs, rather than reporting a number it will flag the 
error... I think.  I know I had what look like error reports when my 
measure statements were not able to be executed.

Otherwise you can create a signal that makes an extreme change in 
voltage when the error condition occurs and monitor it on the waveform 
display.  Switches are useful for bounds checking.

-- 

Rick C

[toc] | [prev] | [next] | [standalone]


#454345

FromSylvia Else <sylvia@not.at.this.address>
Date2017-03-31 17:32 +1100
Message-ID<ek6bflF7el3U1@mid.individual.net>
In reply to#454331
On 31/03/2017 2:53 PM, rickman wrote:
> On 3/30/2017 9:09 PM, Sylvia Else wrote:
>> I'd like a way to make LTSpice report an error if one of my sub-circuits
>> detects an invalid condition. For example, I often simulate a PIC by
>> representing it as a sub-circuit that applies signals to its pins in
>> accordance with the way I intend to program it. I'd like that
>> sub-circuit to check, for example, that it has the correct voltage on
>> its power and ground pins, and flag an error if not.
>>
>> Anyone have a way of doing that?
>
> LTspice will report the results of measurements which can contain
> calculations.  If you have a value called "VoltageTooLow" and calculate
> it by dividing by a value which would be exactly zero when your error
> condition occurs, rather than reporting a number it will flag the
> error... I think.  I know I had what look like error reports when my
> measure statements were not able to be executed.
>
> Otherwise you can create a signal that makes an extreme change in
> voltage when the error condition occurs and monitor it on the waveform
> display.  Switches are useful for bounds checking.
>
I had thought of division by zero. It doesn't work. Nor does sqrt(-1). 
Having a signal whose voltage indicates an error is less effective 
because it requires one to remember to check it.

Sylvia.

[toc] | [prev] | [next] | [standalone]


#454385

Fromrickman <gnuarm@gmail.com>
Date2017-03-31 06:08 -0400
Message-ID<obl9l0$tmt$1@dont-email.me>
In reply to#454345
On 3/31/2017 2:32 AM, Sylvia Else wrote:
> On 31/03/2017 2:53 PM, rickman wrote:
>> On 3/30/2017 9:09 PM, Sylvia Else wrote:
>>> I'd like a way to make LTSpice report an error if one of my sub-circuits
>>> detects an invalid condition. For example, I often simulate a PIC by
>>> representing it as a sub-circuit that applies signals to its pins in
>>> accordance with the way I intend to program it. I'd like that
>>> sub-circuit to check, for example, that it has the correct voltage on
>>> its power and ground pins, and flag an error if not.
>>>
>>> Anyone have a way of doing that?
>>
>> LTspice will report the results of measurements which can contain
>> calculations.  If you have a value called "VoltageTooLow" and calculate
>> it by dividing by a value which would be exactly zero when your error
>> condition occurs, rather than reporting a number it will flag the
>> error... I think.  I know I had what look like error reports when my
>> measure statements were not able to be executed.
>>
>> Otherwise you can create a signal that makes an extreme change in
>> voltage when the error condition occurs and monitor it on the waveform
>> display.  Switches are useful for bounds checking.
>>
> I had thought of division by zero. It doesn't work. Nor does sqrt(-1).
> Having a signal whose voltage indicates an error is less effective
> because it requires one to remember to check it.

I can get it to report that Vcc is not above a threshold.

.MEAS TRAN VccCheck FIND V(Vdd) WHEN V(Vdd)>3.45

Measurement "vcccheck" FAIL'ed

This is a bit backwards, but this will report the voltage if it is above 
the threshold at any time or give the error if it never goes above.

Depending on the nature of your power rail you could check directly for 
a voltage below the threshold.  If it finds it it will report the 
voltage.  If it is *never* below the threshold it will give the error 
message.  If the voltage ramps up or is within spec at any time this 
will not find the improper voltage.

-- 

Rick C

[toc] | [prev] | [next] | [standalone]


#454419

FromJim Thompson <To-Email-Use-The-Envelope-Icon@On-My-Web-Site.com>
Date2017-03-31 09:34 -0700
Message-ID<b61tdchetijc1fokui3a6v0gcuor7vi54u@4ax.com>
In reply to#454318
On Fri, 31 Mar 2017 12:09:52 +1100, Sylvia Else
<sylvia@not.at.this.address> wrote:

>I'd like a way to make LTSpice report an error if one of my sub-circuits 
>detects an invalid condition. For example, I often simulate a PIC by 
>representing it as a sub-circuit that applies signals to its pins in 
>accordance with the way I intend to program it. I'd like that 
>sub-circuit to check, for example, that it has the correct voltage on 
>its power and ground pins, and flag an error if not.
>
>Anyone have a way of doing that?
>
>Sylvia.

Check out Bounding_Circuits.zip on the Device Models & Subcircuits
Page of my website.

That may be of help.
		
                                        ...Jim Thompson
-- 
| James E.Thompson                                 |    mens     |
| Analog Innovations                               |     et      |
| Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    |
| STV, Queen Creek, AZ 85142    Skype: skypeanalog |             |
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  |
| E-mail Icon at http://www.analog-innovations.com |    1962     |

     Thinking outside the box... producing elegant solutions.

[toc] | [prev] | [standalone]


Back to top | Article view | sci.electronics.design


csiph-web