Pulse counter using pic16f877A

tshuck

Joined Oct 18, 2012
3,534
Simply run a timer as a counter with an external clock....

this is intro to microcontroller stuff, so I hope you can sit tight long enough so that the information will seep into your brain, or you can do a little work...
 

spinnaker

Joined Oct 29, 2009
7,830
Simply run a timer as a counter with an external clock....

this is intro to microcontroller stuff, so I hope you can sit tight long enough so that the information will seep into your brain, or you can do a little work...

As the requirements read a timer is not needed. OP do not need to know the frequency of the pulses, just count them when they come in.

But my guess is that we have heard the last of the OP. Anytime a message contains "Please do this for me" and there is the usual refusal the OP goes away for some mysterious reason. :)
 

tshuck

Joined Oct 18, 2012
3,534
That's exactly what a counter does... count!:p

It's a direct hardware implementation instead of interrupting and incrementing a register, all you need to do is read the count and clear the register (if desired)...
 

takao21203

Joined Apr 28, 2012
3,702
As the requirements read a timer is not needed. OP do not need to know the frequency of the pulses, just count them when they come in.

But my guess is that we have heard the last of the OP. Anytime a message contains "Please do this for me" and there is the usual refusal the OP goes away for some mysterious reason. :)
There is a need for a category: Unintelligible and/or trivial posts WITH a likelyhood OP will NOT come back; alternatively, containing cluttered codes and spelling errors (which gives proof OP never actually wrote any meaningful code).

I wonder if and how people may apply for jobs that way. The HR guy (or gal) has a much more shorthand solution: TRASH.

1. OP must outline the steps and attempts already taken.
2. OP must write the software and hardware used (in correct english).
3. OP must use a search engine before posting on the forum.
4. OP must look up programming tutorials (which should enable OP to solve trivial problems on his or her own).

We need another category: Absolute Beginners who are not able even to make a trivial program working (to use Ohms law etc.)

Seep out all these posts from the rest of others.
 

takao21203

Joined Apr 28, 2012
3,702
how to count the number of external pulses using pic16f877a every 1s?

pl write the mikroc code
I am using MicroC edtion blabla on a Windows 7 PC.
I am using a PIC 16f877a with a foobar programmer.
It is built on a breadboard.

I have tried this and this and this (screenshot from debugger),
but I do not have any idea why this can not work.

I have looked up tutorial foobar, and I have read the compiler manual.
However, on page 234, there is simply not enough information.

***************

I would like to use the opportunity to express that posts like that are just annoying to users of the forum who actually write real programs.

Even if they might be willing to give explanation to beginners.

Even if you have great programming skills, if you lack the ability to communicate (in written english), this will take you nowhere.

Alternatively, you'd need to pay money. Then people will try to understand what you mean, even if it is trivial and unintelligible etc.

If you do not have the money, you just need to "duck".
You actually need to write "I am not able to program a counter for external pulses every 1s". Then people may also be willing to help you.

pl write the mikroc code

This will take you nowhere.
I'd like to see such posts to disminish altogether.

Or, what about $30 for each hour I write the mikroc code?
 

takao21203

Joined Apr 28, 2012
3,702
Gotta hunt 'N peck for the keys to milk some time, this should take about 2 minutes...;)
Imagine you get just $2 each time you write such a program. I mean it's just a small fee for people who are too lazy to read tutorials, or who are too lazy to actually write any kind of programs.
 

tshuck

Joined Oct 18, 2012
3,534
Imagine you get just $2 each time you write such a program. I mean it's just a small fee for people who are too lazy to read tutorials, or who are too lazy to actually write any kind of programs.
Good news is that you'd only have to write it once, then charge a flat fee for the program each time you give it to someone! Sounds like a money maker:D
 

takao21203

Joined Apr 28, 2012
3,702
Good news is that you'd only have to write it once, then charge a flat fee for the program each time you give it to someone! Sounds like a money maker:D
With OPs specification, few programmers would actually be able to commence work.

Maybe it is 16 year old from a high school in Bangalore. I hope the place isn't too "high" :D
 

spinnaker

Joined Oct 29, 2009
7,830
With OPs specification, few programmers would actually be able to commence work.

Maybe it is 16 year old from a high school in Bangalore. I hope the place isn't too "high" :D
There have been a lot of these lately. Finals must be due. They seem to come in batches. They panic once they realize they have learned nothing through the year. Too much dope smokin goin on and not enough book learin. :)
 
Top