Timer in autoload mode

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?

Parents
  • The code sent by Erk will work as it functions smoothly in mode 1. After reading the above posts, I think the simulator is designed to function the way it operates. Once it reads the mode, it should load both the registers with the pre-defined values to function in mode 2, but for some reason it doesnt. But the issue is after the roll-over of the TF flag the timer starts again as you step in to execute the next instruction and everything down the lane is stuck.

Reply
  • The code sent by Erk will work as it functions smoothly in mode 1. After reading the above posts, I think the simulator is designed to function the way it operates. Once it reads the mode, it should load both the registers with the pre-defined values to function in mode 2, but for some reason it doesnt. But the issue is after the roll-over of the TF flag the timer starts again as you step in to execute the next instruction and everything down the lane is stuck.

Children
More questions in this forum