Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 14:30 17 Jul 2025 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 : Program Erased

     Page 2 of 3    
Author Message
CircuitGizmos

Guru

Joined: 08/09/2011
Location: United States
Posts: 1427
Posted: 09:14am 01 May 2015
Copy link to clipboard 
Print this post

  Geoffg said  
My current plan is to just disable the feature.


Yay! Edited by CircuitGizmos 2015-05-02
Micromites and Maximites! - Beginning Maximite
 
G8JCF

Guru

Joined: 15/05/2014
Location: United Kingdom
Posts: 676
Posted: 10:01am 01 May 2015
Copy link to clipboard 
Print this post

PS, the default should be

Option NoReset False ie behaviour as current, then for Production,

set Option NoReset True ie shorting RX and TX will do nothing

The reason for my plea to keep the functionality but put in the Option NoReset True|False functionality, is that I have on occasion changed the baudrate but made a mistake and mistyped the baudrate leaving me with a "stuffed up" chip, and especially when I was first starting out, I didn't have a PICKit3, didn't know about PICProg32.exe for my PICKit2, so I would have been completely stuffed and may very well have been put off.

One of the really big attractions of the 'mite is the very low entry point, ie a USB<->TTL serial adapter, a preprogrammed chip, a couple of AAs, and you're away. I think all of us here on TBS tend more towards the really interested and have PICKit3's and lots of other stuff, but I'm not sure that applies to the "average" 'mite user.

Peter
The only Konstant is Change
 
twofingers

Guru

Joined: 02/06/2014
Location: Germany
Posts: 1579
Posted: 10:20am 01 May 2015
Copy link to clipboard 
Print this post

  G8JCF said   ...

One of the really big attractions of the 'mite is the very low entry point, ie a USB<->TTL serial adapter, a preprogrammed chip, a couple of AAs, and you're away. I think all of us here on TBS tend more towards the really interested and have PICKit3's and lots of other stuff, but I'm not sure that applies to the "average" 'mite user.

Peter

That's exactly what I think! And of course I have a Pickit3 and I flashed using Peters and Johns (thank you both!) method! We should remember why Mites are so popular. Don't throw out the baby with the bath water!

Michael
causality ≠ correlation ≠ coincidence
 
CircuitGizmos

Guru

Joined: 08/09/2011
Location: United States
Posts: 1427
Posted: 10:26am 01 May 2015
Copy link to clipboard 
Print this post

I was going to suggest that the "feature" only reset the serial port settings.

But to me the trouble is that the feature is unreliable. No matter what it will kick up some dust when you don't want it to. To a newbie even if there is a good excuse for the chip erasing their program, the result is that the chip will be perceived as flakey when it happens and they have to diagnose why.

"I can't prove it, but it probably erased itself or something" isn't the type of thing that makes the chip sound reliable.


The trouble with remembering to set something for "production" is the average user is a hobbiest and doesn't think in terms of "production." They are just making a something and when they are done, they use it. Perhaps later they will come back to the device and tweak something.
Edited by CircuitGizmos 2015-05-02
Micromites and Maximites! - Beginning Maximite
 
G8JCF

Guru

Joined: 15/05/2014
Location: United Kingdom
Posts: 676
Posted: 11:21am 01 May 2015
Copy link to clipboard 
Print this post

Hi @CircuitGizmos

Good points indeed, much to ponder.

Today I was trying to get a DLink DAP-1320 wifi extender working and I stuffed up the configuration, but, thank goodness there was that tiny little hole for factory reset !! and I was able with a paper-clip to recover from the mess I'd gotten myself into. (BTW, this little wifi extender really does work, and only costs GBP 12.00 here in UK).

Anyway, the moral of the story, is that we all make mistakes, and being able to do "Factory Reset" is a really good safety blanket.

  Quote  The trouble with remembering to set something for "production" is the average user is a hobbiest and doesn't think in terms of "production."


