Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #5865
    StefanA
    Participant

    When I download a sketch from the Arduino IDE to my Mini Ultra 8 MHz Plus I get the following error message:

    “Binary sketch size: 1 108 bytes (of a 30 720 byte maximum)
    avrdude: verification error, first mismatch at byte 0x0056
    0x7e != 0xfe
    avrdude: verification error; content mismatch”

    But the sketch seems to work just as it should anyways. Should I just ignore the error message?

    Do you have any example code for how to best utilise the battery voltage monitor connected to pin A6?

    #6111
    LIM PHANG MOH
    Keymaster

    Hi Stefan,

    “Binary sketch size: 1 108 bytes (of a 30 720 byte maximum)
    avrdude: verification error, first mismatch at byte 0x0056
    0x7e != 0xfe
    avrdude: verification error; content mismatch”

    If your connection with the FTDI is not properly secured or sometimes before the completion of the upload, you remove/accidentally touch, it could affect the read back of the flash content during the verification stage of upload. The write stage was completed without error, hence the code runs as you would have expected.

    Do you have any example code for how to best utilise the battery voltage monitor connected to pin A6?

    Here you go:

    float readBattery(void)
    {
      int count;
      int adcValue;
      float batteryVoltage;
    
      // Discard 1st reading (inaccurate)
      adcValue = analogRead(A6);
      adcValue = 0;
    
      // Average battery voltage reading
      for (count = 0; count < 10; count++)
      {
        adcValue += analogRead(A6);
      }
      adcValue = adcValue / 10;
      batteryVoltage = (105.6 * adcValue) / 22528;
    
      return batteryVoltage;
    }
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.