Voltage raises to extrem high levels
Quote from steinm on January 19, 2024, 3:43 pmNot 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?
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:Quote from arcachofo on January 19, 2024, 4:04 pmIs 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.
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.
Quote from Defran on January 19, 2024, 4:17 pmIf 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.