raspberry pi - lecture 1 introduction

28
Prepared by: Mohamed AbdAllah Raspberry pi interfacing Lecture 1: Introduction 1

Upload: mohamed-abdallah

Post on 11-Feb-2017

1.017 views

Category:

Engineering


9 download

TRANSCRIPT

Page 1: Raspberry Pi - Lecture 1 Introduction

Prepared by: Mohamed AbdAllah

Raspberry pi interfacing Lecture 1: Introduction

1

Page 2: Raspberry Pi - Lecture 1 Introduction

Course content

Introduction

• Introduction to Embedded Systems.

• Introduction to Linux operating system.

• Introduction to Embedded Linux.

Linux operating system

• Linux file system hierarchy.

• Linux commands.

• Files permissions.

• Input-Output redirection.

• Environment variables.

• Process management.

• Linux shell scripting.

2

Page 3: Raspberry Pi - Lecture 1 Introduction

Course content

Embedded Systems Communication Protocols

• UART protocol.

• I2C protocol.

• SPI protocol.

Hardware interfacing special cases • Analog to Digital Converter (ADC).

• Pulse Width Modulation (PWM).

• Polling V.S Interrupt based interfacing.

3

Page 4: Raspberry Pi - Lecture 1 Introduction

Course content

Raspberry Pi – Hardware interfacing

• Hardware interfacing using Python language.

• Installing Linux on the Pi.

• Setting a static IP address and local host name for the Pi.

• Configuring the Wi-Fi dongle.

• Working with Pi GPIO.

• Working with Pi UART.

• Working with Pi PWM.

4

Page 5: Raspberry Pi - Lecture 1 Introduction

Introduction Agenda

Introduction to Embedded Systems.

• What is an embedded system ? • Embedded systems in our life. • Embedded systems characteristics. • Hardware, Software Co-Design. • Micro-Controller concepts. • Embedded systems market in Egypt.

Introduction to Linux operating system.

• What is an operating system ? • Why to use an operating system ? • What is Linux operating system ? • Linux OS main components. • Linux features.

Introduction to Embedded Linux.

• What is an embedded Linux ? • Why to use embedded Linux ? • Embedded Linux main components.

5

Page 6: Raspberry Pi - Lecture 1 Introduction

Introduction Agenda

Introduction to

Embedded Systems

Introduction to Linux operating

system

Introduction to

Embedded Linux

6

Page 7: Raspberry Pi - Lecture 1 Introduction

Introduction to Embedded Systems

Introduction to

Embedded Systems

Introduction to Linux operating

system

Introduction to

Embedded Linux

7

Page 8: Raspberry Pi - Lecture 1 Introduction

Introduction to Embedded Systems

What is an embedded system ? An embedded system is a computer system with a dedicated function within a larger mechanical or electrical system, sometimes with real-time computing constraints. It is embedded as part of a complete device often including hardware and mechanical parts.

8

Page 9: Raspberry Pi - Lecture 1 Introduction

Introduction to Embedded Systems

Embedded systems in our life

9

Page 10: Raspberry Pi - Lecture 1 Introduction

Introduction to Embedded Systems

Embedded systems characteristics

• Cost of hardware and software.

• Memory.

• Power consumption.

• Operator interface.

• Reliability.

• Maintainability.

• Security.

• Safety.

• Real time critical.

• Interface to environment through sensors and actuators.

10

Page 11: Raspberry Pi - Lecture 1 Introduction

Introduction to Embedded Systems

Hardware, Software Co-Design

• Break system into subsystems.

• Identify concurrency and dependencies in over all system.

• Allocate system components between hardware and software.

• Trade off between hardware and software.

• Break software into layers.

• Design user interface system.

11

Page 12: Raspberry Pi - Lecture 1 Introduction

Introduction to Embedded Systems

Micro-Controller concepts

12

Page 13: Raspberry Pi - Lecture 1 Introduction

Introduction to Embedded Systems

Micro-Controller concepts

0010011000

ADD R16,R10 SUB R7,R3

Z = x + y ; If (y==3) return 0 ;

file1.c Compiler

file1.asm

Assembler

file1.o Linker

file2.o file3.o

prog.hex

13

Page 14: Raspberry Pi - Lecture 1 Introduction

Introduction to Embedded Systems

Embedded systems market in Egypt

14

Page 15: Raspberry Pi - Lecture 1 Introduction

Introduction to Linux operating system

Introduction to

Embedded Systems

Introduction to Linux operating

system

Introduction to

Embedded Linux

15

Page 16: Raspberry Pi - Lecture 1 Introduction

