Re: How to count pulses per second ?



Guys, thanks alot for your responses, all excellent & informative
posts. I will most definately attempt this solution with a pic at a
later time, convincing arguments in favor of the pic... and any
suggestions with regards to obtaining a good and relatively
inexpensive pic starter kit are definately appreciated.

In the meantime, I'd like to attempt a temporary quick-fix to my
problem, as i'm working with limited components in a relatively short
time-frame.

JF: I'm not sure if a monostable would fix the problem (but correct me
if im wrong)
Two conditions need to be met:

1. If and only if the pulse train coming in >=10Hz (10 "up" cycles
per second with no particular duty-cycle pattern) only then turn on a
transistor.
2. Otherwise, if the pulse train count goes below 10 cycles at any
point, turn off the transistor at once.

So the output should be HIGH only if 10 cycles per second (or higher)
are counted, otherwise output is LOW.

I'm afraid I still dont have a working solution (PIC programming
aside :)

Guys, thanks for all your help again.


On Feb 13, 10:51 pm, "Bob Eld" <nsmontas...@xxxxxxxxx> wrote:
"John Fields" <jfie...@xxxxxxxxxxxxxxxxxxxxx> wrote in message

news:67j4t2lee8s77t3h3gbtr1sv20pddgkfe3@xxxxxxxxxx





On 13 Feb 2007 15:33:01 -0800, "Mike C" <tiberi...@xxxxxxxxx> wrote:

:)

I'd have to agree w/ JF. Learning curve would be big (at least for
me).. the "one-chip in a few hours" would just work so much better :)
JF: would you be able to shed some light on what I should do. (A
schematic would be simply amazing)

---
Basically, what you do is set up a retriggerable monostable
multivibrator (one-shot) so that as long as the edges which trigger
it keep coming in before the one-shot times out, they start a new
timeout period, which should be precisely 100 milliseconds plus or
minus whatever slop you can tolerate. That way, as long as the
inputs occur quickly enough, the output will always be stable and
the LED will never come on.

Which brings up another point:

If the signal drops below 10Hz and then goes back to >= 10 Hz, would
you like the LED to stay on forever (Until it gets manually reset
or something like that) or to go off automatically if/when the input
signal goes back to >= 10Hz?

Be aware that if the latch is what you want it'll probably take more
than one chip to get there.

--
JF

Yes but an 8 pin PIC could do this without a timing resistor and capacitor
and do it in an absolute counting way that handles irregualr pulse timing
like from a person pushing a switch. It would require writing some simple
code and programing, of course, but would be cheaper and more stable and
have a lower parts count and a smaller footprint than the one shot. The 25mA
output current will drive LED's better than a one-shot. The clock is
internal, no other parts required except a bypass cap and LED resistor that
you have to have anyway. The one shot is OK for a do it once solution but
is not the best for even moderate production of a few units. Besides, once
one learns how to program and blow parts, there is no limit to what else can
be done. That's a much more valuable learning curve than screwing with a
one-shot.- Hide quoted text -

- Show quoted text -


.



Relevant Pages

  • Re: PIC18 Timer 2 weirdness
    ... "Phil Hobbs" wrote in message ... From last time, I remember that MCU programming is all about getting the configuration bits right--once that's done, it's pretty simple. ... I got the PWM working OK, but with a 64 MHz clock, the slowest rate the PWM can go is 4 kHz, which is too quick for the servos. ... For N+M/1024 cycles, it turns ON the RD5 output when the down-count reaches N, and then switches to the PWM for cycle 0 only. ...
    (sci.electronics.design)
  • PIC18 Timer 2 weirdness
    ... From last time, I remember that MCU programming is all about getting the configuration bits right--once that's done, it's pretty simple. ... Sooo, I'm trying something fairly simple to start with, namely controlling an RC airplane servo. ... I got the PWM working OK, but with a 64 MHz clock, the slowest rate the PWM can go is 4 kHz, which is too quick for the servos. ... For N+M/1024 cycles, it turns ON the RD5 output when the down-count reaches N, and then switches to the PWM for cycle 0 only. ...
    (sci.electronics.design)
  • Re: FPGA Recommendation
    ... is the limited programming cycles. ... NAND flashes, CPLD's, FPGA's with internal config memories, and ...
    (sci.electronics.design)
  • Re: PIC18 Timer 2 weirdness
    ... I remember that MCU programming is all about getting ... The PWM is done with Timer 2 and capture/PWM module ECCP 1. ... M/1024 partial cycles, yielding 15 bits resolution at a 61 Hz rep ... Dr Philip C D Hobbs ...
    (sci.electronics.design)
  • Re: PIC18 Timer 2 weirdness
    ... I remember that MCU programming is all about getting ... The PWM is done with Timer 2 and capture/PWM module ECCP 1. ... I could have N complete cycles ... Phil Hobbs ...
    (sci.electronics.design)