We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I'll very appreciate if you can help me with the following issue: Configured Timer 2 on P89C51RD2 . I'm getting around me and become confused from it ... So, I configure Timer 2 / 16-bit timer (the timer overflows (goes from 0xFFFF to 0x0000) An interrupt service routine (ISR) have to be invoked whan timer 2 have expired. (In which register I have to set the interrupt number void timer2_ISR (void) interrupt xx ??) Can you send me a 'C' example code which demonstrated this issue. Thanks Moshe
Hi Thanks. It's works but u have to add EA=1 Moshe /* init timer2 to required delay and start it*/ static void timer2_init(void) { T2CON = 0x00; /* timer 2 16 bit auto-reload. */ TL2 = TIMER2_CLK_TICK_RELOAD & 0xFF; TH2 = TIMER2_CLK_TICK_RELOAD % 0x0100; RCAP2L = TIMER2_CLK_TICK_RELOAD & 0xFF; /* lower byte of 16 bit reload value. */ RCAP2H = TIMER2_CLK_TICK_RELOAD % 0x0100;/* upper byte of 16 bit reload value. */ TR2 = 1; /* start timer 2. */ ET2 = 1; EA = 1; }