Page 2 of 2

Re: Can't get switches to work in the simulator

Posted: Sat Jan 10, 2026 10:02 pm
by chipfryer27
Hi

Would you please attach a chart showing the issue?

Regards

Re: Can't get switches to work in the simulator

Posted: Sat Jan 10, 2026 11:05 pm
by chipfryer27
Hi

Attached is a very basic chart which uses an interupt to change the status of an LED.

IOC_Example.fcfx
(13.37 KiB) Downloaded 6 times


It loops doing nothing more than displaying the status of a variable called "Flag"

Prior to the loop we set an Interrupt On Change (IOC) connected to a push button, Upon each press (rising edge) we branch to User Macro ISR and swap the state of variable "Flag"

When you press the button during simulation, you will see the status on the switch change from "Off" to "On". Releasing sets it back to "Off". When pressed the button changes colour to blue.

This is using a PIC16F1939.

If you can show a similar chart with your issue I'm sure we can assist further.

Regards