Ah, this is a deep philosophical question - I am being serious, honestly - should we protect the ignorant (used in the proper meaning of the word, ie nothing pejorative) from their ignorance (again used in the proper meaning of the word ie nothing pejorative) ?

When the novice user does a typo changing the baudrate and can't communicate to their chip what should they do, what should we advise, have we become a salesperson for Microchip, ie buy a PicKit3 ?

Perhaps the real fix is that MMBasic should NOT accept a baudrate other than one of the properly defined rates, eg 282000, 230400, 115200, 57600, 38400, 19200,9600,4800,2400,1200 etc. so that way a typo can't stuff up the uMite.

If someone puts something into "production" but doesn't know/remember to issue an OPTION NORESET TRUE command, why are they surprised when stuff goes wrong ? I would have thought that if they can't get this one statement right, then probably the rest of what they've done is the real problem - and NO I'm not being snooty/snobby about this, just disciplined - RTFM ?

This is clearly more about user expectation/behaviour than technical functionality.

Thinking about things more, if it was IMPOSSIBLE to set an invalid baud rate, ie so that in all events the user could connect to the console, then I would tend to agree with removing the shorting TX/RX functionality if implementing the OPTION NORESET TRUE|FALSE really was too difficult to do.

Once again @CircuitGizmos, good points, much to think about

Peter
The only Konstant is Change
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3285
Posted: 02:38pm 01 May 2015
Copy link to clipboard 
Print this post

Good discussion.

My summary would be:
- I have tried to make the reset feature as bullet proof as possible but it still causes some unexpected program wipes - which is completely unacceptable.

- The reset feature is mostly needed by novices so an option which disables it by default would be counter productive as the novice would never think of changing the option in the first place.

- An incorrect baudrate is the common cause of a bricked Micromite so insisting on standard baud values would help but not fix the issue. Setting a PIN or OPTION BREAK could also brick a Micromite but that is less common.

- Rob has a great suggestion for an alternative reset mechanism but I believe that it is too complex for the novice, who is the person that needs this feature.

My simple solution is to suggest that someone with a bricked Micromite buy a PICKit3 clone, they are as cheap as US$20 and it is a valuable tool for other tasks. This will inconvenience some users but it is nowhere near as bad as having your program unexpectedly erased. Insisting on a limited range of baudrates would help.

I would be interesting on hearing from people who needed and used the reset feature - what was the cause? Also the opinion of people who suffered from an unexpected program erasure.

Geoff
Geoff Graham - http://geoffg.net
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9594
Posted: 03:09pm 01 May 2015
Copy link to clipboard 
Print this post

I will also throw my 2c into the bucket here, and suggest that perhaps those members who would like to help the newbies, could offer a re-programming service so that IF the newbie does not want to buy a PK3 clone or deal with IPE or re-flashing the firmware, we could help them. I should qualify that remark by saying this service would need to be free - they pay return postage, but you re-flash the chip for nothing.

I have done this a couple of times for members from NZ with no PK3, and I am happy to do it, to keep them interested in the MM.

While this approach is inefficient, it would be an avenue of help if there was no reset ability on the chip. They would still need to contact one of the helpers here, and send them the chip, and wait for it to return, so perhaps that is even worse in the long run!

I don't know.

@ Geoff - Rob's suggestion - with the greatest respect, why is a single transistor too complicated? Not disagreeing with you, just curious as to why you see this as too complicated for a novice. Is it just that they have to fit it at all to reset the MM, that it becomes too complicated for the newbie?

Edited by Grogster 2015-05-03
Smoke makes things work. When the smoke gets out, it stops!
 
Zonker

Guru

Joined: 18/08/2012
Location: United States
Posts: 767
Posted: 03:31pm 01 May 2015
Copy link to clipboard 
Print this post

Well... One more chiming in...

I am very glad the baud rates in the MM code work the way they are... here's why...

