A little bit of legwork on your end wouldn't hurt your case either ya know...
(Comments in boldface, obviously)
[code]
void interrupt() If you don't know how to use interrupts, this would be a good chance to learn how to use them
{
PORTA = PORTA - 1; //decrement the value on PORTA PortA = PortA -1, although I don't think I'd use this method. I'd use another variable to do the counting and then copy that variable into portA
INTCON.INTF = 0; //enable new RB0/INT interrupts The datasheet for your particular PIC will show you which bit of INTCON enables RB0/INT interrupts
OPTION_REG=0;
}
void main()
{
OPTION_REG.INTEDG=1; Again, the datasheet will show you which bit select the edge to trigger from
TRISA = 0x00; //set all PORTA pins as outputs
PORTA = 0xff; //make all PORTA pins high
INTCON.INTE = 1; //enable RB0/INT interrupts same as above
INTCON.GIE = 1; //enable all un-masked interrupts same as above
}
[/QUOTE]





Bookmarks