Unfortunately the timer does not work in the example! I can tell this because flag is never set and ms_counter never changes!
This is the problematic code:
Code: Select all
#include "Click_Heart_Rate_5_types.h"
uint32_t ms_counter;
uint8_t flag;
void InitTimer(){
// 3.9ms Timer interrupt for sampling
T1CON = 0x8010;
T1IP0_bit = 1;
T1IP1_bit = 1;
T1IP2_bit = 1;
T1IF_bit = 0;
T1IE_bit = 1;
PR1 = 39000;
TMR1 = 0;
}
void Timer1Interrupt() iv IVT_TIMER_1 ilevel 7 ics ICS_SRS {
T1IF_bit = 0;
//Enter your code here
ms_counter++;
flag=1;
}
Additionally, as soon as any call to a bus is made (UART, I2C), the debugger will ignore all further breakpoints and let the code run freely. Is the debugger broken? Is there a way to update the debugger firmware so that it does not have this behavior?
It makes the debugger entirely useless!