You need to log in to create posts and topics.

Voltage raises to extrem high levels

Not sure if this is a bug, but the behaviour is somehow odd. The circuit basically charges a capacitor of 10pf over 1MOhm and after a while it discharges it by pulling it 0V. During charging the PB4 is an input pin and once the voltage has reached a level high enough to detect a high level at PB4 the Attiny85 will do some internal calculation and set PB4 to an output pin and pulls it to low.

This works for a couple of seconds and than the voltage at PB4 starts raising to extremly high levels.

Is this related to rounding errors?

Uploaded files:

Is this related to rounding errors?

Yes, probably.

I guess that precision in floating point  operations with Mehaohms and picofarads can have an impact.

To solve it yo should decrease the reactive step. Try with 500 ns or so.

EDIT: 
Indeed the 40 pF capacitor has some impact in the simulation.
If you delete it the simulation will work correctly even at higher longer steps.

If you rationalize your scheme, everything works. Sometimes in Simulide you have to make small changes for everything to work, especially if the schematic is a copy of another.

 
 
Uploaded files:

Setting reactive step does actually make a difference. 

arcachofo has reacted to this post.
arcachofo