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?
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.
Erik
"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.
"but it is a disgrace if the compiler does not contain logic for detecting shifts resulting in 8-bit aligned reads and writes."
the pic24f family (probably the h and e families too) has a shifter block that can do up to 15 bit shifts in hardware.
as a result, the shift approach on those chips are only 4x longer than the union approach.
but the fastest really is to use a (double) pointer to point to the unsigned long / unsigned char array representation of a double: that takes about 1/4 of the time of the union approach.