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

VRS51L1050-25-PG-ISPV3 参数 Datasheet PDF下载

VRS51L1050-25-PG-ISPV3图片预览
型号: VRS51L1050-25-PG-ISPV3
PDF下载: 下载PDF文件 查看货源
内容描述: 的Versa 8051 MCU的3.3V与IAP / ISP功能的Flash 64KB [Versa 8051 3.3V MCU with 64KB of IAP/ISP Flash]
分类和应用: 光电二极管微控制器
文件页数/大小: 49 页 / 505 K
品牌: RAMTRON [ RAMTRON INTERNATIONAL CORPORATION ]
 浏览型号VRS51L1050-25-PG-ISPV3的Datasheet PDF文件第27页浏览型号VRS51L1050-25-PG-ISPV3的Datasheet PDF文件第28页浏览型号VRS51L1050-25-PG-ISPV3的Datasheet PDF文件第29页浏览型号VRS51L1050-25-PG-ISPV3的Datasheet PDF文件第30页浏览型号VRS51L1050-25-PG-ISPV3的Datasheet PDF文件第32页浏览型号VRS51L1050-25-PG-ISPV3的Datasheet PDF文件第33页浏览型号VRS51L1050-25-PG-ISPV3的Datasheet PDF文件第34页浏览型号VRS51L1050-25-PG-ISPV3的Datasheet PDF文件第35页  
VRS51L1050  
//---------------------------------------------------//  
//---------------------------------------------------//  
//; EE_I²C_Read  
//  
EE_I²C_ByteWrite  
//---------------------------------------------------//  
//---------------------------------------------------//  
char EE_I²C_ByteWrite( char device, int address, char txdata)  
{
char EE_I²C_Read( char device)  
{
Int  
adrstemp = address;  
//--Wait Bus idle  
while((I2CCTRL1 & 0x08) != 0x00){};  
//--Wait Bus idle  
while((I2CCTRL1 & 0x08) != 0x00){};  
//Configure I²C ID and device number  
device = (device << 1)& 0x0E;  
I2CADDR = 0xA0 + device;  
I2CCTRL2 = 0x01;  
//Configure I²C ID and device number  
device = (device << 2)& 0x0E;  
I2CADDR = 0xA0 + device;  
//Set device in Read mode and restart  
//wait RXIF flag to get set  
I2CMASTER = 1;  
//--Wait for Data Byte to be loaded into I2CTX  
while(!I2CRXIF){};  
//Configure master mode Data direction = Write  
I2CCTRL2 &= 0xFE;  
//I²C Master Write  
//Generate a Stop  
I2CMASTER = 0;  
return I2CRX ;  
//Start I²C  
I2CMASTER = 1;  
//--Send MSB of address  
}//end of EE_I²C_RandomByteRead  
while((I2CSTATUS & 0x40) == 0x00){}; //wait TXIF flag to get set  
I2CTX = (adrstemp >> 8)& 0x1F;  
//Send lower 5 bit of MCB address  
//---------------------------------------------------//  
//--Send LSB of address  
while(!I2CTXIF){};  
I2CTX = address & 0x00FF;  
//  
I²C_MCONFIG  
//wait TXIF flag to get set  
//Send lLSB of address  
//---------------------------------------------------//  
void I²C_MConfig(void )  
{
//--Send Data  
while(!I2CTXIF){};  
I2CTX = txdata;  
//wait TXIF flag to get set  
//Send Data  
//Activate I²C SCL and SDA access to P1  
I2CPWME = 0xC0;  
while(!I2CTXIF){};  
I2CSTATUS &= 0xFD;  
//wait TXIF flag to get set  
//Clear MASTER -> Generate STOP  
//Set I²C Speed=Fosc/512 (43kHz @ 22.1184MHz)  
I2CCTRL1 = 0x84;  
if(I2CTXACK)  
return OK  
else  
while((I2CCTRL1 & 0x08) == 0x08){};  
//Wait I2CBUSY == 0  
//if NAKIF Flag == 0 -> ACK received  
I2CCTRL2 = 0x00;  
return BUG; //else device is nt responding  
}//end of EE_I²C_ByteWrite  
//configure I²C in master Transmit  
I2CADDR = 0xA0;  
//EEPROM Device Address  
}///end of I²C_MConfig  
//--------------------------------------------------------------//  
//; EE_I²C_RandomByteRead  
//--------------------------------------------------------------//  
char EE_I²C_RandomByteRead( char device, int address)  
{
int  
adrstemp = address;  
while((I2CCTRL1 & 0x08) != 0x00){};  
//--Wait Bus idle  
//Configure I²C ID and device number + Write address  
device = (device << 1)& 0x0E;  
I2CADDR = 0xA0 + device;  
I2CMASTER = 1;  
//Start I²C Transaction  
//--Send MSB of address  
while(!I2CTXIF){};  
//wait TXIF flag to get set  
I2CTX = (adrstemp >> 8)& 0x1F;  
//Send lower 5 bit of MCB address  
//--Send LSB of address  
while(!I2CTXIF){};  
I2CTX = address & 0x00FF;  
//wait TXIF flag to get set  
//Send lLSB of address  
while(!I2CTXIF){};  
I2CCTRL2 = 0x09;  
//wait TXIF flag to get set  
//Set device in Read mode and restart  
//--Wait for Data Byte to be loaded into I2CTX  
while(!I2CRXIF){};  
//wait RXIF flag to get set  
//Generate a Stop  
I2CSTATUS = 0x00;  
return I2CRX ;  
}//end of FRAM_I²C_RandomByteRead  
______________________________________________________________________________________________  
www.ramtron.com page 31 of 49  
 复制成功!