Hardware Reference
In-Depth Information
Allows many more devices in the same I 2 C bus
Allows resources to be shared by multiple master devices (microcontrollers)
However, the SPI has the following advantages over the I 2 C interface:
Higher data rates (no longer true for I 2 C high-speed mode)
Much lower software overhead to carry out data transmission
Data transfer over the I 2 C bus requires the user to generate the following signal
components:
1. Start condition
2. Stop condition
3. ACK
4. Restart condition
5. Data
Whenever there are multiple master devices attempting to send data over the I 2 C bus, bus arbi-
tration is carried out automatically. The loser is decided whenever it attempts to drive the data
line to high, whereas another master device drives the same data line to low.
To select the slave device without using the chip-select (or chip-enable) signal, address in-
formation is used. Both 7-bit and 10-bit addresses are supported in the same I 2 C bus. Ten-bit
addressing will be used in a system that consists of many slave devices. The I 2 C bus supports
three speed rates:
100 kHz
400 kHz
3.4 MHz
Currently, the HCS12 devices support only 7-bit addressing and a 100-kHz clock rate.
Each data transfer starts with a start condition and ends with the stop condition. One or
two control bytes will follow the start condition, which specifies the slave device to receive or
send data. For each data byte, the receiver must assert either the ACK or NACK condition to
acknowledge or unacknowledge, respectively, the data transfer.
The DS1307 is a real-time clock that can keep track of the current time and calendar in-
formation. After the current time and calendar information have been set up, the DS1307 will
update it once per clock period. As long as the clock frequency input is accurate, the DS1307
can keep track of the time very accurately. The DS1307 can also optionally interrupt the MCU
once per second so that the MCU can update the time display.
The DS1631A is a digital thermometer that allows the ambient temperature to be read us-
ing the I 2 C bus. It has an output signal (T OUT ) that will become active whenever the ambient
temperature reaches the value preset by the designer. This feature is useful to provide early
warning about potential overheating in a system. The DS1631A can be configured to operate in
one-shot mode or continuous conversion mode. The default temperature conversion resolution
is 12-bit. However, it can also be reduced to 9-, or 10-, or 11-bit if high resolution is not impor-
tant compared to the required conversion time.
The 24LC08B is an EEPROM with an I 2 C interface. The capacity of the 24LC08B is 8K bits.
This chip has an internal address pointer that will increment automatically after each access.
This feature can increase the access efficiency when the access patterns are sequential.
Functions for performing basic read and write access to the I 2 C slave devices have been
provided in this chapter. Designers can add their own processing functions to provide further
processing or data formatting to make the data more user-friendly.
Search WWH ::




Custom Search