How to count pulses per second ?

JF: Sorry, I forgot to answer your question: "what kind of accuracy are we talking here? 5-10% ? " Yes, 5-10% sounds about right ... And I'd love to see your "solution which uses a 555 made retriggerable" after you're done simulating..

Thanks !

Reply to
Mike C
Loading thread data ...

--
You are.
Reply to
John Fields

--- No problem.

It'll be sometime today I think and It'll be an LTSPICE circuit list.

The problem with the garbled schematic (from your other post)is something I don't understand.

Over the last few days I've sent three schematics to three different individuals with gmail accounts and they all report the same thing, a text file instead the schematic. Here's the beginning of it:

begin 644 10PPS-Model.pdf M)5!$1BTQ+C0*)>+CS],*,2`P(&]B:@H\\/`HO5'EP92`O0V%T86QO9PHO4&%G M97,@,B`P(%(*+U!A9V5-;V1E("]5

Reply to
John Fields

--
And you knew precisely what he wanted from a less than precisely
worded statement?   You\'re fulla shit, Fremont.  You remind me of
the kid who learned a magic trick one day and then pretended he knew
it all along.  Kinda like "Positively Fourth Street."
Reply to
John Fields

Thanks Jason.

It looks like I can get set up for < $100, which certainly sounds reasonable....

And I like the idea of setting up a cross-compile environment in linux.... That has merit.

--Yan

Reply to
CptDondo

There you go again John, making untrue statements. I have never even begun to insinuate something as stupid as that. Other solutions are fine as long as the limitations are fine too. As I stated before, this particular problem can be done with less parts by using a PIC, and so far we all know that it can, including you John. Why is that so disturbing to you?

Suggesting the use of a PIC is a far cry from "ramming it down someones throat", now isn't it John? Should I never suggest one? Have I ever suggested one in an inappropriate way? You make it sound like I'm some kind of Java nut that can't see anything else. Nothing could be further from the truth, and I think you know that well. You just have to keep your perpetual battle going with someone, even if you have to "gild the lilly" as it were. Just because you can do it without a PIC doesn't make using one wrong.

Actually that was exactly the point. I have written "bug free" code the first time, so what?

And exactly what stimulated you to start this whole mess between us? It couldn't be that you jumped all over something I said that really wasn't even all that incorrect. Then when I clarified my answer instead of falling into your trap, you got all pissed and started ranting and raving, just like now. Picking on spelling errors and petty nonsense like that; you don't seem to like it being done to you, so why do you do it to so many others without cause?

OK, here you go.

Here's the entire thread:

formatting link

Here is the tail dragging post:

formatting link

And just so people don't have to hunt for it:

"I will say one thing now, though, and that is that after having checked your posting history last night I found that you do seem to know what you're talking about, technically, most of the time, so I apologize for any inaccurate broad-brush slurs I may have made earlier."

Ignite any brain cells yet?

I've only been plonked a couple of times, you got two yesterday IIRC.

Are you feeling ok? My statement has nothing to do with myself. The quotes are to set apart my statement.

I meant thanks, not plonks. Sorry about the confusion.

Enough is enough. Where did the OP say that exactly? Oh, that's right, he didn't. That's your misinterpretation of what he said.

I'll go ahead and help you out then, I'd like to see .005%. Does that give you what you need?

Oh does it look like I actually made an assumption? I know you've worked with micros..

You say that now, but later on down........

Then why did you bring it up John? Sounds like a typical response from you. What you can recall has little to do with what has taken place here, good thing we don't all rely on your recollection. Most of us don't even need to pin our name and address to our shirts before leaving home. :-) Just kickin' it up a notch.

Anything you want, except a micro, PEEL, PAL, GAL, FPGA ..... you get the idea, no programmable logic. Ready to commit yet?

The irony here is that you already know that I'm right and so does most everyone else, you're now just hoping that I can't actually produce some code that works. You're absolutely incredible John.

Come on over and watch me. How else will I prove it to you? This is a simple piece of code, it really doesn't get much easier. Why is it so hard for you to believe that it won't be hard to write.

I have a user with a serious production problem right now (not my fault though, just trying to be a nice guy for them) so I may not have code posted until morning. I think that's fair enough, it took you 24 hours to get it right and you're the expert. I'm just a tinker.

Before you get your mouth open too far here, remember that I came closer to interpreting his first post correctly than you did. I've been extracting what people want from what they say for more than 25 years, I have some experience at this.

Are you taking some kind of medication that brings on these fanciful hallucinations? You put more words into my mouth than I do. Just wishing that my behavior was as you say won't make it true. You just can't resist making foolish accusations, without evidence, even though you have been proven wrong time and again.

For God's sake John, I've been a "professional programmer" for more than 25 years. Do you honestly believe that anyone proceeds like you described. Oh, I keep forgetting, you do it that way.

