ata6616 ATMEL Corporation, ata6616 Datasheet - Page 43

no-image

ata6616

Manufacturer Part Number
ata6616
Description
Microcontroller With Lin Transceiver, 5v Regulator And Watchdog
Manufacturer
ATMEL Corporation
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
ata6616-P3QW
Manufacturer:
ATMEL
Quantity:
950
Part Number:
ata6616-P3QW
Manufacturer:
ATMEL/爱特梅尔
Quantity:
20 000
Part Number:
ata6616C
Manufacturer:
ATMEL/爱特梅尔
Quantity:
20 000
Part Number:
ata6616C-P3QW
Manufacturer:
ATMEL
Quantity:
887
9132A–AUTO–10/08
DRAFT
The calibrated Oscillator is used to time the EEPROM accesses. Make sure the Oscillator fre-
quency is within the requirements described in
Register” on page
The following code examples show one assembly and one C function for erase, write, or atomic
write of the EEPROM. The examples assume that interrupts are controlled (e.g., by disabling
interrupts globally) so that no interrupts will occur during execution of these functions.
Assembly Code Example
C Code Example
EEPROM_write:
void EEPROM_write(unsigned char ucAddress, unsigned char ucData)
{
}
; Wait for completion of previous write
sbic
rjmp
; Set Programming mode
ldi
out
; Set up address (r18:r17) in address register
out
out
; Write data (r16) to data register
out
; Write logical one to EEMPE
sbi
; Start eeprom write by setting EEPE
sbi
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 */
EEAR = ucAddress;
EEDR = ucData;
/* Write logical one to EEMPE */
EECR |= (1<<EEMPE);
/* Start eeprom write by setting EEPE */
EECR |= (1<<EEPE);
;
EECR,EEPE
EEPROM_write
r16, (0<<EEPM1)|(0<<EEPM0)
EECR, r16
EEARH, r18
EEARL, r17
EEDR, r16
EECR,EEMPE
EECR,EEPE
62.
ATA6616/ATA6617 [Preliminary]
Section 4.5.5.1 “OSCCAL – Oscillator Calibration
43

Related parts for ata6616