36
9140CINDCO02/10
ATA8741
The next code examples show assembly and C functions for reading the EEPROM. The exam-
ples assume that interrupts are controlled so that no interrupts will occur during execution of
these functions.
Note:
The code examples are only valid for ATtiny24 and ATtiny44, using 8-bit addressing mode.
13.3.6
Preventing EEPROM Corruption
During periods of low V
CC
, the EEPROM data can be corrupted because the supply voltage is
too low for the CPU and the EEPROM to operate properly. These issues are the same as for
board level systems using EEPROM, and the same design solutions should be applied.
An EEPROM data corruption can be caused by two situations when the voltage is too low. First,
a regular write sequence to the EEPROM requires a minimum voltage to operate correctly. Sec-
ondly, the CPU itself can execute instructions incorrectly, if the supply voltage is too low.
EEPROM data corruption can easily be avoided by following this design recommendation:
Keep the AVR RESET active (low) during periods of insufficient power supply voltage. This can
be done by enabling the internal Brown-out Detector (BOD). If the detection level of the internal
BOD does not match the needed detection level, an external low V
CC
 reset protection circuit can
be used. If a reset occurs while a write operation is in progress, the write operation will be com-
pleted provided that the power supply voltage is sufficient.
Assembly Code Example
EEPROM_read:
; Wait for completion of previous write
sbic EECR,EEPE
rjmp EEPROM_read
; Set up address (r17) in address register
out  EEARL, r17
; Start eeprom read by writing EERE
sbi  EECR,EERE
; Read data from data register
in   r16,EEDR
ret
C Code Example
unsigned char EEPROM_read(unsigned char ucAddress)
{
/* Wait for completion of previous write */
while(EECR & (1<
;
/* Set up address register */
EEARL = ucAddress;
/* Start eeprom read by writing EERE */
EECR |= (1<
/* Return data from data register */
return EEDR;
}
相关PDF资料
ATA8742-PXQW MCU W/TRANSMITTER ASK/FSK 24QFN
ATA8743-PXQW MCU W/TRANSMITTER ASK/FSK 24QFN
ATAVRRZ200 KIT DEMO AT86RF230
AV101-12LF ATTENUATOR HIP3 0.70-1GHZ 8-SOIC
AV102-12LF ATTENUATOR HIP3 1.7-2GHZ 8SOIC
AV113-12LF ATTENUATOR HIP3 2.1-2.3GHZ 8SOIC
AXUV100G SENSOR ELECTRON DETECTION
B0205F50200AHF XFRMR BALUN RF 200-500MHZ 1608
相关代理商/技术参数
ATA8742 制造商:ATMEL 制造商全称:ATMEL Corporation 功能描述:Microcontroller with UHF ASK/FSK Transmitter
ATA8742C- PXQW 制造商:Atmel Corporation 功能描述:Embedded C incl RF Tx for 433 MHz
ATA8742C-PXQW 功能描述:8位微控制器 -MCU RoHS:否 制造商:Silicon Labs 核心:8051 处理器系列:C8051F39x 数据总线宽度:8 bit 最大时钟频率:50 MHz 程序存储器大小:16 KB 数据 RAM 大小:1 KB 片上 ADC:Yes 工作电源电压:1.8 V to 3.6 V 工作温度范围:- 40 C to + 105 C 封装 / 箱体:QFN-20 安装风格:SMD/SMT
ATA8742C-PXQW-1 功能描述:EMBEDDED INCL RF TX FOR 433 MHZ 制造商:microchip technology 系列:- 包装:剪切带(CT) 零件状态:在售 频率:429MHz ~ 439MHz 应用:通用 调制或协议:UHF 数据速率(最大值):32kbps 功率 - 输出:7.5dBm 电流 - 传输:9.8mA 数据接口:SPI 天线连接器:PCB,表面贴装 存储容量:4kB 闪存,256B EEPROM,256B SRAM 特性:- 电压 - 电源:2 V ~ 4 V 工作温度:-40°C ~ 85°C 封装/外壳:24-VQFN 裸露焊盘 标准包装:1
ATA8742-PXQW 功能描述:8位微控制器 -MCU Embedded uC incl RF Tx for 433 MHz RoHS:否 制造商:Silicon Labs 核心:8051 处理器系列:C8051F39x 数据总线宽度:8 bit 最大时钟频率:50 MHz 程序存储器大小:16 KB 数据 RAM 大小:1 KB 片上 ADC:Yes 工作电源电压:1.8 V to 3.6 V 工作温度范围:- 40 C to + 105 C 封装 / 箱体:QFN-20 安装风格:SMD/SMT
ATA8743 制造商:ATMEL 制造商全称:ATMEL Corporation 功能描述:Microcontroller with UHF ASK/FSK Transmitter
ATA8743C- PXQW 功能描述:8位微控制器 -MCU Embedded uC incl RF Tx for 315 MHz RoHS:否 制造商:Silicon Labs 核心:8051 处理器系列:C8051F39x 数据总线宽度:8 bit 最大时钟频率:50 MHz 程序存储器大小:16 KB 数据 RAM 大小:1 KB 片上 ADC:Yes 工作电源电压:1.8 V to 3.6 V 工作温度范围:- 40 C to + 105 C 封装 / 箱体:QFN-20 安装风格:SMD/SMT
ATA8743C-PXQW 制造商:Atmel Corporation 功能描述:EMBEDDED ?C INCL RF TX FOR 868 MHZ - Trays 制造商:Atmel Corporation 功能描述:EMBEDDED C INCL 868MHZ TX