![]() |
Forum Index : Microcontroller and PC projects : Program Erased
![]() ![]() |
|||||
Author | Message | ||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3285 |
I like Rob's idea of a sequence of ! characters at startup as no extra hardware is required and it seems bullet proof. It is worth exploring so I will setup a test environment and give it a go. Geoff Graham - http://geoffg.net |
||||
G8JCF![]() Guru ![]() Joined: 15/05/2014 Location: United KingdomPosts: 676 |
@RR's idea of ! etc is excellent, a factory reset using @RR's scheme would be most unlikely by accident, and @RR's scheme cracks the problem of the accidental incorrect baud rate setting typo; get's my vote. Peter The only Konstant is Change |
||||
CircuitGizmos![]() Guru ![]() Joined: 08/09/2011 Location: United StatesPosts: 1427 |
The 28 pin and 44 pin micromite have adjacent console connections. Has anyone had an unintended erase on the micromite470 where the console pins are NOT right next to each other? I had an erase issue with a 28 pin device. I chalked it up to leakage between these two pins because of moist flux on the board. I cleaned the board and used a couple of pull-down resistors (10k I think) and have not had the issue since. Micromites and Maximites! - Beginning Maximite |
||||
twofingers![]() Guru ![]() Joined: 02/06/2014 Location: GermanyPosts: 1579 |
Maybe it would be good enough if there will be - after a power on or reset and shorting TX/RX together - an attempt of a transmission of one byte (a bit pattern like eg "10110111") or more between Tx/Rx, instead of simply testing for a short*? Edit: Imho should this be combined with Peter's proposal (but as default: Option NoReset False). A safe, simple to handle and cheap (no PICkit needed) solution. Hope not to increase the confusion! * guess this is what happen now. I don't know the µM-source code. causality ≠correlation ≠coincidence |
||||
rentner111 Newbie ![]() Joined: 18/03/2014 Location: AustriaPosts: 19 |
Hello! The Micromite is the best thing that has ever existed for Basic programmers. But deleting the program when changing the battery is a big problem. For devices to be used on the go, unfortunately, almost unusable. One must always come back to the lab, to program the new MM. Would it be possible to remove the MMBasic reset facility completly ? |
||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2934 |
Geoff is looking into this with a great solution mentioned here on this thread. I have tried to recreate the issue but just can't. If it is not too sensitive, can you post a circuit diagram of exactly what you have (and also describe the type of battery used. This is more from a 'curiosity' point of view . . . WW |
||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3285 |
I have just tested Rob's solution for an emergency reset of MMBasic and it works fine. The new firmware pauses for 100mS during the startup sequence and checks the console for an exclamation mark (!) received at 38400 baud. If that is received it then goes on and waits for a further two seconds, if at least 25 consecutive exclamation marks are received in that time it will reset MMBasic and erase the program. For the user this is very simple, all they have to do is configure Tera Term or whatever to 38400 baud and hold down the exclamation key while they power up the Micromite. I did not go on to implement the question/response sequence that Rob suggested because it is hard to see how 26 consecutive exclamation marks could be a glitch, it must be deliberate. About the only downside that I can see is that there is an extra 100mS delay in the power up time. If anyone can think of a defect in this test, please speak up now. Otherwise I plan to implement it in the next version. Geoff Geoff Graham - http://geoffg.net |
||||
robert.rozee Guru ![]() Joined: 31/12/2012 Location: New ZealandPosts: 2437 |
i am rather chuffed that i was able to come up with a good idea ![]() but i would still like to see something beyond just the "!" being required, even if only a single letter, to prevent a stuck key from causing a disaster. how about "R" for 'reset' following the string of exclamations? cheers, rob :-) (no no, honestly, "R" does not stand for 'Rob'!) |
||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2934 |
Isn't the '!'input appropriate from the point of view it would actually require 2 'stuck keys i.e. 'SHIFT' and '1'? From a user point of view it is easy to hold down these keys rather than have to 'change' keypresses within a set time period. Seems bullet proof to me IMHO. @Geoff When do you think the next version will be released? And will it be a 'public' release on your website, or, a TBS release? WW |
||||
robert.rozee Guru ![]() Joined: 31/12/2012 Location: New ZealandPosts: 2437 |
good point - i didn't think of that! cheers, rob :-) |
||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3285 |
There is a lot of work in a new public release and at this time I am working hard on another project so it could be a month or two away. However, I might get a TBS beta release out sooner. Another good thing about the '!' character is that it has an odd pattern of bits so a repetitive signal could not be mistaken for a reset signal. But then, you knew that when you suggested it, didn't you Rob ![]() Geoff Geoff Graham - http://geoffg.net |
||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2934 |
This is definitely a smart move as it allows us give you some feedback (assuming it is 'reasonably' easy to create the 'Beta' in the first place) |
||||
PicFan Senior Member ![]() Joined: 18/03/2014 Location: AustriaPosts: 133 |
Hello @ WhiteWizzard! Below the diagram of the module, as the power supply are used 4 x 1.2V NiMH batteries. As R1 I tested from 0 to 10k, 10k and also a capacitor with 0.1uF - 1uF to 0V did not improve. The best results are with 10k without C to 0V. Konsole RX/TX are open or connected to COM1 from a 2. Micromite. Everything worked correct for months with the PIC32MX150, but since conversion to "170" occur these problem. Thanks to all! Wolfgang ![]() |
||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2934 |
@picfan Can you please email the Circuit Diagram as not too clear on here - Thanks! ![]() |
||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2934 |
@PicFan Thanks for emailing the circuit. Two things: 1> Have you powered the circuit from a mains power supply? If so, does it still behave the same (i.e. erase the program whenever you connect/remove power? 2> Try swapping the 10uF cap between pins 27 & 28 with a 100nF (0.1uF) ceramic. Nothing else seems to potentially cause the issue you are witnessing so the only other thing I would try is to remove D2. I fully understand why you have it in place but just see if when removed it 'resolves' things. I assume you have nothing connected to the console pins when the 'erase' occurs. If the MM is in a socket then can I also recommend 'isolating' pins 11&12 by removing the PIC, then bending those two pins outwards, and then reinserting the PIC back into the socket so that those two pins are not actually in the socket (hope that makes sense!). The purpose is to isolate any PCB track issues (assuming a PCB is in use!). One last thought - if the circuit is ultra lower power, then try adding an LED across 3v3 just to pull some current (about 20mA). With this in place - does it change things. Obviously you don't want to leave this in place for a battery powered circuit - just use it to try isolate the issue) WW |
||||
PicFan Senior Member ![]() Joined: 18/03/2014 Location: AustriaPosts: 133 |
I will try it on the weekend and wait for the solution of geoff. ![]() The same modul with the same PCB works with the MM-150 without problems, for a long time. Thank you ! |
||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2934 |
@GeoffG Not sure if this helps you but I have noticed the following when using a battery to power the MM (and suffer the issue of an 'erased' program): Even though the EDITOR show no listing, the first few lines of the program are actually still present somewhere in memory and the program lines that remain do still RUN. I had a program that gave visual and audible feedback to a user and then done lots of other things afterwards. When I disconnected & reconnected the battery powering the MM, I suffered the apparent loss of program (i.e. the editor was showing no program listing). However, when I typed RUN, the visual and audible feedback from the first few lines of my program was still seen/heard (i.e. as if the start of the program was working properly). However, the remaining code was corrupt somewhere as not everything contained in the original program ran as expected. So I conclude that the program is only partially erased for whatever reason but is NOT erased (totally) as the editor implies. This may be of no value - but just in case . . . . |
||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3285 |
Thanks, There was something like this reported a while ago and my interpretation of it was that the supply voltage rapidly came on and off due to contact bounce during the disconnection. On one of the times that the power came on the uM decided that a reset was needed and started the reset. However the power failed again before it was able to finish leaving a partially erased memory. This is one of the benefits of Rob's approach, the power must be stable for a second or two. Geoff Geoff Graham - http://geoffg.net |
||||
![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |