Is there a way to count pulses (a steady 120hz) for a changing length of a butt



  • Jon WilliamsJon Williams Posts: 6,491
    edited June 2005 Vote Up0Vote Down

    I recommend the 74HC595 because it is latched; so the outputs do not ripple when new data is being clocked in and through.· As I've tried to explain a couple times, you can use three pins to connect to the 595s: Data, Clock, Latch.· The clock and latch lines are common to all, the data line gets pushed "through" like this:

    >[noparse][[/noparse]14·· 595-1··· 9]
    >[noparse][[/noparse]14·· 595-2··· 9]
    >[noparse][[/noparse]14·· 595-3··· 9]

    When you do that you can read the segments pattern from a table (use READ with the index created with DIG) and then push them out.· If the 1s value is the third digit in the chain, you could do something like this:

    · FOR theDigit = 0 TO 2
    ··· idx = bpm DIG·theDigit
    ··· READ (SegTable·+ idx), segments
    ··· SHIFTOUT DataOut, Clock, MSBFIRST, [noparse][[/noparse]segments]
    · NEXT
    · PULSOUT Latch, 5
    · RETURN

    Notice that the latch comes AFTER all the shifting -- this allows data to be "pushed through" the 595s to the right position before you move that data to the outputs.

    Of course, you can do things the hard way (manual multiplexing)·if you like, but if you're target is to get three digits displayed without hassle, spend a couple bucks on some 595s -- you'll be glad you did; they are one of my favorite expansion components.

    Jon Williams
    Applications Engineer, Parallax
  • Clock LoopClock Loop Posts: 1,443
    edited June 2005 Vote Up0Vote Down
    thanks! I didn't understand all the things involved in displaying digits, when you mentioned the 595 before. So I just figured I would try to use the 7447's, knowing after doing it all that I would probably understand better, what exactly is going on and why you CAN'T do it with a few 7447's.
    And I definetly learned that. Sometimes I do things the hard way to understand better why it should be done a different way. I am cursed with wanting to know how to do something, and then if I think I can do it one way, I must try it and understand why it cannot be done that way.

    But thanks to you, I am not going to spend the next month on trying many different ways, I'll just go buy some 595's!
    This will be my first time working with shift out.. mmmmmm....

    Post Edited (BPM) : 6/30/2005 10:56:43 PM GMT
    To study the nature of randomness in a digital processor network using the same clock source, 54 prop chips were all connected to a master prop.
    Optic communication between homogenous and commensurable, 8-core, 635nm emitting, phase locked loop, bit salad tossing units?
    TheBlackBox: Release v2.0 - Propeller HSS FX/Sequencer with Digital Audio SPDIF output.
    E-Tools - Mono555 calculator, resistor calculator, voltage divider calculator, RCtime calculator, LM317 calculator, Binary-Hex-Decimal calculator, Resistor color matrix, Series LED resistance calculator, OHMS LAW calculator.
  • Jon WilliamsJon Williams Posts: 6,491
    edited June 2005 Vote Up0Vote Down
    See the help file for SHIFTOUT -- it has a 595 example to get you going.· Nothing like a breadboard and some LEDs for a little fun (for a LOT of fun, get one of our PDBs).

    Jon Williams
    Applications Engineer, Parallax
Sign In or Register to comment.