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.

how many countdown timer in PIC16F877A

Status
Not open for further replies.

yangueyren

Newbie level 3
Joined
Jul 19, 2008
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,305
countdown

how many countdown timer in PIC16F877A
 

ok thank blueroomelectronics!

How can I program it using C? cause only one interrupt is available (RB0).. I want to make this three timers to control 3 states of processes..

and do you know how to make the pins switch on for how many seconds then it switches off?I'll use it to drive the motors of my system..

Added after 11 minutes:

here is my program and it doesnt work


#include<pic.h>

int B,C,D;
int decode[10]={0,1,2,3,4,5,6,7,8,9};

main()
{
TRISA=0x2F;
TRISB=0x00;
TRISC=0x00;
TRISD=0x00;
while(1)
{
if (RA0){B++;}
if (RA1){B--;}
if (RA2){C++;}
if (RA3){C--;}
if (RA4){D++;}
if (RA5){D--;}


PORTB=decode;
PORTC=decode[C];
PORTD=decode[D];
}
}

Port A only sets the time for each to countdown..
 

There are many interrupt sources in the PIC, all the timers have them. There is only one interrupt vector (0x004) you simply need to sort out what generated it.
 

there are three timers TIMER0 is 8 bit,TIMER1 is16 bit,TIMER2 is 8bit
 

Hi yangueyren.

Pins RB7, RB6, RB5 and RB4 offers the possiblity to trigger an interrupt when their state changes(from high to low or from low to high) if they are configured as digital inputs.
Look in the datasheet on the description of PORTB.

Another thing. If you are using some push buttons on RA5-o pins to change the values of B, C and D, you should use some debouncing delay.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top