I have two Arduino NG that seem to be loosing the code stored on them, either after a period of time or when the machine is turned off, I can't be sure. I'm also wondering if it has anything to do with over heating.
So I have code compiled and loaded that turns leds on/off when you send it a serial message. Then after a day or two of use it just stops working. I use the Arduino terminal to send it the start led message, and nothing happens. If I upload the code again it works fine.
If you have any ideas what might be causing this I'd be grateful to hear them,
I had some strange poblems after I defined a huge array. Maybe your code is filling up memory after a few days? You don't have a lot of space for you variables, only 1kbytes. If I am not mistaken 128 are already in use for the serial buffer.
Last night I uploaded the PWM example program (LED fade) to my new arduino board (Mega8) and it worked okay. After a while I tuned it off. I turned it back on again and it did not came back on. I connected led to pin 13 and told me that the boot loader was cycling again and again. :o
Maybe it has to do with the PWM as OP's application also involved PWM! strange :exclamation
I'll check if the program is there in the chip by using a parallel programmer.
After flashing (uploading in Arduino terms) the fade sketch, it worked ok. Then after a few power on off cycles, the flash got corrupted again. Here is what I got from the dump...
I have used 78L05 on the Bare-Bones Aurdino board "Rev C". 0.1 and 47uf caps on both end of 78L05. Board is being powered by a 9V battery. The xtal and Mega8 are not installed in the picture. Have omitted the diodes. In the picture the board is being powered from the 78l05 on the breadboard. http://www.bhargavaz.net/arduino/bbarduino-06262007.jpg
Do you have anything else connected? The one thing I notice is the regulator: the 78L05 you're using is only good for 100ma. This is cutting it a bit close in terms of current... The one Paul Badger specifies is in a T0-92 case but puts out more current. As it is, you're eating up almost half the current just for the Arduino and the LED, so connecting much more is going to starve the processor and lead to flakiness.
D
PS: if you use a crystal and not a resonator, you have to put 22pf capacitors from each crystal contact to ground... they make the oscillator start up.
Do you have anything else connected? The one thing I notice is the regulator: the 78L05 you're using is only good for 100ma. This is cutting it a bit close in terms of current... The one Paul Badger specifies is in a T0-92 case but puts out more current. As it is, you're eating up almost half the current just for the Arduino and the LED, so connecting much more is going to starve the processor and lead to flakiness.
Nothing else connected, just Mega8 and LED
I measured the actual current drawn by the board and max was 41ma when the LED @ pin9 was bright.
I don't think that the active current of mega 8 would be more than 30ma @ 16MHz. And LED would consume about 30ma max! so IMHO 100ma would be enough for it.
BTW TO-92 reg can only deliver 100ma it is the TO-220 version that delivers current up to 500ma.
PS: if you use a crystal and not a resonator, you have to put 22pf capacitors from each crystal contact to ground... they make the oscillator start up.
hey
PS The regulator PB specifies for the Barebones actually does put out 300ma in a little tiny T0-92 case.. it's an L4931 by ST Microelectronics.
I doubt that arduino board would draw 300ma just by itself! Only active device on my board is ATMega8 and the ATMEGA8 datasheet specifies 3.6ma active current @ 4MHz and I doubt that it will rise to 300 ma @ 16MHz
Paul uses regulator L4931CZ50 and according to ST datasheet (below) the maximum current delivered out is 250ma. But that doesn't mean that Arduino baord draws 300ma all the time ;D
Massimo mentioned that each pin can deliver 20ma, and that we should use a capacitor. Can you recommend which capacitor to use and the best way to wire it up.
Arduino 1 is running 1 led, Arduino 2 is running 3 leds (one at a time), an ultrasound and an IR ranger.
i've mentioned a transistor... a capacitor will help but only very minimally
if you draw 50ma from a pin that is desiged to provide 20ma that's more than 100% overload
even a simple bc547 would do the trick or use mosfet to save some time (one less resistor to solder)
1.5 ohm seems quite small
the datasheet says 50ma at 2.3v typical , this means the resistor will have to drop 2.7v while 50ma are going through it
2.7/0.050 = 54 , nearest resistor 56 ohm