CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

countdown

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
nina



Joined: 20 Apr 2007
Posts: 111

View user's profile Send private message Send e-mail

countdown
PostPosted: Sun Feb 15, 2009 2:41 pm     Reply with quote

hi everybody

what is the best way to develop a system do countdowns 5000 hours. I have a machine that I need do maintenance after 5000 hours. So I would like to develop a system, using pic and lcd to show me how many hours are remaining to stop that machine and do maintenance.
Which pic and what way is the best to do this?

tks

nina
Ttelmah
Guest







PostPosted: Sun Feb 15, 2009 3:50 pm     Reply with quote

Almost any PIC, can potentially do this.
Best method, depends massively, on what 'else' you want it to do. Display the countdown?. Nature of output at the end?. What power is available?. etc. etc..
However I also have to query, whether it is worth 're-inventing the wheel'. Programmable service interval timers, are readily available.

Best Wishes
nina



Joined: 20 Apr 2007
Posts: 111

View user's profile Send private message Send e-mail

idea
PostPosted: Sun Feb 15, 2009 3:55 pm     Reply with quote

My idea is after countdown reach 5000 hours activate a relay and a message is show on LCD. That's all...
Do you think should I use a external hardware or just use timer?

tks Ttelmah


Ttelmah wrote:
Almost any PIC, can potentially do this.
Best method, depends massively, on what 'else' you want it to do. Display the countdown?. Nature of output at the end?. What power is available?. etc. etc..
However I also have to query, whether it is worth 're-inventing the wheel'. Programmable service interval timers, are readily available.

Best Wishes
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Sun Feb 15, 2009 5:37 pm     Reply with quote

Just set up a timer to run as long as you can, producing a "tick" every time it overflows. Set an Hour variable to so many ticks per hour, and Maint to 5000 hours per maintenance cycle. Decrement Hour each tick. When Hour = 0 decrement Maint and rest Hour. When Maint = 0 trigger you display and reset Maint to 5000.

Any trivial PIC can do this.
_________________
The search for better is endless. Instead simply find very good and get the job done.
dyeatman



Joined: 06 Sep 2003
Posts: 1933
Location: Norman, OK

View user's profile Send private message

PostPosted: Sun Feb 15, 2009 5:48 pm     Reply with quote

Of course, now it gets more complicated for him...

What if power is lost then restored?
Does he want it to keep time while power is off?
Does he just want it to start back where it left off?

Oh the possibilities!!! Very Happy
nina



Joined: 20 Apr 2007
Posts: 111

View user's profile Send private message Send e-mail

PostPosted: Sun Feb 15, 2009 7:24 pm     Reply with quote

thank you very much SherpaDoug for all information provided. what is the best timer0,timer1 or RTC??

dyeatman....during the equipment is running I'll get power from it and when it is turn off I'll will supply from a battery.
Does he want it to keep time while power is off? YES, HE DOES. Any suggestion to implement this?

First of all, I'll try implement just the decrement 5000 hours after that I'll try the rest of the program.

So, is it possible countdown 5000 hours just using internal timer???

tks again
dyeatman



Joined: 06 Sep 2003
Posts: 1933
Location: Norman, OK

View user's profile Send private message

PostPosted: Sun Feb 15, 2009 7:46 pm     Reply with quote

There are basically three choices.
1. Use the nanowatt PIC version and keep time internally
2. Use an RTC module with a battery and store the start time in EPROM.
3. You could also get a DS1307 and implement one yourself with a little work.

Personally, I would choose the second one. It makes the whole thing pretty simple. Sparkfun sells one for $20.

The next question would be:
Is the 5000 going to be actual machine run time? If so you will need to somehow monitor the equiment to keep track of the run time.
nina



Joined: 20 Apr 2007
Posts: 111

View user's profile Send private message Send e-mail

counter
PostPosted: Sun Feb 15, 2009 8:07 pm     Reply with quote

dyeatman...I'll use the lcd to follow the time and when it reach 5000 hours this system will activate a relay to shutdow the machine.

tks again for all information dyeatman. You have helped me a lot
crystal_lattice



Joined: 13 Jun 2006
Posts: 164

View user's profile Send private message

Service Timer/Counter
PostPosted: Mon Feb 16, 2009 1:21 am     Reply with quote

Have a look at Maxim product range, they have a interval timer that can do what you want. Look at: DS1372, DS1318, DS1904, DS1371, DS1374
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group