Pages: [1] 2   Go Down
Author Topic: Uploading error I am not familiar with (Pro Mini)  (Read 564 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Please forgive my ignorance as I am just starting out having never used Arduino or programmed anything prior to 2013.

I am using a clone Pro Mini 5V, 16MHz W/ATmega 328.  I am trying to upload code that has worked on the Uno and the Nano.  This time I keep getting the following error message:

Quote
avrdude: stk500_getsync(): not in sync: resp=0x00

I have tested the Mini Pro by messing around with the basic pin 13 blink program which does upload and seems to work fine.  What am I missing?  What other information can I provide that may help?

Here is the code:
(All it does is randomly flash 5 LEDs in sequence with a re-purposed voltmeter gauge needle for a toy.  I am working on some simple tone oscillation to work with it as well, but that is not included yet.)

Code:
/*
  By Luke Thomas
 */
 
 #define LED_PIN 13        //LED in on pin 13
 #define DELAY_AMOUNT_MIN 20  //500m == 0.5s
 #define DELAY_AMOUNT_MAX 100  //500m == 0.5s
 #define BETWEEN_CYCLE_DELAY_MIN 200
 #define BETWEEN_CYCLE_DELAY_MAX 800
 #define LONG_DELAY_COUNT_MIN 5
 #define LONG_DELAY_COUNT_MAX 10

 #define NUM_LEDS 5
 #define LED_1 6
 #define LED_2 5
 #define LED_3 4
 #define LED_4 3
 #define LED_5 2
 
 #define VOLT_METER_PIN 9
 #define VOLT_METER_MAX_VAL (255/45)

 
// Pin 13 has an LED connected on most Arduino boards.                                                                                                                                                                                                                                                                                                                                                                        ZX
// give it a name:
int led_global = LED_PIN;
int leds[NUM_LEDS] = {LED_1, LED_2, LED_3, LED_4, LED_5};
int globalCycleCount = 0;
int globalLongDelayCount = 0;
int voltMeterLookup[] = {1, 2, 3, 4, 6};

// the setup routine runs once when you press reset:
void setup() {                
  
  //Local variables
  int ct = 0;
  
  // initialize the digital pin as an output.
  pinMode(led_global, OUTPUT);  
  pinMode(VOLT_METER_PIN, OUTPUT);  
  
  for(ct = 0; ct < NUM_LEDS; ct++){
    pinMode(leds[ct], OUTPUT);
  }
  
  //Intialize global variables
  globalCycleCount = 0;
  globalLongDelayCount = 0;
  
}

// the loop routine runs over and over again forever:
void loop() {

  //Local variables
  int ct = 0;
  int randNumLedVal = rand() % NUM_LEDS + 1;
  int tempDelayVal = rand() % (DELAY_AMOUNT_MAX - DELAY_AMOUNT_MIN) + DELAY_AMOUNT_MIN;
  int topDelayVal = 3 * randNumLedVal * tempDelayVal;
  int betweenCyleDelayVal = rand() % (BETWEEN_CYCLE_DELAY_MAX - BETWEEN_CYCLE_DELAY_MIN) + BETWEEN_CYCLE_DELAY_MIN;
  
  int voltMeterIncrVal = (VOLT_METER_MAX_VAL / (NUM_LEDS));
  
  /*
  digitalWrite(led_global, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(DELAY_AMOUNT);               // wait for DELAY_AMOUNT
  digitalWrite(led_global, LOW);    // turn the LED off by making the voltage LOW
  delay(DELAY_AMOUNT);               // wait for DELAY_AMOUNT
  */
  
  digitalWrite(led_global, HIGH);
  
  //Run the LEDs up - from the low to high LEDs, with a delay between each
  for(ct = 0; ct < randNumLedVal; ct++){
    
    analogWrite(VOLT_METER_PIN, voltMeterLookup[ct]);
    
    digitalWrite(leds[ct], HIGH);   // turn the LED on (HIGH is the voltage level)
    
    delay(tempDelayVal);               // wait for DELAY_AMOUNT
  }
  
  //DEBUG - toggle the onboard LED for debug purposes.
  digitalWrite(led_global, LOW);
  //Delay at the top of the LEDs for a bit
  delay(topDelayVal);
  
  //Run the LEDs back down - from the high to low LEDs, with a delay between each
  for(ct = randNumLedVal-1; ct >= 0; ct--){
    
    analogWrite(VOLT_METER_PIN, voltMeterLookup[ct]);
    
    digitalWrite(leds[ct], LOW);    // turn the LED off by making the voltage LOW
    
    delay(tempDelayVal);               // wait for DELAY_AMOUNT
  }

  //Reset the volt meter to no output...
  analogWrite(VOLT_METER_PIN, 0);

  //Increment the global cycle counter
  globalCycleCount++;
  
  //Check if a 'long' delay should be ran
  if(globalCycleCount >= globalLongDelayCount){
    
    //If there should be one here, reset the global cycle counter and determine a new cycle wait delay
    globalCycleCount = 0;
    globalLongDelayCount = rand()%(LONG_DELAY_COUNT_MAX - LONG_DELAY_COUNT_MIN) + LONG_DELAY_COUNT_MIN;
    
    //Delay 5 times the previously determined random delay
    //TODO - make this random?
    delay(5*betweenCyleDelayVal);
  
  //If it isn't a long delay, just delay the normal amount
  } else {
    //Wait for a bit between cycles
    delay(betweenCyleDelayVal);  
  }
  
}


« Last Edit: November 23, 2013, 12:23:42 pm by sulla » Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 627
Posts: 34213
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

That error message is the most common error message you will get uploading. It means that the Arduino has not responded to the bootloader. This is probably because of your programming setup.
Odd you are having a program  loading problem but you don't mention how you are doing it so we can only guess what you are doing wrong.
So in the absance of any real information provided by you read this page:-
http://arduino.cc/en/Main/ArduinoBoardProMini
especially the bit that says "Automatic (Software) Reset"
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the info.  

I am using a tinyosshp.com FTDI Basic Breakout and the Arduino 1.0.5 software.  I selected the Arduino Pro or Pro Mini (5V, 16 MHz) w/ATmega328  on COM5, brought up my sketch, clicked the verify button, then clicked the upload button.  I even tried a manual reset using the button on the board before uploading.

FTDI link: http://www.tinyosshop.com/index.php?route=product/product&product_id=600

Does this help?
« Last Edit: November 23, 2013, 01:14:16 pm by sulla » Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 627
Posts: 34213
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I am using a tinyosshp.com FTDI Basic Breakout and the Arduino 1.0.5 software.
Broken link!
Have you wired in the auto reset wire?

Quote
I even tried a manual reset using the button on the board before uploading.
You have to do it at exactly the right time. You hold down the reset button click the upload button. When you see it say "uploading" you count 1 and 2 and 3, then you release. It works about 5 times out of ten.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I changed the link, thanks; It should work now.  I tried the 1, 2, 3, count thing with no luck.   smiley-cry  I'll keep reading and trying.  I have a couple more Pro mini's still in their packaging.  Think it'd be worth it to open 'em up and try them?  I wonder if the problem is with the PC, the Pro Mini, the break out board, or the connection(s) between them.

Anyhow, thanks for all the replies so far!
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 627
Posts: 34213
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Think it'd be worth it to open 'em up and try them?
No.
You still haven't said how you have wired up the auto reset circuit.

Have you seen this page:-
http://www.gammon.com.au/forum/?id=11637
« Last Edit: November 23, 2013, 01:26:11 pm by Grumpy_Mike » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Think it'd be worth it to open 'em up and try them?
No.
You still haven't said how you have wired up the auto reset circuit.

Please forgive my ignorance.  I have the 5 pins soldered up between the breakout and the pro mini.  GND, CTS, VCC, TXD, RXD, DTR.  Is the auto reset circuit something separate?

« Last Edit: November 23, 2013, 01:32:47 pm by sulla » Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 627
Posts: 34213
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Is the auto reset circuit something separate?
The auto reset is the DTR connected to the reset pin.

That looks all wrong, the pins might fit but none of the signals match up with the signals on the Pro Mini.
You say you have a clone, is this pinned out differently from the real one?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Is the auto reset circuit something separate?
The auto reset is the DTR connected to the reset pin.

That looks all wrong, the pins might fit but none of the signals match up with the signals on the Pro Mini.
You say you have a clone, is this pinned out differently from the real one?

Excellent observation!  Here is how they are laid out when plugged into one another:

Break out  to  Pro Mini
          GND = BLK
          CTS = GND
          VCC = VCC
          TXD = RX
          RXD = TX
          DTR = GRN
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 627
Posts: 34213
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
DTR = GRN
What is GRN?
You need to connect the DTR to the reset.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
DTR = GRN
What is GRN?
You need to connect the DTR to the reset.

Good question, I have no idea.  So how about this then?  Did I screw it up?

Logged

The Netherlands
Offline Offline
Edison Member
*
Karma: 50
Posts: 1672
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote from: Grumpy_Mike
Quote
DTR = GRN
What is GRN?

The ProMini has these texts printed near those pins.
I assume GRN means GReeN and BLK BLacK.
No idea why these pins would need wires in these colors.
Logged

Have a look at "blink without delay".
Did you connect the grounds ?
Je kunt hier ook in het Nederlands terecht: http://arduino.cc/forum/index.php/board,77.0.html

Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So how about this then?  Did I screw it up?



Well that didn't work.  Anyone care to point out my mistake(s)?  I'd be grateful.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 627
Posts: 34213
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Two things I notice:-
1) There is nothing connected to CTS, this is an input handshaking line into the USB / serial interface, it might need connecting to ground or high.
2) There is an other set of TX and TX pins, are you using the right ones?
Logged

Sydney, Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 1273
Big things come in large packages
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Some things I learned when I was trying to do the same thing a while ago:
- RTS on the serial side gets connected to the RST (Reset) on the Pro Mini. On my USB converter this is up the side of the small PCB.
- In the Windows Device Manager for the COM port, go to the Advanced Setting tab and make sure that "Set RTS on Close" is checked.

For manual reset:
- Start the download from the IDE
- Hold down the reset on the Mini Pro
- When the Tx/Rx light on the USB converter blinks the first time, let the reset go.

The manual reset method works almost 100% of the time if you do it this way. The IDE will retry 3 times to establish connection and then give you the message you see.
« Last Edit: November 24, 2013, 05:36:16 am by marco_c » Logged

Arduino libraries http://arduinocode.codeplex.com
Parola hardware & library http://parola.codeplex.com

Pages: [1] 2   Go Up
Jump to: