Sketch on Mini w/328 only runs once

I have the following problem with my Arduino Mini.

When I upload a sketch (no matter which one, even a simple LED blink sample sketch) it only runs once, right after uploading. Once unplugged and reconnected to a power source, the arduino does nothing, I have to re-upload the sketch and it works again.

Has anyone ever experienced this problem? Any ideas?

thank you guys!

@raschemmel: Too subtle?

You do know that the Mini may have some differences as to pin numbers (and is there a led?) from say, the UNO? http://arduino.cc/en/Main/ArduinoBoardMini

If you can't get this sketch to run it may be due to those very differences:

/*
  Blink
  Turns on an LED on for one second, then off for one second, repeatedly.

  This example code is in the public domain.
 */

// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 13;

// the setup routine runs once when you press reset:
void setup() {                
  // initialize the digital pin as an output.
  pinMode(led, OUTPUT);    
}

// the loop routine runs over and over again forever:
void loop() {
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);               // wait for a second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);               // wait for a second
}

There could be power issues for all I know.

objectr: Once unplugged and reconnected to a power source, the arduino does nothing, I have to re-upload the sketch and it works again.

The old Uno bootloader had a bug that sounds like this one. Maybe you need to update the bootloader on your board.

You do know that the Mini may have some differences as to pin numbers (and is there a led?) from say, the UNO?

No it doesn't. It's the same 328P chip. Only difference is that some promini's support A6/A as analog inputs.

@econjack, I missed this part...

no matter which one

I went back and re-read it after reading your post. Thanks for the hint

CrossRoads:

You do know that the Mini may have some differences as to pin numbers (and is there a led?) from say, the UNO?

No it doesn't. It's the same 328P chip. Only difference is that some promini's support A6/A as analog inputs.

My UNO board has a pin map just to tell board pins from 328 pins.

Does the Mini have the built-in led and resistor on pin 13?

yes

My UNO board has a pin map just to tell board pins from 328 pins.

All '328P use the same pin map, if you look from the bare die to the software name: PORTD0,1,2,3,4,5,6,7 = D0,1,2,3,4,5,6,7 PORTB0,1,2,3,4,5 = D8,9,10,11,12,13 PORTC0,1,2,3,4,5 = A0,1,2,3,4,5,6

That's all the software cares about.

There are then connections from the PORT to the physical pins, which is the mapping you see on the schematics and which a board designer carries about. For writing code and making connections:

byte pin8 = 8;

digitalWrite (pin8, HIGH );

will show up at the header pin labelled D8 on both an Uno and a Promini because in both cases PORTB bit 0 is being addressed, as an example.

Too bad.

Are you sure the sketch copies?

thank you guys so much for the help!

I don't know if the sketch copies, but the whole thing worked a couple of weeks ago. Will get the AVR ISP programmer now and try to re-install the bootloader. maybe that will help.

You should know by the compiler output messages below the code window when you download.

it says 'done uploading' so i guess this part works.

How many volts and amps are you feeding it after you program it?

It will say "done uploading" whether it works or not. Under File:Preference, turn on Verbose outputs. Drag the seperating line in the IDE and make the bottom half bigger, scroll backwards and see if it's really completing, or if there are error messages there.

sorry for digging out that threat again, but I found out why the sketch didn't run. (or better: how to make it run)

It only works when the serial Adapter is NOT connected. Whenever I plug it in, it shows 2 rows of blocks. (except the first time, ie. right after uploading the code)

still don't know why this is not working, since the adapter is not interfering with the lcd (or is it??) but i thought it might be helpful for someone in the same situation.

thanks guys!