April
1999, Issue 105
Dallas
1-Wire Devices, (Part 1):
One
on One
by
Jeff Bachiochi
Hey,
its not just one time only! Jeff opens this
new series on the Dallas 1-wire bus protocol by discussing
1-wire devices and how they are accessed when you
use them alone on a single bidirectional I/O pin.
Those of you
who work with small embedded micros know that there
are always tradeoffs to be made between cost and function.
You pay more, you get more. Whether its code space,
internal RAM, peripherals, or I/O, the more you need
the more it costs.
Its
no wonder that when designs change (via managerial enhancements),
designers often go nuts trying to cram in the necessary
bells and whistles. Sure, great designs maximize the
use of available assets. Just dont expect tomorrows
bright idea to be easily implemented with todays
minimalist designs. Maybe we engineers have to start
outsmarting management by overcompensating for the anticipated
deluge of last minute must-haves.
There are
a number of successful approaches to adding function
through external devices without demanding more and
more I/O from a processor. To keep the required I/O
to a minimum, these approaches tend to use some kind
of serial protocol. SPI and I2C are two of the most
popular.
SPI uses up
to four signal lines (SCL, SDI, SDO, and CS), whereas
I2C uses two signal lines (CLK and DATA). SPI is a shorter
protocol because each device has its own chip select.
I2C requires address information to be sent along with
the data so its a longer protocol. But, it only
requires two signal lines, even when multiple devices
share the same I/O.