Byte ablegen im Flash vom ATtiny102 möglich?

Gast #4905599
Lesenswert?

Hallo, zusammen!

Möchte gerne ein Byte bei Bedarf im Flash vom ATtiny102 ablegen. Nun bin 
ich etwas konfus über das Datenblatt. Da steht:


Seite 185: Internal programming (self-programming) operations to NVM 
have been disabled and the NVM therefore appears to the application 
software as read-only. Internal write or erase operations of the NVM 
will not be successful.

Seite 191: ATtiny102/ATtiny104 supports external programming and 
internal programming (self-programming).

Seite 192: The Flash erase operations can only performed for the entire 
Flash sections.

Seite 194: The device provides a Self-Programming mechanism for 
downloading and uploading program code by the MCU itself. Only 
WORD_WRITE and PAGE_ERASE commands are supported in self-programming.
The CPU can execute Page Erase and Word Write in the NVM code memory 
section to perform programming operations.


Das verstehe ich jetzt nicht so ganz. Kann ich jetzt bei Bedarf ein Byte 
im Flash ablegen oder nicht? Page Erase für 64 Bytes vorher?

Vielen Dank!
Ingo
#4905613
Lesenswert?

Ingo Hütlein schrieb:
> Das verstehe ich jetzt nicht so ganz. Kann ich jetzt bei Bedarf ein Byte
> im Flash ablegen oder nicht?

Du kannst bei Flash Write die Bits nur in eine Richtung kippen, 
üblicherweise 1->0.

Rückgangig macht das nur die Erase Operation, die geht aber nur für 
ganze "Sections", deren Größe im Datenblatt steht.

Wegen der begrenzten Zyklen sollte man das nicht zu oft machen.
Moderator (Firma: Titel) Persönliche Seite #4905657
Lesenswert?

Ingo Hütlein schrieb:
> Das verstehe ich jetzt nicht so ganz. Kann ich jetzt bei Bedarf ein Byte
> im Flash ablegen oder nicht? Page Erase für 64 Bytes vorher?
Und noch davor die 64 Bytes ins RAM laden dort manipulieren und dann die 
ganze Page wieder sichern. Aber wie gesagt: aufpassen, nach 1000 
Löschzyklen ist das Flash kaputt.

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren