I use Keil sometimes and while using a timer in autoload mode, the TH0 is loaded with the calculated value but TL0 starts incrementing from 00 instead of the calculated value F0.Am I missing something while using or configuring the keil simulator?
You can use this example as a reference:
http://www.keil.com/download/docs/97.asp
This is a Timer 1, 8 bit auto-reload example that is being serviced by a Timer ISR.
This example will exhibit the same issue you see - that the hardware is clearing the flag when it jumps to the Timer 1 interrupt vector.
Are you using an Timer ISR? In the above example, if you set EA = 0 or go to Peripheral -> Interrupt, and set EA =0, you will see the timer flag 1 (TF1) will never get cleared.
You can also observe the timer values under Peripherals -> Timer 1.
You can read more about how timers work on an 8051 here:
www.8052.com/tuttimer.phtml
"This example will exhibit the same issue you see"
I am not sure. I think his code appears to be correct. it is not clear what he observed (no auto-reloading or incorrect auto-reloading?). but if all he is concerned is that the first observable tmr count in the isr is not 0xf0 - that's due to interrupt latency.
but from what he wrote, it doesn't sound like that's he is complaining.
" - that the hardware is clearing the flag when it jumps to the Timer 1 interrupt vector."
I am pretty sure that's not his issue, and I am pretty sure that's supposed to have happened.