Is that why you immediately proceeded to develop the wrong solution? The whole world saw it already John, you're just making a bigger fool of yourself with every post.

Then please explain how his post wasn't clear on when to extinguish the LED, I still haven't figured out how that part confused you. I didn't want to say anything, but here we are.

You're absolutely right, the shouting down was a bit harsh.

You were the first to make a contest out of this with your smart remarks about having it done while the suggestor would still be struggling with his code.

That doesn't answer the question. I've already submitted that I understood a proper solution before you did, or don't you believe that either? Will I have to prove that too?

Wow, just happened to snip your part off huh, your such a cheat when it comes to debate.

You absolutely changed the subject and you know it.

Another lie. There have been a myriad of posts were people wanted help with PIC code. There have also been people that were willing to use a PIC even if they had to pay someone to flash it for them.

Now, grow up, stop the hand waving, stop the creative snippery and just debate like a man. Can you do that John?

And now you speak for all the past, present and future noobs that want some help? And exactly how are PIC lovers not real people John. You just can't alienate people fast enough, can you?

Reply to
Anthony Fremont

Yan,

You should be able to get going with AVRs for well under $20, even. I'd say a good "Starter Kit" would be:

  • A couple ATmega8s for .66 each at Digikey
  • Parallel port cable from your local electronics store, probably
  • WinAVR or the AVR GCC toolchain for Linux (free)
  • Various resistors, and at least 1 10k resistor (few bucks)

Check out

formatting link
to see how to wire up the parallel port cable to use as an in circuit serial programmer.

Since the ATmega8 has a good on chip oscillator you don't even need a crystal!

Good luck! And feel free to email me if you've got questions. I really enjoy using AVRs and I don't mind blabbing about them :)

Jason

Reply to
Jason von Nieda

Where is the ramming? My entire point was made in a post that you wouldn't even reply to. To solve this problem, IT TAKES LESS PARTS WITH A PIC, that's all I said. When you can prove that wrong, come on back.

You know this isn't about Microchip PICs in specific. By PIC haters, I was referring to the "no micros at any cost" group.

I'm afraid I have to agree with you on something. Even though I haven't programmed on it, the Motorola arch looks pretty decent. Of course the PIC is ugly, but then look at what Intel came up with.

Actually that's all just for your benefit. ;-) Now come on John, you know that it really isn't quite like that. OTOH, the anti-micro group (AKA PIC haters) do often come off like they're pissed at the mention, just look at Ed and how he went off.

Reply to
Anthony Fremont

That wasn't my issue. My point was that "it wasn't simpler". Now I guess we can debate what that means, but I was thinking parts count.

That will be interesting.

WILL YOU MAKE UP YOUR MIND???? Yes, I will, but as I said I have allot going on today, but I will try to have something by the morning, otherwise I will get after it this weekend. I'm at a slight disadvantage in that I haven't tinkered with my PIC stuff for a while, so I have to dig it all out.

If you've been snooping around Google, you'll know that I took up watchmaking as another hobby. Imagine that, a PIC lover that wears vintage wind-up watches. I have to convert my bench back to PIC development, but I've been wanting to switch back to tinkering with that stuff for a little while anyway.

Less than a whole day (8 man hours), but finding 8 spare man hours is a bit tough these days. I don't mean to be tossing out excuses, but I have been way too busy lately.

Reply to
Anthony Fremont

John: I get the same garbled text in Gmail ... i just enabled POP and downloaded in outlook, it worked... I can see the pdf now... I guess its something with google. Thanks a bunch again ! I just downloaded LTSPICE so I could see your next circuit. is this the right one ?

formatting link

MC

Reply to
Mike C

--
It isn\'t, but I\'d say that because of your constant whining about
how good a PIC would be in this application that you\'re upset
because the OP won\'t buy into it.
Reply to
John Fields

Just like the post I made less than around 9:30 pm Tuesday says Fields, you're the one making a mistake.

ISTM, that I'm not telling you anything here, I was talking to Eric.

Pot, kettle, black and all that, ya know.

I guess I was right, huh?

Reply to
Anthony Fremont

--
Sounds like you want to smoke peace pipe. OK.

Tell you what, I\'m kind of busy too, so if you want to wait \'til
next week I\'ll write some Motorola assembler to do it in one of
their processors and we can compare.

?
Reply to
John Fields

--
Yup!
Reply to
John Fields

I don't care if the OP "buys into it", and that's not the issue. The issue is you and your constant waffling crap.

I never once said that it was the "right" solution, as if there is only one solution. I said it was valid, simpler (less parts) etc....., that's your own fantasy.

You should since that was what most of your spewage was about.

What are you talking about. I never even spoke directly to the OP about it. Where did he tell ME no? Where was I begging him. Just a bunch more lies, big surprise.

I guess not.

Aparently your memory is worse than I thought. The only thing I said regarding your stupidity was about installing the yellow disc and not having a seperate firewall. AIR, you got mad over my suggestion that if you were happy with SBC/Yahoo support, then you were easy to impress. I still stand behind that statement.

formatting link

formatting link

Guess that means you've run out of lies to spread then. I'll take that as a win then.

Reply to
Anthony Fremont

"Mike C" schreef in bericht news: snipped-for-privacy@a34g2000cwb.googlegroups.com...

Mike,

I'm neither a PIC-hater nor a PIC-lover. Nevertheless I'm a PIC-user (sometimes). As for the problem you mentioned I'd use the smallest PIC and write some code for it. That's not to say I'd advise you to do so. I fully agree with John that a electronic solution might be better in your situation. PICs *do* have a learning curve which is often underestimated by the "lovers".

If you want to learn PICs I often advise to go to

formatting link
IMHO a clear explanation of pros and cons. You will find a programmer (kit or build) and a JAL compiler which may suit higher level language programmers better then assembler. You will definitively need the datasheet of the PIC you want to use. Free downloadable from Microchip.

Small solutions that use small PICs are better done by assembler. Microchip has a complete development environment for free. You can also build your own programmer. I build one found on

formatting link
That one works for me but you can find many, many others.

Likewise you can find other micros too.

petrus bitbyter

Reply to
petrus bitbyter

For the most part, I tend to treat people the way they treat me. I rarely go off on someone that didn't smack me first, but I must admit that I have done it. I can't help but to defend the underdog sometimes, and it really gets under my skin when someone comes down hard on a noob for no reason. Besides, you can't say that you don't enjoy a good flame war anyway, can you? ;-)

AIR, my first encounter with Ed was him going off on me over being another "PIC lover". In that case, I actually did suggest one to the OP. That's when I find out about this whole anti-PIC (anti-micro) movement. I ended up having to post code for that one too. That's probably why I couldn't resist responding to him this time. Aly was just being funny and Ed took it all personal on your behalf. You have to admit, surely, that Aly was pretty funny.

There's nothing wrong with promoting PICs, just like there is nothing wrong with promoting the "Rube Goldberg" techniques. At least while parts are still available. ;-)

It's a simple problem so there really shouldn't be much to compare, except the actual approach taken. I already have some code thrown together, but it hasn't been assembled yet. I like using interrupts, so I was just thinking I'd use a timer to generate 1 int/second and use an RB0 int to capture and count the pulses. The LED will be turned on or off once per second in that interrupt handler so it will remain on or off for that amount of time. Another main level with no code to execute. :-)

Reply to
Anthony Fremont

Since I have been going on about AVRs, here's my contribution. It's around 15 minutes of write/debug. Grab it at

formatting link
if it doesn't show up well here. The circuit for this would be an ATmega8 ($3.66 on Digikey), a 10k pullup to +5v on RESET, VCC = 5v, GND, input on pin 4 and output LED on pin 14. Total cost: ~$4.00 Total time: ~30 minutes including building the circuit

/* Chip Configuration ATmega8, 8MHz Internal RC Oscillator I/O Configuration Input pulse train on PD2 Output LED on PB0 Operational Theory When rising edges are detected on PD2 (input) a global variable called pulses is incremented. The main program runs in a infinite loop delaying for one second at a time, checking the number of pulses in that last second and then triggering power to an LED if the pulse count is equal to or greater than 10.

*/

#include #include /* Most people have their own delay routines. If not, there are dozens available on the Internet that all basically amount to the same thing.

*/ #include "delay.h"

int pulses;

/* This interrupt handler is triggered each time a rising edge is detected on INT0, which on a ATmega8 is PD2

*/ ISR(INT0_vect) { pulses++; }

int main(void) { pulses = 0; // Enable PD2 as an input DDRD &= ~_BV(PORTD2); // Enable PB0 as an output DDRB |= _BV(PORTB0); // Make sure the LED is off PORTB &= ~_BV(PORTB0); // Configure INT0 to trigger on rising edge MCUCR |= _BV(ISC00) | _BV(ISC01); // Configure INT0 to fire interrupts GICR |= _BV(INT0); // Enable interrupts sei(); // Loop forever while (1) { // Delay for 1000ms (1 second) delay_ms(1000); if (pulses >= 10) { // If there are more than 10 pulses in the last second turn on the LED PORTB |= _BV(PORTB0); } else { // If not, turn the LED off PORTB &= ~_BV(PORTB0); } } return 0; }

Jason

Reply to
Jason von Nieda

// Did you forget this? :-)

pulses = 0;

Reply to
Anthony Fremont

Would you believe me if I said I left that as an exercise to the reader? :) Okay, okay, I forgot it. Nice catch :)

Jason

Reply to
Jason von Nieda

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.