Introduction to Raspberry Pi Jonghwan Hyun DPNM Lab

Introduction to Raspberry Pi Jonghwan Hyun DPNM Lab. Department of Computer Science and Engineering, POSTECH PNM Lab. , POSTECH noraki@postech. ac. kr Sep. 15, 2015 CS 490 K - Internet of Things (Io. T) 1/2

What is Raspberry Pi v Created by Raspberry Pi Foundation v A credit-card sized computer that plugs into your TV and a keyboard v Model B was released in 2012 and Model A in early 2013 v It’s a capable little PC which can be used for many of the things that your desktop PC does PNM Lab. , POSTECH CS 490 K - Internet of Things (Io. T) 2/2

Why was Raspberry Pi Made? PNM Lab. , POSTECH v For education v Original measure of success: more CS students v But education-related efforts are rapidly spreading downward, aiming toward young children CS 490 K - Internet of Things (Io. T) 3/2

Raspberry Pi JTAG Video Audio USB GPIO Ethernet DSI Display Connector CSI Connector - Camera SD HDMI Power PNM Lab. , POSTECH CPU/GPU CS 490 K - Internet of Things (Io. T) 4/2

Two Models v Model B, version 1 Original $35 board (almost everybody's is this one) 256 MB RAM, all peripheral support v Model B, version 2 512 MB RAM v Model A $25 No Ethernet jack: networking via USB add-on 256 MB RAM PNM Lab. , POSTECH CS 490 K - Internet of Things (Io. T) 5/2

Raspberry Pi – Hardware v Processor and Memory Broadcom 2835 System On Chip • 32 bit ARM RISC CPU core (not x 86 compatible) • Videocore IV GPU Arm 11 hardware, Arm 6 architecture Default clock is 700 Mhz, but most will overclock to ~1 Ghz GPU is basically as powerful as what was on the original Xbox v Mass Storage: SD card Any SD card Kernel boots from SD card Easy to have root FS on other device PNM Lab. , POSTECH CS 490 K - Internet of Things (Io. T) 6/2

Raspberry Pi – Hardware v Video HDMI or (digital) DVI via cheap adaptor/cable Composite NTSC/PAL via RCA Wide range of resolutions • 640× 350 to 1920× 1200 v Audio Via HDMI Via 3. 5 mm stereo jack Stereo analog Output only PNM Lab. , POSTECH CS 490 K - Internet of Things (Io. T) 7/2

Raspberry Pi – Hardware v Networking 10/100 Mbps via RJ 45 on model B Wireless via USB add-on supported v USB Dual USB sockets on RPi model B, single on model A Expandable via regular or powered hubs PNM Lab. , POSTECH CS 490 K - Internet of Things (Io. T) 8/2

Raspberry Pi – Hardware v Power Primary power via micro. USB plug • A one amp cell charger works well, but you'll need two amps with a USB hard drive Model A about a quarter amp less PC USB port does not work Most Rpi boards have a current limiting fuse in the USB socket path • Highpower peripherals like HDD MUST use a powered USB hub • Fixed in rev 2 boards PNM Lab. , POSTECH CS 490 K - Internet of Things (Io. T) 9/2

Raspberry Pi – Hardware v General Purpose I/O (GPIO) 3. 3 volt logic via 26 pin header • NOT 5 volt or short tolerant Parallel I/O pins UART (Linux console support) I 2 C, SPI for peripherals No A/D, so no analog input Can do software-based PWM Libraries exist for interacting with the GPIO through several programming languages PNM Lab. , POSTECH CS 490 K - Internet of Things (Io. T) 10/

Raspberry Pi – Hardware v More I/O DSI LCD panel support CSI camera support JTAG Additional GPIO via other headers PNM Lab. , POSTECH CS 490 K - Internet of Things (Io. T) 11/

Raspberry Pi – Hardware v Hardware Specification Price CPU GPU Model A Model B US$ 25 US$ 35 700 MHz ARM 1176 JZF-S core (ARM 11 family) Broadcom Video. Core IV, Open. GL ES 2. 0, MPEG-2 and VC-1, 1080 p 30 h. 264/MPEG-4 AVC Memory (SDRAM) 256 MB (shared with GPU) 512 MB (shared with GPU) USB 2. 0 ports Video outputs Audio outputs Onboard storage Onboard network Power ratings Size and Weight Operating systems PNM Lab. , POSTECH 1 2 Composite RCA, HDMI, raw LCD Panels via DSI 14 HDMI resolutions from 640× 350 to 1920× 1200 HDMI, 3. 5 mm jack (stereo analog) SD / MMC / SDIO card slot None 10/100 Ethernet 300 m. A (1. 5 W) 700 m. A (3. 5 W) 85. 60 mm × 53. 98 mm, 45 g Debian GNU/Linux, Raspbian OS, Fedora, Arch Linux ARM, RISC OS, Free. BSD, Plan 9 CS 490 K - Internet of Things (Io. T) 12/

Setting Up Raspberry Pi v v v v SD card (Minimum size 4 Gb) HDMI to HDMI / DVI lead RCA video lead (if you are not using the HDMI output) Keyboard and mouse (USB 2. 0) Ethernet network cable (optional) Power adapter (micro USB power 700 m. A at 5 V) Audio lead (If you are not using HDMI) HDMI connector PNM Lab. , POSTECH HDMI to DVI lead CS 490 K - Internet of Things (Io. T) RCA composite video connector 13/

Setting Up Raspberry Pi PNM Lab. , POSTECH CS 490 K - Internet of Things (Io. T) 14/

Raspberry Pi OS v Raspberry Pi is a full blown computer v Runs Linux v Supported OS Raspbian (Debian optimized for Rpi) Debian (non-optimized) Arch Linux RISC OS Net. BSD Openelec – an XBMC media center Pidora – Fedora remix PNM Lab. , POSTECH CS 490 K - Internet of Things (Io. T) 15/

Programming v By default, supporting Python as the educational language v Any language which will compile for ARMv 6 can be used with the Raspberry Pi v For primary age SCRATCH game maker is bundled v Raspbian contains Java SE platform PNM Lab. , POSTECH CS 490 K - Internet of Things (Io. T) 16/

Programming – SCRATCH PNM Lab. , POSTECH scratch is free from MIT CS 490 K - Internet of Things (Io. T) 17/

Programming – Python PNM Lab. , POSTECH CS 490 K - Internet of Things (Io. T) 18/

Programming – Python v Example – a simple game of snake Other series of simple game examples can be downloaded: • http: //www. raspberrypi. org/game. tar. gz PNM Lab. , POSTECH CS 490 K - Internet of Things (Io. T) 19/

Programming - Open. GL v Raspberry Pi incorporates a powerful graphics accelerator – Open. GL Examples, including Quake 3 at • https: //github. com/raspberrypi/quake 3 PNM Lab. , POSTECH CS 490 K - Internet of Things (Io. T) 20/

Some Other Things v Can run XMBC Home Theater PC software Turn your TV into a Smart TV! v Emulators for tons of old platforms (C 64, Atari, NES, etc. ) v Games – Open. TTD, Open. Arena, more… v Has its own app store http: //store. raspberrypi. com/ PNM Lab. , POSTECH CS 490 K - Internet of Things (Io. T) 21/

Projects Using Raspberry Pi v Raspberry Pi Cluster http: //www. southampton. ac. uk/~sjc/raspberrypi/pi_supercomputer_s outhampton. htm http: //www. youtube. com/watch? v=Jq 5 nr. Hz 9 I 94 PNM Lab. , POSTECH CS 490 K - Internet of Things (Io. T) 22/

Projects Using Raspberry Pi v Raspberry Pi powered Quadcopter http: //www 2. warwick. ac. uk/fac/sci/eng/meng/wmr/projects/autonom ousuav/poster_design_final. pdf PNM Lab. , POSTECH CS 490 K - Internet of Things (Io. T) 23/

Projects Using Raspberry Pi v Raspberry Pi in the Sky Sending images from near space Pi, webcam, GPS, batteries, and other equipments PNM Lab. , POSTECH CS 490 K - Internet of Things (Io. T) 24/

References v v v v v Raspberry Pi Manual Raspberrypi. org + associated forums www. elinux. org - entire areas on this wiki for the Rpi Adafruit. com/category/105 – products, tutorials, and an educational distro of Linux for the Pi. Youtube – TONS of Rpi related videos en. wikipedia. org/wiki/Raspberry_Pi www. element 14. com/community/docs/DOC 44424/l/presentation--programming-the-raspberry-pi-with-dr -eben-upton www. thomastongue. com/Making/Raspberry. Pi/CDMPi. Jams/Getting. Started. pdf www. slideshare. net/ltg_oxford/raspberry-pie-anintroduction Qt 5 on Raspberry Pi PNM Lab. , POSTECH CS 490 K - Internet of Things (Io. T) 25/
- Slides: 25