当前位置:网站首页>20、 EEPROM memory (AT24C02) (similar to AD)
20、 EEPROM memory (AT24C02) (similar to AD)
2022-07-06 03:51:00 【Can't go on the ground】
EEPROM Memory (AT24C02): Power down data is also saved
//************EEPROM Memory ***********************************************
unsigned char eeprom_read(unsigned char add)// from EEPROM( Which address ) Reading data
{
unsigned char temp;
IIC_Start();
IIC_SendByte(0xa0);// Allow writing ( read 1/ Write 0) 1010 000 0/1
IIC_WaitAck();
IIC_SendByte(add);// Tell it the address
IIC_WaitAck();
IIC_Stop();
IIC_Start();
IIC_SendByte(0xa1);// Allow to read ( read 1/ Write 0) 1010 000 0/1
IIC_WaitAck();
temp = IIC_RecByte();// Reading data
IIC_Stop();
return temp;
Delayms(5);//( Read continuously , Write in succession , Only the first one is right ) Need a delay
}
void eeprom_write(unsigned char add, dat)// Go to EEPROM Writing data ( Where is the writing , What to write )
{
IIC_Start();
IIC_SendByte(0xa0);// Allow writing ( read 1/ Write 0) 1010 000 0/1
IIC_WaitAck();
IIC_SendByte(add);// Tell it the address
IIC_WaitAck();
IIC_SendByte(dat);// Write content
IIC_WaitAck();
IIC_Stop();
Delayms(5);// Need a delay
}
//***********************************************************************
application :
EEPROM_write(0x01,32);// towards 0x01 Write 32
dat1 = EEPROM_read(0x01);// read 0x01 The data of (dat1 It's a digital tube )
边栏推荐
- Pointer for in-depth analysis (problem solution)
- 有条件地 [JsonIgnore]
- MySQL 中的数据类型介绍
- Hashcode and equals
- 施努卡:什么是视觉定位系统 视觉系统如何定位
- Blue Bridge Cup - day of week
- [Massey] Massey font format and typesetting requirements
- 【按键消抖】基于FPGA的按键消抖模块开发
- Mathematical modeling regression analysis relationship between variables
- 简易博客系统
猜你喜欢
WPF效果第一百九十一篇之框选ListBox
[meisai] meisai thesis reference template
BUAA calculator (expression calculation - expression tree implementation)
Ks008 SSM based press release system
BUAA计算器(表达式计算-表达式树实现)
Exchange bottles (graph theory + thinking)
Network security - Security Service Engineer - detailed summary of skill manual (it is recommended to learn and collect)
Cubemx 移植正点原子LCD显示例程
SAP ALV cell level set color
ESP32_ FreeRTOS_ Arduino_ 1_ Create task
随机推荐
【Qt5】Qt QWidget立刻出现并消失
2.2 STM32 GPIO操作
Overview of super-resolution reconstruction of remote sensing images
3.2 detailed explanation of rtthread serial port device (V2)
Error 1045 (28000): access denied for user 'root' @ 'localhost' (using password: no/yes
Ks008 SSM based press release system
简述C语言中的符号和链接库
Shell pass parameters
The solution of permission denied (750 permissions should be used with caution)
STC8H开发(十二): I2C驱动AT24C08,AT24C32系列EEPROM存储
SWC introduction
No qualifying bean of type ‘......‘ available
1、工程新建
An article will give you a comprehensive understanding of the internal and external components of "computer"
A brief introduction to symbols and link libraries in C language
Align items and align content in flex layout
Quick sort function in C language -- qsort
KS008基于SSM的新闻发布系统
Failure causes and optimization methods of LTE CSFB
Alibaba testers use UI automated testing to achieve element positioning