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?
Even though I understand that the simulator is not designed to operate in a specific way for certain modes does not mean that it should get stuck at certain instruction and does not return to the main program or execute the next set of instructions. If you run the code u will find that its stuck in the while loop with timer getting loaded and overflow repeatedly and the program does not return to main. I dont think any datasheet specifies such abnormal operation. How does this simulator help in debug mode when it gets stuck at some point for such a small program?
How does this simulator help in debug mode when it gets stuck at some point for such a small program? The issue is not the size of the program, but whether the particular operation were correctly implemented when the simulator was made. You are/were making a somewhat 'exotic' piece of code. Using reload "without making use of the feature" and I can easily see such "slipping through the cracks". I (and I guess most) have never used reload and stop together. Reload is usually used with a "timer tick" that you never stop.
Erik
"I can easily see such "slipping through the cracks"."
that's the problem throughout the whole discussion. his code absolutely works: either in simulation or on actual hardware.
and his code has identical return mechanism to yours. so if his code couldn't return, yours couldn't either.
all you need to do is to load his code into the compiler and run it through.
the problem is NOT the code.
all you need to do is to load his code into the compiler and run it through. I see no problem in it compiling, but the discussion is about simulating
PS I got rid of the simulator ages ago when it took me through some frustrating sequences. If I can't emulate/ICE/JTAG/... I do not do.
Posting queries on this forum is useless.One hardly gets answers except abusing each other and pointing at trivial issues
Trivial questions deserve trivial answers!
Posting queries on this forum is useless.
what is usesless is that about 3 posts down I posted "get rid of autoload" and it took you about 40 more posts to do so.
"what is usesless is that about 3 posts down I posted "get rid of autoload""
what is more useless is that even after 40+ posts, you still haven't realized why that suggestion was useless.
when the OP finally followed my suggestion, he posted
The code sent by Erk will work as it functions smoothly in mode 1.
what is usesless about fixing the problem? As opposed to the homewrecker I am not interested in long theoritical discussions when a simple solution exist.
IF the homewrecker had not argued against my solution which solved the problem this thread would have been a whole lot shorter.