Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : Stop a PULSE
Author | Message | ||||
Blackened Regular Member Joined: 11/08/2012 Location: AustraliaPosts: 66 |
Hello all, I was just wondering if there is a way to interrupt an active background PULSE once it has been called and before the specified duration is up? I haven't yet had the opportunity to experiment, my device is otherwise engaged. PULSE pin 0 or perhaps PIN(pin) = 0 Will either of these work? Or will everything be ignored until the duration is up? Thanks everyone! |
||||
cwilt Senior Member Joined: 20/03/2012 Location: United StatesPosts: 147 |
My gut says setpin pin,0 should do it. Unable to test though. |
||||
Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3194 |
Currently you cannot prematurely terminate a pulse command running in the background (BTW you can have up to five separate but concurrent pulses running in the background on different I/O pins). You could however just set the I/O pin to inactive (eg, PIN(x) = 0). The pulse command will continue running in the background but when it terminates nothing will happen. In 4.4 you will be able to change the timing of a background pulse (with PULSE pin, newtime) or terminate it early (with PULSE pin, 0). Geoff Geoff Graham - http://geoffg.net |
||||
Blackened Regular Member Joined: 11/08/2012 Location: AustraliaPosts: 66 |
Thanks for the enlightenment Geoff, I want to terminate a pulse, as I use it to drive a heating element VIA SSR and would like to switch it off immediately in the case of a temperature that is out of bounds, rather than wait for the pulse to complete. However, the pulse has a maximum duration of just 3 seconds so I'll leave it until the 4.4 update. No biggy. I'm probably being a bit thick here lol, but regarding the use of PIN(x) = 0 during the pulse, when you say nothing will happen when the pulse terminates, do you mean once the pulse finishes, it will remain in the pulsed state? |
||||
Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3194 |
Using an example is probably the easiest way to explain... 1 - Assume that your pin starts with the output low. 2 - You use the command "PULSE pin, 3000" and the pin's output goes high. 3 - After two seconds you use the command "PIN(pin) = 0" and the pin will go low and as far as your SSR is concerned the pulse has completed. 4 - After three seconds the background pulse will terminate and set the pin's output low. But, because it is already low, nothing observable happens (ie, the pin continues to be low). Geoff Geoff Graham - http://geoffg.net |
||||
Blackened Regular Member Joined: 11/08/2012 Location: AustraliaPosts: 66 |
Ahhhh I see. Thanks for dumbing it down for me My partially automated home brewery and I thank you very much. If you were in Vic you'd be welcome to sample the results. |
||||
bigmik Guru Joined: 20/06/2011 Location: AustraliaPosts: 2914 |
Hi Blackened, I am in Vic and I am happy to sample your brew and email Geoff and let him know what its like.. HAHAHA Regards, Mick Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<< |
||||
Blackened Regular Member Joined: 11/08/2012 Location: AustraliaPosts: 66 |
I suppose I should have expected that LOL! Nothing ready to taste just yet I'm afraid. First batch in the fermenter but the samples I'm forced to draw off for testing taste ok so far |
||||
Print this page |