当前位置:网站首页>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 )
边栏推荐
- [Qt5] QT QWidget immediately appears and disappears
- 多项目编程极简用例
- WPF effect Article 191 box selection listbox
- 2.13 weekly report
- Do you know cookies, sessions, tokens?
- Blue Bridge Cup - Castle formula
- Introduction to DeNO
- Failure causes and optimization methods of LTE CSFB
- C#(三十)之C#comboBox ListView treeView
- ESP32_ FreeRTOS_ Arduino_ 1_ Create task
猜你喜欢

How to modify field constraints (type, default, null, etc.) in a table

3.1 rtthread 串口设备(V1)详解

C#(三十一)之自定义事件

Blue Bridge Cup - Castle formula

Data analysis Seaborn visualization (for personal use)

Teach you to build your own simple BP neural network with pytoch (take iris data set as an example)

C#(二十九)之C#listBox checkedlistbox imagelist

C (thirty) C combobox listview TreeView

Serial port-rs232-rs485-ttl

C#(二十八)之C#鼠标事件、键盘事件
随机推荐
Cubemx transplantation punctual atom LCD display routine
[practical exercise] face location model based on skin color
C language -- structs, unions, enumerations, and custom types
Network security - Security Service Engineer - detailed summary of skill manual (it is recommended to learn and collect)
Why do you want to start pointer compression?
2.2 fonctionnement stm32 GPIO
Maxay paper latex template description
C#(二十八)之C#鼠标事件、键盘事件
Shell pass parameters
施努卡:什么是视觉定位系统 视觉系统如何定位
Schnuka: 3D vision detection application industry machine vision 3D detection
Cf464e the classic problem [shortest path, chairman tree]
Quick sort function in C language -- qsort
C#(三十一)之自定义事件
Take you to wechat applet development in 3 minutes
User experience index system
自动化测试的好处
A brief introduction to symbols and link libraries in C language
Flask learning and project practice 9: WTF form verification
Chinese brand hybrid technology: there is no best technical route, only better products