Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 02:48 27 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 : how to "reset" a Maximite ?

     Page 1 of 2    
Author Message
f1fco

Senior Member

Joined: 18/03/2012
Location: France
Posts: 154
Posted: 07:23am 24 Nov 2012
Copy link to clipboard 
Print this post

hello from France

do you know how to reset a Maximite board (basic v4) by software ?
a special POKE ?

thank you for answer

Pierre, south of France

hamradio : F1FCO
73s de F1FCO
 
bigmik

Guru

Joined: 20/06/2011
Location: Australia
Posts: 2914
Posted: 12:48pm 24 Nov 2012
Copy link to clipboard 
Print this post

  f1fco said   hello from France

do you know how to reset a Maximite board (basic v4) by software ?
a special POKE ?



Hi Pierre,

As I just posted in another thread for someone who asked a similar question. ....

You could always try connecting an unsed ouptut pin (pulled high via a 10k or 4k7 OHM resistor) to the RESET.. when you want to reset the MM direct the pin to go LOW and bingo it kicks itself up the ..... errr ... well it resets itself.

The MM should reconfigure the pin as an INPUT and the pull up would keep it high until the MM has control again.

Regards,

Mick

PS.. Maybe there is some merit in this being added as a command..

Mik
Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<<
 
Talbit
Senior Member

Joined: 07/06/2011
Location: Australia
Posts: 210
Posted: 11:29pm 24 Nov 2012
Copy link to clipboard 
Print this post

Not sure if a kick up the Kyber by a MM pin would work because I'm presuming the MM has frozen. A watchdog timer could be made with a hardware timer like a LM555 that is continually reset by a MM pin programmed to periodically reset the timer. If the timer times out because the MM has frozen then it could somehow toggle the MM power to get it to reboot.
Talbit
Talbit
 
bigmik

Guru

Joined: 20/06/2011
Location: Australia
Posts: 2914
Posted: 12:57am 25 Nov 2012
Copy link to clipboard 
Print this post

  Talbit said   Not sure if a kick up the Kyber by a MM pin would work because I'm presuming the MM has frozen. A watchdog timer could be made with a hardware timer like a LM555 that is continually reset by a MM pin programmed to periodically reset the timer. If the timer times out because the MM has frozen then it could somehow toggle the MM power to get it to reboot.
Talbit


But Pierre wanted a way to do it in software... One makes the assumption that the MM hasnt crashed. Yes a watchdog timer is a good recovery system in the event it crashed but I think he wanted to controll the resetting..

Regards Mick
Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<<
 
VK2MCT
Senior Member

Joined: 30/03/2012
Location: Australia
Posts: 120
Posted: 04:21am 25 Nov 2012
Copy link to clipboard 
Print this post

A watchdog arrangement maybe a bit tricky because of an infinite loop of resetting before program runs. ie - program run needs to happen to stop watchdog timing out.

John B Edited by VK2MCT 2012-11-26
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 05:16am 25 Nov 2012
Copy link to clipboard 
Print this post

A PIC32 has a builtin watchdog.
I am not sure if it is used by MMBasic.
http://ww1.microchip.com/downloads/en/DeviceDoc/61114E.pdf

Microblocks. Build with logic.
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3194
Posted: 09:10pm 25 Nov 2012
Copy link to clipboard 
Print this post

No, MMBasic does not use the watchdog timer. There is little advantage in using it in a general purpose computer and a lot of issues.

Geoff
Geoff Graham - http://geoffg.net
 
TinkersALot
Regular Member

Joined: 20/11/2012
Location: United States
Posts: 72
Posted: 12:40pm 26 Nov 2012
Copy link to clipboard 
Print this post

there are dozens of watchdog circuits out on the web. Here are a couple:

http://techdoc.kvindesland.no/radio/ymse3/20081009164537926. pdf

http://cache.freescale.com/files/microcontrollers/doc/app_no te/AN1263.pdf (see page 9)

http://discovercircuits.com/DJ-Circuits/watchdog.htm

http://www.industrologic.com/nv_watchdogtimer.pdf

http://powerelectronics.com/704PET07.pdf
Edited by TinkersALot 2012-11-27
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3194
Posted: 01:56pm 26 Nov 2012
Copy link to clipboard 
Print this post

The PIC32 has a watchdog timer built in (as do most micros) - it does not need an external circuit.
Geoff Graham - http://geoffg.net
 
TinkersALot
Regular Member

Joined: 20/11/2012
Location: United States
Posts: 72
Posted: 04:53pm 26 Nov 2012
Copy link to clipboard 
Print this post

  Geoffg said  
No, MMBasic does not use the watchdog timer. There is little advantage in using it in a general purpose computer and a lot of issues.

The PIC32 has a watchdog timer built in (as do most micros) - it does not need an external circuit.



...confused....these replies seem at odds with each other?Edited by TinkersALot 2012-11-28
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3194
Posted: 05:57pm 26 Nov 2012
Copy link to clipboard 
Print this post

Hi Michael,

The PIC32 has a watchdog timer but MMBasic does not enable it or use it. I only mentioned this because you gave some circuits for an external watchdog circuit.

I did not enable the watchdog in MMBasic because the interpreter is stable enough that it does not need it and the watchdog timer would (if it went off) completely reset the PIC32 chip erasing the program and data in RAM (not a good thing).

But, I could imagine a circumstance where a BASIC program written by a user got itself stuck in a loop and, to prevent that being a problem, you could use the SETTICK command as a watchdog timer for MMBasic programs.

