Raspberry Pi. Hans-Petter Halvorsen, M.Sc.

Similar documents
Raspberry Pi - I/O Interfaces

Serial Peripheral Interface. What is it? Basic SPI. Capabilities. Protocol. Pros and Cons. Uses

Copyright. Getting Started with Arduino Wiring for Windows 10 IoT Core Agus Kurniawan 1st Edition, Copyright 2016 Agus Kurniawan

Raspberry Pi 3 Model B

Microcontrollers and Interfacing

Hugo Cunha. Senior Firmware Developer Globaltronics

Introduction to I2C & SPI. Chapter 22

Digital Circuits Part 2 - Communication

IoE Workshop. Marc Khayat, CCIE #41288, Leonard Janer Technical Managers. June 16

or between microcontrollers)

Prototyping Module Datasheet

Overview of the Raspberry Pi Models 3B & 2B

Interfacing Techniques in Embedded Systems

HZX N03 Bluetooth 4.0 Low Energy Module Datasheet

The Digital Revolution

The Information contained herein is subject to change without notice. Revisions may be issued regarding changes and/or additions.

Growing Together Globally Serial Communication Design In Embedded System

Network Embedded Systems Sensor Networks Fall Hardware. Marcus Chang,

Design and development of embedded systems for the Internet of Things (IoT) Fabio Angeletti Fabrizio Gattuso

Parallel Data Transfer. Suppose you need to transfer data from one HCS12 to another. How can you do this?

SKB360I Bluetooth 4.0 Low Energy Module Datasheet

pcduino V3B XC4350 User Manual

EMBEDDED SYSTEMS WITH ROBOTICS AND SENSORS USING ERLANG

A platform to build smart solutions for everyday ease

< W3150A+ / W5100 Application Note for SPI >

Universität Dortmund. IO and Peripheral Interfaces

AN10428 UART-SPI Gateway for Philips SPI slave bridges

Introduction the Serial Communications Parallel Communications Parallel Communications with Handshaking Serial Communications

Real-Time Embedded Systems. CpE-450 Spring 06

IoT Project Proposals

The TechNexion Difference

AlphaBot2 robot building kit for Raspberry Pi 3 Model B

Design Development and Implementation of SPI

Cooking with Team 279

Java Programming on the Raspberry Pi with Pi4J. Rob Ratcliff

w w w. b a s e t r a i n i n g i n s t i t u t e. c o

Raspberry Pi board. EB080

i.mx 8M MINI System-On-Module (SOM) Hardware Architecture

ArduCAM-M-5MP Camera Shield

McMaster University Embedded Systems. Computer Engineering 4DS4 Lecture 6 Serial Peripherals Amin Vali Feb. 2016

USB-to-I2C. Ultra Hardware User s Manual.

Product Specification

Embedded Systems and Software. Serial Interconnect Buses I 2 C (SMB) and SPI

Multicommunication Type Identifying Debugging Probe

Team 2228 CougarTech 1. Training L2. Software Environment

SBC3100 (Cortex-A72) Single Board Computer

BLUETOOTH BASED OFFICE AUTOMATION AND SECURITY SYSTEM USING RASPBERRY PI AND ANDROID APPLICATION

Basics of UART Communication

LinkSprite Technologies,.Inc. pcduino V2

User s Guide. IP-201 I2C Bus Multiplexer Board Revision 1. Micro Computer Control Corporation

DESIGN OF LIGHTWEIGHT E- ATTENDANCE PROTOTYPE USING RASPBERRY PI

Nano RK And Zigduino. wnfa ta course hikaru4

Win-I2CUSB Hardware User s Manual

EE 456 Fall, Table 1 SPI bus signals. Figure 1 SPI Bus exchange of information between a master and a slave.

Microcontroller basics

USB-to-I2C. Professional Hardware User s Manual.

II. PROPOSED SYSTEM AND IMPLEMENTATION

EECS 373 Design of Microprocessor-Based Systems

Design & Development of My SmartPhone Kit:

By: Haron Abdel-Raziq

EECS 373 Design of Microprocessor-Based Systems

A Low Cost Internet of Things Network for Contamination Detection in Drinking Water Systems Using Raspberry Pi

. SMARC 2.0 Compliant

参考資料. LinkSprite.com. pcduino V2

IOT-GATE-iMX7 Datasheet

SETUP INSTRUCTIONS. Eynio Server Setup Instruction

USER MANUAL FOR HARDWARE REV

EECS 373 Design of Microprocessor-Based Systems

PARALLEL COMMUNICATIONS

ARDUINO PRIMO. Code: A000135

Web Site: Forums: forums.parallax.com Sales: Technical:

DATA SHEET. XCT-0101: Xicato Configuration Tool

