Timer

Im using a microcontroller 8051f226. I dont know how delay in 1 sec. I was thinking if i have to add some more codes under ISR?

void Timer2_ISR (void) interrupt 5
{
TF2 = 0; // clear Timer2 overflow interrupt flag
LED = ~LED; // change state of LED
}

my SYSCLK is 2000000
Last edited on
The command to wait is:

DELAY_MS(1000);

this command gets the MCU to wait 1000 ms.

Cheers.

PS: This is not the right place to ask microcontroller question. Find a microcontroller forum.
Last edited on
hello! yep i tried it, but it doesnt work. I was thinking of using the if else/for loop statement but not sure how to program it.
Please go to some MCU forum. This is not the right place.

btw, I used that command before for mz PIC16F84A
Topic archived. No new replies allowed.