欢迎访问ic37.com |
会员登录 免费注册
发布采购

ATTINY2313-20SUR 参数 Datasheet PDF下载

ATTINY2313-20SUR图片预览
型号: ATTINY2313-20SUR
PDF下载: 下载PDF文件 查看货源
内容描述: [RISC Microcontroller, 8-Bit, FLASH, AVR RISC CPU, 20MHz, CMOS, PDSO20, 0.300 INCH, GREEN, PLASTIC, MS-013AC, SOIC-20]
分类和应用: 闪存微控制器
文件页数/大小: 223 页 / 1792 K
品牌: ATMEL [ ATMEL ]
 浏览型号ATTINY2313-20SUR的Datasheet PDF文件第14页浏览型号ATTINY2313-20SUR的Datasheet PDF文件第15页浏览型号ATTINY2313-20SUR的Datasheet PDF文件第16页浏览型号ATTINY2313-20SUR的Datasheet PDF文件第17页浏览型号ATTINY2313-20SUR的Datasheet PDF文件第19页浏览型号ATTINY2313-20SUR的Datasheet PDF文件第20页浏览型号ATTINY2313-20SUR的Datasheet PDF文件第21页浏览型号ATTINY2313-20SUR的Datasheet PDF文件第22页  
The calibrated Oscillator is used to time the EEPROM accesses. Make sure the Oscilla-  
tor frequency is within the requirements described in “Oscillator Calibration Register –  
OSCCAL” on page 25.  
The following code examples show one assembly and one C function for writing to the  
EEPROM. The examples assume that interrupts are controlled (e.g. by disabling inter-  
rupts globally) so that no interrupts will occur during execution of these functions.  
Assembly Code Example  
EEPROM_write:  
; Wait for completion of previous write  
sbic EECR,EEPE  
rjmp EEPROM_write  
; Set up address (r17) in address register  
out EEAR, 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  
C Code Example  
void EEPROM_write(unsigned int uiAddress, unsigned char ucData)  
{
/* Wait for completion of previous write */  
while(EECR & (1<<EEPE))  
;
/* Set up address and data registers */  
EEAR = uiAddress;  
EEDR = ucData;  
/* Write logical one to EEMPE */  
EECR |= (1<<EEMPE);  
/* Start eeprom write by setting EEPE */  
EECR |= (1<<EEPE);  
}
18  
ATtiny2313/V  
2543F–AVR–08/04  
 复制成功!