Lecture 14 Serial Peripheral Interface

Raspberry PI 3B + microcomputer as a central control unit in intelligent building automation management systems

Serial Buses in Industrial and Automotive Applications

LM53X Development and Evaluation Product Family

Serial Communication. Spring, 2018 Prof. Jungkeun Park

Raspberry Pi Compute Development board

Part 1 Using Serial EEPROMs

SPI (Serial & Peripheral Interface)

Understanding SPI with Precision Data Converters

Introduction the Serial Communications Huang Sections 9.2, 10.2 SCI Block User Guide SPI Block User Guide

Arduino Dock 2. The Hardware

EyeCheck Smart Cameras

A Raspberry Pi Based System for ECG Monitoring and Visualization

Pmod modules are powered by the host via the interface s power and ground pins.

. Micro SD Card Socket. SMARC 2.0 Compliant

CprE 488 Embedded Systems Design. Lecture 4 Interfacing Technologies

ARDUINO LEONARDO ETH Code: A000022

UART TO SPI SPECIFICATION

AT90SO36 Summary Datasheet

IOT x86 Joule Gateway

Serial Communications

The Information contained herein is subject to change without notice. Revisions may be issued regarding changes and/or additions.

6LoWPAN Development Platform Saker Manual

Advanced Embedded Systems

BLE MODULE SPECIFICATIONS

MSC02 & I2C01 MODULAR SWITCH CONTROL SYSTEM

Level Shifter. for. Hardware User s Manual.

TechNexion PICO SOM Expansion Board

Transcription:

Raspberry Pi Hans-Petter Halvorsen, M.Sc.

Raspberry Pi https://www.raspberrypi.org https://dev.windows.com/iot Hans-Petter Halvorsen, M.Sc.

Raspberry Pi - Overview The Raspberry Pi 2 is a low cost, credit-card sized computer that plugs into a computer monitor or TV, and uses a standard keyboard and mouse. The Raspberry Pi 2 can run Windows 10 IoT Core. A 900MHz quad-core ARM Cortex-A7 CPU, 1GB RAM Windows 10 IoT Core 3.5mm audio jack/composite video Small-Scale Computer 13x - GPIO pins 2x - SPI buses 1x - I2C bus 2x - 5V power pins 2x - 3.3V power pins 8x - Ground pins

Raspberry Pi 3 The Raspberry Pi 3 is the third generation Raspberry Pi. It replaced the Raspberry Pi 2 Model B in February 2016. Compared to the Raspberry Pi 2 it has: A 1.2GHz 64-bit quad-core ARMv8 CPU 802.11n Wireless LAN Bluetooth 4.1 Bluetooth Low Energy (BLE)

Raspberry Pi - Connectors The Raspberry Pi 2 type B runs a quad-core ARM Cortex-A7 CPU and 1 GB RAM. It offers the following Connectors: 4 x USB 2.0 sockets 10/100 BaseT Ethernet socket HDMI video socket RCA composite video socket microsd card socket Powered from microusb socket 3.5 mm audio out jack Header for GPIO and serial buses (I2C and SPI) Display Serial Interface (DSI) 15 way flat flex cable connector with two data lanes and a clock lane Camera connector 15-pin MIPI Camera Serial Interface (CSI-2)

Raspberry Pi - Pin Mappings

