Book Image

Programming the BeagleBone

By : Yogesh Chavan, Amit Pandurang Karpe
Book Image

Programming the BeagleBone

By: Yogesh Chavan, Amit Pandurang Karpe

Overview of this book

The whole world is moving from desktop computers to smartphones and embedded systems. We are moving towards utilizing Internet of Things (IoT). An exponential rise in the demand for embedded systems and programming in the last few years is driving programmers to use embedded development boards such as Beaglebone. BeagleBone is an ultra-small, cost-effective computer that comes with a powerful hardware. It runs a full-fledged Debian Linux OS and provides numerous electronics solutions. BeagleBone is open source and comes with an Ethernet port, which allows you to deploy IoT projects without any additions to the board. It provides plenty of GPIO, Anlaog pins, and UART, I2C, SPI pins which makes it the right choice to perform electronics projects. This gives you all the benefits of Linux kernel such as multitasking, multiusers, and extensive device driver support. This allows you to do programming in many languages including high-level languages such as JavaScript and Python. This book aims to exploit the hardware and software capabilities of BeagleBone to create real-life electronics and IoT applications quickly. It is divided into two parts. The first part covers JavaScript programs. The second part provides electronics projects and IoT applications in Python. First, you will learn to use BeagleBone as tool to write useful applications on embedded systems. Starting with the basics needed to set up BeagleBone and the Cloud9 IDE, this book covers interfacing with various electronics components via simple programs. The electronics theory related to these components is then explained in depth before you use them in a program. Finally, the book helps you create some real-life IoT applications.
Table of Contents (21 chapters)
Programming the BeagleBone
Credits
About the Author
Acknowledgment
About the Reviewers
www.PacktPub.com
Preface
BeagleBone Capes
Index

What is Pinmux?


Different embedded projects deal with different components. Some embedded projects conduct communication with analog sensors. Some projects apply the ON/OFF logic on LEDs/buttons. Some interface with devices on I2C / SPI / UART. These different components have different types of voltage, current, and protocol requirement. We cannot attach an I2C device to a pin that follows the protocol of the SPI bus. Also, we cannot attach an analog sensor to the GPIO pin. This means that we need to have all these types of pins available on the board so that we can do any embedded project. Some embedded projects need interfacing multiple such interfaces. This increases the need of pins available in the CPU. It is not possible to have that many CPU pins. Therefore, there is a need to share the functionalities of available pins. This functionality that shares multiple pins is called Pinmux. Each pin has a set of different modes that support connecting corresponding components. Correct mode for the attached component has to be selected by the user. These pins support multiple voltage and current levels. Voltage and current level of pin can be changed according to the mode selection. BeagleBone SRM lists the possible pin mux modes in the Expansion header pinout tables.

The BeagleBone pins can have maximum eight different modes.

You can see currently configured pin mode using this command:

sudo cat /sys/kernel/debug/pinctrl/44e10800.pinmux/pinmux-pins

You can use utility config-pin to change mode of any pin. Run the following command to get information about this utility:

sudo config-pin