OK I am making a rate meter. 18M2+ chip
When I run it in what I call 'One Shot' mode it malfunctions. I think my logic is OK.
What I am trying to achieve, in 'One Shot mode' is measuring a rate for a period of time, then stopping it after a defined period of time, (time needs to stay fixed) and displaying the rate till it is reset. Rate is Events / Time.
So, I stop the time with Disable time and then display till reset. My logic is OK. BUT the time is still advancing! Therefore my rate degrades
So, I have removed everything to simulate the bug and have the following code... It 'malfunctions' too! Can you explain this?
I show the minimalistic code which still demonstrates the problem...
Is this a 'Bug' has it been fixed? Is it feature? What is happening? Have others found this?
Nap seems to reactivate the time variable incrementing during the subsequent pause command.
HertzHog
When I run it in what I call 'One Shot' mode it malfunctions. I think my logic is OK.
What I am trying to achieve, in 'One Shot mode' is measuring a rate for a period of time, then stopping it after a defined period of time, (time needs to stay fixed) and displaying the rate till it is reset. Rate is Events / Time.
So, I stop the time with Disable time and then display till reset. My logic is OK. BUT the time is still advancing! Therefore my rate degrades
So, I have removed everything to simulate the bug and have the following code... It 'malfunctions' too! Can you explain this?
I show the minimalistic code which still demonstrates the problem...
Code:
#no_data
Disabletime ; This should stop the word variable time from incrementing
Main:
Nap 1 ; Commenting out this Nap makes it work OK!
Pause 2000 ; It seems to be the Nap AND the Pause which makes this bug appear, but why?
SerTxd("The value of Time is = ",#Time," seconds.",13,10) ; Time slowly increments while this runs on my chip but why?
Goto Main
Nap seems to reactivate the time variable incrementing during the subsequent pause command.
HertzHog
Last edited: