Introduction to Embedded Systems Instructed by Iksan Bukhori
Introduction to Embedded Systems Instructed by: Iksan Bukhori
Outline • • Course Information Course Overview & Objectives Course Materials Course Requirement/Evaluation/Grading (REG)
I. Course Information • Instructor + Name : Iksan Bukhori + Address : Jl. Ki Hadjar Dewantara, President University, Cikarang, Bekasi : bukhoriiksan@gmail. com : + Email Address + Office Hours • Course‘s Meeting Time & Location + Meeting Time : Thursday-> 10. 30 – 13. 00 (Lec) + Location : Friday -> 10. 30 – 13. 00 (Lab) : Room B, President University, Cikarang Baru, Bekasi
Course Objectives The objectives of this course are students should be able to : • Demonstrate the understanding of several microprocessor architectures & organizations, bus systems, input/output units, and memory systems • Exhibit the ability in designing and building an interface for AVR ATmega 328 p microcontroller of an Arduino UNO Board • Develop interface programming using Assembly, or C languages • Assemble the interfacing of AVR ATmega 328 p microcontroller to other external peripherals, sensor(s) , actuator(s), computer(s)
III. Course Materials Week (Tentative) I II IV V VI Content Activity
Week Content Activity (Tentative) VIII IX X XI XIII Final Exam : All Chapters/Activities
IV. Course Requirement/Evaluation/Grading • Requirements : - Microcomputer Interfacing - Engineering Programming • Evaluation for the final grade will be based on : - Mid-Term Exam - Quizzes - Lab Experiments or Assignments - Course Project : 30 % : 15 % : 25 % : 30%
- Mid-Term Exam consists of Lectures given in between the Week 1 and the Week 6. - Final Exam covers whole subjects or materials given during the classes. § Grading Policy Final grades may be adjusted; however, you are guaranteed the following: If your final score is 85 - 100, your grade will be A. If your final score is 70 - 84, your grade will be B. If your final score is 60 - 69, your grade will be C. If your final score is 55 - 59, your grade will be D. If your final score is < 55, your grade will be E.
REFERENCES • LOTS
Rules & Regulations
Chapter 6 Analog to Digital Converters
Analog Signal Analog signals – directly measurable quantities in terms of some other quantity, continuous in time and sensitive to noises. Examples: l Thermometer – mercury height rises as temperature rises l Car Speedometer – Needle moves farther right as you accelerate l Stereo – Volume increases as you turn the knob.
Digital Signals – have only two states. For digital computers, we refer to binary states, 0 and 1. “ 1” can be on, “ 0” can be off. Digital signals are discrete both in time and amplitude. Examples: l Light switch can be either on or off l Door to a room is either open or closed
Why is ADC Important? o All microcontrollers store information using digital logic o Compress information to digital form for efficient storage o Medium for storing digital data is more robust o Digital data transfer is more efficient o Digital data is easily reproducible o Provides a link between real-world signals and data storage
How ADC Works Clock signal Input Analog Signal S/H Circuit Sample A/D and Hold Conversion Output Analog signal segment Equally spaced Digital signal
Sampling Reduction of a continuous signal to a discrete signal Achieved through sampling and holding circuit Switch ON – sampling of signal (time to charge capacitor w/ Vin) Switch OFF - voltage stored in capacitor (hold operation) Must hold sampled value constant for digital conversion
Sampling rate depends on clock frequency Use Nyquist Criterion Increasing sampling rate increases accuracy of conversion Possibility of aliasing Sampling Signal: Sampling Period: Nyquist Criterion:
Aliasing High and low frequency samples are indistinguishable Results in improper conversion of the input signal Usually exists when Nyquist Criterion is violated Can exist even when: Prevented through the use of Low-Pass (Anti-aliasing) Filters
Quantizing and Encoding Approximates a continuous range of values and replaces it with a binary number Error is introduced between input voltage and output binary representation Error depends on the resolution of the ADC
Quantizing The number of possible states that the converter can output is: N=2 n where n is the number of bits in the AD converter Example: For a 3 bit A/D converter, N=23=8. Analog quantization size: Q=(Vmax-Vmin)/N = (10 V – 0 V)/8 = 1. 25 V Resolution of ADC
Quantizing Example: Quantize a continuous voltage within range 0 -10 v into a set of discrete states based on 3 -bit system. Output States Discrete Voltage Ranges (V) 0 0. 00 -1. 25 1 1. 25 -2. 50 2 2. 50 -3. 75 3 3. 75 -5. 00 4 5. 00 -6. 25 5 6. 25 -7. 50 6 7. 50 -8. 75 7 8. 75 -10. 0
Encoding • Here we assign the digital value (binary number) to each state for the computer to read. Output States Output Binary Equivalent 0 000 1 001 2 010 3 011 4 100 5 101 6 110 7 111
Accuracy of A/D Conversion There are two ways to best improve accuracy of A/D conversion: • increasing the resolution which improves the accuracy in measuring the amplitude of the analog signal. • increasing the sampling rate which increases the maximum frequency that can be measured.
Resolution • Resolution (number of discrete values the converter can produce) = Analog Quantization size (Q) = Vrange / 2^n, where Vrange is the range of analog voltages which can be represented • limited by signal-to-noise ratio (should be around 6 d. B) • In our previous example: Q = 1. 25 V, this is a high resolution. A lower resolution would be if we used a 2 -bit converter, then the resolution would be 10/2^2 = 2. 50 V.
Sampling Rate Frequency at which ADC evaluates analog signal. As we see in the second picture, evaluating the signal more often more accurately depicts the ADC signal.
Overall Better Accuracy • Increasing both the sampling rate and the resolution you can obtain better accuracy in your AD signals.
A/D Converter Types • Converters – Flash ADC – Delta-Sigma ADC – Dual Slope (integrating) ADC – Successive Approximation ADC
Flash ADC • Consists of a series of comparators, each one comparing the input signal to a unique reference voltage. • The comparator outputs connect to the inputs of a priority encoder circuit, which produces a binary output
Elements of Flash ADC Encoder Comparator
How Flash ADC Works Resolution 23 -1 = 7 Comparators 3 Bit Digital Output
Flash ADC: Pros and Cons Advantages • Simplest in terms of operational theory • Most efficient in terms of speed, very fast • limited only in terms of comparator and gate propagation delays Disadvantages • Lower resolution • Expensive • For each additional output bit, the number of comparators is doubled • i. e. for 8 bits, 256 comparators needed
Delta-Sigma ADC: Components Main Components Resistors Capacitor Comparators Control Logic DAC
How Delta-Sigma ADC Works Input is over sampled, and goes to integrator. The integration is then compared to ground. Iterates and produces a serial bit stream Output is a serial bit stream with # of 1’s proportional to Vin With this arrangement the sigma-delta modulator automatically adjusts its output to ensure that the average error at the quantizer output is zero. The integrator value is the sum of all past values of the error, so whenever there is a non-zero error value the integrator value just keeps building until the error is once again forced to zero.
Delta-sigma ADC: Pros and Cons Advantages • High Resolution • No need for precision components Disadvantages • Slow due to over sampling • Only good for low bandwidth
Double Slope ADC: Components
How Double Slope ADC Works • The sampled signal charges a capacitor for a fixed amount of time • By integrating over time, noise integrates out of the conversion • Then the ADC discharges the capacitor at a fixed rate with the counter counts the ADC’s output bits. A longer discharge time results in a higher count
Double Slope ADC: Pros and Cons Advantages • Input signal is averaged • Greater noise immunity than other ADC types • High accuracy Disadvantages • Slow • High precision external components required to achieve accuracy
Successive Approximation ADC: Components
HOW SA ADC Works • A Successive Approximation Register (SAR) is added to the circuit • Instead of counting up in binary sequence, this register counts by trying all values of bits starting with the MSB and finishing at the LSB. • The register monitors the comparators output to see if the binary count is greater or less than the analog signal input and adjusts the bits accordingly
SA ADC: Pros and Cons Advantages • Capable of high speed and reliable • Medium accuracy compared to other ADC types • Good tradeoff between speed and cost • Capable of outputting the binary number in serial (one bit at a time) format. Disadvantages • Higher resolution successive approximation ADC’s will be slower • Speed limited to ~5 Msps
ADC Type Comparisons Type Speed (relative) Cost (relative) Dual Slope Slow Med Flash Very Fast High Successive Appox Medium – Fast Low Sigma-Delta Slow Low
Thank You
- Slides: 42