I have written a flowcode program in Flowcode for an 18F72 PIC.
I am testing it using the eBlocks system - so I assume all pins are terminated correctly and not floating.
Port A is not used, Port B is inputs, Port C is outputs.
It works a treat in simulation, with the RBchange interrupt working perfectly.
However when I compile it to chip, it goes immediately into interrupt.
The INT Enable flowcode block is the first entry after 'Begin'.
If I write a dummy loop sitting waiting for all the switches to be zero before enabling the interrupt it seems to fix it - however this shouldn't be necessary should it????
Interrupt on startup
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Interrupt on startup
Hello
What if you add an input icon to the start of your program before the interrupt enable to read the contents of portb into a dummy variable? Hopefully this should get rid of the false interrupt problem.
If this fails then you could create a flag in your main program that gets set on startup. The interrupt then checks the flag and if it is set then it clears it and exits the interrupt. Then if the flag is already clear then the interrupt happens as normal.
What if you add an input icon to the start of your program before the interrupt enable to read the contents of portb into a dummy variable? Hopefully this should get rid of the false interrupt problem.
If this fails then you could create a flag in your main program that gets set on startup. The interrupt then checks the flag and if it is set then it clears it and exits the interrupt. Then if the flag is already clear then the interrupt happens as normal.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel