Timonel v0.9
Pre-release
Pre-release
Notes:
In this version, the first-page garbage issue after a writing retry when an I2C transmission error occurs is solved. The temporary page buffer is cleared in a way that works before writing the application to flash memory again.
The ATtiny85 datasheet is confusing on how to clear this buffer. Setting CTBP in the SPMCSR register:
SPMCSR |= (1 << CTPB);
is not enough. So this code (or similar) has to be implemented to properly clearing the temporary buffer:
__SPM_REG = (_BV(CTPB) | _BV(__SPM_ENABLE));
asm volatile("spm");
This issue was spotted and its solution suggested by Joey Morin @ AVRFreaks.net