Random verification errors when flashing a bare atmega328p via USBtinyISP

Check for loose connections.
Other than the programmer, is anything connected to the MOSI, MISO, or SCK pins?

An SD card module. Removed, no change:
13k works, 16k shows error, this time:
avrdude.exe: verification error, first mismatch at byte 0x0500

Are you certain the target is running at 8 MHz (when your program runs does the timing seem correct)?

Yes, 1000 millis are a second, roundabout. How precise must it be ?

Other than the target, is USBtinyISP powering anything else?
-> Not really, SD card signal lines removed, edit: a few mA from a DS1307 and a TSOP31238 IR Receiver. And a 3.3V regulator on the SD module (to feed LCD signals with 3.3V when drained by atmega outputs)

I also have the impression that serial upload is faster ( or is it due to the fact that the other system runs at 16MHz ?)
I'll give it a test try, though it should not be a solution.
My goal was to build a naked system with just the required stuff: no external oscillator, no serial line, no bootloader.

Is there a way to write to flash from a sketch ( how does bootloader do it ? ) ???
I could run a kind of memory check then ?

What is strange to me is that an address ( 0x0500 ), which obviously works well in the 13k sketch, now fails with a 16k sketch.
And that the failing address varies.

Thanks, so far. Any more ideas welcome :wink: