1. when I add this code "IVBR = 0x7Fu;" to main.c , this project is always reset.
2. when I delete this code "IVBR = 0x7Fu;" this project is running correctly.
main.c如下:
unsigned char test_flag = 0;
void main(void) {
/* put your own code here */
TSCR2 |= 0x84u; /* 16 Prescale Factor */
TSCR1 |= 0x80u; /* start timer */
//IVBR = 0x7F; /* delte this code ,the code is OK */
EnableInterrupts;
for(;;) {} /* wait forever */
/* please make sure that you never leave this function */
}
#pragma CODE_SEG NON_BANKED
#pragma TRAP_PROC SAVE_ALL_REGS
void ECT_OVERLOW(void)
{
test_flag++;