36
9152BINDCO02/10
ATA8743
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资料
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
B0310J50100AHF XFRMR BALUN RF 300-1000MHZ 0805
B0322J5050AHF XFRMR BALUN RF 300-2200MHZ 0805
相关代理商/技术参数
ATAB5275 功能描述:射频开发工具 LF Tx Antenna driver board (TPMS) RoHS:否 制造商:Taiyo Yuden 产品:Wireless Modules 类型:Wireless Audio 工具用于评估:WYSAAVDX7 频率: 工作电源电压:3.4 V to 5.5 V
ATAB5276 功能描述:射频开发工具 1A Antenna Driver Demoboard RoHS:否 制造商:Taiyo Yuden 产品:Wireless Modules 类型:Wireless Audio 工具用于评估:WYSAAVDX7 频率: 工作电源电压:3.4 V to 5.5 V
ATAB5278 功能描述:射频开发工具 LF Tx Antenna driver board (PEG) RoHS:否 制造商:Taiyo Yuden 产品:Wireless Modules 类型:Wireless Audio 工具用于评估:WYSAAVDX7 频率: 工作电源电压:3.4 V to 5.5 V
ATAB5279 功能描述:射频开发工具 LF Transmitter with ATA5279 RoHS:否 制造商:Taiyo Yuden 产品:Wireless Modules 类型:Wireless Audio 工具用于评估:WYSAAVDX7 频率: 工作电源电压:3.4 V to 5.5 V
ATAB5282 功能描述:BOARD EVAL LF 125KHZ ANT DVR 3CH RoHS:是 类别:RF/IF 和 RFID >> RFID 评估和开发套件及电路板 系列:Smart RF 产品培训模块:M24LR64 Dual Interface EEPROM 标准包装:1 系列:- 类型:读取器模块 频率:13.56MHz 适用于相关产品:M24LR-64-R 已供物品:2 根基准天线,I2C 和 RFID 读取器,样品 其它名称:497-10480
ATAB5283 功能描述:射频开发工具 LF Rx Board 1 channel (TPMS) RoHS:否 制造商:Taiyo Yuden 产品:Wireless Modules 类型:Wireless Audio 工具用于评估:WYSAAVDX7 频率: 工作电源电压:3.4 V to 5.5 V
ATAB5423-3-B 功能描述:射频开发工具 UHF Transceiver Base station Board 315MHz RoHS:否 制造商:Taiyo Yuden 产品:Wireless Modules 类型:Wireless Audio 工具用于评估:WYSAAVDX7 频率: 工作电源电压:3.4 V to 5.5 V
ATAB5423-3-WB 功能描述:射频开发工具 UHF TRx Application Board 315MHz RoHS:否 制造商:Taiyo Yuden 产品:Wireless Modules 类型:Wireless Audio 工具用于评估:WYSAAVDX7 频率: 工作电源电压:3.4 V to 5.5 V