Introduction to Embedded Systems (CSE 337/537) Amarjeet Singh January 8, 2013
A Small Exercise On a small sheet of paper explain the following: What are the different interfaces through which a CPU talk to external peripherals? Name some microcontroller platforms that you may have heard of How much power is consumed by a typical motherboard? Where do you see embedded systems around you? What are the different kind of memory devices you are aware of? Cyber-physical systems: Interfacing cyber world and physical world If you were to be given an option to collect data/information about 2 of your daily activities, what would that be? 2
Another Exercise – Rate Yourself On the same sheet of paper, rate yourself (between 1-5) on
Embedded Programming in C Different modules inside a microcontroller like Timers, Counters, ADC, memories
What different interfaces exist for a microcontroller to talk to outside world e.g. SPI, UART Hardware development and processes therein e.g. soldering Hardware debugging Optimizing system level constraints like power consumption, memory, synchronization Development using Real Time Operating System (RTOS)
Experience of deploying (making necessary connections, basic programming and setup to get it working) your own hardware system (other than a computer/laptop) from scratch 3
My view: Why is this course important? How many of you think that learning Embedded Systems necessarily require strong Electronics background? Often people with Electronics background think that programming is tough People with programming background shy away from hardware
Good understanding of both hardware and software often is very beneficial What different skills will the course require?
Electronics Computer Architecture Operating Systems Good programming skills Willingness to put in consistent hard work and learn new things 4
My view: Why is this course important? We believe that: A good CS/IT engineer should have good understanding of how the hardware, he is using, operates Basic knowledge of hardware instills confidence
Exposure to embedded systems get you to experience tangible things happening for real - robots moving, LEDs blinking! Learning such activities are fun and will create the right mindset for other IT courses
Embedded is now everywhere - Metro card, Driving License, Microwave, Automated Car Controls…. Basic knowledge of its operation will help in better understanding of how these systems operate
5
Proposed Learning Outcomes Based on how much effort you put in (irrespective of what grade you get), I expect you to achieve the following through this course: Programming microcontroller (using embedded C) and use several of its internal modules including Pulse Width Modulator (PWM), Timer, Counter, Analog-to-Digital Converter (ADC), Serial Port (UART), Memory (EEPROM, SRAM) Learn to interface off-the-shelf external components with the microcontroller over multiple interfaces such as SPI, UART, GPIO, ADC Develop your own simple hardware attachments for the microcontroller; Learning to debugging the hardware in the process 6
Proposed Learning Outcomes Based on how much effort you put in (irrespective of what grade you get), I expect you to achieve the following through this course: Appreciate broader system level constraints like power consumption, synchronization, scheduling that may arise when building a network of embedded systems Broad understanding of RTOS by actually implementing the code in the hardware above a RTOS
Exposure to recent work in the domain of Cyber Physical Systems Learn about the challenges in real world deployment of the system through hands-on exposure in the course project
7
How will we learn? - Lectures Tuesday – 2:00 PM - 3:30 PM Friday - 11:30 AM – 1:00 PM
Lectures in first 1.5 months will give you basic understanding of the microcontroller architecture - Power, Memory, External Interfaces … Lectures in the remaining course will be taken as a mix by me and by M.Tech. students from the class I will give a topic and some associated readings for that topic – Students in groups will be expected to volunteer for a topic and present it in the class Towards the end, we will cover recent work in Cyber-Physical systems Slides for each lecture will http://www.iiitd.edu.in/~amarjeet/ES2013.html
be
posted
at
8
How will we learn? - Lab Sessions No formal lab sessions You will be given four lab assignments with due deadlines
Details on the course webpage -
http://www.iiitd.edu.in/~amarjeet/ES2013.html
Submission to be made online on the Google code repository http://code.google.com/p/cse537
In each specific directory (Assignment1, ..) create a sub-directory with your name and submit it online Requires using SVN repositories Submissions later than deadline will not count towards evaluation Need all submissions to pass the course Need to be done in groups of two - If you take help from some source online or some student, acknowledge it on top of your code All code available to everyone - Your integrity in your hands! Viva will be taken to test your understanding of what you have written 9
How will we learn? - Lab Sessions
Hardware platform AVR based microcontroller boards –AVR EVK1100 (mostly used), AVR Dragon, AVR A1-Xplained (optional) Will use one of them to learn microcontroller programming – Will always be available in the lab (you can put your name on one of the boxes and always use the same box for yourself) Currently there may be a few boards short, but depending on the number of students finally registered, I will try to get the hardware platform for each student – once we have enough, you can issue a board for your group and take it home Software: AVR Studio (Free) – IDE for embedded programming Programming in Embedded C Enough documentation online to get you started (some references on the course website) Several online tutorials to learn other details On demand lab session for clearing your doubts 10
How will you learn? - Lab Sessions Expected to learn some hardware stuff besides microcontroller programming - soldering station, other hardware components at your disposal in the hardware lab Policy for using these components
Keep the desk clean before you leave Put the components back in their appropriate place If you want to take something outside the room, take permission and get it recorded in the sheet If you want to order some hardware components, record it in the sheet along with your name and date - We will try to order small stuff together as per your requirements
Each one of you is expected to make at least 1 trip to Lajpat Rai Market to do hardware purchase – an experience in itself
All expenses made with permissions will be reimbursed
11
How will you learn? - Group Project To be performed in a group of 2 Groups of 3 (or single person) not allowed We will be giving another commercial hardware together with the core embedded software as well as core server side software to you
Each group is expected to own up a room in the hostel – deploy the hardware with necessary core sensors and get the whole system working end-to-end
Each group is expected to do some new addition to the system – may be a mix of hardware and software (though not completely software) and get the updated system working in real setting
Some ideas on these expansions will be given by me – you can come up with your own idea as well
M.Tech. students are expected to do more in the extension 12
How will you learn? - Group Project Guidelines:
It is your responsibility to deal with inter-personal issues in the group Final deliverable should clearly specify the contribution of each member in the group There will be 3-4 milestones (specified later on) by when a specific work is to be finished. Each milestone will carry some weight towards the final project
13
How will you learn? – Student Presentations In groups of 2 (Mandatory for M.Tech. students, Optional for B.Tech. students) Each group will be expected to make a presentation on recent research work in Cyber-Physical Systems – rest of the groups to submit a 1 page summary on one of the papers Remaining groups to submit a 1-page summary for the work that is discussed – Mandatory for everyone
14
Course Outline
Logistics - Evaluation
Quantifying the evaluation* Hardware assignments – 10% Presentation on research paper in Cyber Physical Systems 10% (0%#) Summary reports for other research papers in Cyber Physical Systems - 5% (10%#) Group Project – 35% Mid Term Exam – 15% (17.5%#)
Final Exam – 25% (27.5%#) *
Subject to minor changes at a later stage
# For
B.Tech students opting out of presentation 15
Course Outline
Logistics - Miscellaneous
Two TAs – Nipun Batra (PhD student); and Arpan Jati (2nd year M.Tech.) will be there to help you
Office hours Tuesday, Monday – 1-2 pm By appointment (Email me a day in advance) Will ask TAs to fix office hours as well – try to approach them within this hour. Any email communication - Prefix subject with ES2013 (for faster response) Feedback First course with embedded hardware and software exposure Feel free to give feedback at regular intervals on how the course can be improved 16
Course Outline
Logistics - Miscellaneous
Class Information Communication Most of the communication over email (
[email protected] list) - Make sure to subscribe to the list and check your email at least once a day I will also try using Piazza for communication
Since there will be a lot of doubts which will be common to many of you, please try to participate in the discussion forum on Piazza Course Number – B.Tech (CSE-337, M.Tech. – CSE-537) Will be a heavy course – Do not take it if you are not willing to put in consistent hard work Need to learn Embedded C Need patience to debug hardware bugs
Real deployments will be challenging – you need to get your hands dirty
17
Course Outline
Logistics - Miscellaneous
Reference books: Computers as Components: Principles of Embedded Computing System Design by Wayne Wolf Designing Embedded Hardware by John Catsoulis (O’Reilly) Although lecture slides will suffice for most purposes
NO gadget in the class - computer, phone, tablet … Food/drinks allowed Arrive on time (within 2 min) No cross-talk in the class After first warning you will be asked to leave the class I will be on travel for a few days: TAs to take substitute lectures in that case January 11 January 15 (possibly) February 15 18
Class Breaks Every class, we will take a short 5 minute break in between: Time for all of us to share something and get to know each other better You can use this to ask me on my experiences with things related/non-related to the course Raise your hand to stop me and take a break
19
Course Outline
Thinking Ahead
Will be one of the unique opportunities to have fun with small computing systems interfacing them with the physical world around you Companies value hands-on exposure in software, embedded and hardware Course projects will be subset of large scale deployment we plan on campus – Your chance to contribute something that will remain live for a long time You can continue with BTP/MTP in embedded in your final year
Possibly extending the group project itself
20
What? - Lecture Overview Week 1,2: Introduction to embedded systems
Course logistics Brief introduction to embedded and cyber physical systems Overview of Embedded Systems design challenges Architectural overview of example embedded system architectures - TelosB (TI-MSP430); mBED (ARM7 based NXP-LPC1768); AVR based (Atmel-ATMega328)
Week 3: Introduction to AVR architecture
Exposure to architecture of AVR microcontroller and programming these devices
Week 4,5,6: Microcontroller peripherals and interfaces
Exposure to various peripherals - Timers, counters, watchdog, PWM, ADC Motivation and requirement of voltage regulators External memory interfaces Serial/Parallel communication protocols - RS232, I2C, PCI, SPI 21
What? - Lecture Overview Week 7: Collecting and transmitting data
ADC interfaces for external sensors Wireless transceivers for transmitting the collected data
Week 8: Mid term week Week 9-10: Real Time Operating Systems
Give overview of freeRTOS Discuss things specific to the platform that will be used for the Group Project
Week 11-16: Student presentations on recent work on Cyberphysical systems Papers will be put up by mid-sem
22
QUESTIONS ?
23
Readings for this week Wikipedia article on Embedded Systems http://en.wikipedia.org/wiki/Embedded_system Wikipedia article on Cyber-Physical Systems http://en.wikipedia.org/wiki/Cyber-physical_system Edward Lee, Cyber Physical Systems: Design Challenges, University of California, Berkeley http://www.eecs.berkeley.edu/Pubs/TechRpts/2008/EECS-20088.html
24
Ubiquitous Embedded Systems Embedded systems are becoming ever more integral part of our daily lives - to an extent go unnoticed Specialized instrumentation only serve the specific purpose Typically lack interaction thus limiting the system level interaction logging and
corresponding decision making
What systems do you come across in your typical daily routine?
25
Where else?
Home appliances Automotive Personal electronics Entertainment Transportation -
Manufacturing Healthcare Agriculture Chemical Processes Robotics …. 26
Faster, Smaller, Numerous
Moore’s Law Computing resources double every 1-2 years
Bell’s Law New computing class every 10 years
27
Evolution of Computing Classes Mainframes - 1960s Mini computers - 1970s Personal computers and workstations - 1980s Web Browser - Client Server Structures enabled by internet 1990s Small form factor devices (cellphones, ipod) - 2000s Wireless Sensor Networks - 2010 Body Networks - vision, hearing, monitoring - 2015 Embedding of speech and vision functions - 2020 What is the trend? 28
Changing Face of Computing
29
Changing Face of Computing
30
Embedded Everywhere Specialized devices and information appliances are replacing the generalist PC Variety of forms: set-top boxes, smart mobile phones, iPods, iPads, game consoles, robotic appliance etc. Vast majority of internet access devices are appliances and not PCs - In 1997, 96% of internet access devices sold in the US were PCs - Now, unit shipments of just internet-enabled cells phones exceed PCs Traditional systems becoming dependent on computation systems Modern cars: up to ~100 processors running complex software - engine & emissions control, stability & traction control, diagnostics, gearless automatic transmission http://www.howstuffworks.com/car-computer.htm 31
Embedded Everywhere An indicator: where are the CPUs being used? More than 90% of all processors get used in “non-computers” Over 10 Billion embedded processors of various types shipped in 2008 Report by US National Research Council: “Embedded, Everywhere” (2001) http://books.nap.edu/html/embedded_everywhere/ UN ITU Report in 2005 “The Internet of Things” http://www.itu.int/osg/spu/publications/internetofthings/ Ubiquitous computing, pervasive computing, physical computing, cyber-physical systems, internet of things...
32