You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-22Lines changed: 22 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,36 +7,31 @@ _This manual is released by the author into the public domain._
7
7
- Connect Arduino 5V to EEPROM Vcc.
8
8
9
9
#Arduino set-up:
10
-
- Open the Arduino IDE.
11
-
- Connect Arduino (I used USB).
12
-
- Choose correct board and serial port in Arduino IDE.
13
-
- Upload code to Arduino using the IDE.
14
-
- Open serial console (Ctrl+Shift+M).
15
-
- The board waits 4 seconds after Arduino reset (end of upload).
16
-
- Then it promps for I²C address.
17
-
- If you miss this prompt, just enter the address.
18
-
- If you don't know the address, enter the character 'P'.
10
+
* Open the Arduino IDE.
11
+
* Connect Arduino (I used USB).
12
+
* Choose correct board and serial port in Arduino IDE.
13
+
* Upload code to Arduino using the IDE.
14
+
* Open serial console (Ctrl+Shift+M).
15
+
* The board waits 4 seconds after Arduino reset (end of upload).
16
+
* Then it promps for I²C address.
17
+
* If you miss this prompt, just enter the address.
18
+
* If you don't know the address, enter the character 'P'.
19
19
20
20
#Getting started:
21
-
If you opened the serial console soon enough, you'll be prompted for an I²C address or a 'P'.
22
-
23
-
If you did not open the serial console within four seconds after the Arduino reset, you will not see the prompt, but the Arduino will still patiently wait for your input.
21
+
If you opened the serial console soon enough, you'll be prompted for an I²C address or a 'P'. If you did not open the serial console within four seconds after the Arduino reset, you will not see the prompt, but the Arduino will still patiently wait for your input.
24
22
25
23
Enter the address, or the character 'P'.
26
24
27
-
##The address:
28
-
__The Arduino wire library works with 7-bit adresses.__
29
-
30
-
The Arduino Serial library can easily parse decimal values, not hex codes.
31
-
32
-
Therefore the default T24C02A address 0xA0 is rendered thus:
25
+
##Setting the I²C address:
26
+
__The Arduino wire library works with 7-bit I²C adresses.__
33
27
34
-
Shift right one bit to get 7-bit address: 0xA0 >> 1 → 0x50
28
+
The Arduino Serial library can easily parse decimal values, not hex codes. Therefore the default T24C02A address 0xA0 is rendered thus:
29
+
* Right-shift one bit to get 7-bit address: 0xA0 >> 1 → 0x50
30
+
* Convert to decimal: 0x50 → 5×16 + 0 = 80
35
31
36
-
Convert to decimal: 0x50 → 5×16 + 0 = 80
37
32
##Polling:
38
33
If you entered the character 'P', the Arduino will poll all 128 possible addresses on the I²C bus.
39
-
It wil show you the address + answer of the devices that answered.
34
+
It wil show you the address the devices that answered, and their answers.
40
35
41
36
#The main menu:
42
37
Once you have successfully entered an address, you will arrive in the main shell menu.
@@ -46,13 +41,15 @@ You will be asked for a command char:
46
41
W — Write
47
42
S — Set I²C address _useful if you set it wrong, have multiple EEPROMs or have a T24C04A, T24C08A or T24C16A IC._
48
43
P — Poll the I²C bus.
44
+
49
45
##Reading:
50
46
- Follow the instruction:
51
47
- Enter the start address for the read.
52
48
- Enter the number of bytes to be read.
53
49
- The device will print all characters on a single line.
54
50
- Followed by a line of statistics.
55
51
- Optionally followed by a line indicating an error.
52
+
56
53
##Writing:
57
54
- Follow the instruction:
58
55
- Enter the start address for the write.
@@ -63,12 +60,15 @@ You will be asked for a command char:
63
60
- The device will print a human readable error message for each unsuccessful write.
64
61
- The device will retransmit (including reprint of) the character up to NUM_TRIES times.
65
62
_<NUM_TRIES> is set to 10 by default in the code._
63
+
66
64
__After ten failed tries the device:__
67
65
- Will print an error message indication.
68
66
- It will skip this address.
69
67
- It will continue to write the next character to the next location in the EEPROM.
68
+
70
69
##Setting the I²C address:
71
70
The same procedure as detailed in the section "Getting Started", see above.
71
+
72
72
##Polling:
73
73
The same procedure as detailed in the section "Getting Started", see above.
74
-
This polling is not done as part of a change of address. Therefore, the device will give information on the polled devices, and return to the menu immediately afterwards.
74
+
This polling is not done as part of a change of address. Therefore, the device will give information on the polled devices, and return to the menu immediately afterwards.
0 commit comments