You are previewing Bad to the Bone.
O'Reilly logo
Bad to the Bone

Book Description

This comprehensive book provides detailed materials for both novice and experienced programmers using all BeagleBone variants which host a powerful 32-bit, super-scalar TI Sitara ARM Cortex A8 processor. Authored by Steven F. Barrett and Jason Kridner, a seasoned ECE educator along with the founder of Beagleboard.org, respectively, the work may be used in a wide variety of projects from science fair projects to university courses and senior design projects to first prototypes of very complex systems. Beginners may access the power of the "Bone" through the user-friendly Bonescript examples. Seasoned users may take full advantage of the Bone's power using the underlying Linux-based operating system, a host of feature extension boards (Capes) and a wide variety of Linux community open source libraries. The book contains background theory on system operation coupled with many well-documented, illustrative examples. Examples for novice users are centered on motivational, fun robot projects while advanced projects follow the theme of assistive technology and image processing applications. Key Features: - Provides detailed examples for all BeagleBone variants, including the newest "next generation" BeagleBone Black - BeagleBone is a low cost, open hardware, expandable computer first introduced in november 2011 by beagleboard - BeagleBone variants, including the original BeagleBone and the new beaglebone black, hosts a powerful 32-bit, super-scalar arM Cortex A8 processor - BeagleBone is small enough to fit in a small mint tin box - "Bone" may be used in a wide variety of projects from middle school science fair projects to university courses and senior design projects to first prototypes of very complex systems - Novice users may access the power of the bone through the user-friendly bonescript environment - Seasoned users may take full advantage of the Bone's power using the underlying Linux-based operating system - A host of feature extension boards (Capes) and a wide variety of Linux community open source libraries are available - The book provides an introduction to this powerful computer and has been designed for a wide variety of users - The book contains background theory on system operation coupled with many well-documented, illustrative examples - Examples for novice users are centered on motivational, fun robot projects - Advanced projects follow the theme of assistive technology and image processing applications

