PDA

View Full Version : Pause command? (maximum number of seconds allowable?)



HankMcSpank
- 8th July 2010, 00:43
Hiya,

I'd like to make a countdown timer for a UV lightbox I have - they were throwing out an old Eprom eraser out at work - a bit of a result *but* it's got a really bad mechanical timer on it & it's not granular enough for my needs (0-60mins...I need more like 1-10 mins)

10 mins being 600 secs, which in picbasic equates to



PAUSE 600000


Eeek!!!!

Any issues with such a long pause command?

To set the countdown time, I was thinking about a simple pot arrangement - ie AtoD the value between 0 & 1024, where 1024 = 10 mins.


Also I guess it would be nice to have some adjustable 'user presets' - how do I tackle storing user input into non voltaile ram on a PIC? (if it helps, I'm using a 16f690 for no other reason than I'm sort of getting used to it)

PS I realise when the pic is 'pausing' it's not gonna give out any countdown (time left) info, but I'm not too worried about an elegant implementation with many bells & whistles here.


Edit: Ok, with a view to creating the most simple of programs I'd overlooked the most basic of solutions (why does that happen immediately after pressing the post button). A simple loop with a 1 second pause in it would do here - and then keeping track of the number of times the loop has run. (this will translate into an approximate time for the job in hand)

ardhuru
- 8th July 2010, 05:24
Ok, with a view to creating the most simple of programs I'd overlooked the most basic of solutions (why does that happen immediately after pressing the post button). A simple loop with a 1 second pause in it would do here - and then keeping track of the number of times the loop has run. (this will translate into an approximate time for the job in hand)

Exactly. For a simple user interface for setting the duration, I would use a pot on an ADC pin; with 270 degrees of rotation, you could easily resolve the position into 10 total readings for setting the timer duration. Just add a dial around the pot, and you wouldnt even need a display.

Regards,

Anand