Skip to content

Commit fdfb864

Browse files
authored
Merge branch 'sparkfun:main' into main
2 parents afbf770 + 934c611 commit fdfb864

File tree

11 files changed

+571
-505
lines changed

11 files changed

+571
-505
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Add new issue to our main project
2+
3+
on:
4+
issues:
5+
types:
6+
- opened
7+
8+
jobs:
9+
add-to-project:
10+
name: Add issue to project
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/add-to-project@main
14+
with:
15+
# You can target a project in a different organization
16+
# to the issue
17+
project-url: https://github.com/orgs/sparkfun/projects/19
18+
github-token: ${{ secrets.DEFECT_ADD_TO_PROJECT }}

README.md

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,41 @@ SparkFun External EEPROM Arduino Library
55

66
[*SparkFun Qwiic EEPROM (COM-18355)*](https://www.sparkfun.com/products/18355)
77

8-
A simple to use I2C library for talking to any EEPROM. It uses the same template system found in the Arduino EEPROM library so you can use the same get() and put() functions.
8+
A simple-to-use I2C library for talking to any EEPROM. It uses the same template system found in the Arduino EEPROM library so you can use the same get() and put() functions.
99

1010
Various external EEPROMs have various interface specs (overall size, page size, write times, etc). This library works with all types and allows the various settings to be set at runtime. All read and write restrictions associated with pages are taken care of. You can access the external memory as if it was contiguous.
1111

12-
Best used with the Qwiic EEPROM: https://www.sparkfun.com/products/14764
12+
Once the library has been started, the memory type needs to be set, the following is an example for the [Qwiic 24xx512 EEPROM](https://www.sparkfun.com/products/18355):
1313

14-
For a list of all the EEPROM datasheets, please see [this repo](https://github.com/sparkfun/SparkFun_External_EEPROM_Arduino_Library_Docs). We don't want to store the PDFs in the library repo, otherwise every user will have to download all the PDFs just to install the library.
14+
myMem.setMemoryType(512);
15+
16+
Where *512* is the model (ie, 24LC**512**). Setting the memory type configures the memory size in bytes, the number of address bytes, and the page size in bytes. The following memory types are valid: 0, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1025, 2048
17+
18+
* **0** - 24xx00 / ie [24LC00](https://github.com/sparkfun/SparkFun_External_EEPROM_Arduino_Library_Docs/blob/main/24LC00%20-%20128.pdf)
19+
* **1** - 24xx01 / ie [24LC01B](https://github.com/sparkfun/SparkFun_External_EEPROM_Arduino_Library_Docs/blob/main/24LC01%20-%201k.pdf)
20+
* **2** - 24xx02 / ie [24LC02B](https://github.com/sparkfun/SparkFun_External_EEPROM_Arduino_Library_Docs/blob/main/24LC02%20-%202k.pdf)
21+
* **4** - 24xx04 / ie [CAT24C04](https://github.com/sparkfun/SparkFun_External_EEPROM_Arduino_Library_Docs/blob/main/24LC04%20-%204k%20Onsemi.PDF)
22+
* **8** - 24xx08 / ie [BR24G08](https://github.com/sparkfun/SparkFun_External_EEPROM_Arduino_Library_Docs/blob/main/24LC08%20-%208k%20Rohm.pdf)
23+
* **16** - 24xx16 / ie [24AA16](https://github.com/sparkfun/SparkFun_External_EEPROM_Arduino_Library_Docs/blob/main/24LC16%20-%2016k.pdf)
24+
* **32** - 24xx32 / ie [24LC32A](https://github.com/sparkfun/SparkFun_External_EEPROM_Arduino_Library_Docs/blob/main/24LC32%20-%2032k.pdf)
25+
* **64** - 24xx64 / ie [24FC64](https://github.com/sparkfun/SparkFun_External_EEPROM_Arduino_Library_Docs/blob/main/24LC64%20-%2064k.pdf)
26+
* **128** - 24xx128 / ie [24LC128](https://github.com/sparkfun/SparkFun_External_EEPROM_Arduino_Library_Docs/blob/main/24LC128-%20128k.pdf)
27+
* **256** - 24xx256 / ie [24AA256](https://github.com/sparkfun/SparkFun_External_EEPROM_Arduino_Library_Docs/blob/main/24LC256%20-%20256k.pdf)
28+
* **512** - 24xx512 / ie [24C512C](https://github.com/sparkfun/SparkFun_External_EEPROM_Arduino_Library_Docs/blob/main/24LC512%20-%20512k.pdf)
29+
* **1025** - 24xx1025 / ie [24LC1025](https://github.com/sparkfun/SparkFun_External_EEPROM_Arduino_Library_Docs/blob/main/24LC1024%20-%201Mbit.pdf)
30+
* **2048** - 24xx2048 / ie [AT24CM02](https://github.com/sparkfun/SparkFun_External_EEPROM_Arduino_Library_Docs/blob/main/24LC2048%20-%202Mbit.pdf)
31+
32+
For a list of all the EEPROM datasheets, please see [this repo](https://github.com/sparkfun/SparkFun_External_EEPROM_Arduino_Library_Docs). We don't want to store the PDFs in the library repo, otherwise, every user will have to download all the PDFs just to install the library.
33+
34+
Alternatively, the individual settings can be set. If setMemorySizeBytes/setAddressBytes/setPageSizeBytes() are called, they will overwrite any previous settings set by `setMemoryType()`.
35+
36+
myMem.setMemorySizeBytes(65536);
37+
myMem.setAddressBytes(2); // Set address bytes and page size after MemorySizeBytes()
38+
myMem.setPageSizeBytes(128);
39+
40+
Set the memory type, or set the memory settings, but not both.
41+
42+
This library is best used with the [Qwiic EEPROM](https://www.sparkfun.com/products/18355).
1543

1644
This library can be installed via the Arduino Library manager. Search for **SparkFun External EEPROM**.
1745

examples/Example1_BasicReadWrite/Example1_BasicReadWrite.ino

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
License: This code is public domain but you buy me a beer if you use this
77
and we meet someday (Beerware license).
88
Feel like supporting our work? Buy a board from SparkFun!
9-
https://www.sparkfun.com/products/14764
9+
https://www.sparkfun.com/products/18355
1010
1111
This example demonstrates how to read and write various variables to memory.
1212
@@ -48,10 +48,9 @@ void setup()
4848
// 24xx1025 - 1024000 bit / 128000 byte - 2 address byte, 128 byte page
4949
// 24xxM02 - 2097152 bit / 262144 byte - 2 address bytes, 256 byte page
5050

51-
// Valid types: 24xx00, 01, 02, 04, 08, 16, 32, 64, 128, 256, 512, 1025, 2048
52-
// myMem.setMemoryType(16);
51+
// Setting the memory type configures the memory size in bytes, the number of address bytes, and the page size in bytes.
5352

54-
// Default to the Qwiic 24xx512 EEPROM: https://www.sparkfun.com/products/14764
53+
// Default to the Qwiic 24xx512 EEPROM: https://www.sparkfun.com/products/18355
5554
myMem.setMemoryType(512); // Valid types: 0, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1025, 2048
5655

5756
if (myMem.begin() == false)

examples/Example2_AdvancedI2C/Example2_AdvancedI2C.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
License: This code is public domain but you buy me a beer if you use this
77
and we meet someday (Beerware license).
88
Feel like supporting our work? Buy a board from SparkFun!
9-
https://www.sparkfun.com/products/14764
9+
https://www.sparkfun.com/products/18355
1010
1111
This example demonstrates how to pass a custom EEPROM address and Wire.
1212
@@ -42,7 +42,7 @@ void setup()
4242
// Wire1.setClock(400000); //set I2C communication to 400kHz
4343
Wire1.begin();
4444

45-
// Default to the Qwiic 24xx512 EEPROM: https://www.sparkfun.com/products/14764
45+
// Default to the Qwiic 24xx512 EEPROM: https://www.sparkfun.com/products/18355
4646
myMem.setMemoryType(512); // Valid types: 0, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1025, 2048
4747

4848
#define EEPROM_ADDRESS 0b1010001 //0b1010(A2 A1 A0): A standard I2C EEPROM with the ADR0 bit set to VCC

examples/Example3_SettingsStruc/Example3_SettingsStruc.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
License: This code is public domain but you buy me a beer if you use this
77
and we meet someday (Beerware license).
88
Feel like supporting our work? Buy a board from SparkFun!
9-
https://www.sparkfun.com/products/14764
9+
https://www.sparkfun.com/products/18355
1010
1111
This example demonstrates how to record various user settings easily to EEPROM.
1212
@@ -50,7 +50,7 @@ void setup()
5050

5151
Wire.begin();
5252

53-
// Default to the Qwiic 24xx512 EEPROM: https://www.sparkfun.com/products/14764
53+
// Default to the Qwiic 24xx512 EEPROM: https://www.sparkfun.com/products/18355
5454
myMem.setMemoryType(512); // Valid types: 0, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1025, 2048
5555

5656
if (myMem.begin() == false)

examples/Example4_DetectSettings/Example4_DetectSettings.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ void setup()
5656
Serial.print("Detected pageSizeBytes: ");
5757
Serial.println(myMem.detectPageSizeBytes());
5858

59-
//detectWriteTimeMs is *not* automatically called at begin() and is
60-
//generally not needed. Write times are guaranteed to be under 5ms,
61-
//and we use polling by default so its use is limited.
59+
//The EEPROM write time is 5 ms for all EEPROMs currently manufactured.
60+
//Automatically detecting the write time is therefore not generally needed,
61+
//but it's here if needed.
6262
Serial.print("Detected page write time (ms): ");
6363
Serial.println(myMem.detectWriteTimeMs());
6464

examples/Example7_AutoDetectionTest/Example7_AutoDetectionTest.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,14 @@ void setup()
126126
myMem.write(0, myValue1); //(location, data)
127127

128128
byte myRead1 = myMem.read(0);
129-
Serial.print("I read: ");
129+
Serial.print("I read (should be 200): ");
130130
Serial.println(myRead1);
131131

132132
int myValue2 = -366;
133133
myMem.put(10, myValue2); //(location, data)
134134
int myRead2;
135135
myMem.get(10, myRead2); //location to read, thing to put data into
136-
Serial.print("I read: ");
136+
Serial.print("I read (should be -366): ");
137137
Serial.println(myRead2);
138138

139139
if (myMem.getMemorySizeBytes() > 16)
@@ -142,7 +142,7 @@ void setup()
142142
myMem.put(20, myValue3); //(location, data)
143143
float myRead3;
144144
myMem.get(20, myRead3); //location to read, thing to put data into
145-
Serial.print("I read: ");
145+
Serial.print("I read (should be -7.35): ");
146146
Serial.println(myRead3);
147147

148148
String myString = "Hi, I am just a simple test string"; //34 characters

0 commit comments

Comments
 (0)