Coundown timer on LCD


Closed Thread
Results 1 to 19 of 19

Hybrid View

  1. #1
    Join Date
    Oct 2008
    Posts
    51

    Lightbulb Coundown timer on LCD

    Hay, this is my first post on these forums as im pritty new to the world of prgramming. Ive done a few simple things before like making a servo track a person in a room using PIR's and using pressure sensors etc but thats about it.

    What i want to do now is to create a countdown timer on a LCD display. This is only part of a much larger project im attempting but its the first step

    Basically i want a countdown timer which i will either have several different periods which you can select from or be able to enter a custom figure. I need the circuit to start with for now the press of a button (Later im going to be using a RF signal to activate the circuit but one step at a time!). It also needs to be able to pause and then resume from its last time and to switch a transitor to turn on a buzzer/sounder.

    Ive looked around on the forums but icant seem to find any countdown timers, all ive found are 24 hour clock types and the oylipmics timer. So i realy need to know if its going to be easier to make a new code or if its easier to adapt one thats out there.

    Looking at other posts most people seemed to be worried about the accuracy but this isnt too big an issue for me.

    Im currently using a p16f876a chip and i have got the hang of displaying messages on both lines 1 and two but thats where i need some guidance

    Any help would be much appreciatd!

    Cheers Chris

  2. #2
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429


    Did you find this post helpful? Yes | No

    Default

    My advice would be to use a 32.768kHz crystal connected to the timer 1 clock input. You can then use the timer 1 interrupt to decrement your countdown.
    "I think fish is nice, but then I think that rain is wet, so who am I to judge?" - Douglas Adams

  3. #3
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default I e d ?

    Ya know, comming from a Law Enforcement Background, in a Post 911 world where we Americans are no longer immune to the rest of the world's problems, which admittedly our CIA likely caused, I feel really insecure about this forum when sombody jumps in from nowhere and asks about countdown timers and then mentions hooking them up to r/f links or cell phones. Even if you are The ALL AMERICAN BOY, anything like that posted here might be used by BAD PEOPLE, who might otherwise lack the skill to roll their own. That said I am sure BAD PEOPLE have people who have skills, nevertheless, I cannot in good concencience assist this endeavor, which by the way if you really did those projects listed above, you should be able to do without assistance.
    JS
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  4. #4
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    See this thread: http://www.picbasic.co.uk/forum/show...hlight=O_FLOWS

    WARNING: This code is designed (you can't see it, because it's hidden
    internally) to immediately blow-up-in-your-face - if used for destructive
    purposes.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  5. #5
    Join Date
    Jan 2007
    Location
    Houston, TX
    Posts
    96


    Did you find this post helpful? Yes | No

    Talking ha ha ha ha ha THANKS PIC MASTERS OF THE UNIVERSE!

    PIC MASTERS OF THE UNIVERSE,
    At the end of a long week of broken electronics at work, this forum does provide much needed comic relief. Even my wife found this thread to be hilarious. Anyway I hope we have no nasty electronic/ firmware moles on this forum trying to hook up IED's or anything like that (not pointing fingers, postulating or anything) but seriously I do appreciate a few jokes mixed in with the great work on this forum.

    On another note, I thought I would let this forum know that because of a recent PIC project I worked on in the oilfield (with help form this forum of course!) I have just recieved a large wampum promotion and will be uprooting my family to another state to begin work in a new design engineering position out of the "field". THanks for your help along the way Mr. E, Bruce, Skimask, and a whole bunch of others (sorry for not mentioning you all by name) that have helped me along the way to better learn how these Microcontrollers REALLY work. I will continue my search through the galaxy of electronics one PIC at a time, may the force be with!
    Attached Images Attached Images  
    Padawan-78

  6. #6
    Join Date
    Jun 2005
    Location
    Up the bush, Western Plains, NSW Au
    Posts
    216


    Did you find this post helpful? Yes | No

    Default

    Hmmm....This countdown timer just HAS to be for hollywood. Who else would want to have remaining time on a display. Is the mad bomber going to hang around to watch the damn thing? At least he will then know how much longer he has to wait to meet all those virgins he has been sucked into believing all about.
    Oh dear, now I've probably offended someone..Tough, get over it.
    Peter Moritz.
    Up the bush, Western Plains,
    New South Wales,
    Australia.

  7. #7
    Join Date
    Oct 2008
    Posts
    51


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Bruce View Post
    See this thread: http://www.picbasic.co.uk/forum/show...hlight=O_FLOWS

    WARNING: This code is designed (you can't see it, because it's hidden
    internally) to immediately blow-up-in-your-face - if used for destructive
    purposes.
    So far ive played around with this code. All seems good, the timer is in pure seonds atm so 120 secs etc but thats my next task to get it displaying in the correct format
    Ive so far moddified bits of the above links coding but nothing major, i need to expand the protoype board im using as atm all i have is the chip, osc, LCD and a pull up resistor

  8. #8
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    Use a crystal oscillator for the PIC (any frequency) and setup timer0 to timeout once a second (if that is your countdown rate). Use Mister E's PIC multi-calc to come up with the values. Sit in a tight loop and read INTCON.2 (Timer0 overflow bit). When that bit goes high, decrement your counter and display it on the LCD, then jump back to the tight loop. You can put a test for a button push or turn on a buzzer in that tight loop as well. It will be perfectly accurate as long as whatever you do in the tight loop takes less than 1 second.
    Charles Linquist

Similar Threads

  1. Is this code not initialising the LCD properly?
    By Platypus in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 30th January 2010, 19:14
  2. 16f688 LCD what have I done wrong
    By spitfiredriver in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 8th August 2009, 19:54
  3. Play with LCD on PICDEM
    By The IceMan in forum mel PIC BASIC
    Replies: 5
    Last Post: - 22nd August 2008, 16:56
  4. Need help with LCD number display.
    By Steve Matson in forum mel PIC BASIC
    Replies: 8
    Last Post: - 26th June 2007, 23:07
  5. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 02:30

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts