Hi, i have been testing interrupt and it works pretty good and fast but i have some programming issues so far with the looping of interrupts.
First i will decode the rotary encoder with a D flip flop which will give 2 signals; an up-down bit and a pulse for each mechanical rotations of the rotary encoder. The pulse will be used for the interrupt pin on the Picaxe. I have been testing the example code given with the "setint" command and understand it well so far but i need the interrupt to be done as a one shot only for each rotary pulse. Since we have to redo the setint command within the interrupt sub itself, it will repeat again if the interrupt pin is still maintained high after the interrupt sub is finished. If i do not reset the interrupt in the sub it will do just a one shot interrupt but then again you have to reset it eventually somewhere in your code after the pulse has ended.
Besides making the pulse much faster in hardware or making a loop that waits for the pulse to end on the interrupt pin to reset setint, can i use a software trick to prevent interrupt looping?
Anyone in the great Picaxe collective have a trick on this or am i missing something?
Thanks
First i will decode the rotary encoder with a D flip flop which will give 2 signals; an up-down bit and a pulse for each mechanical rotations of the rotary encoder. The pulse will be used for the interrupt pin on the Picaxe. I have been testing the example code given with the "setint" command and understand it well so far but i need the interrupt to be done as a one shot only for each rotary pulse. Since we have to redo the setint command within the interrupt sub itself, it will repeat again if the interrupt pin is still maintained high after the interrupt sub is finished. If i do not reset the interrupt in the sub it will do just a one shot interrupt but then again you have to reset it eventually somewhere in your code after the pulse has ended.
Besides making the pulse much faster in hardware or making a loop that waits for the pulse to end on the interrupt pin to reset setint, can i use a software trick to prevent interrupt looping?
Anyone in the great Picaxe collective have a trick on this or am i missing something?
Thanks