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
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.
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.
Nö. Es sind 10.000 garantiere Zyklen. In der Realität eher 15-20k.
Lothar M. schrieb: > Aber wie gesagt: aufpassen, nach 1000 > Löschzyklen ist das Flash kaputt. Eine Null mehr spendiert Atmel den Dingerchen doch - es sind 10.000 Flash/Write Zyklen. Nichtsdestotrotz ist es aber etwas, was man im Hinterkopf haben muss und nicht bei jedem Powerdown oder so machen sollte.
Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.