Manual 104-AIO16A and 104-AIO16E
22
Reading from the EEPROM
Similarly, reading a word takes 10 writes (enable code, start bit, read opcode (2 bits 1,0) and the address
(6 bits, MSB first)), followed by 16 reads to acquire the data from the EEPROM, followed by one write to
terminate communication with the EEPROM. Therefore, to read from address 4, perform the following
writes and reads:
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
1xxxxxx1 = 81
Opcode Bit 1. Always write 81 as the 3
rd
byte for reading
4
0xxxxxx1 = 01
Opcode Bit 0. Always write 01 as the 4
th
byte for reading
5
0
xxxxxx1 =
0
1
MSB of address. Bit 7 should be 1 or 0 based on the D5 bit of address in the
EEPROM to be Read. 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
0
xxxxxx1 =
0
1
LSB of address. Bit 7 should be 1 or 0 based on the D0 bit of address to be
read. Always set D0 to “1"
Read 1
Bit D7 of this Read returns the Most Significant Bit (D15) of the 16-bit data
stored at the address specified in writes 4 through 9.
Read 2
D7 contains bit D14 from the word at the specified address
Read 3
D7 contains bit D13 from the word at the specified address
Read 4
D7 contains bit D12 from the word at the specified address
Read 5
D7 contains bit D11 from the word at the specified address
Read 6
D7 contains bit D10 from the word at the specified address
Read 7
D7 contains bit D9 from the word at the specified address
Read 8
D7 contains bit D8 from the word at the specified address
Read 9
D7 contains bit D7 from the word at the specified address
Read 10
D7 contains bit D6 from the word at the specified address
Read 11
D7 contains bit D5 from the word at the specified address
Read 12
D7 contains bit D4 from the word at the specified address
Read 13
D7 contains bit D3 from the word at the specified address
Read 14
D7 contains bit D2 from the word at the specified address
Read 15
D7 contains bit D1 from the word at the specified address
Read 16
D7 contains bit D0 from the word at the specified address
Write 11 0xxxxxx0 = 00
End. Always write 00 as the last step
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 11 write and 16 read 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.
The Software Master CD contains sample programs demonstrating the use of the EEPROM in a variety of
languages, including a “driverlet” which encapsulates the complexities of the process. Using this
“driverlet” is as simple as passing the address and data in the EEPROM you wish to write, or the address
from which to read, to our functions. It is highly recommended that you use the provided source code as a
basis for your own programs.