Connect with us

How to count pulses per second ?

Discussion in 'Electronic Basics' started by Mike C, Feb 13, 2007.

Scroll to continue with content
  1. John Fields

    John Fields Guest

  2. Eric R Snow

    Eric R Snow Guest

    Greetings Mike,
    I think that if you follow this link:
    you will find your solution. The circuit seems to do exactly what you
  3. John Fields

    John Fields Guest

  4. Aly

    Aly Guest

    In the time you've all been talking about this, he could have done it by now
    by buying a cheap PIC programmer, a couple of PICs, and visiting the piclist
    a few dozen times.

    God knows how many times I've sat in a meeting and said "Do this," and
    3-months later they've spent thousands, a few people have left, and they're
    all still arguing about it.

  5. LOL, but the funniest part is that it's true as long as he didn't have a run
    in with Olin. ;-)

    .......6 months after that and tens of thousands more wasted, the project
    manager is fired and the java crew are given their walking papers. You then
    do the project with a PIC in about a week. But no reward or even a pat on
    the back for you, uh uh. Even though you never mention it, they all know
    what snide little thoughts you're they reward you by
    hiring an H-1B to "help you out around the office". ;-)
  6. Chris

    Chris Guest

    Hi, Mike. If you're still there, you might want to consider using a
    4518 (dual BCD counter) and a 556 (dual 555). If you've also got a
    couple of spare inverter gates, it's easy (view in fixed font or M$

    + .---------------. .-----------------.
    | | | | |
    '--oEN | | |
    | 1/2 4518 Q3o------oEN 1/2 4518 |
    | | | |
    o---oCLK | .--oCLK |
    | RST | | | Q0 RST |
    '-------o-------' === '--o-----o--------'
    | GND | |
    | | |
    VCC | | |
    + '---------o-------)-----'VCC
    | | | +
    .-. | | |
    | | O | .-. VCC
    | | .---------. / \ | | | +
    '-' | | (___) | | | |
    | | | | | '-' .------------.
    o-----o | | | | | |
    | | 1/2 556 | | | |\ | | |
    .-. | OUTo---' '--| >O-)--o 1/2 556 |
    | | .--o | |/ | | OUTo
    | | | | | | | |
    '-' | | | | | |
    | | | | | | |
    o--o--o | --- | |
    | | | --- | |
    --- '---------' | '------------'
    --- | |
    | === ===
    === GND GND
    (created by AACircuit v1.28.6 beta 04/19/05

    The 4518 is set up to count the positive transitions of the input (if
    you want to count NGTs, connect the input to EN and make CLK=0). If
    the 10s bit goes high before the once a second reset pulse of the
    first half of the 556, it triggers the second half of the 556. Make
    the monostable output pulse as long as you want to turn on an LED or
    something else.

    Here are the datasheets:

    Good luck with your homework.

  7. ehsjr

    ehsjr Guest

    No. He (the OP) said it would be a big learning curve.

    PIC's are great, but how is it that the "PIC crowd"
    always comes in with the same mantra "he could have done
    it with a PIC in a few hours" or similar, yet we never
    see a PIC solution offered by them?

    Take a look at the huge number of helpful answers on
    this newsgroup and others from John Fields. He posts
    complete, solid solutions with schematics & identified
    parts values. He doesn't just say, "you could do that
    with an electronic circuit" and walk away.

    If the "PIC crowd" wants to promote PIC solutions, show

    In the time *you've* been following the thread, John has
    already designed and posted a hardware solution. You
    haven't - no one from the PIC crowd has. If it's so
    damn easy that a "PIC newbie" like the OP can do it with
    a few hours work, then one has to wonder why experienced
    PICers can't/don't/won't come up with something. Lord
    knows there's plenty of opportunities. Fields has proven
    that by posting solutions over and over and over again
    countless times to a wide variety of questions. The
    "PIC crowd" has made comments. As to providing solutions,
    they are dead silent. You guys want to take what you
    see as tantamount to "the moral high ground" with your
    "use a PIC" chant, then arrogantly walk away, offering
    nothing. When you start providing practical solutions
    your words will take on weight. Otherwise, they are
    smokescreen that may look good, but is without substance.

  8. Could it be that the OP never wants to see one? The circuit for this using
    a PIC is a joke, the code is the real work effort. If the OP doesn't want
    to use a PIC, why should someone write code?
    I'm sorry, I can't seem to find your solution here.
    Several in fact, most don't work or meet the OP requirements, but I guess
    that doesn't matter because it didn't involve a PIC.
    Too bad that he's such an offensive person. If he wasn't in everyone's
    killfile, more people might appreciate his efforts.
    Yet another PIC hater speaks. Same old mantra: learning curve, PIC crowd,
    no help, rah rah rah. And where is your schematic showing how to do it the
    Rube Goldberg way? I've posted PIC code here before, have you? IOW, until
    you offer up more than rhetoric, you're no better than "us". When have you
    seen a poster ask for the code and a "PIC lover" just blew them off?
  9. John Fields

    John Fields Guest

    Exactly. And if the OP doesn't want to use a PIC why should he be
    berated for that?
    So what, neither is yours. Fact is, Ed's posted a lot of schematics
    with nice solutions to various problems, but I don't recall ever
    seeing anything from you other than telling people to do it your
    Two only, in this thread, but the second try should have cleared up
    the problems I had with the first one, so what's wrong with that? I
    often have errors with design first cuts, but I always fix them
    before I put the thing to bed. I guess you write totally bug-free
    code out of the box huh?
    I'm generally offensive only to those I find offensive, like you,
    and I'm sure I'm not in _everyone's_ killfile, LOL. Those who've
    plonked me I have no use for anyway. I'm also sure that my efforts
    are appreciated from the thanks I get from the folks I help out.
    "Rube Goldberg"? See, now _you're_ being gratuitously offensive
    because he made a point which struck a nerve and you're being
    retaliatory. Besides, why should he have to post a design to
    register his opinion? You certainly didn't and you're certainly
    being critical as hell. And an asshole as well. How's that? Want
    to kick it up a notch?
    You're being ridiculous. If he has a good non-PIC way of doing
    something, then why should he post code. As I noted before, he's
    contributed lots of _complete_ solutions in the past, but I can't
    recall ever seeing _anything_ from you. What did you post, some
    stubs? No doubt.

    I you want to convince everyone how great a PIC would be for this
    application why don't you build the thing (It's only a PIC, a
    resistor, and an LED after all) then sit down and work out the code
    (It should only take an hour, you said) program the PIC, test it,
    then go through the several cycles of debug I'm sure you'll have to
    go through, and then post the code so we can all enjoy it.

    Should be duck soup now that you've seen how to do it in hardware
    and the hardware's been debugged.
    When have you seen a poster ask for the code? IME they don't and
    they don't want any part of it since they're usually looking for a
    simple one-off and don't want to get involved with PICs.

    Their choice, and people like you, who try to ram PICs down people's
    throats aren't making it any easier for your camp.
  10. John Fields

    John Fields Guest

  11. John Fields

    John Fields Guest

  12. Show me a post where I berated someone asking for help.

    Show me a post where I "tell people to do it my way". Your absolutely
    juvenile and a liar.

    I certainly have, plenty of times. Don't you believe me?

    That's only because you jumped before you looked, as usual. Or don't you
    remember that, "current/power hog"? You struck the first, second, .... and
    tenth blows before you even bothered to do a Google search. You had to come
    back with your tail between your legs and fess up. Why do you do this to
    yourself John?
    You get killfiled more in one week than I have in a lifetime. I think you
    should look at it like this, "the ones that plonked you, have no use for
    YOU". I've gotten plenty too, should we compete on that too?

    Continually adding parts just to make the point that a PIC isn't necessary
    is a silly exercise. Two pots? Come on, a micro has far more accuracy
    using the internal osc (1%) without adjustment. Times change, even if you
    don't want to.
    Look who's being retaliatory.
    My code will be posted later, now that someone actully wants to see some.
    I've given away plenty of code, you just don't know where to look for it.
    I'd be willing to wager money that you couldn't duplicate the functionality
    with discretes either. Now go ahead and shoot your mouth off some more
    without knowing what will be actually required of you.
    Convince everyone? Get real. The PIC haters are the PIC haters period,
    there is no "convincing".
    That's the difference between you and I. I think before I write, therefore
    it likely won't take "several" cycles to debug. This is one of those things
    that will likely work the first time out.
    You're the one that couldn't even interpret the OP's requirements without
    asking more questions, even though they were fairly clearly stated. Once
    you knew what they actually were, you couldn't wait to shout down someone
    elses reintroduction to your idea of a missing pulse detector. It's all
    about being first isn't it John, never about getting it right the first

    How is your hardware design going to help me? Outside of the LED and
    resistor, there will be no common parts. You don't even think things thru,
    you just keep ratcheting your jaws.

    Changing the subject doesn't constitute a rebuttal of my statement. Show us
    an example of what you claimed or please shut up.
  13. And I thought he said this about using a PIC. "Thanks for your help. I
    actually considered that option, but I was under the impression that a
    simpler circuit could do this job." Of course you then proceeded to show
    him that a "simpler circuit" would not do the job.
  14. Who, exactly, is doing the ramming here Fields? You PIC haters are all
    alike, just the mention of the word and you guys are frothing at the mouth
    like rabid dogs. Making baseless accusations about ramming, shoving,
    walking-away and the like, it's downright pitiful. Of course cost, circuit
    simplicity, consistency of results, flexibility, and power consumption are
    topics that aren't allowed in this discussion of merits, because the micro
    has an "unfair" advantage in these areas. It's not like "my camp" needs to
    recruit people, it's not the one in danger of becoming extinct.
  15. Eric R Snow

    Eric R Snow Guest

    OK John, I'll take your word for it. You certainly know tons more than
    me about electronics. I'll go back and read his original post and see
    if I can figure out why what I thought was a solution is not.
  16. Please don't feed the trolls. :)

    To explain it in a less belligerent way, the OP doesn't guarantee duty cycle
    or overall pulse width. This was further reitterated by the OP when JF
    didn't get it either and had to ask. Why he now thinks it proper to slap
    you around for making the same error, but I digress. The OP only cares
    about 10 pulses per second, and simply counting the pulses received in one
    second will satisfy his requirements. The one second latency to the output
    is of no concern either.
  17. Obviously I left out the "is beyond me" part.
  18. John Fields

    John Fields Guest

    The berating isn't direct, it's in your attitude and in your disdain
    for anything other than a PIC to be used as a solution to a problem.
    I could be wrong, but it seems to me that when you say, "A PIC is
    the right way to do it." that that's your way and that's what you're
    telling them to use.
    So have I, but so what? That's not the point. The point is that we
    all make mistakes and you're insultingly criticizing me for making
    one as if you were a lily-white infallible judge.
    I don't recall anything like that. Refresh my memory.
    Even for you, that's a ridiculous statement.
    Which goes to prove what I said about you wanting people to do
    things your way.
    I don't consider you to be competition, I consider you to be more
    like a gadfly, just buzzing around making a lot of noise and being
    generally annoying. As far as the plonking thing goes, if you've
    been plonked "plenty" of times, (and I certainly believe _that_ !)
    then I'm sure you win that one.
    Hardly. Using two pots because the OP doesn't _want_ to use a PIC is
    perfectly acceptable. Depending on his accuracy requirements, the
    pots might be replaced with fixed resistors, but he hasn't replied
    with that information, so the thing is a work in progress and the
    pots are there because they'll cover any eventuality.
    I see. You're a PIC programmer so that puts you at the forefront of
    technology, while I'm just an old has-been twiddling pots, huh? LOL,
    Fremont, you're a piece of work all right. You need to do a little
    more legwork before you start making assumptions.

    You are.
    If you think that's me, don't bother.
    Nor do I care.
    "Discretes" like in transistors, resistors, and capacitors?
    Sure there is. The proof is in the pudding and we all like to see
    something that works, so if it's as easy as you say it is why don't
    you just go ahead and build it, post some information as to how you
    tested it, and the code, and maybe some pictures, and then for the
    fillip, send it to the OP? After all, it's only a cheap chip, a
    resistor, and an LED, no?
    Prove it, then.
    So you think that "fairly clearly stated" is enough to base a design

    I can see it now... You get a "fairly clear" set of specs for some
    embedded thingy so you work up a design, write the code, order the
    parts, build it, test it and it works perfectly! You then proudly
    take it to your customer only to find out that you should have been
    a little more diligent up front and gotten the specs _very clear_
    because the way it works is not the way he wants it to work.

    I preferred to iron out all the big wrinkles up front, and if you
    think that wasn't necessary then you didn't understand the
    subtleties of the problem. Still might not for that matter, had it
    not been cleared up.
    Which I wouldn't have known, had I not asked the questions I did,
    would I?

    you couldn't wait to shout down someone
    Well, "shouting down" is a little harsh, I think, but in any case
    telling someone that it's not a missing pulse detector when it isn't
    should be permitted, don't you think?
    You're the one making all the noise about competition, Anthony, so
    you tell me.
    If you can read a schematic you can understand the design philosophy
    and then replicate it, via software, in a microcontroller. A
    microcontroller is all hardware inside, you know, and all you're
    doing with software is hooking it up so it'll do what the original
    hardware design did.
    Not changing the subject at all. The fact is that I've never seen
    anyone ask a "PIC lover" for code, and my opinion as to the reason
    behind that was as I stated, "they don't want any part of it since
    they're usually looking for a simple one-off and don't want to get
    involved with PICs." YMMV, but I think it's more likely that you
    were sharing code with other PIC lovers or PIC lover newbies than
    with real people.
  19. John Fields

    John Fields Guest

    Now, now, Anthony, be a nice boy, won't you?

    He has in his possession, and I've posted to abse, the corrected
    version which _does_ work.

    Moreover, I've come up with a simpler two-chip solution which uses a
    555 made retriggerable which I'll post later on as soon as I
    simulate it. I don't think the OP's in a big rush and it's not like
    I'm doing it for the money, Eh?

    BTW, are you going to do anything by way of showing that your way is
    the way he should go? You know, build something and test it since
    he certainly isn't going to do the programming himself, I suspect.

    If you do I think it would be nice if you kept a log of how long it
    took you to write the code, how long it took you to debug it, and
    the bugs you found. Oh, and then post it here. The whole think
    shouldn't take more than about a day, should it?
  20. Mike C

    Mike C Guest

    Guys thanks for all your posts, and I certainly didn't mean to start a
    PIC vs Traditional-Circuits argument. :)

    JH: I got your email, but your attachment didn't seem to go through..
    could you please re-send? I ordered the parts, should be here in a
    few and hopefully I could bring this circuit to a conclusion.

    Chris: Thanks for your post. I can see John's point regarding 555 not
    being re-triggerable... John, could the re-set be used instead to
    achieve something of the sort ? (just a thought, but you probably know

    As a side-note: I have nothing against PIC controllers, in fact, I
    think it would be great to learn how to use them... I would just
    prefer to do the learning as more of a side-hobby than a means to an
    end in this particular case. In fact, I would love to attempt this
    solution with a PIC also, so I'm totally open to suggestions as to
    where and what I should get as a starter kit, and any code would make
    this work (thats if its not too much work for anyone of course..)
    ... and again, I truly appreciate everyone's responses to my post.

    Best regards,
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day