I made a counter with a button and a seven segment LED display

Поділитися
Вставка
  • Опубліковано 19 сер 2024
  • Follow along as I count up to 9 button presses on a 7 segment display!
    -- Links
    SN74LS160N Data Sheet: hlf-ic.cn/uploa...
    SN74LS162N Data Sheet: hlf-ic.cn/uploa...
    SN74LS48N Data Sheet: hlf-ic.cn/uploa...
    7 Segment Display Data Sheet: www.xlitx.com/d...
    7 Segment Display: amzn.to/3viAu1l
    TTL ICs: amzn.to/40WH75c
    Breadboard kit: amzn.to/3MYwfho
    Power supply: amzn.to/3uAYxIE
    Antistatic mat: amzn.to/49RhcQi
    My Wife's Books: amzn.to/47yt9Ji
    (Maybe you and/or someone you know will like them!)

КОМЕНТАРІ • 21

  • @GordieGii
    @GordieGii 7 місяців тому +3

    The difference between the two chips is that one has a synchronous reset while the other has an asynchronous reset.

  • @internet155
    @internet155 7 місяців тому +6

    I don't know what's really going on but making mistakes is the best way to learn, cool videos mate

  • @RobR386
    @RobR386 7 місяців тому +7

    You need to debounce the button, add a ceramic capacitor between the button and the counter.
    Also if you want to have the counter running without the need for a button, feed it a square wave source, a simple 555 circuit will work to create a clock pulse.

    • @joruss
      @joruss 7 місяців тому

      Adding JUST capacitor will increase chance of burning out the switch as you'll be dumping the whole charge stored in capacitor via the contacts. What you need is basically 1st order low pass filter to cut off the high frequency spikes. Which coincidentally also puts extra resistor between capacitor and switch preventing arcing.

    • @RobR386
      @RobR386 7 місяців тому

      @@joruss that would be true of HV, however the voltage is low enough that it won't be an issue, hardly any current there either.

    • @joruss
      @joruss 7 місяців тому

      @@RobR386 the bigger capacitor the more charge will be dumped. And these little dome switches can be easily burned out with DC switching. Of course not immediately but i'll wear out over time.

  • @PlumGurly
    @PlumGurly 7 місяців тому +2

    A debouncer other than a capacitor across the switch would be a Schmitt trigger. That adds hysteresis and only changes the signal after a threshold of time and voltage change is reached.

  • @shagreobe
    @shagreobe 7 місяців тому +3

    Somewhere in the datasheet, there is usually a schematic for 'typical' uses

  • @brunofariasilva
    @brunofariasilva 7 місяців тому +3

    To avoid a bounce effect add a 100nF ceramic capacitor between the pins of the push button

  • @hmoazed
    @hmoazed 7 місяців тому +1

    From Motorola datasheet: "The LS160A and LS161A have an asynchronous Master Reset (Clear) input that overrides, and is independent of, the clock and all other control inputs. The LS162A and LS163A have a Synchronous Reset (Clear) input that
    overrides all other control inputs, but is active only during the rising clock"

  • @alabamacajun7791
    @alabamacajun7791 7 місяців тому

    add a 0.01 cap from the VCC pin ground for each TTL chip you add. That captures noise from that chip.

  • @Fifury161
    @Fifury161 7 місяців тому

    BCD stands for Binary Coded Decimal and a capacitor across the pins of the push button will quelch mechanical bounce.
    I built a circuit back in the day using a BCD counter circuit to simultaneously display the number on a seven segment display and it's equivalent binary display on LEDs. I struggle to find the dtaa sheets to recreate the circuit again! So little attention is given to discrete logic these days as the likes of Arduino, ESP and Raspberry chips are so cheap!

  • @jeffreyyoung4104
    @jeffreyyoung4104 7 місяців тому

    I use a debounce circuit using two nand gates. I avoid using caps in the debounce circuit, as they are not needed.
    You need to look up the IC data sheet for a complete description of the operation of the IC. A book with the digital circuits and the common usage of them might be a good purchase, so you can have the reference handy, when you experiment.

  • @DarrenHughes-Hybrid
    @DarrenHughes-Hybrid 7 місяців тому

    It looks like Enable T enables the Carry Output.

  • @DarrenHughes-Hybrid
    @DarrenHughes-Hybrid 7 місяців тому

    ALL switches bounce.

  • @gadgetdeez7069
    @gadgetdeez7069 7 місяців тому

    If you ALWAYS want it to be cleared and at 0 on startup. It is active low, so you need to delay it going high for long enough that the counter chip sees a low. You need a small capacitor in the negative rail and attached to clear. It needs to be pulled up to rail voltage, maybe a 5k and use maybe a 100k shunt across the cap. Play with values or do some math. I'm sure you only need maybe 100ns at most. The shunt kills any charge in the cap sonit is at 0 volts. As you apply power, the cap takes time to charge through your 5k resistor. If the counter chip wakes before the cap is above the threshold voltage (probably something like 2v) then itcs registered as a clear and then as it keeps charging it will stop clearing. After power down, the 100k discharges the cap so you have a fresh start when you power on next time.
    So that takes care of your random startup value.
    For in circuit button debouncing. All you need is a cap connected to your clock pin to ground. Ground the switch and the other side of the switch, add a pull up resistor. On the output of the switch, use another resistor connected to your clock input+cap.
    When the button is released, the pull up will feed the filter resistor connected to your cap which will charge it to a "high" state. When you press the button, it will short the pull up, pulling it to 0v. The filter resistor will begin discharging the cap. As this takes some time (depending on your RC) the intermittnet bounce of the switch is not registered and is filtered out through the RC circuit. Now that the cap is discharged from you pushing the button, when you release, the pull up then begins charging the cap again through the filter resistor.
    There are plenty of free calculators online that will help you select the appropriate resistor and capacitor values to achieve the charge/discharge times that you're looking for..
    Hth

  • @PlumGurly
    @PlumGurly 7 місяців тому

    I think async vs. synch is the difference. Async means you can change things at any time and get a result (while observing setup and hold times), whereas, you can set sync about any time, but it only works on the next clock pulse.

  • @zbradbell
    @zbradbell 7 місяців тому

    pretty sure HLF's 162 datasheet is wrong. Clear on the 162 should be synchronous, like the load (per TI's datasheets)

  • @jhonbus
    @jhonbus 7 місяців тому

    I think the P input is meant as an "enable" to turn counting on or off, and the T input is what I'd consider to be the actual count input. The way you have it set up now is constantly adding, so it increments the counter on every clock pulse. But usually you'd have the clock running all the time, and only incrementing when T is high.

    • @bigzaphod
      @bigzaphod  7 місяців тому

      Ah ha.. that makes sense!

    • @mikegLXIVMM
      @mikegLXIVMM 7 місяців тому

      More debounce to the ounce.