Time variable at different clock frequencies

crowland

Member
I've been using the time variable with different clock frequencies and found that if I set 1 Mhz then the time variable increments about once every 16 seconds.

Could the compiler be assuming that any clock frequency other than 4 MHz is 16MHz?

This is with 08M2+ using programming editor version 5.5.6

Chris
 

crowland

Member
Thanks, good to hear that it's known about. I was using an older PDF version of that which doesn't have the table.
 

matchbox

Senior Member
What exactly does the manual mean in the quote below, when it says Safely? I have used 'let time=0' many times, without selecting 'disabletime', and with no apparent consequences.

"When the time function is disabled the time variable may be altered safely with a command such as 'let time = 0' ".
 
Last edited:

hippy

Technical Support
Staff member
What I believe that is suggesting is that with DISABLETIME you can set 'time' and it will be that value afterwards; that it's safe to expect that what you set it to is what it will be.

Without DISABLETIME, the 'time' variable is not guaranteed to be what it was set to afterwards, it may be incremented by an internal tick immediately after it has been set.
 
Top