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: FrancePosts: 154 |
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: AustraliaPosts: 2914 |
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: AustraliaPosts: 210 |
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: AustraliaPosts: 2914 |
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: AustraliaPosts: 120 |
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 |
||||
MicroBlocks Guru Joined: 12/05/2012 Location: ThailandPosts: 2209 |
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: AustraliaPosts: 3194 |
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 StatesPosts: 72 |
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 |
||||
Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3194 |
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 StatesPosts: 72 |
...confused....these replies seem at odds with each other? |
||||
Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3194 |
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. Geoff Geoff Graham - http://geoffg.net |
||||
TinkersALot Regular Member Joined: 20/11/2012 Location: United StatesPosts: 72 |
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. |
||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 6098 |
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: AustraliaPosts: 2914 |
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 StatesPosts: 72 |
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: AustraliaPosts: 6098 |
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 StatesPosts: 72 |
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 StatesPosts: 72 |
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? |
||||
BobD Guru Joined: 07/12/2011 Location: AustraliaPosts: 935 |
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 StatesPosts: 1425 |
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 |