11-1 Bard, Tiwari, Telang, Janapa Reddi, Gerstlauer, Valvano, Yerraballi EE 319K Introduction to Embedded Systems Lecture 11: Data Acquisition, Numerical.

Slides:



Advertisements
Similar presentations
11-1 Bard, Gerstlauer, Valvano, Yerraballi EE 319K Introduction to Embedded Systems Lecture 11: Data Acquisition, Numerical Fixed-Point Calculations, Lab.
Advertisements

EE 319K Introduction to Embedded Systems
4-1 EE 319K Introduction to Embedded Systems Lecture 4: Arithmetic overflow, Branches, Control Structures, Abstraction & Refinement Bard, Erez, Gerstlauer,
1/1/ / faculty of Electrical Engineering eindhoven university of technology Introduction Part 2: Data types and addressing modes dr.ir. A.C. Verschueren.
INSTRUCTION SET ARCHITECTURES
1-1 Bard, Gerstlauer, Valvano, Yerraballi EE 319K Introduction to Microcontrollers Lecture 1: Introduction, Embedded Systems, Product Life-Cycle, ARM Programming.
Assembly Language for Intel-Based Computers, 4 th Edition Chapter 1: Basic Concepts (c) Pearson Education, All rights reserved. You may modify and.
Fixed Point Numbers The binary integer arithmetic you are used to is known by the more general term of Fixed Point arithmetic. Fixed Point means that we.
Analysis of Algorithms
Analog-to-Digital Converter (ADC) And
EET 2261 Unit 14 INCOMPLETE Analog-to-Digital Conversion (ADC) & Digital-to-Analog Conversion (DAC)  Read.  Homework #13 and Lab #13 due next week. 
ECE 353 Introduction to Microprocessor Systems Michael G. Morrow, P.E. Week 6.
Lecture 17: Analog to Digital Converters Lecturers: Professor John Devlin Mr Robert Ross.
DAT2343 Comparison of The LMC and General Computer Models © Alan T. Pinck / Algonquin College; 2003.
10-1 Bard, Tiwari, Telang, Janapa Reddi, Gerstlauer, Valvano, Yerraballi EE 319K Introduction to Embedded Systems Lecture 10: Sampling, Analog-to-Digital.
Bellevue University CIS 205: Introduction to Programming Using C++ Lecture 3: Primitive Data Types.
Elementary Data Types Scalar Data Types Numerical Data Types Other
Data types and variables
Assembly Language for Intel-Based Computers, 5 th Edition Chapter 1: Basic Concepts (c) Pearson Education, All rights reserved. You may modify.
2 Systems Architecture, Fifth Edition Chapter Goals Describe numbering systems and their use in data representation Compare and contrast various data.
6-1 EE 319K Introduction to Embedded Systems Lecture 6: SysTick Timer, Exam 1 Review Bard, Erez, Gerstlauer, Valvano, Yerraballi, Telang, Janapa Reddi,
DATA ACQUISITION Today’s Topics Define DAQ and DAQ systems Signals (digital and analogue types) Transducers Signal Conditioning - Importance of grounding.
Simple Data Type Representation and conversion of numbers
Advanced Instructions Most PLCs now support more advanced functions such as Floating point math, Boolean operations, Shifting, Sequencing, Program control.
1 Layers of Computer Science, ISA and uArch Alexander Titov 20 September 2014.
Computers Organization & Assembly Language
Number Systems Part 2 Numerical Overflow Right and Left Shifts Storage Methods Subtraction Ranges.
CSU0014 Assembly Languages Homepage: Textbook: Kip R. Irvine, Assembly Language for Intel-Based Computers,
Summer 2014 Chapter 1: Basic Concepts. Irvine, Kip R. Assembly Language for Intel-Based Computers 6/e, Chapter Overview Welcome to Assembly Language.
Assembly Language for x86 Processors 7th Edition
Machine Instruction Characteristics
Data Acquisition Data acquisition (DAQ) basics Connecting Signals Simple DAQ application Computer DAQ Device Terminal Block Cable Sensors.
Copyright © 2002 W. A. Tucker1 Chapter 7 Lecture Notes Bill Tucker Austin Community College COSC 1315.
Lec 3: Data Representation Computer Organization & Assembly Language Programming.
Objectives Implement pointers using indexed addressing modes Use pointers to access arrays, strings, structures, tables, and matrices Present finite-state.
Input, Output, and Processing
Other Chapters From the text by Valvano: Introduction to Embedded Systems: Interfacing to the Freescale 9S12.
8-1 Embedded Systems Fixed-Point Math and Other Optimizations.
Quick and Easy Binary to dB Conversion George Weistroffer, Jeremy Cooper, and Jerry Tucker Electrical and Computer Engineering Virginia Commonwealth University.
9-1 EE 319K Introduction to Microcontrollers Lecture 9:I/O Synchronization; LCD Interfacing; Implementing Local Variables using a Stack Frame; Parameter.
1 Instruction Set Architecture (ISA) Alexander Titov 10/20/2012.
Representing Numerical Data Analog Any signal that varies continuously over time Mechanical Pneumatic Hydraulic Electrical Digital Quantities are represented.
CS161 Topic #16 1 Today in CS161 Lecture #16 Prepare for the Final Reviewing all Topics this term Variables If Statements Loops (do while, while, for)
Chapter 10 Hashing. The search time of each algorithm depend on the number n of elements of the collection S of the data. A searching technique called.
Chapter 5 Input/Output 5.1 Principles of I/O hardware
8-1 EE 319K Introduction to Microcontrollers Lecture 8:Fixed Point Numbers, Local Variables, Binding, Allocation, Access, Deallocation.
Operators & Identifiers The Data Elements. Arithmetic Operators exponentiation multiplication division ( real ) division ( integer quotient ) division.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
EE 319K Introduction to Embedded Systems
CHAPTER 2 PROBLEM SOLVING USING C++ 1 C++ Programming PEG200/Saidatul Rahah.
Ch. 10 Numerical Calculations From Valvano’s text Introduction to Embedded Systems.
Time Management.  Time management is concerned with OS facilities and services which measure real time.  These services include:  Keeping track of.
Onlinedeeneislam.blogspot.com1 Design and Analysis of Algorithms Slide # 1 Download From
INTRODUCTION TO PROGRAMING System Development Mansoura October 2015.
MECH 373 Instrumentation and Measurements
Chapter 3 Data Representation
Topic: Binary Encoding – Part 1
Digital Control CSE 421.
“<Fill in your definition here.>”
EE 319K Introduction to Embedded Systems
Microprocessor Systems Design I
Microprocessor Systems Design I
Data Types.
EET 2261 Unit 14 INCOMPLETE Analog-to-Digital Conversion (ADC) & Digital-to-Analog Conversion (DAC) Read. Homework #13 and Lab #13 due next week. Quiz.
This presentation will probably involve audience discussion, which will create action items. Use PowerPoint to keep track of these action items during.
CSCI1600: Embedded and Real Time Software
EE 319K Introduction to Embedded Systems
ECE 103 Engineering Programming Chapter 8 Data Types and Constants
CSCI1600: Embedded and Real Time Software
Working with the Compute Block
Presentation transcript:

