Go Down

Topic: Can you use digitalWrite too much? (Read 992 times) previous topic - next topic

SouthernAtHeart

In my loop I have something like:
if (reading == idleVal) motorIdle();

and then that function is:

Code: [Select]
void  motorIdle(){  //turn off motor
  digitalWrite(motorUpPin, LOW);  //motor is not going up
  digitalWrite(motorDownPin, LOW);  //or down

}


...it's going to be idle most of the time in real life.  Does that matter that it continually keeps setting the pin low???  If it's low, it's low, ...it won't hurt anything will it?

Graynomad

#1
Dec 14, 2012, 04:22 am Last Edit: Dec 14, 2012, 04:24 am by Graynomad Reason: 1
Makes no difference to the processor or any hardware. Often that's as good a way as any because it saves extra logic although it does go against the grain a little I admit.

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com


MarkT

Or put another way, electrons don't wear out!
[ I won't respond to messages, use the forum please ]

retrolefty

#4
Dec 17, 2012, 02:49 am Last Edit: Dec 17, 2012, 06:34 am by retrolefty Reason: 1

Or put another way, electrons don't wear out!


Yea. electrons are the only moving parts in a AVR chip.

OT, but also any one specific electron is pretty slow poke. An instructor once explained that while the electron current flow through a conductor is near or at the speed of light, a specific given electron may take years to travel from one end of a 12" wire to the other. Not sure about the year part (I'm old now!), but it was of a duration that made my jaw drop as I slowly got an appreciation of how many damn electrons are in a 12" 22 gauge piece of copper wire.


SouthernAtHeart

Thanks. I know I've read something about only writing some many times to the EEPROM, and there's no moving parts in there is there?  I'm sure there's a big difference so how.

MarkT


Thanks. I know I've read something about only writing some many times to the EEPROM, and there's no moving parts in there is there?  I'm sure there's a big difference so how.


Well yes, it was a glib statement - most electronic devices only have electrons moving.

An EEPROM involves programming with high voltage gradients to force (well, quantum-tunnel) electrons through an oxide insulator -
this stresses the insulating layer and leaves electrons trapped in flaws in the oxide, these build up and eventually cause
mis-behaviour of memory cells - so technically the electrons don't wear out but the flaws in the insulator allow degradation
of the device in this manner.

Electronic devices also age (the material isn't stable long-term), suffer from thermal cycling (causes mechanical stresses),
and various effects, but in general should stay reliable if kept below "absolute maximum ratings".
[ I won't respond to messages, use the forum please ]

LMI

My colleagues and I once tested a microprocessor controlled device. We used softwate loops to test every system there were. One of the parts/systems was a flashrom to store some settings. We left the loop running and went to have a coffee break. After the break the chip was broken. It took some time before we understood what was wrong.

More info about flash roms and why they break.
http://en.wikipedia.org/wiki/EEPROM

Go Up