Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Counter mode program for PIC16F877 using MPLAB compiler

Status
Not open for further replies.

aandavan

Advanced Member level 4
Joined
Aug 31, 2006
Messages
104
Helped
8
Reputation
16
Reaction score
7
Trophy points
1,298
Location
india
Activity points
1,918
counter program for pic16f877

hi ,
I wrote a timer interrupt program for PIC16F877 but i got confused for writing a counter mode program for PIC16F877 . anyone help me please...
 

mplab counter

i have written a program like making a pin high and low alternatively . i need to count number of times the pin goes high. For that any one help me please...
 

Probably the easiest is to use a pin with an interrupt capability on change (RB0/INT or RB4-7). In the interrupt routine simply increment your counter.
 

aandavan, could you post your code for review? maybe it would be useful...

also, in counter mode, wich timer are U using? have you changed to counter mode? are U using any interrupt in this counter mode?
 

use the timer to interrupt the program with
a known time u can calculate it from
delay = (max nu of counts - initial count )*time of one count
then an interrup routine will calculate the counts u count
 

Hi!
If you post your code or describe the end use of the software more clearly then i will be in a better postion to help you. Are you using the controller to count something (items on a conveyor belt) and display the no of items?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top