Pulse counter using pic16f877A

Discussion in 'Embedded Systems and Microcontrollers' started by aswathymohan, Nov 11, 2012.

  1. aswathymohan

    Thread Starter New Member

    Nov 11, 2012
    3
    0
    how to count the number of external pulses using pic16f877a every 1s?

    pl write the mikroc code
     
  2. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    4,886
    1,010

    That is your job. Folks around here are happy to help but they are not going to do your job for you.

    Look at page 46 of the datasheet for interrupt on change.
     
  3. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
  4. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    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...
     
  5. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    4,886
    1,010

    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. :)
     
  6. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    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)...
     
  7. takao21203

    Distinguished Member

    Apr 28, 2012
    3,577
    463
    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.
     
  8. takao21203

    Distinguished Member

    Apr 28, 2012
    3,577
    463
    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?
     
  9. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    Gotta hunt 'N peck for the keys to milk some time, this should take about 2 minutes...;)
     
  10. takao21203

    Distinguished Member

    Apr 28, 2012
    3,577
    463
    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.
     
  11. takao21203

    Distinguished Member

    Apr 28, 2012
    3,577
    463
    And it might not be totally trivial after all- the counter must be displayed somehow or the value transmitted. OP isn't giving this information.
     
  12. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    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
     
  13. takao21203

    Distinguished Member

    Apr 28, 2012
    3,577
    463
    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
     
  14. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    4,886
    1,010
    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. :)
     
Loading...