Manual 104-AIO16A and 104-AIO16E
21
Writing to the EEPROM
In order to write to the EEPROM, an enable code and start bit must be transmitted, then the write opcode
(2 bits, 01) followed by the address location of the data to be loaded into the EEPROM (6 bits, MSB first),
followed by the data (16bits, MSB first). Then the transmission is ended with 00. Therefore, to write a
value of aa55 to location 5, you would perform the following 27 writes:
Write
Value
Description
1
1xxxxxx0 = 80
Enable code. Always write 80 as the 1
st
byte
2
1xxxxxx1 = 81
Start Bit. Always write 81 as the
2
nd
byte
3
0xxxxxx1 = 01
opcode bit 1, always write 01 as the 3
rd
byte for EEPROM writing
4
1xxxxxx1 = 81
opcode bit 0, always write 81 as the 4
th
byte for EEPROM writing
5
0
xxxxxx1 =
0
1
MSB of address. Bit 7 should be 1 or 0 based on the D5 bit of address to be
written. Always set D0 to “1"
6
0
xxxxxx1 =
0
1
Bit 7 should be bit D4 of address. Always set D0 to “1"
7
0
xxxxxx1 =
0
1
Bit 7 should be bit D3 of address. Always set D0 to “1"
8
1
xxxxxx1 =
8
1
Bit 7 should be bit D2 of address. Always set D0 to “1"
9
0
xxxxxx1 =
0
1
Bit 7 should be bit D1 of address. Always set D0 to “1"
10
1
xxxxxx1 =
8
1
LSB of address. Bit 7 should be 1 or 0 based on the D0 bit of address to be
written. Always set D0 to “1"
11
1
xxxxxx1 =
8
1
MSB of data. Bit 7 should be 1 or 0 based on the D15 bit of address to be
written. Always set D0 to “1"
12
0
xxxxxx1 =
0
1
Bit 7 should be bit D14 of data. Always set D0 to “1"
13
1
xxxxxx1 =
8
1
Bit 7 should be bit D13 of data. Always set D0 to “1"
14
0
xxxxxx1 =
0
1
Bit 7 should be bit D12 of data. Always set D0 to “1"
15
1
xxxxxx1 =
8
1
Bit 7 should be bit D11 of data. Always set D0 to “1"
16
0
xxxxxx1 =
0
1
Bit 7 should be bit D10 of data. Always set D0 to “1"
17
1
xxxxxx1 =
8
1
Bit 7 should be bit D9 of data. Always set D0 to “1"
18
0
xxxxxx1 =
0
1
Bit 7 should be bit D8 of data. Always set D0 to “1"
19
0
xxxxxx1 =
0
1
Bit 7 should be bit D7 of data. Always set D0 to “1"
20
1
xxxxxx1 =
8
1
Bit 7 should be bit D6 of data. Always set D0 to “1"
21
0
xxxxxx1 =
0
1
Bit 7 should be bit D5 of data. Always set D0 to “1"
22
1
xxxxxx1 =
8
1
Bit 7 should be bit D4 of data. Always set D0 to “1"
23
0
xxxxxx1 =
0
1
Bit 7 should be bit D3 of data. Always set D0 to “1"
24
1
xxxxxx1 =
8
1
Bit 7 should be bit D2 of data. Always set D0 to “1"
25
0
xxxxxx1 =
0
1
Bit 7 should be bit D1 of data. Always set D0 to “1"
26
1
xxxxxx1 =
8
1
LSB of data. Bit 7 should be 1 or 0 based on the D0 bit of data written. Always
set D0 to “1"
27
0
xxxxxx0=
0
0
End. Always write 00 as the 27
th
byte
For ease of reference the bits which can change are typeset in
bold
.
There must be a least a 4µs delay between each of the 27 write operations to the EEPROM. After the last
write operation which ends communication with the EEPROM, it will be unavailable for 20mS. Do not
access the EEPROM during this period.
Please note, it is not possible to write to the EEPROM until an EEPROM WRITE ENABLE (EWREN)
sequence has been written to Base + A. The EWREN sequence consists of the following bytes, in order:
81, 01, 01, 81, 81, 01, 01, 01, 01, 00.
Once the EWREN sequence has been written it is possible to write to the EEPROM as desired. If you
wish to subsequently disable writes to the EEPROM, a disable sequence of bytes may be written to Base
+ A as follows: 81, 01, 01, 01, 01, 01, 01, 01, 01, 00.