Nothing Special   »   [go: up one dir, main page]

Beaglebone Black (BBB) Board

Download as pdf or txt
Download as pdf or txt
You are on page 1of 32

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)

eMMC - embedded Multi-Media Controller,flash memory


and controller
4
BeagleBone Black – Programming
• BoneScript: node.js based, open source,
server side..apps written in javascript
• Java, python, C, ruby,
• C++ programming with Eclipse IDE with CDT

• We use Python programming

5
Connecting BBB to PC/Laptop
Connecting USB Cable to BBB
BBB Power-on
BBB Boot Status
4 LEDS of BBB and their Status

• USER0 is the heartbeat indicator from the


Linux kernel
• USER1 turns on when the microSD card is
being accessed
• USER2 is an activity indicator; It turns on when
the kernel is not in the idle loop.
• USER3 turns on when the onboard eMMC is
being accessed
BBB Boot Modes
1. eMMC Boot – (THIS IS USED IN OUR CASE)
• This is the default boot mode and will allow
for the fastest boot time and will enable the
board to boot out of the box using the pre-
flashed OS image
2. SD Boot –
• This mode will boot from the microSD slot.

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

Example for GPIO :


import Adafruit_BBIO.GPIO as GPIO
GPIO.setup("P8_10", GPIO.OUT)
GPIO.output("P8_10", GPIO.HIGH)
GPIO.output("P8_10", GPIO.LOW)
GPIO.cleanup()
Time Library in python
 This module provides various time-related functions
 time.sleep(secs) e.g.: time.sleep(10)
 Suspend execution of the current thread for the given
number of seconds
 The argument may be a floating point number to
indicate a more precise sleep time
 Import time module in our programs to generate delays
GPIO Output
• GPIO.setup(“Pin_Name”, GPIO.OUT) #Pin_Name such
as P8_29, or GPIO2_1

• 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

EOS - Assignment No. 1


Mapping P8 and P9 expansion
connector pins to GPIO pins
• LED used 16 in no, therefore 16 GPIO pins required!
• GPIO pins are mapped to P8 and P9 Expansion Connectors
on BBB
• P8_11 => GPIO1_13, P8_12 => GPIO1_12,
P8_13 => GPIO0_23, P8_14 => GPIO0_26,
P8_15 => GPIO1_15, P8_16 => GPIO1_14,
P8_17 => GPIO0_27, P8_18 => GPIO2_1,

• P9_11 => GPIO0_30, P9_12 => GPIO1_28,


P9_13 =>GPIO0_31, P9_14 => GPIO1_18,
P9_15 => GPIO1_16, P9_16 => GPIO1_19,
P9_23 => GPIO1_17, P9_24 => GPIO0_15,
Traffic Light Controller Card Layout
1st 74LS245
Buffer/Latch VCC 26 25 GND

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

2nd 74LS245 FRC Connector


Buffer/Latch
FRC Connector on Cape
VCC 26 25 GND

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

You might also like