Extend EEPROM via I2C connection with ESP8266 and make it use for storing the data

Status
Not open for further replies.
Look for an ESP8266 module that brings the I2C interface to external pins and connect them directly to the external EEPROM. The ESP8266-01 module (the 8 pin one) is not suitable due to lack of IO pins.

Note that the ATHC02C only has 256 addresses so you won't be able to store much in it.

Brian.
 


From what you specified above, it will not be stored a bulk data, but just settings at large time intervals. It will not be necessary to use an external EEPROM memory, as the ESP8266 modules has plenty of r/w FLASH available. Note that these modules has a limited I/O available, and this way you would not waste 2 pins for that.
 


you can store any datatype to the eeprom
char - 1byte, int type -2bytes
so, its better to store the char datatype. in case you want to store the wifi credentials to eeprom like ssid and password, you need to specify the address where you want to store the char. begin your eeprom and specify the size. First specify the size of char array where you want to store your ssid and password. use the eeprom.write(addr,data);
You can do it like this


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
eeprom.begin(length of address);
 
//to write to eeprom
 
char ssid[30];//store ssid here
charpass[30];//store pass here
 
for (n=0;n<ssid.length()+1;n++){
 eeprom.write(n,ssid[n]);
}
 
for(int n= 31; n<pass.length()+1;++n){
 eeprom.write(n,pass[n]);
}
 
//to read from the eeprom
 
char datassid[];
char datapass[];
 
for(int r=0; r<30 r++){
  datassid += eeprom.read(r-1); 
}
//similarly for datapass

 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…