I uploaded the following sketch to my Arduino Uno Rev V3:
#define READ_PIN 5
#define ON_BOARD_LED_DIO_PIN 13
#define BUFFER_SIZE 300
int buffer[BUFFER_SIZE];
unsigned long timeStamp[BUFFER_SIZE];
unsigned int index = 0;
void setup()
{
Serial.begin(115200);
Serial.println("START");
pinMode(ON_BOARD_LED_DIO_PIN, OUTPUT);
digitalWrite(ON_BOARD_LED_DIO_PIN, LOW);
}
void loop()
{
if (index < BUFFER_SIZE)
{
timeStamp[index] = micros();
buffer[index++] = analogRead(READ_PIN);
}
else if (index == BUFFER_SIZE)
{
for (int i=0; i < BUFFER_SIZE; i++)
{
Serial.print(i);
Serial.print("\t");
Serial.print(timeStamp[i]);
Serial.print("\t");
Serial.println(buffer[i]);
}
index++;
}
}
It started to just continuoulsy send "START" messages, and it seems like it is restaring all the time. The big problem is that I can not exit this condition. I can not upload any new scetches. The TX LED is lit all the time due to the "START" messages, and I can talk to the Uno via the Serial Monitor (the RX LED lits), although the sketch does not monitor the serial line (the serial link seems to work OK). I now have nothing connected to any port of the Uno. Cycling the power just make the Uno start to send "START" again. The funny thing is that when I compile a sketch it says "nnn bytes (of a 28672 byte maximum)". The maximum has become lower (it was 32 K before)! When I uploaded the sketch I had a photo transistor and resistor attached to A5. The simple circuit worked, since I previously had it attached to DIO pin 2 (Emitter to ground, Collector to A5 and 10k resistor from Collector to +5V).
Please give me some advice on how to exit the lock-up.
Moderator edit: code tags added, italics removed.