Pages: [1]   Go Down
Author Topic: A RESET can save your board (english/german)  (Read 721 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Before wiring and downloading a new sketch (program) you should make sure that you have reset all of your digital pins to INPUT. Otherwise your new wiring could destoy the board, even if your sketch is programmed correctly.

Example: You used pin 7 for output. Your new sketch uses pin 7 as input with a pull up resistor and a push button to pull the signal to LOW without having a protective resistor (minimum 120 ohms). As soon as the Arduino gets power, it will execute the last loaded program. And before the new program will be loaded  down, you might have shorted pin 7 with your new hardware setup (wiring) when pressing the pushbutton.
Pin 7 is just an example. This can happen to all pins that have been defined as output before rewiring and reprogramming the board.

RESOLUTION:  execute a reset procedure, which is a sketch that sets all digital pins as INPUT.

After that you can rewire and reprogram your board

DESPITE A PERFECT SKETCH AND HW SETUP YOUR LAST SKETCH MIGHT KILL YOUR ARDUINO.

--------------------------------------------------------------------------------------------------------------------------------------

ACHTUNG:
------------

Bevor Sie Ihr Board neu verdrahten und ein neues Programm (Sketch) auf das Arduino Board laden,
sollten Sie alle digitalen Pins (0 bis 13) als INPUT definieren.
Erstellen Sie dazu eine kleine Routine, die dieses erledigt.

Ansonsten könnte folgendes passieren:

Ihr neues Programm hat Pin 7 als INPUT definiert, mit einem Pull-Up Wiederstand (verbuden mit 5 Volt) und einem Druckknopf, der das Signal auf LOW zieht. Sie haben keinen Sicherheitswiderstand eingebaut (minimal 120 Ohm). So sieht man das oft in fertigen Sketches!
Ihr neuer Sketch ist zwar perfekt programmiert, aber solange Ihr Sketch nicht kompiliert und downgeloadet ist, solange läuft ihr letzter Sketch. Und in diesem Falle würde er Pin 7 mit Masse (GND) kurzschliessen, wenn Sie in dieser Zeit den Knopf drücken.

TROTZ PERFEKTEM SKETCH UND HW SETUP KANN IHR LETZTER SKETCH IHREN ARDUINO ZERSTOEREN:








 
Logged

Offline Offline
Faraday Member
**
Karma: 68
Posts: 2806
The last thing you did is where you should start looking.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This is a good rule to follow and has been offered as a suggestion before.
The problem is you have to get into the habit.
Logged

The way you have it in your schematic isn't the same as how you have it wired up! That goes for me too.

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 503
Posts: 19089
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
RESOLUTION:  execute a reset procedure, which is a sketch that sets all digital pins as INPUT.

To be more precise, load a sketch that sets all pins to input. Since the default is that pins are input, an empty sketch would do that.

Code:
void setup () { }
void loop ()  { }

Also, fairly obviously, you need to do this before connecting any hardware that might damage it. So if you have a spare Arduino lying around, load the above sketch before connecting up anything that might damage it.

Personally I would try to design my hardware layout so that it would not be damaged, even if the pins happened to be set to output.



Having said all that, since the you need to do this anyway before connecting hardware, and your new sketch presumably works with the new hardware, probably the simple thing is to load the new sketch and then connect the hardware afterwards (preferably after powering it off again).
Logged


Pages: [1]   Go Up
Jump to: