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 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. If necessary, it also provides a data buffer to relax software timing. 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, as modern hardware operates much more quickly than the hardware used when standard communication protocols were created.