;Put 1 byte in temp to address pointed by Z.
put_ieep_byte:
sbic EECR,EEWE ;Wait for completion of previous write
rjmp put_ieep_byte
cli
out EEARH,zh ;Set up address (in Z ) in
address register
out EEARL,zl
out EEDR,temp ;Write data (temp) to data register
sbi EECR,EEMWE ;Write logical one to EEMWE
sbi EECR,EEWE ;Start eeprom write by setting EEWE
sei
ret
But you don't really need to CLI till just before the SBI EECR.
That's the only part that has to be atomic.
This does assume that your ISR preserves Z
--
Feel the power of the dark side! Atmel AVR