Introduction to Linux operating system

What is an operating system ?

• An operating system acts as an intermediary between the user of a computer and the computer hardware. The purpose of an operating system is to provide an environment in which a user can execute programs in a convenient and efficient manner.

• An operating system is software that manages the

computer hardware. The hardware must provide appropriate mechanisms to ensure the correct operation of the computer system and to prevent user programs from interfering with the proper operation of the system.

16

Page 17: Raspberry Pi - Lecture 1 Introduction

Introduction to Linux operating system

Why to use an operating system ?

• Memory management.

• Storage management.

• Process management.

• Protection and security.

• Abstraction layer for every resource.

17

Page 18: Raspberry Pi - Lecture 1 Introduction

What is Linux operating system ?

• In 1983, Richard Stallman, founder of the Free Software Foundation, set forth plans of a complete Unix-like operating system, called GNU, composed entirely of free software.

• By 1991 the lower level (kernel, device drivers, system-level utilities and daemons) was still mostly lacking.

• In 1991, Linus Torvalds released the first version of the Linux kernel. Early Linux developers ported GNU code, including the GNU C Compiler, to the kernel. The free software community adopted the use of the Linux kernel as the missing kernel for the GNU operating system.

Introduction to Linux operating system

18

Page 19: Raspberry Pi - Lecture 1 Introduction

Linux OS main components

Introduction to Linux operating system

19

Page 20: Raspberry Pi - Lecture 1 Introduction

Linux features

• Open Source: Linux source code is freely available and it is community based development project. Multiple teams works in collaboration to enhance the capability of Linux operating system and it is continuously evolving.

• Multi-User: Linux is a multiuser system means multiple users can access system resources like memory, ram, application programs at same time.

• Multiprogramming: Linux is a multiprogramming system means multiple applications can run at same time.

• Hierarchical File System: Linux provides a standard file structure in which system files, user files are arranged.

Introduction to Linux operating system

20

Page 21: Raspberry Pi - Lecture 1 Introduction

Linux features

• Shell: Linux provides a special interpreter program which can be used to execute commands of the operating system. It can be used to do various types of operations, call application programs etc.

• Security: Linux provides user security using authentication features like password protection, controlled access to specific files, encryption of data.

Introduction to Linux operating system

21

Page 22: Raspberry Pi - Lecture 1 Introduction

Introduction to Linux operating system

22

Page 23: Raspberry Pi - Lecture 1 Introduction

Introduction to Embedded Linux

Introduction to

Embedded Systems

Introduction to Linux operating

system

Introduction to

Embedded Linux

23

Page 24: Raspberry Pi - Lecture 1 Introduction

What is an embedded Linux ?

• Operating systems based on the Linux kernel are used in embedded systems such as consumer electronics (i.e. set-top boxes, smart TVs, in-vehicle infotainment (IVI), networking equipment (such as wireless routers), machine control, industrial automation, navigation equipment, spacecraft flight software, and medical instruments in general).

• Thanks to their versatility, operating systems based on the Linux kernel can be also found in mobile devices that are actually touchscreen-based embedded devices, such as smartphones and tablets, together with personal digital assistants (PDAs) and portable media players that also include a touchscreen.

Introduction to Embedded Linux

24

Page 25: Raspberry Pi - Lecture 1 Introduction

Why to use embedded Linux ?

• Linux kernel supports wide range of architectures like:

X86 and x64 in PC and multimedia.

ARM.

PowerPC mainly in real time applications.

And much more architectures.

• A very basic Linux system can work on 8 MB of RAM and 4 MB of storage.

• Linux kernel has support for many communication busses like:

USB.

SPI.

CAN.

Introduction to Embedded Linux

25

Page 26: Raspberry Pi - Lecture 1 Introduction

Why to use embedded Linux ?

• Linux kernel has support for many networking stacks like:

Ethernet.

Wi-Fi.

Bluetooth.

IPv4, IPv6, TCP, UDB.

Firewall and advanced routing.

Introduction to Embedded Linux

26

Page 27: Raspberry Pi - Lecture 1 Introduction

Embedded Linux main components

• Cross-compilation Tool Chain: used to compile source code for the required target hardware.

• Boot loader: used to initialize hardware and load the Linux kernel.

• Linux Kernel: the main software component of the operating system.

• System libraries: System libraries are special functions or programs used by application programs or system utilities to access Kernel's features.

• File system with other libraries & apps.

Introduction to Embedded Linux

27

Page 28: Raspberry Pi - Lecture 1 Introduction

Mohamed AbdAllah Embedded Systems Engineer [email protected]

28