up to yesterday I was working with an Atmega328 with the old bootloader (Duemilanove) until I transformed it to magic smoke by soldering in a 7805 the wrong way. After switching the chip to an Atmega328 with the new bootleader (Uno), I came across two problems:
When powering the chip with an FTDI, the LED on pin 13 goes on, off and then flashes five times three times (with delays inbetween) (like this: ... ... ... ... ...). Afterwards, it starts with the normal program which will then work as expected.
When powering the chip with an external power source, pin 13 lights up, goes out again and nothing happens. But: As soon as I reset the chip (by connecting RESET to GND), the program starts and everything works fine.
The first problem also shows up when I set the chip into a Duemilanove while the second one only appears on the custom board whose wiring is pretty much the same as an Arduino ProMini's one.
So question 1: How do I get rid of this blink-sequence as I need the chip to boot up fast?
And question 2: How can I solve the reset-problem? (I connect RESET to GND with an 100n-capacitor at the moment which works perfectly but which I wouldn't like to become a permanent solution).
The bootloader always blinks the LED as a start up sequnce/signal that it is ready to program. Try putting a .1uf cap across 5v and gnd. Check to make sure the ftdi can supply enough power and isn't "noisey".
Ut a blank program on the arduino to see if it's the program or the bootloader causing the flahsing. The code could be causing the arduino to crash ex to much ram in use etc
I uploaded the blink-program, which works without the initial blinking and directly starts with the programmed blink-sequence. Still, this doesn't clearify anything for me as the program won't blink either when I use an external power supply ... ?
I modified my program now to drive Pin 4 HIGH as soon as the sketch starts (before anything else). And still, while LED 13 blinks the 15 times, the second LED remains off.
So the question is - where could I have writen code that shows such an behaviour if not in setup()?
Oh and btw: I just uploaded the "Arduino as ISP"-program to one of my chips - and with that program, the blink-sequence appears as well (tested on a Duemillanove-board).