12.07.2015 Views

ATmega32A Datasheet - Sunrom Technologies

ATmega32A Datasheet - Sunrom Technologies

ATmega32A Datasheet - Sunrom Technologies

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>ATmega32A</strong>The next code examples show assembly and C functions for reading the EEPROM. The examplesassume that interrupts are controlled so that no interrupts will occur during execution ofthese functions.Assembly Code ExampleEEPROM_read:; Wait for completion of previous writesbic EECR,EEWErjmp EEPROM_read; Set up address (r18:r17) in address registerout EEARH, r18out EEARL, r17; Start eeprom read by writing EEREsbi EECR,EERE; Read data from data registerin r16,EEDRretC Code Exampleunsigned char EEPROM_read(unsigned int uiAddress){/* Wait for completion of previous write */while(EECR & (1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!