Raspberry Pi GPIO GPIO: General Purpose Input/Output These Pins can be used for Digital Input/Output using Windows.Devices.Gpio; public void GPIO() { // Get the default GPIO controller on the system GpioController gpio = GpioController.GetDefault(); if (gpio == null) return; // GPIO not available on this sytem } // Open GPIO 5 using (GpioPin pin = gpio.openpin(5)) { // Latch HIGH value pin.write(gpiopinvalue.high); // Set the IO direction as output pin.setdrivemode(gpiopindrivemode.output); } // Close pin - will revert to its power-on state This Example opens GPIO 5 as an output and writes a digital 1 out on the pin

Raspberry Pi Windows 10 IoT Core for Raspberry Pi Hans-Petter Halvorsen, M.Sc.

Windows 10 IoT Core Windows 10 IoT Core is a small scaled version of Windows running on small devices such as Raspberry Pi 2 https://dev.windows.com/iot IoT Internet of Things

Raspberry Pi Communication Protocols Hans-Petter Halvorsen, M.Sc.

Communication Protocols UART (Universal Asynchronous Receiver/Transmitter,)... http://en.wikipedia.org/wiki/universal_asynchronous_receiver/trans mitter SPI (Serial Peripheral Interface )... http://en.wikipedia.org/wiki/serial_peripheral_interface_bus I2C (Inter-Integrated Circuit)... http://en.wikipedia.org/wiki/i2c http://www.byteparadigm.com/applications/introduction-to-i2c-and-spi-protocols

Raspberry Pi SPI Bus Serial Peripheral Interface (SPI) is a synchronous serial data protocol used by microcontrollers for communicating with one or more peripheral devices quickly over short distances. With an SPI connection there is always one master device (usually a microcontroller) which controls the peripheral devices. SPI devices communicate in full duplex mode using a master-slave architecture with a single master. The interface was developed by Motorola and has become a de facto standard. Typical applications include sensors, Secure Digital cards, and liquid crystal displays (LCD). SCLK : Serial Clock (output from master) MOSI : Master Output, Slave Input (output from master) MISO : Master Input, Slave Output (output from slave) SS (or SC) : Slave Select (active low, output from master) http://en.wikipedia.org/wiki/serial_peripheral_interface_bus https://learn.sparkfun.com/tutorials/serial-peripheral-interface-spi

Raspberry Pi SPI Bus There are 2 SPI bus controllers available on the RPi2: SPI0 and SPI1 SPI0: Pin 19 - SPI0 MOSI Pin 21 - SPI0 MISO Pin 23 - SPI0 SCLK Pin 24 - SPI0 CS0 Pin 26 - SPI0 CS1 SPI1: Pin 38 - SPI1 MOSI Pin 35 - SPI1 MISO Pin 40 - SPI1 SCLK Pin 11 - SPI1 CS0 using Windows.Devices.Enumeration; using Windows.Devices.Spi; public async void SPI() { // Get a selector string for bus "SPI0" string aqs = SpiDevice.GetDeviceSelector("SPI0"); } // Find the SPI bus controller device with our selector string var dis = await DeviceInformation.FindAllAsync(aqs); if (dis.count == 0); return; // "SPI0" not found on this system // Use chip select line CS0 var settings = new SpiConnectionSettings(0); // Create an SpiDevice with our bus controller and SPI settings using (SpiDevice device = await SpiDevice.FromIdAsync(dis[0].Id, settings)) { byte[] writebuf = { 0x01, 0x02, 0x03, 0x04 }; device.write(writebuf); }

http://en.wikipedia.org/wiki/i2c Raspberry Pi - I2C Bus I²C (Inter-Integrated Circuit), is a multi-master, multi-slave, single-ended, serial computer bus It is typically used for attaching lower-speed peripheral ICs to processors and microcontrollers. I²C is typically spelled I2C (pronounced I-two-C) The I²C bus was developed in 1982 by Philips Semiconductor. The I²C protocol requires only 2 wires for connecting all the peripheral to a microcontroller. https://learn.sparkfun.com/tutorials/i2c

Raspberry Pi - I2C Bus There is one I2C controller I2C1 exposed on the pin header with two lines SDA and SCL. 1.8KΩ internal pull-up resistors are already installed on the board for this bus. Pin 3 - I2C1 SDA Pin 5 - I2C1 SCL SDA: Serial Data Line SCL: Serial Clock Line using Windows.Devices.Enumeration; using Windows.Devices.I2c; public async void I2C() { // Get a selector string for bus "I2C1" string aqs = I2cDevice.GetDeviceSelector("I2C1"); // Find the I2C bus controller with our selector string var dis = await DeviceInformation.FindAllAsync(aqs); if (dis.count == 0) return; // bus not found // 0x40 is the I2C device address var settings = new I2cConnectionSettings(0x40); } // Create an I2cDevice with our selected bus controller and I2C settings using (I2cDevice device = await I2cDevice.FromIdAsync(dis[0].Id, settings)) { byte[] writebuf = { 0x01, 0x02, 0x03, 0x04 }; device.write(writebuf); }

Digital Temperature Sensor with I²C Interface http://home.hit.no/~hansha/documents/lab/lab%20equipment/iot_sensors.htm

Honeywell Humidity Sensor with I²C /SPI Interface Honeywell HIH-6120-021-001 4-Pin SIP Temperature & Humidity Sensor http://home.hit.no/~hansha/documents/lab/lab%20equipment/iot_sensors.htm

Raspberry Pi Raspberry Pi Camera Hans-Petter Halvorsen, M.Sc.

Raspberry Pi Camera The Raspberry Pi Camera is ideal for Home Security Applications https://www.raspberrypi.org/help/camera-module-setup/ Connect it directly to the Camera Interface on the Raspberry Pi Note! This module is only capable of taking pictures and video, not sound 5 megapixel resolution Still images 2592 x 1944 Video: 1080p30

Hans-Petter Halvorsen, M.Sc. University College of Southeast Norway www.usn.no E-mail: hans.p.halvorsen@hit.no Blog: http://home.hit.no/~hansha/