This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Timer0 for 16-bit counter

I'm trying to pause at while (TL0 <= 10) {} until I get a count of 10. When I run the program, the program doesn't pause at while (TL0 <= 10) {}. It's like the while is false. Can any one see something I don't?

// Setup TH0 Timer0 for 16-bit counter mode
TMOD = (TMOD & 0xF0) | 0x05;
//Set the counter0 Run control bit.
TR0 = 1;
while (1)
{
//reset Tiimer0 (counter)
TL0 = 0;
// Toggle P3.4 increment the count
while (TL0 <= 10) {}

//The rest of the code
}

0