Beaglebone Black (BBB) Board
Beaglebone Black (BBB) Board
Beaglebone Black (BBB) Board
Introduction
BeagleBone Black
• low-cost, open source, community-supported
development platform for ARM® Cortex™-A8
processor
• Shipped with the Debian GNU/Linux™ in onboard
FLASH
• Other Linux distributions and operating systems are
also supported on BeagleBone Black including:
– Ubuntu, Android, Fedora
• http://www.ti.com/tool/beaglebk
• http://beagleboard.org/
• http://elinux.org/Beagleboard:BeagleBoneBlack –
to get all h/w details
• Blogs
2
BeagleBone Black Board
3
BeagleBone Black – Features
• Processor : 1GHz AM3359 Sitara ARM Cortex-A8
• On-chip 10/100 Ethernet
• 512MB DDR3 RAM
• 4GB 8-bit eMMC on-board flash storage with Debian
GNU/Linux
• USB client for power & communications
• USB host
• Ethernet
• HDMI
• 2x 46 pin headers (Expansion Connectors)
5
Connecting BBB to PC/Laptop
Connecting USB Cable to BBB
BBB Power-on
BBB Boot Status
4 LEDS of BBB and their Status
3. Serial Boot –
• This mode will use the serial port
4. USB Boot –
• This mode supports booting over the USB port
Power Source to BBB
• The board can be powered from four different
sources: We use;
1. A USB port on a PC
2. A 5Volts DC,1Amp power supply plugged into
the DC connector
– For powering only BBB, USB cable to PC is
enough
– When peripherals are required to be
connected to BBB, 5 volts DC, 1 Amp will be
required along with USB connection
Connecting 5Vots DC supply to BBB
Expansion Connectors on BBB…
P8 and P9
Expansion Connectors and GPIO
• General Purpose Input Output (GPIO) modules on AM 3359
processor
• P8 and P9 are Expansion Connectors on BBB.
• There are 4 GPIO modules or ports in AM3359 processor which is
present on BBB
• Each module has 32 pins, thus 128 pins of GPIO
• Out of 128, 92 pins are available on P8 and P9 (46 pins each)
• This means, GPIO pins are mapped to P8 and P9 expansion
connectors
• These pins are made available to the user using CAPE which is
located just above BBB
• Out of 92, only 26 are available on FRC connector of the Cape
• We will be using these 26 GPIO pins only
Different commands …run these on BBB
• Supervisor login at desktop
#su
# ssh 192.168.7.2
Now you are connected to beaglebone black
This is command line prompt for BBB
cd / - BBB board root
ls - lists different files present
under root
cd /sys
df -a
fdisk -l
df -T /dev/mmcblk0p1 - prints
file system type
Programming BBB for PLIII
• We will program in Python
• Linux usually has build-in python support
• To control all the GPIO using python, find a
GPIO library for python
• There are several GPIO libraries Python;
PyBBIO and Adafruit_BBIO are most
commonly used
• We will use Adafruit_BBIO
Using Adafruit_BBIO Library with BBB
To use, import the library ; different options to import: GPIO, PWM, ADC
1. first one is for GPIO:
import Adafruit_BBIO.GPIO as GPIO
setup()
output()
input()
cleanup()
2. Second is for PWM
import Adafruit_BBIO.PWM as PWM
• GPIO.output(“Pin_Name”,GPIO.HIGH)#GPIO.HIGH for
high or GPIO.LOW for low
GPIO Input
• GPIO.setup(“Pin_Name”, GPIO.IN) #Pin_Name such as
P8_29, or GPIO2_1
• E.g. 1:
if (GPIO.input("P8_29")==0:
# your logic
• E.g. 2:
if GPIO.input("P8_29"):
print("HIGH")
else:
print("LOW")
LED Blinking Code in Python
import Adafruit_BBIO.GPIO as GPIO
import time
led = ['P9_11', 'P9_13', 'P9_15', 'P9_24', 'P9_12', 'P9_14', 'P9_16', 'P9_23',
'P8_11', 'P8_13', 'P8_15', 'P8_17', 'P8_14', 'P8_16', 'P8_18', 'P8_12']
for i in range(len(led)):
GPIO.setup(led[i], GPIO.OUT)
GPIO.output(led[i], GPIO.LOW)
while True:
GPIO.output("P9_15", GPIO.HIGH) # here LED connected to
GPIO1_16 (P9_15) is made high
print("high")
time.sleep(8)
GPIO.output("P9_15", GPIO.LOW)
print("LOW")
time.sleep(8)
Traffic Light Controller
P8_21 24 23 P8_19
P9_12 22 21 P9_11
19 P9_13
P9_14 20
17 P9_15
P9_16 18
15 P9_24
P9_23 16
P8_12 14 13 P8_11
P8_14 12 11 P8_13
P8_16 10 09 P8_15
P8_18 08 07 P8_17
P8_7 06 05 P8_8
Traffic Light P8_10
P8_9 04 03
Junction-LEDS
01 P9_17
P9_18 02
P8_21 24 23 P8_19
21 P9_11
P9_12 22
19 P9_13
P9_14 20
17 P9_15
P9_16 18
15 P9_24
P9_23 16
13 P8_11
P8_12 14
P8_14 12 11 P8_13
P8_16 10 09 P8_15
P8_18 08 07 P8_17
P8_7 06 05 P8_8
03 P8_10
P8_9 04
02 01 P9_17
P9_18
1st 74245
2nd 74245
Traffic Light Junction
Hints!
• Setup required P8 and P9 pins (GPIO pins) as
output
• Clear all LEDs first
• Now implement traffic controller logic