eeprom w atmaga ...

witam

nic nie zapisuje, chyba, ze wczesniej wykonam odczyt spod tego adresu.... dlaczego? kompilator CodeVisionAVR ponizej kod:

#define EERE 0 #define EEWE 1 #define EEMWE 2 #define EERIE 3

void EEPROM_write(unsigned int Adr, unsigned char Dane) { #asm("cli"); while(EECR & (1<<EEWE )) EEAR = Adr; EEDR = Dane; EECR |= (1<<EEMWE); EECR |= (1<<EEWE); #asm("sei"); }

unsigned char EEPROM_read(unsigned char Adr) { while(EECR & (1<<EEWE)); EEAR= Adr; EECR |= (1<<EERE); return EEDR; }

Reply to
JareC
Loading thread data ...

Dnia 20.06.2007 JareC snipped-for-privacy@microsoft.com napisa³/a:

tu powinien byc srednik wg przykladu, mozliwe ze kompilator optymalizuje kod w taki sposob ze to nie wykonuje sie poprawnie bo niby tak czy inaczej powinno dzialac

Reply to
czerstwy

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.