Question

Are streams of binary data considered a form of bit banging? Does this definition change if the array is buffered? I am referring software which handles binary data on a general purpose CPU; for example, Java's Input/OutputStream, C++'s istream/ostream, and C's character arrays.

I'm aware of that working on individual bytes rather than a buffered is slower due to efficiency lost at the I/O barrier.

In contrast to bit banging, dedicated hardware (e.g., UART, SPI interface) satisfies these requirements and, if necessary, provides a data buffer to relax software timing requirements.

How is timing related?

This question is in reference to this Wikipedia entry:

https://en.wikipedia.org/wiki/Bit_banging

Was it helpful?

Solution

Are streams of binary data considered a form of bit banging?

No. The term bit banging is only used when referring to creating electrical signals on a processor pin.

There are two ways to create the signals of a protocol on the hardware layer (for example, to send UART signals)

  1. Use software to drive one or more output pins (and read one or more input pins) according to the protocol specification. The software has full control over the signals being sent, but it must also take care of the correct timing according to the protocol. This is called bit banging, because the software is pushing data through one bit at a time.
  2. Use dedicated hardware. Most processors have built-in hardware that can generate the signals for a number of low-level communication protocols (I2C, SPI, UART, etc.). The software transfers the data to the peripheral hardware and the hardware takes responsibility of generating the electrical signals with the correct timing. This is generally preferred, as it frees the software from a lot of very strict timing requirements.
Licensed under: CC-BY-SA with attribution
scroll top