Help With Simple Electronics Project? (Stopwatch)

Discussion in 'Community Discussion' started by cambookpro, Jul 10, 2013.

Thread Status:
Not open for further replies.
  1. cambookpro, Jul 10, 2013
    Last edited: Nov 7, 2013

    cambookpro macrumors 603

    cambookpro

    Joined:
    Feb 3, 2010
    Location:
    United Kingdom
  2. djjclark macrumors regular

    Joined:
    Feb 17, 2008
    #2
    How does the carry bit of the 10 second counter ever toggle if you reset it at 6? Shouldn't the combinational reset logic drive the next counter (and reset) and not the carry?
     
  3. cambookpro thread starter macrumors 603

    cambookpro

    Joined:
    Feb 3, 2010
    Location:
    United Kingdom
    #3
    Actually, that's a good point. I didn't think of that. Will try toggling the last IC from my series of and gates. Thanks :)
     
  4. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #4
    Please explain exactly how you reset the circuit shown. Two of the three counters have their RESET pin grounded. The third has its RESET driven by the output of the IC6a AND-gate. As shown, the circuit can't be reset.

    I can guess what you did, and I can guess what happened as a result, but guessing is a remarkably bad way to debug things.

    ----------

    The carry-out signal falls when the counter reaches 5. It rises when the counter is reset to 0.

    Chip datasheet. See Fig. 3:
    http://www.ti.com/lit/ds/symlink/cd4026b.pdf
     
  5. cambookpro thread starter macrumors 603

    cambookpro

    Joined:
    Feb 3, 2010
    Location:
    United Kingdom
    #5
    Doing this solves the issue of the minutes starting at 1, but not the 10 seconds.

    Resetting it just involved turning the power off and on again - I will eventually build in a system where you can pause and reset it, just haven't got round to doing that.

    I've always been told to ground the reset pin if you want it to loop counting 0-9. The reset on the middle IC was connected the the AND logic system so it resets at 59 and not 99 (59 seconds in a minute)
     
  6. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #6
    I see nothing in the datasheet that guarantees the counter will come up from power-off in any particular state.

    I'm unclear on whether you've actually built the circuit or not, and whether you're talking about actual circuit behavior, or the behavior of a circuit simulator.
     
  7. cambookpro thread starter macrumors 603

    cambookpro

    Joined:
    Feb 3, 2010
    Location:
    United Kingdom
    #7
    Sorry, I should be a bit clearer.

    I haven't built this in real life - I have built something similar to this before a while back, but that only counted seconds up to 99.

    All of this is running on the simulator. I know I should set up a proper reset system, but that's sort of low down on my list of things to do and at the moment I'm just reopening the file to cause the circuit to reset.

    Not very sophisticated I know, but for the sake of convenience it's what I'm doing.
     
  8. djjclark macrumors regular

    Joined:
    Feb 17, 2008
    #8
    I also wonder if there is a problem with your asynchronous reset circuit. Would think you would need a clock input there to make sure the LCD segments are done changing and for any race situations in your gates.
     
  9. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #9
    Does it work? You may have to reprioritize "working" over "convenient".

    I only trust circuit simulators so far. Nothing behaves like a real circuit, especially when it comes to things like unexpected propagation delays (within spec, but not what you expected), race conditions (see propagation delays), quirks of power being applied and removed (and not just rise/fall times, either), and a host of other real-world things. And not every build of the same real-world circuit behaves identically. Two builds can produce different results.

    I'm not sure how to figure out whether there's a problem with the simulator software, or whether it's just a quirk of this particular circuit. I see no obvious reason for it to come up showing all 1's, but that might not mean anything. If you quit the program, relaunch it, then reopen the circuit file, what happens? If it comes up all 0's in that case (and only that case), and all other cases of reopening the file show all 1's (with and without opening other intervening files), then that seems like a program bug, specifically in the initialization. If the circuit-file always opens with all 1's, then I'm not sure what conclusion to draw.
     
  10. firestarter macrumors 603

    firestarter

    Joined:
    Dec 31, 2002
    Location:
    Green and pleasant land
    #10
    This.

    I'd connect pin 15 (reset) via a small capacitor to +v, and a large-ish resistor to ground. Something like 0.1uF and 100K.

    Basically this will pull reset high, then as the capacitor charges, the pin will fall to low. The IC resets on the falling-edge of a signal on 15, so this would reset it, but there would be a delay after power up.

    I suspect you're getting some sort of power supply noise/bounce that's triggering everything shortly after switch on. Using a small RC circuit to delay this reset slightly will stabilise the circuit as the power will have settled by that point.
     
  11. cambookpro thread starter macrumors 603

    cambookpro

    Joined:
    Feb 3, 2010
    Location:
    United Kingdom
    #11
    Thanks for the great advice, will try that soon.
     
  12. balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #12
    Clearly the counters must be thinking they are interfacing with fortran/Cobol/MATLAB world where arrays start at 1. Translate the gates to C and they should start at "0".

    :p

    http://en.wikipedia.org/wiki/Zero-based_numbering

    Seriously, this is about the level where I would consider getting rid of the individual chips and introducing a small/cheap MCU like a PIC or something similar. In practice it would probably be smaller and cheaper and far easier to extend or adjust. :( <- The hardware engineer in me is crying on the inside.

    B
     
  13. cambookpro thread starter macrumors 603

    cambookpro

    Joined:
    Feb 3, 2010
    Location:
    United Kingdom
    #13
    Haha :p

    I have done this with an Arduino fairly easily, but for this project the circuits have to be based on ICs without a MCU.
     
Thread Status:
Not open for further replies.

Share This Page