mmattice wrote:I've run into this as well and tracked the problem down to the 16 bit integer that stores the current read address (address, defined on line 70 of main.c).
Basically, it overflows at 64kbytes, and starts reading the beginning of the chip again. If address was just one bit larger, the >> 9 later down in spi_rw (where address overflows) would turn the address into a proper word address for the read commands.
Now, this wouldn't fix 256kbyte chips as the load extended address byte command ($4d) doesn't seem to be supported at all by the USBtinyISP.
There may be a way to squeeze at least the fix for 128k chips into the tiny2313, but my compiler starts the firmware out at 8 bytes over sized before I change the type of address to uint32_t.
I've reviewed the code and I'm forced to concur. The USBTinyISP appears to be incapable of addressing memory addresses in excess of 64 KB, and while I can't be sure, it seems reasonable to suppose than it might brick the AVR chip if it attempts to write a nondeterministic value to the fuses, which could easily be located at address(es) 0, 1, 2, 3, etc...
Oh, actually I disagree about the line number. It's line 71, not 70.
Can anyone tell me if mmattice is wrong here?