11-1 Bard, Tiwari, Telang, Janapa Reddi, Gerstlauer, Valvano, Yerraballi EE 319K Introduction to Embedded Systems Lecture 11: Data Acquisition, Numerical Fixed-Point Calculations, Lab 8

11-2 Agenda  Recap  Sampling, Nyquist  Analog to Digital Conversion  Agenda  Exam 2 oPointers, arrays, strings, structures, FSMs  Data acquisition  Numerical fixed-point calculations  Lab 8 Bard, Tiwari, Telang, Janapa Reddi, Gerstlauer, Valvano, Yerraballi

11-3 Exam 2 review  0) Being able to quickly design, implement, and debug assembly software  1) Understanding differences between data and address, being able to use pointers and indices  2) Understanding differences between 8-bit, 16-bit data and 32-bit data  3) Understanding differences between signed and unsigned integers  4) Programming if-then if-then-else for-loops while-loops and do-while-loops in assembly  5) Processing a variable-length array or string, either size first or terminating code at end  6) Addition, subtraction, multiplication, division, shift, and, or, xor

11-4 Exam 2 review  7) Structures  8) Call by value, call by reference, return by value  9) AAPCS Program conventions  Save and restore R4-R11,LR if you wish to modify  Parameter passing in registers R0,R1,R2,R3  All input parameters promoted to 32 bits  Return parameter in R0  10) Implementation of FSM using a table structure with an index  Moore  Not a real port, so no bit-specific addressing, no timer  Read modify write sequences to be friendly (including input pin)  11) Accessing arrays strings and structures using pointers and indices  Stepping through two or more arrays at a time  8/16/32-bit data, signed/unsigned numbers No FSM Spring 2015

11-5 Exam 2 review  A) You may be given one or more variable length arrays of data, buf[i]  The size may be the first entry  There may be a termination code  The data may be 8-bit ASCII characters or integers  The integers may be 8 16 or 32 bits  Integers may be signed or unsigned  A pointer to this array may be passed in R0  You may be asked to deal with special cases: size=0, size too big, overflow

11-6 Exam 2 Array problems  Determine the size of the array  Return the first element of the array  Find the maximum or minimum element in an array  Find the sum of all the elements  Find the average of all the elements  Find the mode of all the elements  Find the range = maximum - minimum  Find the maximum or minimum slope (buf[i+1]-buf[i])  Find the maximum or minimum absolute value  Count the number of times a particular value occurs (buf[i]==1000)  Search for the occurrence of one string in another  Concatenate two strings together  Delete characters from a string  Insert one string into another  Move data from one place to another within an array or string  Sort the array (we will give the steps)

11-7 Exam 2 FSM problems  Convert a FSM graph to a linked data structure or table with an index  Write a Mealy FSM controller (with or without timer wait)  Write a Moore FSM controller (with or without timer wait)  It also may involve accessing a linked structure like Lab 5 No FSM Spring 2015

11-8 Exam 2  Runs on your laptop  Keil in simulation (no board)  During exam: Keil, Keil help, PC calculator  Needs internet to download and upload  Battery power  Written in assembly (no C)  No SysTick, no interrupts  Overall grade a combination of  Numerical score from grader  Program style (reviewed later)  Tricking the grader is considered dishonest  Hard-coding answers is considered dishonest

11-9 Data Acquisition System (Lab 8)  Hardware  Transducer  Electronics  ADC  Software  ADC device driver  Timer routines  Output compare interrupts  LCD driver  Measurement system  How fast to update  Fixed-point number system  Algorithm to convert ADC into position Bard, Tiwari, Telang, Janapa Reddi, Gerstlauer, Valvano, Yerraballi

11-10 Analog Input Device  Transducer – A device actuated by power from one system that supplies power in the same or other form to another system. Bard, Tiwari, Telang, Janapa Reddi, Gerstlauer, Valvano, Yerraballi

11-11 Transducer Circuit  Position to voltage Bard, Tiwari, Telang, Janapa Reddi, Gerstlauer, Valvano, Yerraballi

11-12 Data Acquisition System  Data flow graph Bard, Tiwari, Telang, Janapa Reddi, Gerstlauer, Valvano, Yerraballi Position Sensor Voltage 0 to +3.3V ADC hardware ADC driver Sample 0 to 4095 SysTick ISR Sample 0 to 4095 SysTick hardware LCD display LCD driver Fixed-point 0 to Position 0 to 2 cm main Mailbox ST7735

11-13 Data Acquisition System  Call graph Bard, Tiwari, Telang, Janapa Reddi, Gerstlauer, Valvano, Yerraballi ST7735

11-14 Thread Synchronization in Lab 8  SysTick ISR  Sample ADC  Store in ADCmail  Set ADCstatus  Main loop  Wait for ADCstatus  Read ADCmail  Clear ADCstatus  Convert to distance  Display on LCD Background threadForeground thread Bard, Tiwari, Telang, Janapa Reddi, Gerstlauer, Valvano, Yerraballi

11-15 Sampling Jitter  Definition of time-jitter, δ t :  Let n Δ t be the time a task is scheduled to be run and t n the time the task is actually run  Then δ t n = t n – n Δ t  Real time systems with periodic tasks, must have an upper bound, k, on the time-jitter  -k ≤ δ t n ≤ +k for all n Bard, Tiwari, Telang, Janapa Reddi, Gerstlauer, Valvano, Yerraballi

11-16 Measurement  Resolution: Limiting factors  Transducer noise  Electrical noise  ADC precision  Software errors  Accuracy: Limiting factors  Resolution  Calibration  Transducer stability Average accuracy (with units of x) = Bard, Tiwari, Telang, Janapa Reddi, Gerstlauer, Valvano, Yerraballi

11-17 Fixed-Point Revisited  Why: express non-integer values no floating point hardware support (want it to run fast)  When: range of values is known range of values is small  How: 1) variable integer, called I. may be signed or unsigned may be 8, 16 or 32 bits (precision) 2) fixed constant, called  (resolution) value is fixed, and can not be changed not stored in memory specify this fixed content using comments value  integer  Bard, Tiwari, Telang, Janapa Reddi, Gerstlauer, Valvano, Yerraballi

11-18 Fixed-Point Numbers  The value of the fixed-point number: Fixed-point number  I Smallest value= I min , where I min is the smallest integer Largest value = I max , where I max is the largest integer  Decimal fixed-point, =10 m Decimal fixed-point number = I 10 m Nice for human input/output  Binary fixed-point, =2 m Binary fixed-point number = I 2 m Easier for computers to perform calculations Bard, Tiwari, Telang, Janapa Reddi, Gerstlauer, Valvano, Yerraballi

11-19 Fixed-Point Math Example Consider the following calculation. C = 2**R The variables C, and R are integers 2 ≈ C = (6283*R)/1000 Bard, Tiwari, Telang, Janapa Reddi, Gerstlauer, Valvano, Yerraballi

11-20 Fixed-Point Math Example Calculate the volume of a cylinder V = *R 2 * L The variables are fixed-point R = I*2 -4 cmL = J*2 -4 cm V = K*2 -8 cm 3 2 ≈ 201*2 -5 K = (201*I*I*J)>>9 Bard, Tiwari, Telang, Janapa Reddi, Gerstlauer, Valvano, Yerraballi

11-21 V in (V) Analog in N Digital out I (1 mV) Variable part LCD  =0.001 V V in = 3N/4096how ADC works V in = I definition of fixed point I = (3000*N)/4096 substitution I = (mN+b)/ 4096 calibrate to get m and b Bard, Tiwari, Telang, Janapa Reddi, Gerstlauer, Valvano, Yerraballi Make a Voltmeter with ADC

11-22 Lab 8 Calibration Bard, Tiwari, Telang, Janapa Reddi, Gerstlauer, Valvano, Yerraballi