cimulation
New Member
I have tried to toggle RA4 using the following piece of code:
However RA5 flips fine on Timer 1 interrupt but RA4 there is no change. ie RA5 filps after every 100 interrupts but RA4 always shows 0V on a multimeter.
I use the following code to enable interrupts
I am using the follwing initialize sequence:
__CONFIG(INTIO & WDTDIS & PWRTEN & MCLRDIS & UNPROTECT \
& UNPROTECT & BORDIS & IESODIS & FCMDIS); using the PICC compiler.
Can anyone spot the issue here.
Thanks a lot for your insight.
Sumit
Code:
if ( TMR1IE == SET && TMR1IF == SET) //If A Timer1 Interrupt
{
ctr++;
ctr2++;
if(ctr2>100)
{
if(flip==0)
{
RA4=1;
RA5=0;
flip=1;
}
else
{
RA4=0;
RA5=1;
flip=0;
}
ctr2=0;
}
...
However RA5 flips fine on Timer 1 interrupt but RA4 there is no change. ie RA5 filps after every 100 interrupts but RA4 always shows 0V on a multimeter.
I use the following code to enable interrupts
Code:
PEIE = 1; // Enable Peripheral Interrupts
GIE = 1; // Enable Global interrupts
I am using the follwing initialize sequence:
__CONFIG(INTIO & WDTDIS & PWRTEN & MCLRDIS & UNPROTECT \
& UNPROTECT & BORDIS & IESODIS & FCMDIS); using the PICC compiler.
Can anyone spot the issue here.
Thanks a lot for your insight.
Sumit