This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

a new digital clock

hi ,

i want to build a new digital clock with a procesor and need your knowlege.

what procesor would work for it????? would arm be quik enough????

can i use a 32,768 hz watch crystal???? but would it make it slow??????

all help will be kind.

(chief programmer zuisti)

  • You wish to make a digital clock?
    What are your design criteria?
    I think before deciding what processor to use you need design goals. For example is it battery operated, does it have a display, is it settable via a PC serial, USB port, or my some key controlled interface.

    Design criteria will narrow down the remaining part of what you want and choose. Otherwise you my as well try wrestling the pacific ocean in terms of deciding the what and how of your design, wrestling an ocean is at least more tangible although just as frustrating.

    Stephen

  • what procesor would work for it?????

    just any processor Keil supports.

    would arm be quik enough????

    a major overkill.

    can i use a 32,768 hz watch crystal???? but would it make it slow??????

    a maximum XTAL frequency of 25 MHz is more likely, at least for most ARM cores.

    and need your knowlege

    but you are the self proclaimed "chief programmer"?!

  • Why should an ARM chip be too slow - do you think you build wrist watchers around supercomputers?

    Some processors may run at full speed with a 32768 Hz external crystsal. Some may not. That depends on how goo the PLL is.

  • Why would it not be?

    Thnk about it: all a digital clock needs to do is to count up by 1 every second, and remember that every 60th second counts 1 more minute, etc...

    Even an 8051 would be overkill for that!

    You could do it (and many have done it) with just a few basic counter chips!

    electronics.howstuffworks.com/digital-clock.htm

  • In fact, you probably should do it first with basic counter chips - so that you really understand the foundations of what's going on.

    Once you really understand how it works, it will be easy to implement in software on a microcontroller...

  • Gosh - now you're making me feel nostalgic. I built a digital clock, from a Practical Electronics magazine design back around 1970. It had about 20 ICs, four nixie tubes for the display (I still have one of them) and an alarm set by mechanical switch wheels. There's a photo here:

    www.cfbsoftware.com/.../clock.gif

    It's on the left of the turntable (and not much smaller!)

    The Pink Floyd LP (bought a couple of years earlier - which I also still possess) and Ferrograph F307 Stereo amp help to carbon-date the era.

    Fast forward to earlier this year for one of the first apps I developed using Armaide - a digital clock:

    http://www.armaide.com

    (Scroll down the page for a photo of the clock)

    Interesting to do but not nearly as much fun as the original ...

    --
    Chris Burrows
    Armaide: ARM Oberon-07 Development System for Windows

  • As the OP seems to have lost interest (if he ever had any real interest), why not tell us about this "Oberon-07", then...?

  • Looks interesting. I should have one or two LPC21xx board laying around somewhere. Maybe I should take a closer look at the release candidate during christmas.

    An earlier thread did discuss the sparse amount of code posted by the thread regulars. One problem for me is that most code I write have licensing terms that inhibits posting. A hobby programmer on the other hand can always post anything he/she has written.

    Playing around with a completely different language at home would work as a great barrier between private and job. And the ARM is definitely big enough to play nicely with high-level languages.

  • OK - here is some of the relevant parts of Oberon-07 code used in the digital clock:

    The that module that reads the time from the LPC2148 is:

    
    MODULE Clock;
    
    IMPORT LPC, SYSTEM;
    
    CONST
      PCLK = 16000000;
    
    PROCEDURE* GetTime*(VAR hh, mm, ss: INTEGER);
    BEGIN
      SYSTEM.GET(LPC.SEC, ss);
      SYSTEM.GET(LPC.MIN, mm);
      SYSTEM.GET(LPC.HOUR, hh);
    END GetTime;
    
    
    PROCEDURE* Seconds*(): INTEGER;
    VAR
      ss: INTEGER;
    BEGIN
      SYSTEM.GET(LPC.SEC, ss);
      RETURN ss
    END Seconds;
    
    
    PROCEDURE* Init*();
    VAR
      preint, prefrac: INTEGER;
    BEGIN
      preint := (PCLK DIV 32768) - 1;
      prefrac := PCLK - ((preint + 1) * 32768);
      SYSTEM.PUT(LPC.PREINT, preint);
      SYSTEM.PUT(LPC.PREFRAC, prefrac);
      SYSTEM.PUT(LPC.CCR, {0});
    END Init;
    
    END Clock.
    

    The main part of the module that then formats the time and displays it on the LCD is:

    
    PROCEDURE DisplayTime();
    VAR
      hh, mm, ss: INTEGER;
      s: String;
    BEGIN
      Clock.GetTime(hh, mm, ss);
      Clear(s);
      AddInt(s, hh);
      AddChar(s, ':');
      AddInt(s, mm);
      AddChar(s, ':');
      AddInt(s, ss);
      LCD.SetCursor(1, 0);
      LCD.String(s.chars);
    END DisplayTime;
    
    PROCEDURE Run();
    VAR
      prevSecs, secs: INTEGER;
      i: INTEGER;
      sel2: SET;
    BEGIN
      SYSTEM.PUT(LPC.PINSEL0, 0);
      SYSTEM.PUT(LPC.PINSEL1, 0);
      SYSTEM.GET(LPC214x.PINSEL2, sel2);
      SYSTEM.PUT(LPC214x.PINSEL2, sel2 * {2, 3});
    
      LCD.Init(LCD.Linesx2, LCD.DisplayOn, LCD.Increment);
      LCD.ClearDisplay();
      LCD.String("ARM Oberon-07");
      Clock.Init();
      prevSecs := 0;
      WHILE TRUE DO
        secs := Clock.Seconds();
        IF secs # prevSecs THEN
          DisplayTime();
          prevSecs := secs
        END
      END
    END Run;
    

    (For some unknown reason Some of the lines were clipped in the preview - I hope they appear OK in the final post)

    Regards,
    Chris

  • hi frendz , thanx for teh code but its' bad and does'nt even compile!

    nebode have good code for us????

    zuisti

    (chief programmar)

  • hi frendz , thanx for teh code but its' bad and does'nt even compile!

    aaaaah.....I think you're missing something.

    What did you use to try and compile that code?

    Are you the 'chief programmar' in your house, or does a company really pay you to do this?

  • hi freind , we evaleuate mdk and pk51 and teh boss wants workng code. i Am expert on c but cant' undestand code b4 . is c plus????????

    we need code b4 end 08'

    all good helpis thanked

    zeusti

    (senor chief programme)

  • Looks very nice.

    Have you implemented the oberon compiler, or is this a spin-off, integrating the compiler with an IDE?

    Chief: It's just a question of preprocessor settings. If you adjust them properly, then the code should compile just fine. Just make sure that the oberon flag is checked.

  • and teh boss wants workng code.

    what did you do to solve the problem?
    no, the code above is not C++. if you were indeed "Am expert on c" you would know that!

    say what, you were promoted thanks to your heroic efforts to solve this problem (apparently you are now a "senor chief programme"...) ?

  • Senor is not a promotion. Just an attempt at spanish.
    Senior is a promotion, unless it is meant as "retired".