Shop OBEX P1 Docs P2 Docs Learn Events
DS1302 question — Parallax Forums

DS1302 question

GuidoGuido Posts: 195
edited 2005-12-12 23:11 in BASIC Stamp
Hi,
Is there an easy way to be able to flash a led at 1 second interval, and still maintain clock integrety....Any help would be appreciated...
Thanks in advance
Guido

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-12-08 16:33
    That's kind of an open-ended question...I mean, are you trying to use the DS1302 to flash the LED or the BASIC Stamp?· The DS1302 time runs on it's own, so if you were using the BASIC Stamp it would be quite simply.· See the following link for an easy example of affecting the output on the change of each second.

    http://forums.parallax.com/showthread.php?p=552892

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2005-12-08 16:48
    I don't think this will be a problem at all as Chris Savage's circuit Binary Digital Clock does multiple tasks while still fetching the current time. I have a talking video clock circuit (www.sxvm) which does similar functions.

    http://forums.parallax.com/showthread.php?p=553075
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-12-08 16:51
    The main routine I was referring to in my project was that it does the tasks in the loop, then waits for the seconds to change before performing those tasks again.· This could easily be used to flash an LED.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • GuidoGuido Posts: 195
    edited 2005-12-08 22:27
    I am Sorry it sounds confusing, but I do not want to use any pasue in the Stamp Program as I am trying to keep it running to update some analog inputs. I was hoping there was a way to do it from the DS1302 even if it had to trigger a stamp input.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-12-08 23:20
    Guido,

    ·· There is no pause...Did you look at the program I refered you to?· It sits in a loop checking the time until the seconds change, then it updates the displays when the seconds change.· There are no PAUSE commands in the routine.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • GuidoGuido Posts: 195
    edited 2005-12-12 16:19
    Chris,
    Thank You, I did look at it and found what you were talking about. I am Sorry I did not get back to you sooner, but like I have said several times I am a dangerous beginner and have been real busy at work...
    One more question reagrding the DS1302, If I supply external battery to pin 8 and ground will this keep the timing chip up and running during power outage?
    Thanks
    Guido
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-12-12 18:37
    Guido,

    ·· Yes, it will keep the clock running and the RAM backed-up.· The battery should be around 3V or so.· That way it will only be on when the main power is lost.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • superoosuperoo Posts: 5
    edited 2005-12-12 23:11
    If you use a 'supercap', 5.5v 0.047F, the clock will be fine for about 2 weeks without power.

    Also, to flash an LED with the seconds, and still do aother routines, I would simply put the following in a the routine after getting the seconds from the ds1302 ...

    if seconds.bit0 = 0 then low led
    if seconds.bit0 = 1 then high led

    Hope this helps...
Sign In or Register to comment.