- After completing this chapter, you should be able to:
- Describe the most commonly used buses or interfaces that are available on the BBB, and choose the correct bus to use for your application.
- Configure the BBB to enable I²C, SPI, and UART capabilities.
- Attach circuits to the BBB that interface to its I²C bus, and use the Linux I2C‐Tools to communicate with those circuits.
- Build circuits that interface to the SPI bus using shift registers, and write C code that controls low‐level SPI communication.
- Write C code that interfaces to, and C++ code that “wraps” the functionality of devices attached to the I²C and SPI buses.
- Communicate between UART devices using both Linux tools and custom C code.
- Build a basic distributed system that uses UART connections to the Arduino microcontroller to “outsource” workload.
- Add logic‐level translation circuitry to your circuits in order to communicate between devices with different logic‐level voltages.
- 1 Introduction
- 2 Digital Media Resources
- 3 Additional Content
- 4 BeagleBone Bus Videos
- 5 Arduino Videos
- 6 Source Code
- 7 External Resources
- 8 Errata
P8 and P9 Headers
Figure 6-6 and Figure 6-7 from Chapter 6 are available for download as a high-resolution PNG raster format and a high-resolution PDF vector-mapped format using the following links:
- BeagleBone P8 Header – [download label=”Download PDF”]http://exploringbeaglebone.com/wp-content/uploads/resources/BBBP8Header.pdf[/download](1.4MB), [download label=”PNG Format”]http://exploringbeaglebone.com/wp-content/uploads/resources/BBBP8Header.png[/download](0.4MB)
- BeagleBone P9 Header – [download label=”Download PDF”]http://exploringbeaglebone.com/wp-content/uploads/resources/BBBP9Header.pdf[/download](1.9MB), [download label=”PNG Format”]http://exploringbeaglebone.com/wp-content/uploads/resources/BBBP9Header.png[/download](0.3MB)
These are high-resolution images that can be displayed and/or printed in color. The PDF version can be scaled to a format that suits your needs.
The P8 Header
The P9 Header
An I²C Tutorial Video
In this video I discuss the I²C bus and how we can connect and program devices attached to the bus using C/C++. I explain the use of i2c-tools on embedded Linux and then show how we can interface to a digital accelerometer (Bosch BMA180) or any other I²C device. Finally, I show how we can use sysfs to build a C++ class that wraps the functionality of the digital accelerometer.
An Introduction to the Arduino
This is a short introduction to the Arduino platform.
An Arduino on a Breadboard
This tutorial shows you how to build an Arduino on a breadboard. It describes the use of 16MHz and 20Mhz crystals for driving the Arduino and compares their use to the use of a resonator. A simple circuit is created that blinks an LED for 1000ms and 100ms. The Arduino is programmed on the breadboard using an Arduino shield’s Reset, TX and RX pins.
LCD Display Introduction
This short video looks at the different options available for connecting an LCD character display to an Arduino. It uses a wide set of displays: The nuelectronics display shield, 20×4, 20×2,16×2 and 8×2 display modules. It shows the code that you need to create an example display and describes the use of the POT in the display. The modules used are the nuelectronics display shield, JHD 204, WH1602, CM200200 and a YJ 802A.
Arduino Application – A Reaction Timer
In this video I combine three previous videos and write some code to create an Arduino based Reaction Timer. The entire circuit is built on a breadboard using an ATmega328P on its own, which is combined with a Newhaven Display LCD Module that has an RGB backlight. I work through the code in some detail and explain how to write the code for the reaction timer. At the end of the video I provide links to the previous videos that show how to build the three individual circuits: Breadboard PSU, Arduino on a Breadboard and Arduino LCD Tutorial.
8×8 LED Dot Matrix Display Tutorial
In this video a 2 Colour (red/green) 8×8 LED Dot Matrix Display circuit is developed that uses three 74HC595 ICs to drive the rows/columns and a darlington transistor array (UDN2981A) to source the current. An Arduino is used to provide the serial data and the source code is presented to show how this was achieved. The display is a common anode display and the experiment spends time examining the current constraints, explaining why we require transistor arrays to source or sink current.
External Web Sites
- The I²C Manual, Jean‐Marc Irazabal and Steve Blozis, Philips Semiconductors, TecForum at DesignCon 2003 in San Jose, CA, on January 27, 2003, at tiny.cc/ebb805.
- The Linux I²C Subsystem , at i2c.wiki.kernel.org.
- Serial Programming Guide for POSIX Operating Systems, 5th ed., Michael R. Sweet, 1994‐99, at tiny.cc/ebb803.
- Serial Programming HOWTO, Gary Frerking, Revision 1.01, at tiny.cc/ebb804.