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

13»

Comments

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

    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:

    DataOut
    >[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:

    Update_Displays:
    · 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,225
    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. http://forums.parallax.com/discussion/127983/55-parallax-propeller-s-parallells-processing-of-permanent-perturbations/p1
    Optic communication between homogenous and commensurable, 8-core, 635nm emitting, phase locked loop, bit salad tossing units? http://forums.parallax.com/discussion/comment/1248240/#Comment_1248240
    TheBlackBox: Release v2.0 - Propeller HSS FX/Sequencer with Digital Audio SPDIF output. http://forums.parallax.com/discussion/115258/theblackbox-release-v2-0-propeller-hss-fx-sequencer-with-digital-audio-spdif
    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.
    http://forums.parallax.com/discussion/81449/e-tools-html-java-script-electronic-design-tools-free-for-you
  • 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.