Pages created and updated by Terry Sturtevant Date Posted: May 12, 2017

CP495F: Microprocessor Systems and Interfacing

Bit-bashing, or sometimes bit-banging, is the technique of writing code to explicitly control individual pins on a microcontroller is order to implement some sort of protocol. An example of this is to create a serial interface whether or not the controller has pins and/or a dedicated module to do this.
While bit-bashing makes code more involved, and creates some processor overhead, it makes testing easier at the early stages. For instance, if the processor includes a module, but the documentation is unclear about details, a bit-bashed solution allows the actual connections to be tested (assuming the same pins are used as would be used by the built-in module), as well as the external device(s).
Another use of bit-bashing is when the dedicated pins for a particular function are unavailable. For instance, many microcontrollers will have one set of pins which can be used for two or more different serial protocols. In that case, if a designer need to use two devices which require different protocols, one of the devices will have to be bit-bashed. (Or, similarly, a designer needs two independent implementations of the same funtionality, and only one is available. The second must be bit-bashed. An example of this might be a pulse-width modulated output, with one available but two needed.)
Creative Commons License

Information on this site which is produced by Terry Sturtevant is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 2.5 Canada License.


To view pdf documents, you can download Adobe Acrobat Reader .
get Acrobat Reader
If you need to update a browser, you might try Firefox which is Get Firefox!
Since this page uses cascading style sheets for its layout, it will look best with a browser which supports the specifications as fully as possible.

If you are looking for an office package, with a word processor, spreadsheet, etc., you might try LibreOffice which is Get LibreOffice!

Go to the main page for the Department of Physics and Computer Science.

Valid XHTML 1.0 Strict

Valid CSS!

Wilfrid Laurier University