Hello all,
Working with what I had left over in a bin. It looks like the rest of my code works fine, but I'm having trouble toggling one output pin. This is what I'm trying to do. Using MPLAB 5.05 and XC8 1.35
Now here is my timer ISR, I verified I'm entering my ISR.
My problem is my output, HEARTBEAT, is constantly high. It never toggles. I know this chip does not have the latch register and I think this may be the source of my problem. Any tips? Thank you.
Working with what I had left over in a bin. It looks like the rest of my code works fine, but I'm having trouble toggling one output pin. This is what I'm trying to do. Using MPLAB 5.05 and XC8 1.35
Code:
#define HEARTBEAT PORTAbits.RA0 // heartbeat I/O
if(mS_count >= ONE_SECOND)
{
// Heartbeat
HEARTBEAT = ~HEARTBEAT;
mS_count = 0;
}
Code:
void interrupt master_isr(void) // only one interrupt vector on this chip
{
// timer0 interrupt routine
if(INTCONbits.T0IF)
{
INTCONbits.T0IF = 0; // clear the flag
++mS_count; // increment mS_count
++motor_start_time; // increment motor start time
}
}