Wednesday, October 01, 2008

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:

Post a Comment

Please give your suggestion and follow us if you are interested, which encourage us to create new topics for you. And Thankyou for your support.