Hi, I'm new to the forum, but I've been playing with Arduino for about a year and often found terrific answers simply by searching old threads. This time, I had to sign up to address a unique (?) issue. I can bootload my 328p, I can upload and run a blink LED sketch, but I can't upload anything after that without re-bootloading first.
A little bit about my test setup:
I am programming custom boards that use the Atmega328p (32-pin, surface mount version). Sometimes, I can't get Tools > Burn Bootloader to work from the Arduino IDE. It throws up "invalid device signature" errors. So, I tried out the Atmega_Board_Programmer sketch from Nick Gammon (Gammon Forum : Electronics : Microprocessors : Atmega bootloader programmer). I uploaded it to an 8MHz Arduino-compatible board from RocketScream called the Mini Ultra (yes, quite an imaginative name). When I run the sketch, I choose the lilypad option for my 8MHz programmer and the bootloader writes to the chip. Everything seems good.
I, then, take that 328p (which is in a socket adapter, btw) to another breadboard with an 8MHz oscillator, connect the FTDI cable, and upload a simple blink LED sketch w/ no issues. When I try to upload again (even re-uploading the blink LED sketch), my SparkFun FTDI cable never gets a response from the MCU (green LED doesn't blink).
Here's the rub. I bit the bullet, got an AVRISP mkII, and ended up with the same results using the Tools > Burn Bootloader option from the Arduino IDE. For some reason, it won't take a second sketch without burning the bootloader again.
I thought this might be a fuse settings problem, but I can't figure it out. My fuses and lock byte are set after bootloading as follows:
LFuse = 0xFF
HFuse = 0xDA
EFuse = 0xFD
Lock byte = 0xCF
Any thoughts on this? I've looked at boards.txt and tried setting the fuses and lock bytes to be the same within Nick's sketch. Maybe the bootloader is being overwritten? The sketch I am writing is very small, so I doubt this is the problem.
I'm mystified because my boards that successfully bootloaded from the Arduino IDE never had this issue. Advice is appreciated.