I have the 4D display that has a selection of rates that are not "standard" either... BUT, because you can set any number in the MM, I was able to select the 256000 speed for the serial baud rate instead of the "standard" rate of 38400...

This allows the MM code to take in coming data and commands from the soft port at 19200 baud, allow the program enough time to get things done, then quickly spit out the correct actions and get back and handle touch events from objects, at what appears to the user as almost instant response... The code has no pause statements and a house keeping loop running as fast as it can go... AWESOME..!

Mind you, there are now about 40 different UI objects to look after... Some are INT driven, most are command-data driven.. But the grass is starting to get thick..

The good news is that so far it's all working on the 28 pinner 170 core..(nice)

So, my 2c about that... flexible rates allow you to connect to more stuff
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9594
Posted: 03:57pm 01 May 2015
Copy link to clipboard 
Print this post

Is this one of those "You cannot please 100% of people, 100% of the time." situations?
Smoke makes things work. When the smoke gets out, it stops!
 
BobD

Guru

Joined: 07/12/2011
Location: Australia
Posts: 935
Posted: 04:04pm 01 May 2015
Copy link to clipboard 
Print this post

  Grogster said   Is this one of those "You cannot please 100% of people, 100% of the time." situations?

Probably, but like Zonker, I see no need to restrict the baud rates to a limited "standard" selection unless there was an "other" selection where you could set the speeds as you like. Restricting speeds is placing limits on the usability of the micro.
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9594
Posted: 05:35pm 01 May 2015
Copy link to clipboard 
Print this post

For what it's worth, I like the ability to set non-standard baud-rates. Helps to protect your product's secrets. Anyone with a little knowledge can experiment to find the baud-rate, but being able to specify the likes of OPEN "COM1:4526" as #1 has it's place, as then things that are locked to the standard baud-rates, can't see your transmissions. They may know you are transmitting, but they won't be able to make the standard power-of-two baud-rate settings work! This tends to be because most terminals etc(with the exception of Geoff's VT100) will only let you choose from the standard baud-rates, so you cannot select 4526 as the baud rate.On the other hand, non-standard is non-standard, so there is that argument too!
Smoke makes things work. When the smoke gets out, it stops!
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2437
Posted: 06:37pm 01 May 2015
Copy link to clipboard 
Print this post

how about this...

upon startup the micromite listens to the console RxD line, for just 100mS, for the character "!" to come in at a fixed 38400 baud. if it does not see one or more character "!" then it carries on starting up as normal.

if it does see the character "!", ensure that the character carries on being repeated for at least 1 second, then when input stops, wait for up to 2 seconds further to see the rest of the sequence "resetme" entered. upon seeing this sequence, prompt with the text "perform factory reset and clear program memory?". require the user to respond with "YES" (upper case, do not tell the user what they need to enter to avoid any echo being mistaken as a response).

so to do an 'emergency recovery' the user just needs to follow the following procedure:

1. set Teraterm to 38400 baud, 8 bit, no parity
2. press and hold down shift-! on the keyboard
3. press the reset button on the micromite
4. after 1 second or more, release shift-! and immediately type in r-e-s-e-t-m-e
5. when prompted, type in Y-E-S

no extra 'key' hardware required, about zero chance of the sequence being created unintentionally, easy to achieve for even the beginner.

comments?

cheers,
rob :-)Edited by robert.rozee 2015-05-03
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9594
Posted: 07:59pm 01 May 2015
Copy link to clipboard 
Print this post

Sounds like a good idea to me!
Smoke makes things work. When the smoke gets out, it stops!
 
srnet
Senior Member

Joined: 08/08/2014
Location: United Kingdom
Posts: 164
Posted: 08:10pm 01 May 2015
Copy link to clipboard 
Print this post

I can see that there is benefit in having an emergency erase procedure, especially during program development.

The shorting TX\RX seems as good a way as any of achieving this, why make it more complex ?

However once your happy your program is working and reliable, it should always be possible to permanently disable the emergency erase procedure.

Maybe at some point someone will come up with a real clever way of preventing accidental erasure, but it must still be possible to disable this process, if you choose to.

The program could be protected and the PIN can then be lost, but thats going to be an exceptional set of circumstances. Its not unreasonable in such exceptional circumstances to expect to have to reprogram the PIC.
$50SAT is Silent but probably still working.
For information on LoRa visit http://www.loratracker.uk/

 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2934
Posted: 11:26pm 01 May 2015
Copy link to clipboard 
Print this post

Great discussion . . . .

In the meantime (and as previously mentioned) I am more than happy to offer a FREE service to help anyone who wants to 'unbrick' their MicroMite. In fact this offer also extends to anyone wanting a free firmware upgrade for their MicroMite.

I am based in the UK so this will hopefully cover all MicroMiteRs based anywhere in Europe.

So if you don't have a PicKit3 (or any other method for uploading the MicroMite firmware) then fear no more. All I ask is that you pay for return shipping via the PayPal service.

To UK folk the shipping will cost £1.45; and to Europe the cost is £4.05. One 'proviso' I guess that should be added is not to send me more than five chips at a time!

Happy to help anyone else but shipping costs may be 'un-economical'

WW

edit: This offer applies to both 44pin TQFPs as well as 28pin DIL/DIP MicroMites Edited by WhiteWizzard 2015-05-03
 
BobD

Guru

Joined: 07/12/2011
Location: Australia
Posts: 935
Posted: 12:19am 02 May 2015
Copy link to clipboard 
Print this post

One thing those with Pickit3's could do is indicate if they were willing to assist those who don't. This could be done in the TBS profile. Put your locality in there and in the Interests section make an appropriate comment. See my profile for an example.
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2934
Posted: 12:38am 02 May 2015
Copy link to clipboard 
Print this post

@BobD

Good idea - my profile updated to 'similar' comment
 
PicFan
Senior Member

Joined: 18/03/2014
Location: Austria
Posts: 133
Posted: 01:05am 02 May 2015
Copy link to clipboard 
Print this post

Hello everyone!

There are many suggestions that are very good, but as a beginner I need a PICKIT-3 to new software versions to load. I still believe that a PICKIT is the best, fastest, safest and most convenient solution, because it will continue to update, s give for Micromite series.

A letter from Austria to the UK costs € 6.65, the return postage € 5.50 =
€ 12.15 = $ 13.70, a PICkit 3 from China $ 17.99, that's a difference of $ 4.29?

As I write this I have a battery alert from my temperature measurement system, I replace the batteries and the program is lost. The RX / TX pins of the Console are not connected!

Wolfgang

PS: I write also on behalf of my 2 friends Erwin and Günther what have the same problem.
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2437
Posted: 01:05am 02 May 2015
Copy link to clipboard 
Print this post

there is another option for reprogramming:
http://wiki.kewl.org/dokuwiki/projects:nanu-nanu

this method uses an arduino nano (available on ebay for less than $5 including delivery) to program the pic32, and pic32prog as the programming software - no need for mplab.

all that is required to make it availabe to everyone is someone from TBS forums to compile the arduino code into three binary images (for the different flavours of nano: 3v3, 5v, 8MHz, 16MHz) and bundle these up with a copy of Pic32Prog.exe and AVRdude.exe plus some simple instructions.


cheers,
rob :-)Edited by robert.rozee 2015-05-03
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2934
Posted: 01:10am 02 May 2015
Copy link to clipboard 
Print this post

  PicFan said  The RX / TX pins of the Console are not connected!

Are either of these pins connected to anything other than 'not a console'?

Also what is your circuit connected to Pin 1? i.e. hardwired to vdd, or resistor (and cap)?

May help work out what could be the cause. . .
 
     Page 2 of 3    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025