eeprom beispiele für cvavr

(Firma: Nisch-Aufzüge) Persönliche Seite #465604
Lesenswert?

/ EEPROM access example

// CodeVisionAVR C Compiler
// (C) 2000-2002 HP InfoTech S.R.L.
// www.hpinfotech.ro

// Chip: AT90S2313
// Memory Model: TINY
// Data Stack Size: 64 bytes

flash char f[]="This is a test";
#pragma warn-
eeprom char e[16];
#pragma warn+
char r[16];

void main (void)
{
char flash *ptr_to_flash;
char eeprom *ptr_to_eeprom;
char *ptr_to_ram;

// copy the string f from FLASH to
// the string e in EEPROM
ptr_to_flash=f;
ptr_to_eeprom=e;
while (*ptr_to_flash)
      *ptr_to_eeprom++=*ptr_to_flash++;

// copy the string e from EEPROM to
// the string r in RAM
ptr_to_eeprom=e;
ptr_to_ram=r;
while (*ptr_to_eeprom)
      *ptr_to_ram++=*ptr_to_eeprom++;

// stop here
while (1);
}

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