This article needs additional citations for verification. (July 2014) |
In computer engineering and electrical engineering, bit banging[1] or bit bashing[citation needed] is a term of art for any method of data transmission that employs software as a substitute for dedicated hardware to generate transmitted signals or process received signals. Such software directly sets and samples the states of GPIOs (e.g., pins on a microcontroller) to transmit and receive, respectively, and is responsible for meeting all timing requirements and protocol sequencing of the signals. In contrast to bit banging, dedicated hardware (e.g., UART, SPI, I²C) satisfies these requirements and, if necessary, provides a data buffer to relax software timing requirements. Bit banging can be implemented at very low cost, and is commonly used in embedded systems.[2]
Bit banging allows a device to implement different protocols with minimal or no hardware changes. In some cases, bit banging is made feasible by newer, faster processors because more recent hardware operates much more quickly than hardware did when standard communications protocols were created.