ATmega88PA Automotive Atmel Corporation, ATmega88PA Automotive Datasheet - Page 19

no-image

ATmega88PA Automotive

Manufacturer Part Number
ATmega88PA Automotive
Description
Manufacturer
Atmel Corporation
7701E–AVR–02/11
Note:
Assembly Code Example
C Code Example
EEPROM_write:
void EEPROM_write(unsigned char ucAddress, unsigned char ucData)
{
}
; Wait for completion of previous write
sbic EECR,EEPE
rjmp EEPROM_write
; Set Programming mode
ldi
out
; Set up address (r17) in address register
out EEARL, r17
; Write data (r16) to data register
out EEDR,r16
; Write logical one to EEMPE
sbi EECR,EEMPE
; Start eeprom write by setting EEPE
sbi EECR,EEPE
ret
/* Wait for completion of previous write */
while(EECR & (1<<EEPE))
/* Set Programming mode */
EECR = (0<<EEPM1)|(0>>EEPM0)
/* Set up address and data registers */
EEARL = ucAddress;
EEDR = ucData;
/* Write logical one to EEMPE */
EECR |= (1<<EEMPE);
/* Start eeprom write by setting EEPE */
EECR |= (1<<EEPE);
The code examples are only valid for
addressing mode.
;
r16, (0<<EEPM1)|(0<<EEPM0)
EECR, r16
Atmel ATtiny24/44/84 [Preliminary]
Atmel
®
ATtiny24 and
Atmel
ATtiny44, using 8-bit
19

Related parts for ATmega88PA Automotive