Setting input states in the simulator

lauriet

Member
I have a circuit concept with various inputs high on startup.
I appreciate this can be set in the simulator by clicking the pins on the chip diagram.

Is it possible to set them high in code instead?
Thanks,
Lauriet.
 

hippy

Technical Support
Staff member
Not as such; inputs are inputs.

One approach to allow for easier simulation can be to consider inputs not as high or low but as active as not, asserted or not, and coding appropriately for the condition rather than a level -

If pinC.1 = ACTIVE Then ...

If pinC.1 <> ACTIVE Then ...

You can then define ACTIVE via a SYMBOL definition to be 1 when simulated even if that would be 0 for the physical hardware.
 

Buzby

Senior Member
I think the OP is trying to ask "Is there a way to preset the IO before the simulation starts running ?"
 

lauriet

Member
That is exactly what I seek.

Like Basic, there's an alarming gap between what I think I'm writing and the harsh reality of logic.

I am sending flowchart concepts to a moderately unskilled end-user, so I'd like it to be as automatic as possible.
 

AllyCat

Senior Member
Hi,

You could enable some/most of the Weak Pullup Resistors (using the PULLUP command) in the first line of the Program (with most PICaxes). The simulator will probably assume that the other input pins are low (but a real chip won't!).

Cheers, Alan
 
Top