Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 10:34 23 Nov 2024 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 : Settick wont tick

Author Message
ajkw
Senior Member

Joined: 29/06/2011
Location: Australia
Posts: 290
Posted: 08:38am 29 Jul 2011
Copy link to clipboard 
Print this post

Hi,

I have noticed that on occasion the command Settick wont tick.

I went on to narrow things down and would be interested if it is just mine or if it is a bug as I think it is.

If you end a program with ctrl-c whilst the program happens to be at some point in the settick routine and then when you run the program again Settick won't tick, and won't work until you power down then up. This also seems to occur if there is a error in the program. I have reload firmware versions back to 2.4a before the problem ceased.

Some sample code is

10 rem a program to do something.
15 SETTICK 1,2000
20 REM doing stuff
25 a$=INKEY$
26 PRINT a$;
27 IF a$="q" THEN END
30 GOTO 20
2000 PRINT "x";
2010 IRETURN

(This give something like a reverse matrix effect!)

So, if you end this program by pressing q and then run it again it works fine but if you end it with control-c then run it again the routine at 2000 is not run, ie No tick.

If you change line 15 to
15 settick 1000,2000
which gives plenty of time to press control-c whilst not in the settick routine then you can end with control-c and then run again ok.

Mine or a bug??

Cheers,
Anthony.
 
BobDevries

Senior Member

Joined: 08/06/2011
Location: Australia
Posts: 266
Posted: 09:22am 29 Jul 2011
Copy link to clipboard 
Print this post

Hello Anthony,

I have just tried your example using your instructions regarding termination with CTRL-C, and can confirm that mine behaves the same as yours.

Regards,

Bob Devries
Dalby, QLD, Australia
 
seco61
Senior Member

Joined: 15/06/2011
Location: Australia
Posts: 205
Posted: 12:30pm 29 Jul 2011
Copy link to clipboard 
Print this post

Hi All.

I have had a quick look at the code and understand why this is happening. The bug will also affect ANY interrupt routine - ie they will never be invoked. This currently means that the pin change interrupt and the I2C interrupt routines as well as the settick will not be invoked if CNTL-C is invoked while the interpreter is executing an interrupt routine.

The fix is simple, and a version of the 2.5 firmware with the fix is here: Maximite.hex

However, I will send the source to Geoff to verify that that is the way he wishes to fix it. Of course, as he is now enjoying a trip along the Gibb River road (and I wish I was with him!) it may take a little while for the official fix.

Regards

Gerard (vk3cg/vk3grs)Edited by seco61 2011-07-30

Regards

Gerard (vk3cg/vk3grs)
 
donmck

Guru

Joined: 09/06/2011
Location: Australia
Posts: 1313
Posted: 12:38pm 29 Jul 2011
Copy link to clipboard 
Print this post

  seco61 said   Hi All.

However, I will send the source to Geoff to verify that that is the way he wishes to fix it. Of course, as he is now enjoying a trip along the Gibb River road (and I wish I was with him!) it may take a little while for the official fix.

Regards

Gerard (vk3cg/vk3grs)


Great work Gerard, I know the work you are doing will assist Geoff greatly when he does get back on the air.

I wish I was with him too, but we wouldn't be seeing too many sunsets, and the wife's club would hate us I'm sure.

Cheers Don...




https://www.dontronics.com
 
seco61
Senior Member

Joined: 15/06/2011
Location: Australia
Posts: 205
Posted: 09:48pm 29 Jul 2011
Copy link to clipboard 
Print this post

  donmck said  Great work Gerard, I know the work you are doing will assist Geoff greatly when he does get back on the air.

I wish I was with him too, but we wouldn't be seeing too many sunsets, and the wife's club would hate us I'm sure.

Cheers Don...


Hi Don.

My wife would only be upset if she was not travelling with us! We last travelled that part of Australia about 9 years ago and it is stunningly beautiful - we are looking forward to revisiting when the kids have finished secondary school (another 2 years....).

Regards

Gerard (vk3cg/vk3grs)Edited by seco61 2011-07-31

Regards

Gerard (vk3cg/vk3grs)
 
Print this page


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

© JAQ Software 2024