Help
Advanced Member level 2
Timer ISR
Hi,
Anyone know how to explain the red point??
/*-----------------------------------------------------------------*/
#include <Reg52.h>
#define INTERRUPT_Timer_2_Overflow 5
void Timer_2_Init(void);
void main(void)
{
Timer_2_Init(); // Set up Timer 2
EA = 1; // Q1 Why need to set Grobally enable interrupts
while (1); // An empty Super Loop
}
void Timer_2_Init(void)
{
T2CON = 0x04; // bit 3 (0000 0100) = TR2 is set (Timer2 is ON)
TH2 = 0xFC; // Q2 Why don't have any different if i set 0xEC78
RCAP2H = 0xFC; // it should be 5uSec is it??
TL2 = 0x18;
RCAP2L = 0x18;
ET2 = 1;
TR2 = 1; // Q3 The T2CON already set why still need to set again??
}
void X(void) interrupt INTERRUPT_Timer_2_Overflow
{
// Q4 How this function work ??
}
Thank You...
Hi,
Anyone know how to explain the red point??
/*-----------------------------------------------------------------*/
#include <Reg52.h>
#define INTERRUPT_Timer_2_Overflow 5
void Timer_2_Init(void);
void main(void)
{
Timer_2_Init(); // Set up Timer 2
EA = 1; // Q1 Why need to set Grobally enable interrupts
while (1); // An empty Super Loop
}
void Timer_2_Init(void)
{
T2CON = 0x04; // bit 3 (0000 0100) = TR2 is set (Timer2 is ON)
TH2 = 0xFC; // Q2 Why don't have any different if i set 0xEC78
RCAP2H = 0xFC; // it should be 5uSec is it??
TL2 = 0x18;
RCAP2L = 0x18;
ET2 = 1;
TR2 = 1; // Q3 The T2CON already set why still need to set again??
}
void X(void) interrupt INTERRUPT_Timer_2_Overflow
{
// Q4 How this function work ??
}
Thank You...