Embedded clock project

Discussion in 'Programmer's Corner' started by iceman11`, Sep 17, 2007.

  1. iceman11`

    Thread Starter Active Member

    May 4, 2007
    39
    0
    hi all...

    we have the task of designing a clock that is to be run from the AT TINY 2313...it must tell the time, and also tell the temp

    my code does nothing visual on the LED's for some reason...i dont know why...that is i cant c any time or temp being diplayed or anything

    if u guys cud help me thatl be awesome

    PS i have attached the code and schematic

    (NOTE : there is only 1 LED driver...so we have to multiplex them )
     
  2. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    Your schematic is too fuzzy to make out. If the displays are common anode, they must have a connection to a voltage source. If common cathode, they must have a connection to circuit ground.

    You might try slowing down the multiplexer switching to see if the current pulses are too narrow or too brief to light the displays.

    An oscilloscope is a very useful tool to see if your microcontroller is operating the external circuit properly.

    I haven't looked at the code, as I am not familiar with the AT Tiny.
     
  3. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    As beenthere has noted, your schematic is not clear enough to make out the level of detail needed to spot any problem areas that might exist.

    hgmjr
     
  4. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    Here is a link to a similar project to the one you are doing. It is only display temoerature but the 7-segment interface is the same style as yours. I call your attention to the four PNP transistors that are being used to drive each of the common-anodes of the four 7-segment LED displays. You may want to consider including these transistors in your design as a way to avoid requiring the AVR digital outputs to drive the LEDs directly.

    hgmjr
     
  5. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    I'm big on the method referred to as "crawl, walk, run". I would recommend you set your existing code aside and focus on testing your your hardware interface in stages.

    Code a simple routine that just exercises the LED display. Then add code to bring in the pushbutton interface. Once you have ironed out all of the issues with the hardware with these code pieces then you will have confidence in your hardware and you will be able to focus on the timing function and then the temperature function.

    hgmjr
     
  6. iceman11`

    Thread Starter Active Member

    May 4, 2007
    39
    0
    hey guys...the hardware is prebuilt..this particular project is to exercise our coding skills...so the h/W was alrdy built by the lecturer and tested by him.

    i have mangesd to get it to display the time...however...when i try to use the push buttons nothing happens or it counts inctrollably(without stopping).

    i think this is becos im switching or multiplexing the displays...and in the given harware the switches are connected to the same PORT of the controller.

    so the switches need to be driven as inputs and the LEDs outputs(which are simulataneously being multiplexed)

    so i created a function were it jumps to sets PORTB as input, checks if switches are pressed and if not jump back to the dspay function, and set PORT B as output and display the time once more.

    its not working tho...it either does nothing when a button is pushed, or just keeps counting without stopping!!!:mad::confused:
     
Loading...