For example insert the following into critical parts of your code: SETTICK 1000, ErrorRecoveryLabel

If you called that function regularly (ie, faster than once a second) the timer would never go off but, if something did go wrong and the timer timed out, the code at ErrorRecoveryLabel would be executed.

GeoffEdited by Geoffg 2012-11-28
Geoff Graham - http://geoffg.net
 
TinkersALot
Regular Member

Joined: 20/11/2012
Location: United States
Posts: 72
Posted: 06:42pm 26 Nov 2012
Copy link to clipboard 
Print this post

Cool. Thanks for teaching me that. That function could perform the do the output pin toggle to tied to the reset pin as was described earlier in this thread...so kind of a through a timeout based software reset.Edited by TinkersALot 2012-11-28
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6098
Posted: 09:33pm 26 Nov 2012
Copy link to clipboard 
Print this post

I do have a need for a watchdog timer.

I have a Maximite based data acquisition system.
There are times when I can be a few thousand kM away for months at a time.
I did a have a strange problem with my first Maxi that meant it needed a power down at random times. This happened every few weeks so it was hard to track down.
I had an old IP based IO board so it was setup to power the Maxi through a relay.
If the laptop software didn't receive data for 20 seconds, it knew there was a problem and the power to the Maximite was cycled.

I could also log into my system remotely and turn the power of whenever desired.
(Being a Windows computer tech, turning the power of then on again is a common task)

This worked well for a month or so until a mouse with a weak bladder buggered up the IO board.

The replacement Maximite has run for 3 months or so now so the reset hasn't been used lately.

Rather than having the laptop controlling the reset, I have considered a picaxe which is triggered every second or so to keep things running.
Using a picaxe, you can include software that waits for the first pulses before being active. That way you can have time to restart the Maximite application without continual resets.

Jim

VK7JH
MMedit   MMBasic Help
 
bigmik

Guru

Joined: 20/06/2011
Location: Australia
Posts: 2914
Posted: 10:17am 27 Nov 2012
Copy link to clipboard 
Print this post

  Geoffg said  
I did not enable the watchdog in MMBasic because the interpreter is stable enough that it does not need it and the watchdog timer would (if it went off) completely reset the PIC32 chip erasing the program and data in RAM (not a good thing).


Ahh... Yes, True so if my suggestion of a pin is tied to RESET then the program should be stored as AUTORUN.BAS so at least the code will continue away.. The prog will need to be able to handle the recovery from this state.

Regards,

Mick
Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<<
 
TinkersALot
Regular Member

Joined: 20/11/2012
Location: United States
Posts: 72
Posted: 11:16am 27 Nov 2012
Copy link to clipboard 
Print this post

  TassyJim said   I do have a need for a watchdog timer.

...That way you can have time to restart the Maximite application without continual resets.

Jim


for that reason alone, I think I like this external hardware circuit the best out of those that I posted because it offers a very long delay for timeout:

http://discovercircuits.com/DJ-Circuits/watchdog.htm

 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6098
Posted: 01:24pm 27 Nov 2012
Copy link to clipboard 
Print this post

One big disadvantage of any watchdog system is that you loose any chance of finding out what went wrong. This makes fixing the problem a lot harder.

If your program crashes, there is likely to be clues left on the screen.
Doing a reset before reading the clues is not a good idea.

Jim
VK7JH
MMedit   MMBasic Help
 
TinkersALot
Regular Member

Joined: 20/11/2012
Location: United States
Posts: 72
Posted: 02:04pm 27 Nov 2012
Copy link to clipboard 
Print this post

wonders:

if instead of relying on screen content to ascertain the cause of an error/halt; would not a simple checkpoint log (persisted to file) be a solution allow improved forensic analysis of possible fault conditions?

Ideally, this log could contain enough information to reproduce the error; Presuming it is a logic fault, and not a single event upset (SEU) which are transient bit-flips or a single event latchups (SEL) due to the passage of is a single, highly-energetic charged particle through a semiconductor.
 
TinkersALot
Regular Member

Joined: 20/11/2012
Location: United States
Posts: 72
Posted: 02:17pm 28 Nov 2012
Copy link to clipboard 
Print this post

in reviewing the code for MMBasic,

it appears that the device may be reset by MMBasic interpreter if there is arithmetric overflow....

so if I really wanted a way to have a software-reset for the maximite, can I use "bad code" that causes an arithmetric overflow condition to reset the device? Edited by TinkersALot 2012-11-30
 
BobD

Guru

Joined: 07/12/2011
Location: Australia
Posts: 935
Posted: 02:21pm 28 Nov 2012
Copy link to clipboard 
Print this post

  TinkersALot said   in reviewing the code for MMBasic,

it appears that the device may be reset by MMBasic interpreter if there is arithmetric overflow....

so if I really wanted a way to have a software-reset for the maximite, can I use "bad code" that causes an arithmetric overflow condition to reset the device?

Not sure if it will work here ( my machine temporarily out of action) but divide by zero is usually good to cause havoc.
 
CircuitGizmos

Guru

Joined: 08/09/2011
Location: United States
Posts: 1425
Posted: 02:26pm 28 Nov 2012
Copy link to clipboard 
Print this post

POKE 0,0,0 once used to reset the device in version 2.6.
Micromites and Maximites! - Beginning Maximite
 
     Page 1 of 2    
Print this page
© JAQ Software 2024