Possible interupt simulation trouble

For general Flowcode discussion that does not belong in the other sections.
Post Reply
hippalator
Posts: 13
http://meble-kuchenne.info.pl
Joined: Tue Jul 15, 2025 9:05 pm
Has thanked: 2 times

Possible interupt simulation trouble

Post by hippalator »

Playing around with Flowcode and getting the feel of using interrupts.
I have an LED blinking away in a loop.
Outside the loop I have an interupt to turn on a second different LED when a pin changes using INT0.
The program is to have one LED blinking and a second LED following a pin state.
(LED on when pin goes high and turns off when the same pin goes low using an interupt INT0.
In the interupt I'm using two DECISIONS to turn the LED either on or off (following the pin state).
When debugging the program works great but after a few cycles of changing the pin state the LED will flip from "on" when the pin is high to "off" when the pin is high and stay that way.
Anyone else come across this situation?
Is it my coding or a problem with Codeflow?

chipfryer27
Valued Contributor
Posts: 1684
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 374 times
Been thanked: 583 times

Re: Possible interupt simulation trouble

Post by chipfryer27 »

Hi

If you attach your chart we can have a look.

Possible cause could include debounce, a search in the forum will show many causes and solutions. If not addressed then when you close or open your switch, the actual physical chain of pulses this causes, is misinterpreted.

You don't say how your interrupt works nor which chip. They are not all the same so attaching your chart will explain more.

Regards

hippalator
Posts: 13
Joined: Tue Jul 15, 2025 9:05 pm
Has thanked: 2 times

Re: Possible interupt simulation trouble

Post by hippalator »

chipfryer27 wrote:
Thu Jul 24, 2025 11:46 am
Hi

If you attach your chart we can have a look.

Possible cause could include debounce, a search in the forum will show many causes and solutions. If not addressed then when you close or open your switch, the actual physical chain of pulses this causes, is misinterpreted.

You don't say how your interrupt works nor which chip. They are not all the same so attaching your chart will explain more.

Regards
I'm using the 16f18877 chip for playing around with interupts. Figured this chip is used in a lot of Flowcode videos.

After starting over from scratch and putting more thought into the sequences I was able to get my program working as needed.
Thank you for taking the time to reply

Now onto learning how to incorporate an MCP4725 DAC to the scketch and outputting a 1100hz sinewave.
Any advice or learning material?

chipfryer27
Valued Contributor
Posts: 1684
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 374 times
Been thanked: 583 times

Re: Possible interupt simulation trouble

Post by chipfryer27 »

Hi

The 18877 is indeed a very capable chip.

As per previous replies, the WiKi, YouTube channel and forum offer good advice. Also, don't forget the "old" forum as it has about two decades of Q&A.

When connecting to the DAC in hardware, as it is using I2C to communicate, check you have pull-up resistors between the lines and Vcc. A value of 4.7K is typical but could be as high as 10K.

Regards

hippalator
Posts: 13
Joined: Tue Jul 15, 2025 9:05 pm
Has thanked: 2 times

Re: Possible interupt simulation trouble

Post by hippalator »

Old Forum?
I'm not seeing anything here on this forum or any reference to an old forum on the website

chipfryer27
Valued Contributor
Posts: 1684
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 374 times
Been thanked: 583 times

Re: Possible interupt simulation trouble

Post by chipfryer27 »

Hi

The "old forum" ran up to v9 and is full of interesting posts.

You can reach it here https://www.flowcode.co.uk/mmforums/

Regards

Post Reply