Concept

Bit banging

In computer engineering and electrical engineering, bit banging 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. Software directly sets and samples the states of GPIOs (e.g., pins on a microcontroller), 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, I2C) 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 some embedded systems. 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. I2C bus protocol SPI bus - simultaneously transmit and receive a byte The following C language code example transmits a byte of data on an SPI bus. // transmit byte serially, MSB first void send_8bit_serial_data(unsigned char data) { int i; // select device (active low) output_low(SD_CS); // send bits 7..0 for (i = 0; i < 8; i++) { // consider leftmost bit // set line high if bit is 1, low if bit is 0 if (data & 0x80) output_high(SD_DI); else output_low(SD_DI); // pulse the clock state to indicate that bit value should be read output_low(SD_CLK); delay(); output_high(SD_CLK); // shift byte left so next bit will be leftmost data

About this result
This page is automatically generated and may contain information that is not correct, complete, up-to-date, or relevant to your search query. The same applies to every other page on this website. Please make sure to verify the information with EPFL's official sources.
Related publications (3)

Graph Chatbot

Chat with Graph Search

Ask any question about EPFL courses, lectures, exercises, research, news, etc. or try the example questions below.

DISCLAIMER: The Graph Chatbot is not programmed to provide explicit or categorical answers to your questions. Rather, it transforms your questions into API requests that are distributed across the various IT services officially administered by EPFL. Its purpose is solely to collect and recommend relevant references to content that you can explore to help you answer your questions.