Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 23:53 03 Dec 2021 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : CMM2: Strange Timer behaviour

Author Message
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 1943
Posted: 06:19pm 21 Oct 2021
Copy link to clipboard 
Print this post

In my bid to do odd things I did this:
> 480MHz Colour Maximite 2 G2
MMBasic Version 5.07.02b1
Copyright 2011-2021 Geoff Graham
Copyright 2016-2021 Peter Mather

> list "strange_timer.bas"
For i = 0 To 200 Step 10
 Timer = i : Print i, Timer
Next

> run "strange_timer.bas"
0       0.031
10      10.03
20      20.029
30      30.029
40      40.03
50      50.03
60      60.029
70      54.494
80      64.496
90      74.494
100     134.504
110     144.504
120     104.504
130     114.504
140     108.968
150     168.968
160     178.968
170     188.968
180     198.968
190     158.97
200     203.432


If it isn't a bug then I'm sure the explanation will be interesting.

Best wishes,

Tom
Edited 2021-10-22 04:19 by thwill
CMM2 Welcome Tape, Creaky old text adventures
 
twofingers
Guru

Joined: 02/06/2014
Location: Germany
Posts: 957
Posted: 06:39pm 21 Oct 2021
Copy link to clipboard 
Print this post

I suspect it must be a case of chroniton fluctuation.

Regards
Michael
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 1943
Posted: 06:41pm 21 Oct 2021
Copy link to clipboard 
Print this post

  twofingers said  I suspect it must be a case of chroniton fluctuation.

Regards
Michael


In that case we better reverse the polarity of the neutron stream .

Tom
Edited 2021-10-22 04:41 by thwill
CMM2 Welcome Tape, Creaky old text adventures
 
twofingers
Guru

Joined: 02/06/2014
Location: Germany
Posts: 957
Posted: 06:49pm 21 Oct 2021
Copy link to clipboard 
Print this post

  thwill said  In that case we better reverse the polarity of the neutron stream .

Tom

Or you change your place of residence if you live too near to Sellafield ...
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 1943
Posted: 06:51pm 21 Oct 2021
Copy link to clipboard 
Print this post

  twofingers said  Or you change your place of residence if you live too near to Sellafield ...


But then how would I get that healthy glow ?

Tom
CMM2 Welcome Tape, Creaky old text adventures
 
twofingers
Guru

Joined: 02/06/2014
Location: Germany
Posts: 957
Posted: 07:12pm 21 Oct 2021
Copy link to clipboard 
Print this post

  thwill said  But then how would I get that healthy glow ?

Tom

I hope Peter can help you!  

... or the White Wizard? BTW: is he still online? It's been a long time since I've seen him.
Edited 2021-10-22 05:15 by twofingers
 
toml_12953
Senior Member

Joined: 13/02/2015
Location: United States
Posts: 218
Posted: 09:00pm 21 Oct 2021
Copy link to clipboard 
Print this post

  thwill said  In my bid to do odd things I did this:
> 480MHz Colour Maximite 2 G2
MMBasic Version 5.07.02b1
Copyright 2011-2021 Geoff Graham
Copyright 2016-2021 Peter Mather

> list "strange_timer.bas"
For i = 0 To 200 Step 10
 Timer = i : Print i, Timer
Next

> run "strange_timer.bas"
0       0.031
10      10.03
20      20.029
30      30.029
40      40.03
50      50.03
60      60.029
70      54.494
80      64.496
90      74.494
100     134.504
110     144.504
120     104.504
130     114.504
140     108.968
150     168.968
160     178.968
170     188.968
180     198.968
190     158.97
200     203.432


If it isn't a bug then I'm sure the explanation will be interesting.

Best wishes,

Tom


Overclocking doesn't change the time warp:
504MHz Colour Maximite 2 G2
MMBasic Version 5.07.01
Copyright 2011-2021 Geoff Graham
Copyright 2016-2021 Peter Mather

> run

0       0.03
10      10.029
20      20.029
30      30.029
40      40.028
50      50.028
60      60.028
70      54.493
80      64.493
90      74.492
100     134.503
110     144.503
120     104.504
130     114.504
140     108.967
150     168.967
160     178.967
170     188.968
180     198.967
190     158.967
200     203.431
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 5460
Posted: 09:35pm 21 Oct 2021
Copy link to clipboard 
Print this post

Definitely a bug but not in my code

I set a timer register to x with the timer stopped and then read it back and it is not x  

I'll work on it more tomorrow but currently looks very strange
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 5460
Posted: 06:48am 22 Oct 2021
Copy link to clipboard 
Print this post

  Quote  Definitely a bug but not in my code


Except for the bug in my code  

Was
__HAL_TIM_SET_COUNTER(&htim16, (uint16_t)t % 50000);


Should be

__HAL_TIM_SET_COUNTER(&htim16, (uint16_t)(t % 50000));
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 1196
Posted: 07:40am 22 Oct 2021
Copy link to clipboard 
Print this post

It was only a matter of time...

So what's a parenthesis between friends?

:)
-- Mick

Zilog Inside! nascom.info for Nascom & Gemini
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 1943
Posted: 10:40am 22 Oct 2021
Copy link to clipboard 
Print this post

Thanks Peter that has resolved the issue for me.

I've always found that declaring that "it definitely isn't a bug in my code" is always a great way of outfoxing the little buggers and getting them to reveal themselves - I'm sure that's what you were doing too .

Best wishes,

Tom
CMM2 Welcome Tape, Creaky old text adventures
 
Tinine
Guru

Joined: 30/03/2016
Location: United Kingdom
Posts: 726
Posted: 09:04am 23 Oct 2021
Copy link to clipboard 
Print this post

  Mixtel90 said  It was only a matter of time...


[groan]  
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 1196
Posted: 09:24am 23 Oct 2021
Copy link to clipboard 
Print this post

I wondered if it would be you or Tom that groaned first. :)

Sings: "Lets do the Time Warp again..."

Yay! Just unpacked a parcel - my FPGA board and programmer have arrived. :)
Edited 2021-10-23 19:26 by Mixtel90
-- Mick

Zilog Inside! nascom.info for Nascom & Gemini
 
Tinine
Guru

Joined: 30/03/2016
Location: United Kingdom
Posts: 726
Posted: 09:55am 23 Oct 2021
Copy link to clipboard 
Print this post

  Mixtel90 said  I wondered if it would be you or Tom that groaned first. :)

Sings: "Lets do the Time Warp again..."

Yay! Just unpacked a parcel - my FPGA board and programmer have arrived. :)


"It's astounding...time is fleeting...madness takes control" My favourite  

Used to attend the Saturday night, midnight RHPS...great times  

Happy New toys  

Look forward to sharing the adventure  
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 1943
Posted: 10:02am 23 Oct 2021
Copy link to clipboard 
Print this post

  Mixtel90 said  I wondered if it would be you or Tom that groaned first. :)


That would be a bit rich given the subject of the thread.

(It annoys me no end that I let a typo slip through.)

Best wishes,

Tom
CMM2 Welcome Tape, Creaky old text adventures
 
toml_12953
Senior Member

Joined: 13/02/2015
Location: United States
Posts: 218
Posted: 10:22am 23 Oct 2021
Copy link to clipboard 
Print this post

  Mixtel90 said  It was only a matter of time...

So what's a parenthesis between friends?

:)


https://www.youtube.com/watch?v=_J6-3l3hCm0
Edited 2021-10-23 20:23 by toml_12953
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2021