My 74164 Isn't Counting Correctly.

Discussion in 'General Electronics Chat' started by ajm113, Dec 7, 2011.

  1. ajm113

    Thread Starter Member

    Feb 19, 2011
    176
    5
    I've wired up a 74164 and for some odd reason I'm not getting the results I'm expecting...

    Basically I have the CLK pin connected to positive connection with a resistor between and so far it wont count, but if I connect a floating connected wire to CLK or CLR. It works. 0.o

    But only for a little bit and then it stops and it wont do it again until I restart the IC.

    I also find it odd that the IC will randomly pick a number when it starts back up and after it counts one, it jumps to 255 after a second.

    P.S I have the output pins connected to LEDs and do I have to connect CLK to a waveform such as a triangle wave or square wave just so this IC works?

    Did I fry the IC or something?

    http://www.jameco.com/Jameco/Products/ProdDS/49681TI.pdf
     
  2. cumesoftware

    Senior Member

    Apr 27, 2007
    1,330
    10
    The CLK (clock) is not connected to Vcc (with or withour a resistor), but to the output of a clock generator. You will need to input a square wave of some kind so the chip can count. If you leave the CLK pin floating, it might pick up some noise and count for some reason. That might explain that behaviour.

    P.S.: Don't worry. Your chip is not fried.
     
  3. ajm113

    Thread Starter Member

    Feb 19, 2011
    176
    5
    Could this be solved using a 555 timer for the clock?
     
  4. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Yes, you can use a 555 timer.

    I suggest that you use a CMOS 555, like a TLC555 or ICM555. Radio Shack sells a TLC555 if you don't have a quick way to get one.
     
  5. ajm113

    Thread Starter Member

    Feb 19, 2011
    176
    5
    Oh never mind, yes I can. <_<

    I just tried it out, all I need to do at this point is getting my PIC to use it so it can send/recive data to my EEPROM.

    Thank you everyone!
     
  6. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    You should clock it with your PIC then.
     
  7. ajm113

    Thread Starter Member

    Feb 19, 2011
    176
    5
    May I ask how I would do that? I just want to make sure I'm thinking the same thing you are, since this is my first crystal I'm playing with a PIC.

    What I had in mind was setting a pin high and low after going through a "processing" loop.
     
    Last edited: Dec 7, 2011
  8. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Use a PIC I/O pin set to digital output. Connect that pin to the 74164 input. When you want to get data from the 74164 into the PIC, issue however many clocks you need to do to get the data.

    If you clock the 74164 with something else like a 555 timer, the PIC won't know about it. It will be an asynchronous clock. You want to control the 74164 with the PIC.
     
  9. cumesoftware

    Senior Member

    Apr 27, 2007
    1,330
    10
    If you use that pin as your clock generator for the 74164, you will be counting processing loops. Is that what you had in mind?
     
  10. ajm113

    Thread Starter Member

    Feb 19, 2011
    176
    5
    Wow, I answered my own question again. <_< Yeah I think I'm going to put my questions to the side until I really come to a dead end.

    Yeah thats what I had in mind, I'm basically recreating a cheaper and smaller version of the first computer using a PIC 16F, Shift Registers, EEPROM, LEDs, and switches for fun to have sitting on my desk or to show people. ;)

    Originally I was hopping to use a 8bit counter to do the work of looking at a address, but I decided to give shift registers a try, and hopefully get them to do cooler things.
     
    Last edited: Dec 7, 2011
  11. cumesoftware

    Senior Member

    Apr 27, 2007
    1,330
    10
    Well, then you can use that pin from the PIC to clock the 74164 chip. Thus the 74164 will count processing cycles.
     
  12. ajm113

    Thread Starter Member

    Feb 19, 2011
    176
    5
    Yeah I have it doing that right now as we speak. Outputting the number of times in binary code, though one small issue is that the shifting registers will turn a LED on for a split 100 millisecond, so it creates this flickering effect on the LEDs I dont want to have on. Is there a way to solve this with this IC so it wont output anything until I tell it too?
     
  13. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    You might look at a 74HC595 instead. That has latching parallel outputs. You crank the data across, and then latch it when it's where it should be.
     
Loading...