Arduino Pro Micro running slow after disconnect from USB

Hi all,

I' am getting mad. I've a Pro Micro 5V , checked it out with a voltmeter, and can upload the sketch with with the Sparkfun Pro Micro Board AddOn. After uploading everything works fine, but after diconnect and reconnect from USB, the Speed is extremely laggy. It could not be my original code, tried it with a simple sketch to turn some LED on/off with delay like the following example. 75ms are like 250ms, I dont know what it could be. I' ve tested two Pro Micros, everything the same :(.

Someone got an idea? All is fine until I disconnect it from USB after uploading a sketch and reconnect it.

Example-Sketch:

#define ledpinA0 A0
#define ledpinA1 A1
#define ledpinA2 A2
#define ledpinA3 A3

void setup()
{
 
  pinMode(ledpinA0,OUTPUT);
  pinMode(ledpinA1,OUTPUT);
  pinMode(ledpinA2,OUTPUT);
  pinMode(ledpinA3,OUTPUT);
  //pinMode(vibrapinA4,OUTPUT);
  
  //JUST A FUNNY LED TEST
  digitalWrite(ledpinA1, HIGH);
  //digitalWrite(vibrapinA4, HIGH);   
  delay(75);
  digitalWrite(ledpinA1, LOW);
  //digitalWrite(vibrapinA4, LOW);
  delay(75);
  digitalWrite(ledpinA2, HIGH);
  //digitalWrite(vibrapinA4, HIGH); 
  delay(75);
  digitalWrite(ledpinA2, LOW);
//  digitalWrite(vibrapinA4, LOW);
  delay(75);
  digitalWrite(ledpinA3, HIGH);
  //digitalWrite(vibrapinA4, HIGH); 
  delay(75);
  digitalWrite(ledpinA3, LOW);
  //digitalWrite(vibrapinA4, LOW); 
  delay(75);
  digitalWrite(ledpinA0, HIGH);
  //digitalWrite(vibrapinA4, HIGH);    
  delay(75);
  digitalWrite(ledpinA0, LOW);
  //digitalWrite(vibrapinA4, LOW); 
  delay(75);
  digitalWrite(ledpinA3, HIGH);
  //digitalWrite(vibrapinA4, HIGH);    
  delay(75);
  digitalWrite(ledpinA3, LOW);
  //digitalWrite(vibrapinA4, LOW);
  delay(75);
  digitalWrite(ledpinA2, HIGH);
  //digitalWrite(vibrapinA4, HIGH); 
  delay(75);
  digitalWrite(ledpinA2, LOW);
  //digitalWrite(vibrapinA4, LOW);
  delay(75);
  digitalWrite(ledpinA1, HIGH);
  //digitalWrite(vibrapinA4, HIGH); 
  delay(75);
  digitalWrite(ledpinA1, LOW);
  //digitalWrite(vibrapinA4, LOW);
 }

void loop()
{

}

Tryed it with this Testcode, everthing the same, after dis- and reconnecting only at “half-speed”. Something special to know about driver etc? How do you use the Pro Micro?

/* Pro Micro Test Code
   by: Nathan Seidle
   modified by: Jim Lindblom
   SparkFun Electronics
   date: September 16, 2013
   license: Public Domain - please use this code however you'd like.
   It's provided as a learning tool.

   This code is provided to show how to control the SparkFun
   ProMicro's TX and RX LEDs within a sketch. It also serves
   to explain the difference between Serial.print() and
   Serial1.print().
*/




int RXLED = 17;  // The RX LED has a defined Arduino pin
// The TX LED was not so lucky, we'll need to use pre-defined
// macros (TXLED1, TXLED0) to control that.
// (We could use the same macros for the RX LED too -- RXLED1,
//  and RXLED0.)

void setup()
{
 pinMode(RXLED, OUTPUT);  // Set RX LED as an output
 // TX LED is set as an output behind the scenes

 Serial.begin(9600); //This pipes to the serial monitor
 Serial1.begin(9600); //This is the UART, pipes to sensors attached to board
}

void loop()
{
 Serial.println("Hello world");  // Print "Hello World" to the Serial Monitor
 Serial1.println("Hello!");  // Print "Hello!" over hardware UART

 digitalWrite(RXLED, LOW);   // set the LED on
 TXLED0; //TX LED is not tied to a normally controlled pin
 delay(75);              // wait for a second
 digitalWrite(RXLED, HIGH);    // set the LED off
 TXLED1;
 delay(75);              // wait for a second
}

When I connect it to USB and its running at halfspeed and then I do a reset (Pin RST+GRD), it works like it should. But thats not the deal, it has to run in normal speed after connect it to usb without to have to reset it.

Can anyone help???

Is it running at exactly half speed until you reset it? And there is nothing connected to it other than the USB cable? The only thing I can think of is it may have a bootloader on it which is doing some clock division settings only under certain circumstances. Is it possible somebody put a custom compiled bootloader on it? You could put a fresh bootloader on it using ICSP programming (using another Arduino running the ArduinoISP sketch or with an ICSP programmer).

Thx!

Seems to be halfspeed, feels like it is so. There is nothing other attached to the computer. It is a compatible Pro Micro. I only know, that the Sparkfun one has a separate bootloader. But I can do this like it is described at this link with my compatible one too: Pro Micro & Fio V3 Hookup Guide - learn.sparkfun.com

Maybe the cheap kompatible one has something wrong with his maybe selfmade bootloader? Can you give me a link how to put a fresh booloader and the right one to the Pro Micro? Would be my frist time, got a ICSO programmer at home.

I will try this:

Yes, that looks like a good tutorial. Right before you click Burn Bootloader, whichever board you choose in the Tools menu determines which bootloader you put on the board, so I suggest choosing Sparkfun Pro Micro or Leonardo. There are very little differences between the Sparkfun Pro Micro, Leonardo, and Arduino Micro bootloaders, perhaps just the USB PID and VID values. To figure out which pins are MISO, MOSI, and SCK, you can google for Pro Micro Pinout and there are probably lots of diagrams to refer to on the Internet. Post information and/or pictures or start another thread if you need help.

I DID IT!! YIIHAAA ;

It was the bootloader of the "compatible" Pro Micro. I have to install the bootloader with my original Arduino Uno and'm proceed as follows:

Installing the test Sketch Blinkies on to Pro Micro to quickly see at what speed to go the lights on and off, since the Pro Micro has no LED to pin 13:
https://learn.sparkfun.com/tutorials/pro-micro--fio-v3-hookup-guide/example-1-blinkies

After the power cycle he ran at half the speed as discribed before.

After that I attach my Uno and choose the Uno as board and recorded it with the ArduinoISP Sketch from the Arduino IDE. After that I wired the Uno to the Pro Micro to using it as a programmer:
Installing an Arduino Bootloader - learn.sparkfun.com.

Then I have the Pro Micro chosen as Board with the correct COM Port and chose as the Programmer "Arduino as ISP" from. I then choose "burn bootloader". That's who gets Pro Micro a new bootloader via the Uno and it starts immediately after switching on with the process of the code. Even after the power cycle he ran correctly and no longer ran at half the speed. Testet it with the Blinkies Sketch.

I had just unsuccessfully tried to re-install the Pro Micro with a Pro Micro. With the Uno then it works.

Many thanks for your important tip, case closed :).

It helped me too. Thanks!

I was using a Pro Micro clone. Burning the bootloader magically cured it! I was using USBTinyISP.

Same problem, same solution.

The mistery of the Pro Micro bootloader