Cuauhtemoc CarbajalITESM CEM26/02/2013
1
Raspberry Pi
2
USB 2.0 Hub and 10/100Ethernet Controller
Specifications
http://en.wikipedia.org/wiki/Raspberry_Pi
3
The Raspberry Pi uses Linux kernel-based operating systems. Raspbian, a Debian-based free operating system optimized for the Raspberry Pi hardware, is the current recommended system.The GPU hardware is accessed via a firmware image which is loaded into the GPU at boot time from the SD-card. The firmware image is known as the binary blob, while the associated Linux drivers are closed source.Application software use calls to closed source run-time libraries which in turn calls an open source driver inside the Linux kernel. The API of the kernel driver is specific for these closed libraries.
Software
4
The Raspberry Pi board support the following Graphics and Video API via a set of closed source libraries that give access to the GPU acceleration features:
OpenGL ES 2.0 - OpenGL is a 3D Graphics API defined by the Khronos Group.OpenVG – OpenVG is a 2D vector drawing API also defined by the Khronos Group.EGL – EGL is the interface between Khronosrendering APIs such as OpenGL ES or OpenVG and the underlying native platform window system.
Software
5
OpenMAX IL – OpenMAX supplies a set of API’s that provides abstractions for routines used during audio, video, and still images processing. OpenMAX defines 3 layers, Raspberry Pi library will provide an interface to the IL layer, which provides an interface between media framework such as Gstreamer and a set of multimedia components.
The first three libraries are standard in Linux, so porting existing applications using those standard API should be straightforward. OpenMAX does not have standard implementation in Linux, so Broadcom (via R-Pi) provide a custom implementation.
Software
6
Raspberry Pi hardware-accelerated “Multimedia” software architecture
7
Bradcom BCM2835
8
Bradcom BCM2835
9
Low Power ARM1176JZ-F Applications ProcessorDual Core VideoCore IV® Multimedia Co-Processor1080p30 Full HD HP H.264 Video Encode/DecodeAdvanced Image Sensor Pipeline (ISP) for up to 20-megapixel cameras operating at up to 220 megapixels per secondLow power, high performance OpenGL-ES® 1.1/2.0 VideoCore GPU. 1 Gigapixel per second fill rate.High performance display outputs. Simultaneous high resolution LCD and HDMI with HDCP at 1080p60
Features
10
ARM1176 Processor
11
The ARM1176™ applications processors deployed broadly in devices ranging from smart phones to digital TV's to eReaders, delivering media and browser performance, a secure computing environment, and performance up to 1GHz in low cost designs. The ARM1176JZ-S processor features ARM TrustZone® technology for secure applications and ARM Jazelle® technology for efficient embedded Java execution. Optional tightly coupled memories simplify ARM9™ processor migration and real-time design, while AMBA® 3 AXITM interfaces improve memory bus performance. DVFS support enables power optimization below the best-in-class nominal static and dynamic power of the ARM11TM processor architecture.
ARM1176 Processor
12
ARM1176Architecture ARMv6Dhrystone Performance 1.25 DMPS/MHzMulticore No - Single core only
ISA Support
•ARM•Thumb®
•Jazelle® DBX•DSP extension•Floating Point Unit (Optional)
Memory Management Memory management unit
Debug & Trace CoreSight™ Design Kit for ARM11 (available separately)
ARM1176
13
Performance to enable excellent end-user experience750MHz (TSMC 65GP) with conservative design 1GHz+ with design optimizationsLow latency mode for interrupt responsivenessTCM for ARM9™ processor migration, real-time demandsPhysically addressed caches for multi-tasking performanceBroad OS support, multiple Linux distributions, amazing ARM ecosystemFull Internet experience
ARM1176 Key Features
14
Product maturity enables rapid time to market and low risk
Well proven technology in wide range of applicationsAvailable as soft core or hard macro from ARM (TSMC (90G) or from 3rd parties (Socle/GLOBALFOUNDRIES - 65nm, TSMC - 65nm)AMBA AXI supported by wide range of fabricCoreSight debug offering unrivalled system visibilityComprehensive range of development tools from ARM and from third partiesRange of Reference Methodologies supplied
ARM1176 Key Features
15
Low Power LeadershipShutdown modes, Clock Gating, and DVFS capability93% of flops are clock gatedSeparate Main TLB and Micro-TLBs --> main TLB is not clocked unless micro-TLB missesAvoids unnecessary Tag-RAM and Data-RAM activity for sequential accessesPredictive use of Cache or TCM
ARM1176 Key Features
16
17
RPi Low-level peripherals
18
http://www.raspberrypi.org/wp-content/uploads/2012/02/BCM2835-ARM-Peripherals.pdf
In addition to the familiar USB, Ethernet and HDMI ports, the R-Pi offers lower-level interfaces intended to connect more directly with chips and subsystem modules. These GPIO (general purpose I/O) signals on the 2x13 header pins include SPI, I2C, serial UART, 3V3 and 5V power. These interfaces are not "plug and play" and require care to avoid miswiring.The pins use a 3V3 logic level and are not tolerant of 5V levels, such as you might find on a 5V powered Arduino. Not yet software-enabled are the flex cable connectors with CSI (camera serial interface) and DSI (display serial interface), and a serial link inside the HDMI connector called CEC. (consumer electronics control) .
Introduction
19
General Purpose Input/Output (GPIO) is a generic pin on a chip whose behavior (including whether it is an input or output pin) can be controlled (programmed) through software.The Raspberry Pi allows peripherals and expansion boards (such as the Rpi Gertboard) to access the CPU by exposing the inputs and outputs.The Raspberry Pi board has a 26-pin 2.54 mm expansion header, marked as P1, arranged in a 2x13 strip. They provide 8 GPIO pins plus access to I²C, SPI, UART), as well as +3.3 V, +5 V and GND supply lines. Pin one is the pin in the first column and on the bottom row.
General Purpose Input/Output
20
21
Gertboard
GPIO voltage levels are 3.3 V and are not 5 V tolerant. There is no over-voltage protection on the board - serious interfacing will use an external board with buffers, level conversion and analog I/O rather than soldering directly onto the main board.All the GPIO pins can be reconfigured to provide alternate functions, SPI, PWM, I²C and so. At reset only pins GPIO 14 & 15 are assigned to the alternate function UART, these two can be switched back to GPIO to provide a total of 17 GPIO pins.
General Purpose Input/Output
22
Each GPIO can interrupt, high/low/rise/fall/change. There is currently no support for GPIO interrupts in the official kernel, however a patch exists, requiring compilation of modified source tree. The 'Raspbian"wheezy"' version that is currently recommended for starters already includes GPIO interrupts.GPIO input hysteresis (Schmitt trigger) can be on or off, output slew rate can be fast or limited, and source and sink current is configurable from 2 mA up to 16 mA. Note that chipset GPIO pins 0-27 are in the same block and these properties are set per block, not per pin.
23
General Purpose Input/Output
This chip perform bidirectional level shifting from pretty much any voltage to any voltage and will auto-detect the direction. Only thing that doesn't work well with this chip is i2c (because it uses strong pullups which confuse auto-direction sensor). If you need to use pullups, you can but they should be at least 50K ohm - the ones internal to AVRs/Arduino are about 100K ohm so those are OK!
24
8-channel Bi-directional Logic Level Converter - TXB0108
Alternative functions
Header Pinout, top row
25
Alternative functions
Header Pinout, bottom row
26
The maximum permitted current draw from the 3.3 V pins is 50 mA.Maximum permitted current draw from the 5 V pin is the USB input current (usually 1 A) minus any current draw from the rest of the board.
Model A: 1000 mA - 500 mA -> max current draw: 500 mAModel B: 1000 mA - 700 mA -> max current draw: 300 mA
Be very careful with the 5 V pins P1-02 and P1-04, because if you short 5 V to any other P1 pin you may permanently damage your RasPi.
Power pins
27
28
GPIO Input Protection
29
GPIO Interface Circuit
30
Driving a Relay using GPIO
This uses the Python module available at http://pypi.python.org/pypi/RPi.GPIO Any Python script that controls GPIO must be run as root.
GPIO Driving Example (Python)
31
Get and install wiringPi: https://projects.drogon.net/raspberry-pi/wiringpi/download-and-install/Save this, and compile with:
gcc -o blink blink.c -lwiringPi
and run with: sudo ./blink
GPIO Driving Example (C + wiringPi)
32