Author Topic: Binary counter troubles  (Read 2200 times)

0 Members and 1 Guest are viewing this topic.

Offline MechEng87Topic starter

  • Contributor
  • Posts: 15
  • Country: us
Binary counter troubles
« on: October 01, 2016, 01:23:08 am »
Hello everyone, I am new here and love the forum and the eev blog YouTube channels. I am working on a project for a counter that has me troubled. I am using g a 74ls163 binary counter and I am trying to get it to stop could time g at 9 and reset. I have done some looking online e and tried everything I can think of to get it to reset after 9 instead of counting all the way up to 15 then going g back to 0. I hope this isn't too basic a query but if anyone can help I'd appreciate it. I am working on building a light gate timer for velocity measurements.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11260
  • Country: us
    • Personal site
Re: Binary counter troubles
« Reply #1 on: October 01, 2016, 01:47:27 am »
9 is 0b1001 (8421), so your stop signal is: (1 & 8 ) & ~(2 | 4). You can obviously rewrite this into whatever logic gates you have at hand. In this case you need 2 AND gates and one NOR gate.
Alex
 

Offline MechEng87Topic starter

  • Contributor
  • Posts: 15
  • Country: us
Re: Binary counter troubles
« Reply #2 on: October 01, 2016, 01:58:35 am »
Ok, that's kind of were I was headed but so far nothing is working the way I expect. I tried putting a diode and gate with Qa and  Qd as the inputs that would reset the timer on the next clock cycle but no luck. Is a diode AND gate appropriate? I'm using all 5 volt logic levels.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11260
  • Country: us
    • Personal site
Re: Binary counter troubles
« Reply #3 on: October 01, 2016, 02:01:41 am »
You can make AND gate out of diodes, but AND gate alone is not enough here. And it is obviously better to use real gates for a real project.
Alex
 

Offline KerryW

  • Regular Contributor
  • *
  • Posts: 112
  • Country: us
Re: Binary counter troubles
« Reply #4 on: October 01, 2016, 03:38:29 am »
Actually, if you just NAND Q0 & Q3, you would get a Reset pulse at 9, 11, 13 and 15, but since it would reset to 0 at a count of 9 it wouldn't matter.
One accurate measurement is worth a thousand expert opinions
- Adm. Grace Hopper
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11260
  • Country: us
    • Personal site
Re: Binary counter troubles
« Reply #5 on: October 01, 2016, 03:53:53 am »
Actually, if you just NAND Q0 & Q3
Good point. In that case diode AND should work just fine.
Alex
 

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Re: Binary counter troubles
« Reply #6 on: October 01, 2016, 09:48:50 am »
Do you have a race condition or not meeting PW for the reset signal ?

A scope can help here, and look at datasheet to create a timing diagram to
see if you are not meeting chip timing.


Regards, Dana.
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 

Offline MechEng87Topic starter

  • Contributor
  • Posts: 15
  • Country: us
Re: Binary counter troubles
« Reply #7 on: October 01, 2016, 04:36:45 pm »
Got it! Thanks for everyone's help, I used an AND gate on q0 and Qd then fed it through an inverter and it works perfectly. I will just use a NAND gate as KerryW suggested. Thanks again everyone. I will post pics of it when I get the rest of the circuit going
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf