Tuesday, December 25, 2007

What Is Bit-Banging?

What Is Bit-Banging?
Bit-banging is a method of using general-purpose I/O lines to
emulate a serial port. Microcontrollers that include serial-port
modules like SPI[tm] and I2C[tm] manage all synchronization and
timing signals, and this activity is transparent to the user.
With bit-banging, however, each write to the port causes a
single transition at the port pin. And it's up to the user,
first, to provide the correct number of transitions to obtain
the desired waveform and, second, to ensure that the timing
requirements (particularly setup and hold times for reading and
writing data) are met. Due to the overhead associated with the
number of writes to the port, though the actual port speed might
be quite high the actual bit-bang throughput rate is usually
very slow. This technique is very inefficient from a software
perspective, but it may be acceptable in some applications where
the communication overhead is acceptable (for example for doing
occasional controlling communication).

No comments:

Blog Archive