Zitat Zitat von rogerberglen Beitrag anzeigen
Ich habe jetzt eine Routine geschrieben die mir die benötigten Daten ins EEprom schreiben soll. Leider wird das Bit EEPE im EECR-Register nicht zurückgesetzt, so daß nur der erste Wert eingeschrieben wird. Alles andere nicht.

ee_loop:

lpm temp, Z+
cpi temp, 0xFF
breq ee_end
out EEAR, temp2
out EEDR, temp
sbi EECR, EEMPE
sbi EECR, EEPE
inc temp2
rjmp ee_loop

ee_end:
Hallo,
geht es noch um den Simulator?

In Deinem Programm fehlt in der loop jedenfalls das Warten bis EEPE von der Hardware gelöscht ist. Erst dann kann ein weiteres Byte ins EEPROM geschrieben werden.

In einem älteren ATtiny24 Datenblatt ist Folgendes beschrieben:

5.3.5 Write
To write a location, the user must write the address into EEAR and the data into EEDR. If the EEPMn bits are 0b10, writing the EEPE (within four cycles after EEMPE is written) will trigger the write operation only (programming time is given in Table 5-1 on page 22). The EEPE bit remains set until the write operation completes. If the location to be written has not been erased before write, the data that is stored must be considered as lost. While the device is busy with programming, it is not possible to do any other EEPROM operations.

In neueren Microchip Datenblättern fand ich das nicht so gut beschrieben.

Gruß
Searcher