Table of Contents

  1. Cover
  2. Title
  3. Copyright
  4. Contents
  5. Preface
  6. Acknowledgments
  7. 1 Getting Started
    1. 1.1 Welcome!
    2. 1.2 Overview
    3. 1.3 A brief Beagle history
    4. 1.4 BeagleBoard.org community
    5. 1.5 BeagleBone hardware
      1. 1.5.1 Open source hardware
    6. 1.6 Developing with Bonescript
    7. 1.7 BeagleBone Capes
    8. 1.8 Power requirements and capabilities
    9. 1.9 Getting started — success out of the box
      1. 1.9.1 Exercise 1: Programming with Bonescript through your browser
      2. 1.9.2 Exercise 2: Blinking an LED with Bonescript
      3. 1.9.3 Executing the blinkled.js program
      4. 1.9.4 Exercise 3: Developing your own Boneyard — AROO!
    10. 1.10 Summary
    11. 1.11 References
    12. 1.12 Chapter Exercises
  8. 2 System Design: Programming
    1. 2.1 An Overview of the Design Process
    2. 2.2 Overview
    3. 2.3 Anatomy of a Program
      1. 2.3.1 Comments
      2. 2.3.2 Include files
      3. 2.3.3 Functions
      4. 2.3.4 Interrupt handler definitions
      5. 2.3.5 Program constants
      6. 2.3.6 Variables
      7. 2.3.7 Main function
    4. 2.4 Fundamental programming concepts
      1. 2.4.1 Operators
      2. 2.4.2 Programming constructs
      3. 2.4.3 Decision processing
    5. 2.5 Programming in JavaScript using Node.js
      1. 2.5.1 JavaScript
      2. 2.5.2 Event–driven programming
      3. 2.5.3 Node.js
    6. 2.6 Bonescript Development Environment
    7. 2.7 Application 1: Robot IR sensor
    8. 2.8 Application 2: Art piece illumination system
    9. 2.9 Application 3: Blinky 602A Autonomous Maze Navigating Robot
      1. 2.9.1 Blinky 602A robot
      2. 2.9.2 Requirements
      3. 2.9.3 Circuit diagram
      4. 2.9.4 Structure chart
      5. 2.9.5 UML activity diagrams
      6. 2.9.6 Bonescript code
    10. 2.10 Summary
    11. 2.11 References
    12. 2.12 Chapter Exercises
  9. 3 BeagleBone Operating Parameters and Interfacing
    1. 3.1 Overview
    2. 3.2 Operating Parameters
      1. 3.2.1 BeagleBone 3.3 VDC operation
      2. 3.2.2 Compatible 3.3 VDC logic families
      3. 3.2.3 Input/output operation at 5.0 VDC
      4. 3.2.4 Interfacing 3.3 VDC logic families to 5.0 VDC logic families
    3. 3.3 Input Devices
      1. 3.3.1 Switches
      2. 3.3.2 Switch Debouncing
      3. 3.3.3 Keypads
      4. 3.3.4 Sensors
      5. 3.3.5 Transducer Interface Design (TID) Circuit
      6. 3.3.6 Operational Amplifiers
    4. 3.4 Output Devices
      1. 3.4.1 Light Emitting Diodes (LEDs)
      2. 3.4.2 Seven Segment LED Displays
      3. 3.4.3 Tri–state LED Indicator
      4. 3.4.4 Dot Matrix Display
      5. 3.4.5 Liquid Crystal Display (LCD)
    5. 3.5 High Power Interfaces
      1. 3.5.1 High Power DC Devices
      2. 3.5.2 DC Motor Speed and Direction Control
      3. 3.5.3 DC Motor Operating Parameters
      4. 3.5.4 H–bridge direction control
      5. 3.5.5 DC Solenoid Control
      6. 3.5.6 Stepper motor control
    6. 3.6 Interfacing to Miscellaneous Devices
      1. 3.6.1 Sonalerts, Beepers, Buzzers
      2. 3.6.2 Vibrating Motor
      3. 3.6.3 DC Fan
    7. 3.7 AC Devices
    8. 3.8 Application: Equipping the Blinky 602A robot with a LCD
    9. 3.9 Application: the Blinky 602A interface on a custom cape
    10. 3.10 Summary
    11. 3.11 References
    12. 3.12 Chapter Exercises
  10. 4 BeagleBone Systems Design
    1. 4.1 Overview
    2. 4.2 What is an embedded system?
    3. 4.3 Embedded system design process
      1. 4.3.1 Project Description
      2. 4.3.2 Background Research
      3. 4.3.3 Pre–Design
      4. 4.3.4 Design
      5. 4.3.5 Implement Prototype
      6. 4.3.6 Preliminary Testing
      7. 4.3.7 Complete and Accurate Documentation
    4. 4.4 Submersible Robot
      1. 4.4.1 Requirements
      2. 4.4.2 Structure chart
      3. 4.4.3 Circuit Diagram
      4. 4.4.4 UML Activity Diagram
      5. 4.4.5 BeagleBone Code
      6. 4.4.6 Project Extensions
    5. 4.5 Mountain Maze Navigating Robot
      1. 4.5.1 Description
      2. 4.5.2 Requirements
      3. 4.5.3 Circuit diagram
      4. 4.5.4 Structure chart
      5. 4.5.5 UML activity diagrams
      6. 4.5.6 Bonescript code
      7. 4.5.7 Mountain Maze
      8. 4.5.8 Project extensions
    6. 4.6 Summary
    7. 4.7 References
    8. 4.8 Chapter Exercises
  11. 5 BeagleBone features and subsystems
    1. 5.1 Overview
    2. 5.2 Programming BeagleBone in Linux, C and C++
      1. 5.2.1 Beagling in Linux
      2. 5.2.2 BeagleBone Linux releases
      3. 5.2.3 Bonescript processing in Linux
    3. 5.3 Updating your SD card or eMMC in Linux
      1. 5.3.1 Programming in C using the Ångström Toolchain
    4. 5.4 BeagleBone features and subsystems
    5. 5.5 Exposed functions
      1. 5.5.1 Expansion interface – original BeagleBone
      2. 5.5.2 Accessing pins via Linux 3.2
    6. 5.6 Expansion Interface BeagleBone Black
      1. 5.6.1 Accessing pins with Device Tree Overlays –Linux 3.8
      2. 5.6.2 Overview
      3. 5.6.3 Binary Tree
      4. 5.6.4 Device Tree Format
      5. 5.6.5 BeagleBone Device Tree–Linux 3.8
    7. 5.7 Fundamental Examples Programming in C with BeagleBone Black–Linux 3.8
    8. 5.8 Analog–to–Digital Converters (ADC)
      1. 5.8.1 ADC process: sampling, quantization and encoding
      2. 5.8.2 Resolution and Data Rate
      3. 5.8.3 ADC Conversion Technologies
      4. 5.8.4 BeagleBone ADC subsystem description –Linux 3.2
      5. 5.8.5 ADC conversion via Linux 3.2
      6. 5.8.6 ADC support functions in C Linux 3.2
      7. 5.8.7 ADC support functions in C Linux 3.8
    9. 5.9 Serial Communications
      1. 5.9.1 Serial Communication Terminology
      2. 5.9.2 Serial UART
      3. 5.9.3 Serial Peripheral Interface (SPI)
    10. 5.10 Precision Timing
      1. 5.10.1 Timing related terminology
      2. 5.10.2 BeagleBone timing capability system–Linux 3.2
    11. 5.11 Pulse Width Modulation (PWM)
      1. 5.11.1 BeagleBone PWM subsystem (PWMSS) description
      2. 5.11.2 PWM configuration–Linux 3.2
      3. 5.11.3 PWM C support functions–Linux 3.2
      4. 5.11.4 PWM C support functions–Linux 3.8
    12. 5.12 Networking
      1. 5.12.1 Inter–Integrated Circuit (I2C) bus
      2. 5.12.2 Controller Area Network (CAN) bus
      3. 5.12.3 Ethernet
    13. 5.13 Liquid Crystal Display (LCD) interface
      1. 5.13.1 C support functions
    14. 5.14 Interrupts
      1. 5.14.1 Bonescript interrupt support
    15. 5.15 Summary
    16. 5.16 References
    17. 5.17 Chapter Exercises
  12. 6 BeagleBone Off the Leash
    1. 6.1 Overview
    2. 6.2 Boneyard II: a portable Linux platform–BeagleBone unleashed
    3. 6.3 Application 1: Weather station in Bonescript
      1. 6.3.1 Requirements
      2. 6.3.2 Structure chart
      3. 6.3.3 Circuit diagram
      4. 6.3.4 UML activity diagrams
      5. 6.3.5 Bonescript code
    4. 6.4 Application 2: Speak-and-Spell in C
      1. 6.4.1 BeagleBone C Code
    5. 6.5 Application 3: Dagu Rover 5 Treaded Robot
      1. 6.5.1 Description
      2. 6.5.2 Requirements
      3. 6.5.3 Circuit diagram
      4. 6.5.4 Structure chart
      5. 6.5.5 UML activity diagrams
      6. 6.5.6 BeagleBone C code
    6. 6.6 Application 4: Portable Image Processing Engine
      1. 6.6.1 Brief introduction to image processing
      2. 6.6.2 OpenCV Computer Vision Library
      3. 6.6.3 Stache Cam
    7. 6.7 Summary
    8. 6.8 References
    9. 6.9 Chapter Exercises
  13. 7 Where to from here?
    1. 7.1 Overview
    2. 7.2 Software Libraries
      1. 7.2.1 OpenCV
      2. 7.2.2 Qt
      3. 7.2.3 Kinect
    3. 7.3 Additional resources
      1. 7.3.1 OpenROV
      2. 7.3.2 Ninja Blocks
      3. 7.3.3 BeagleBoard.org Resources
      4. 7.3.4 Contributing to Bonescript
    4. 7.4 Summary
    5. 7.5 References
    6. 7.6 Chapter Exercises
  14. A Bonescript functions
  15. B LCD interface for BeagleBone in C
    1. B.1 BeagleBone Original – Linux 3.2
    2. B.2 BeagleBone Black –Linux 3.8
  16. C Parts List for Projects
  17. D BeagleBone Device Tree
    1. D.1 am33xx.dtsi
    2. D.2 am335x–bone–common.dtsi
    3. D.3 am335x–bone.dts
    4. D.4 am335x–boneblack.dts
    5. D.5 am33xx_pwm–00A0.dts
    6. D.6 bone_pwm_P8_13–00A0.dts
    7. D.7 cape–bone–iio–00A0.dts
  18. Authors’ Biographies
  19. Index