Issue title: [bug #34892] USBasp + ATMEGA328 broken in current SVN
 Issue body: Tomaž <None>
Thu 24 Nov 2011 07:39:50 PM UTC

Hi

Sorry for yet another mail. While working on the "part parent" patch I noticed that the current SVN head doesn't work with my setup: USBasp programmer and ATMEGA 328.

It appears it will not program the chip at all and also always fails the verification step:

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0080
0xff != 0x2a
avrdude: verification error; content mismatch

The exact command line I'm using is:

avrdude -F -p m328p -c usbasp -e -U flash:w:blink.hex

This same setup is working with avrdude 5.10

Using svn-bisect I found out that the bug appeared in revision 1007 (1006 is the last one working correctly).

Since 1007 is a "mega-commit" it's hard to find what exactly introduced the bug. I've been looking at the diff and can't spot it.

If someone more familiar with the code can help, I can give some more debugging info.

Thanks
Tomaž

[file #24443: avrdude_stderr_head](https://savannah.nongnu.org/bugs/download.php?file_id=24443)
[file #24442: avrdude_stderr_5_10](https://savannah.nongnu.org/bugs/download.php?file_id=24442)

This issue was migrated from https://savannah.nongnu.org/bugs/?34892
 Comments: 
 Comment 0: Joerg Wunsch <joerg_wunsch>
Thu 24 Nov 2011 07:50:41 PM UTC

Sorry for the breakage.  It appears parts of the device can
be programmed correctly, and the problem apparently starts
at the second page or block.

Can you please run your command with -vvvv, and attach the
stderr output here as a file?  You could also attach the
same output for v5.10 if you want, but of course, the output
from the failing version is more important.
 Comment 1: Tomaž Šolc <avian>
Thu 24 Nov 2011 08:08:08 PM UTC

Thanks for the quick reply.

avrdude_stderr_5_10 is from the working 5.10 release.

avrdude_stderr_head is from the broken SVN head.

(**[file #24442](https://savannah.nongnu.org/support/download.php?file_id=24442)**, **[file #24443](https://savannah.nongnu.org/support/download.php?file_id=24443)**)
 Comment 2: Rene Liebscher <rliebscher>
Sun 08 Jan 2012 08:11:58 PM UTC

Is this solved by svn revision 1034?

(svn comment:
Reported by Jason Kotzin:

- usbasp.c (usbasp_spi_paged_load, usbasp_spi_paged_write):Fix buffer address calculation.
)
 Comment 3: Tomaž Šolc <avian>
Sat 14 Jan 2012 05:17:12 PM UTC

Yes, I tried svn revision 1039 and the problem appears to be solved. Thanks!
{'source': 'GithubIssues', 'repo_name_with_owner': 'avrdudes/avrdude', 'issue_id': 1077131849, 'repo_stars': 218.0}