Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 20:19 27 Apr 2024 Privacy Policy
Jump to

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: Australia
Posts: 66
Posted: 03:08pm 10 Jul 2013
Copy link to clipboard 
Print this post

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 States
Posts: 147
Posted: 06:55pm 10 Jul 2013
Copy link to clipboard 
Print this post

My gut says setpin pin,0 should do it. Unable to test though.
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3165
Posted: 05:02pm 11 Jul 2013
Copy link to clipboard 
Print this post

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: Australia
Posts: 66
Posted: 12:50am 12 Jul 2013
Copy link to clipboard 
Print this post

  Geoffg said   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


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: Australia
Posts: 3165
Posted: 02:10am 12 Jul 2013
Copy link to clipboard 
Print this post

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: Australia
Posts: 66
Posted: 05:49am 12 Jul 2013
Copy link to clipboard 
Print this post

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: Australia
Posts: 2870
Posted: 12:59pm 12 Jul 2013
Copy link to clipboard 
Print this post

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: Australia
Posts: 66
Posted: 10:55pm 12 Jul 2013
Copy link to clipboard 
Print this post

  bigmik said   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


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


To reply to this topic, you need to log in.

© JAQ Software 2024