Verification error with Arduino Nano

Hi everyone, is my first time asking something because I am desperate with this issue.
Using my Arduino Nano, working with the Narcoleptic library (to save energy), appears this verification error that I have never seen before, not even in the posts.

[“avrdude: verification error, first mismatch at byte 0x0000
0x00 != 0x0c
avrdude: verification error; content mismatch
avrdude: verification error; content mismatch”]

What this error means? How can I solve it? I have tried many simple things (I am a beginner in this family) but none of them fix the problem.
This error doesn’t let me upload the code to Arduino.

Any help will be considered because I am in a roadblock.

Thanks

Turn on verbose upload logging in Preferences to get detailed messages about the progress of your upload. That will let us know what area of memory was being written.

When such an error was happening for me it was because I was using "ArduinoISP" on an Arduino UNO and had not disabled the auto-reset. When avrdude reset the board it was then talking to the Arduino bootloader and not the ArduinoISP sketch. The bootloader speaks the same STK500 protocol as the ArduinoISP sketch. The uploader thought it was able to set some configuration fuses (the bootloader is happy to acknowledge the write) but when the bootloader is asked to read back the fuses it always returns zero so the verification failed.

Thanks for the quick response John,
Your suggestion about turning on verbose upload logging in Preferences has helped me out a bit, now a can see that the problem is the programmer is not responding.
I have tried with every programmer and still not responding.
:frowning:

Are you using “Sketch->Upload Using Programmer”?!? If so, why? Typically you would connect your USB cable to the Nano and do an upload using the bootloader.

No, i just using the "Sketch->Upload"

nicopolidis3:
No, i just using the "Sketch->Upload"

"Programer is not responding" is a communication problem. Either you picked the wrong board, the wrong serial port, the USB driver isn't working (the serial port won't show up), or the bootloader is failing. One common problem is receiving a Nano with an UNO bootloader. Try selecting UNO for the board to see if that helps.

Thanks again for your support,
It doesn't work with the UNO settings, but i did something (i don't know what) and now doesn't appear to be any errors. However, i can tell that the code is not working in the Arduino Nano. I mean, the IDE says that the code is perfectly uploaded but the board is not changing anything. It works, but not how i tell it to work.

If you want help debugging your sketch you can post it here. Also describe any hardware attached to your Nano,

This is the Hardware, is an Arduino Nano used to control a DC water pump,
you can see in tthe image a transistor, a resistor and a diode as well.
And the code is very simple, using the narcoleptic library for the energy save. the code is working well. So it is probably something wrong with the Arduino, but i don’t know what.

#include <Narcoleptic.h>

const int pump = 4;
const uint32_t SECOND = 1000;
const uint32_t MINUTE = 60000;

void setup()
{
Serial.begin(9600);
pinMode(pump, OUTPUT);
}

void loop()
{
digitalWrite(pump, HIGH);
Narcoleptic.delay(10SECOND);
digitalWrite(pump, LOW);
Narcoleptic.delay(5
MINUTE);
}

Why the whacky Narcoleptic library ?

What happens if you use the ordinary delay() function ? What do you see if you include some Serial. print()s to track which code is being executed ?

Why the nutty centered layout for the code ? Did you read this before posting a programming question

UKHeliBob:
Why the nutty centered layout for the code ?

That could
become
a thing

Try this to see if the problem is the hardware or the library:

const int pump = 4;
const uint32_t SECOND = 1000;
const uint32_t MINUTE = 60000;

void setup()
{
  Serial.begin(9600);
  pinMode(pump, OUTPUT);
}

void loop()
{
  digitalWrite(pump, HIGH);
  delay(10 * SECOND);
  digitalWrite(pump, LOW);
  delay(5 * MINUTE);
}

If this does what you want, the problem is in the library or your use of it.

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Thanks.. Tom... :slight_smile:

Hi,
This the example code that comes with the library.

/**
 * Narcoleptic - A sleep library for Arduino
 * Copyright (C) 2010 Peter Knight (Cathedrow)
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

/*
** Welcome to Narcoleptic. This library allows you to dramatically reduce
** the power consumption of your Arduino project.
**
** Whilst in a Narcoleptic delay, the CPU current consumption drops from
** around 15mA down to about 7µA.
**
** Note that Narcoleptic only shuts down the CPU. It does not shut down
** anything else consuming current - LEDs, or the USB to serial chip.
** For low current applications, consider using boards without those,
** such as the Sparkfun Arduino Pro with the power LED removed.
**
** Narcoleptic is available from: http://narcoleptic.googlecode.com
*/

/* To use Narcoleptic, you will need the following line. Arduino will
** auto-insert it if you select Sketch > Import Library > Narcoleptic. */

#include <Narcoleptic.h>

#define LED 13
#define BUTTON 2

void setup() {
  pinMode(BUTTON,INPUT);
  digitalWrite(BUTTON,HIGH);  
  pinMode(LED,OUTPUT);
  digitalWrite(LED,LOW);

  // Narcoleptic.disableMillis(); Do not disable millis - we need it for our delay() function.
  Narcoleptic.disableTimer1();
  Narcoleptic.disableTimer2();
  Narcoleptic.disableSerial();
  Narcoleptic.disableADC();
  Narcoleptic.disableWire();
  Narcoleptic.disableSPI();
}

void loop() {

  // Merlin the cat is snoozing... Connect digital pin 2 to ground to wake him up.
  Narcoleptic.delay(500); // During this time power consumption is minimised

  while (digitalRead(BUTTON) == LOW) {
    // Wake up CPU. Unfortunately, Merlin does not like waking up.

    // Swipe claws left
    digitalWrite(LED,HIGH);
    delay(50);
    
    // Swipe claws right
    digitalWrite(LED,LOW);
    delay(50);
  }

  // Merlin the cat goes to sleep...
}

The delay is not

Narcoleptic.delay(10*SECOND);

You need to read the comment at the start of the example, to see what the library actually does.
What reason do you have to limit current consumption?
Tom… :slight_smile: