stuff to reset a rogue Arduino
Neil Wyatt | 21/04/2016 15:01:27 |
![]() 19226 forum posts 749 photos 86 articles | Posted by Michael Gilligan on 21/04/2016 13:30:26:
Neil, I think Murray has made the point more expertly than I could. My 'Cut-Out' would be in addition to all the clever 'Get-Out' devices. ... Remember HAL in 2001 MichaelG. "Turn off the blower, Hal." "I'm afraid I can't do that right now, Dave." |
Neil Wyatt | 21/04/2016 15:04:24 |
![]() 19226 forum posts 749 photos 86 articles | Posted by John Fielding on 21/04/2016 13:44:46:
I don't know if Atmel have changed the original AVR processor but it was renowned for being sensitive to glitches. We almost went into full production with the AVR until a colleague discovered a real nasty effect! We changed to the Motorola GP32 processor, which is an automotive qualified device, and tried the same test. Absolutely no ill effects with the GP32 and we used it successfully ever after. You would probably be wanting these then: www.atmel.com/products/microcontrollers/avr/automotive_avr.aspx They may not have been available way back, if you were trying AVR back in the days of 1200 and 8515. Neil Edit: for those unfamiliar with these, they are versions of normal AVRS adapted for an automotive environment. Edited By Neil Wyatt on 21/04/2016 15:05:46 |
Steve Addy | 21/04/2016 16:44:07 |
![]() 158 forum posts 107 photos 1 articles | I wish I'd kept my gob shut! Steve |
Muzzer | 21/04/2016 17:17:35 |
![]() 2904 forum posts 448 photos | You wouldn't be allowed anywhere near a production vehicle without having passed a vast set of validation tests for both the hardware and the software. In particular, the "voltage reset" tests in ISO-7637 simulate the effects of voltage dips on the supply (battery) lines. The sort of misbehaviour described would certainly result in a fail and sounds as if it would most likely require a redesign. Clearly it's true that some microcontrollers are more sensitive than others in some areas but I've yet to hear of one that is somehow so flawed it can't be used consistently. However, any microcontroller that sees any of its pins taken a few hundred mV below the substrate is liable to misbehave in an unpredictable way, so this is something that absolutely must be taken care of by good layout and following the application note very carefully. The device itself is tiny and is only susceptible to transients on account of the PCB layout itself - herein lies the skill of good design. The normal approach to avoiding microcontrollers misbehaving due to supply voltage wobbles is to use an LDO incorporating a monitor (eg LP3871 from TI). You do the sums so that it flags an error before the micro has fallen out of its legal supply voltage range so that it goes safely into reset - it absolutely is possible. And of course you test it to demonstrate it works, not to find out. From a software POV, the micro is required to be able to wake up and find itself looking at a spinning engine and take control without doing anything silly. Again, this is simply a basic requirement for the software and anything less would not be acceptable. |
Simon Williams 3 | 21/04/2016 20:50:16 |
728 forum posts 90 photos | I say chaps, have we not fallen into the trap of "if you want to make it complicated ask an expert"? I get the feeling that the OP is more than somewhat bemused at the extent of the expertise this spotlight on the intricacies of safety circuits has revealed. But it isn't answering the original question. At risk of lecturing all and sundry, for which I apologise, the OP made his risk assessment, identified the hazard, and devised some control measures. Other solutions exist. So to focus on making sure that the control measures are effective, how do you reset an Arduino with the output of a 555? My cursory glimpse at the equivalent circuit of the 555 output stage shows a pair of npn transistors connected between the supply rails. I fancy one needs to think about the leakage currents through the base bias resistors to be sure that pin 3 will actually go properly low. Alternatively - and more simply - should not the Arduino reset input be fed from an open collector output? Minds other than mine understand the intricacies of these things better than I do. For my part I like the idea of not allowing the microprocessor in the Arduino to suicide itself in times of peril. If the innards have gone doolally, then exterior means to bring the Express to a safe halt are indeed prudent. That goes back to the next stage of the risk assessment - have the implemented control measures reduced the risk to an acceptable level?
Rgds to all Simon |
Steve Addy | 21/04/2016 21:20:42 |
![]() 158 forum posts 107 photos 1 articles | Thank you Simon. Without wishing to offend anyone, people are exhibiting their knowledge and may as well be speaking in Japanese. I'm an amateur engineer and get by quite nicely in that field, but electronics are new to me. There is no point in talking about other processors, I'm playing Arduino period! I am not taking to the road or the main line with 3000hp. All I'd like is some ideas as to why it doesn't reset in words of one syllable and I'll have a play with the circuit when I'm in a suitable mood. I did try to look what happened to D2 when a reset was forced with the switch, it appeared to go high, but I was struggling to concentrate as usual. During normal operation it is going low for 30 milliseconds and discharging the capacitor, by way of "heartbeat". My mother is driving me crackers with constant stupid phone calls, I'm not in the right frame of mind for this at the moment at all! Steve |
Neil Wyatt | 21/04/2016 21:25:52 |
![]() 19226 forum posts 749 photos 86 articles | The 555 is adding complexity for the sake of it, IMHO. The reset pin will have a ~30K pullup internally so happy being driven by an open collector. Good point made earlier about the diode - the minimum input low voltage hreshold is 0.2V which will be fine with an open collector transistor in saturation, but not with a diode in line. Final thought - if you do implement an external reset - have you made sure thats fails all your systems safe? Will teh regulator close itself if no signal comes from the arduino, for example? Neil
|
John Haine | 21/04/2016 21:30:25 |
5563 forum posts 322 photos | I'd still like to know what the Arduino output that triggers the 555 does when reset is asserted. But I agree with Neil that the 555 is adding complexity for no obvious benefit (in fact, the contrary!). If you do want something external to generate a reset if you stop getting watchdog pulses, a better choice is an edge triggered retriggerable monostable such as the CD4538. Edited By John Haine on 21/04/2016 21:34:35 |
Simon Williams 3 | 21/04/2016 21:53:41 |
728 forum posts 90 photos | Sorry John, but this OP isn't ready for CMOS static sensitive stuff yet. The same essential functionality exists with the 555 - so the original question stands. How do you implement a reset with a 555? There are other ways to do the same job, but that wasn't the question. Equally the point that he is adding complexity for the sake of may be correct, but - with respect - is irrelevant. The OP wanted to learn how to do this stuff, and asked why does it not behave as he expected. He can build an entire Heath Robinson panorama of unnecessary complication - and learn much as he does it. But it is nice (and ever so much more rewarding) if the lights come on when you expect them to. Rgds to all Simon
|
Steve Addy | 21/04/2016 22:13:36 |
![]() 158 forum posts 107 photos 1 articles | That CD4538 thing has twice as many pins and I'm buggered if I understand it.........
|
Simon Williams 3 | 21/04/2016 22:46:18 |
728 forum posts 90 photos | Posted by Steve Addy on 21/04/2016 22:13:36:
That CD4538 thing has twice as many pins and I'm buggered if I understand it.........
That's the complexity leaking out. Come on chaps, I don't know enough about the innards of an Arduino chip to know if the answer is as simple as ditch the diode, feed the reset I/p with an open collector and rely on the pull up resistor inside the A' chip. But some of you jolly clever chaps must do. The OP was asking for help in his hour of befuddlement. I don't feel we've maintained our high standards of brotherhood in adversity here. Edited By Simon Williams 3 on 21/04/2016 22:52:08 |
Michael Gilligan | 21/04/2016 22:59:53 |
![]() 23121 forum posts 1360 photos | Steve, Having found Chris Ramsay's description **LINK** ... I now know that he was using a Pro Mini, and you are using a Uno R3. I don't know much about Arduino, but I have read somewhere that the Uno reset arrangement is a little different [requires more current ?] ... something to do with the USB chip ? Hopefully this might ring a bell with someone. MichaelG. |
John Haine | 21/04/2016 23:02:55 |
5563 forum posts 322 photos | Posted by Simon Williams 3 on 21/04/2016 21:53:41:
Sorry John, but this OP isn't ready for CMOS static sensitive stuff yet.
That rules out using an Arduino then. Anyway in a 40 year career in electronics I've never blown a 4000 series CMOS device through static. They are remarkably robust. |
Simon Williams 3 | 21/04/2016 23:04:21 |
728 forum posts 90 photos | John - thank you , fair comment. I have! Rgds Simon |
Simon Williams 3 | 21/04/2016 23:29:06 |
728 forum posts 90 photos | Isn't there a problem with the component values for the 555 timing circuit? The values as shown and as per the link MichaelG added show R1 = 1M, R2 = 3K3. This gives a mark space ratio of about 300 to 1. A 555 can't do this. You can go to about 100 to 1 (but not with this basic circuit) but 300 to 1 is going too far. Why does the reset pulse have to be short? Simon
Edited By Simon Williams 3 on 21/04/2016 23:49:24 |
Michael Gilligan | 21/04/2016 23:37:01 |
![]() 23121 forum posts 1360 photos | Posted by Andrew Holdaway on 20/04/2016 22:27:28:
Steve, what is the purpose of the IN4001 diode on pin 3 of the 555? . This version of the WatchDog includes a brief explanation. MichaelG. |
Michael Gilligan | 21/04/2016 23:41:40 |
![]() 23121 forum posts 1360 photos | Posted by Simon Williams 3 on 21/04/2016 23:29:06:
The values as shown and as per the link Mike G added ... . Simon, I do prefer to be called Michael Thanks MichaelG |
Simon Williams 3 | 21/04/2016 23:48:12 |
728 forum posts 90 photos | Posted by Michael Gilligan on 21/04/2016 23:41:40:
Posted by Simon Williams 3 on 21/04/2016 23:29:06:
Simon, I do prefer to be called Michael Thanks MichaelG My Apologies. So it shall be. Simon |
Michael Gilligan | 21/04/2016 23:59:31 |
![]() 23121 forum posts 1360 photos | Thanks, Simon MichaelG. ... Now back to the 555 mystery !! |
Andy Holdaway | 22/04/2016 07:54:56 |
![]() 167 forum posts 15 photos | Forgetting for now about diodes and sink current, what I fail to understand is that the OP says that the Arduino resets with a push button connected to the reset pin, and he has tried a relay from the 555 output to do the same, but the Arduino does not reset. Now it may be that the relay has high resistance on its contacts, or was not pulling in fully, but that aside, the relay is doing exactly the same as the push button. The 555 circuit should work, but clearly doesn't. I had assumed the OP was using a pro mini as well from the original diagram that was linked to. Maybe it is down to different reset strategy on the Uno, I don't know. I'll have a look through the datasheets later. Andy |
Please login to post a reply.
Want the latest issue of Model Engineer or Model Engineers' Workshop? Use our magazine locator links to find your nearest stockist!
Sign up to our newsletter and get a free digital issue.
You can unsubscribe at anytime. View our privacy policy at www.mortons.co.uk/privacy
You can contact us by phone, mail or email about the magazines including becoming a contributor, submitting reader's letters or making queries about articles. You can also get in touch about this website, advertising or other general issues.
Click THIS LINK for full contact details.
For subscription issues please see THIS LINK.