Page 88 - Embedded Microprocessor Systems Real World Design
P. 88
address pins that are used to set part of the peripheral address. Next comes a single
bit to select a read or write operation (1 for read, 0 for write).
After the read/write bit is sent, the processor programs the 1/0 pin connected
to the SDA bit to be an input and clocks in an acknowledge bit. The selected periph-
eral will drive the SDA line low to indicate that it has received the address and
read/write information.
After the acknowledge, the processor sends ADDR 2, which is the internal
address within the peripheral that the processor wants to access. The length of this
field varies with the peripheral. After ADDR 2 is another acknowledge, then the
data bits are sent. For a write operation, the processor clocks out 8 data bits; for a
read operation, the processor treats the SDA pin as an input and clocks in 8 bits.
After the data comes another acknowledge. Some peripherals permit multiple bytes
to be read or written in one transfer. The processor repeats the data/acknowledge
sequence until all the bytes are transferred.
A number of manufacturers, including Xicor and Philips, make EEPROM
devices for the I'C bus. They have application notes that describe I'C solutions.
Most microcontroller manufacturers have application notes that show how to inter-
face 1% to their processors, including code. In addition to EEPROMs, Philips makes
other 1% peripherals, including 8-bit port expanders and LED drivers.
EEPROMs, whether serial or conventional, have a limitation on the maximum
number of write cycles that can be performed on the device. Early parts typically
had a 10,000 writecycle limit. Newer parts allow around 1 million write cycles.
However, even without this limitation, EEPROM write times are too slow for use as
general-purpose RAM. If you need EEPROM, it will have to be in addition to, not
in place of, general-purpose RAM. In using the serial EEPROMs, the simplest
approach is to set aside a portion of RAM, load the EEPROM contents into it at
power-up, and store data back to the EEPROM only if something changes.
One additional advantage of the serial EEPROMs is expandability. If you find
sometime in the development cycle that more EEPROM is needed than was origi-
nally planned for, just plug in a larger device. The pinouts are the same. However,
don't get extravagant. Typical serial EEPROM densities are 256 x 8, 1K x 8,
and so on.
One drawback to the I'C bus is speed-the clock rate is limited to about
1OOkHz. That limitation is not a severe speed penalty for a microcontroller that
is toggling the lines in software, but faster interfaces are available. Philips, which
originally developed the 1% bus concept, also released a fastmode 1% bus that
operates to 400Kbits/sec. In 1999, Philips announced a high-speed mode with oper-
ation to 3.4 Mbits/sec. High-speed and fast-mode devices are capable of operating
in older systems as well, although older peripherals are not useable in a higher-
speed system.
High-speed and fast-mode 1% also support a 10-bit address field, so up to 1024
addresses can be supported. Of course, to use the high-speed mode, you cannot
72 Embedded Mimopfocessm Systems