Digital-to-Analog Converter. Lab 3 Final Report

Similar documents
Lab 3: Embedded Systems

Embedded Test System. Design and Implementation of Digital to Analog Converter. TEAM BIG HERO 3 John Sopczynski Karim Shik-Khahil Yanzhe Zhao

Lab 3 Final report: Embedded Systems Digital Potentiometer Subsystem TEAM: RAR

Design and Implement of a Frequency Response Analysis System

Lab 1.2 Joystick Interface

Data Conversion and Lab Lab 4 Fall Digital to Analog Conversions

EE 368 Electronics Lab. Experiment 10 Operational Amplifier Applications (2)

Brian Hanna Meteor IP 2007 Microcontroller

UC Berkeley, EECS Department EECS 40/42/100 Lab LAB3: Operational Amplifier UID:

Exercise 1: AC Waveform Generator Familiarization

AC : PERSONAL LAB HARDWARE: A SINE WAVE GENERATOR, LOGIC PULSE SIGNAL, AND PROGRAMMABLE SYNCHRONOUS SERIAL INTERFACE FOR ENHANCING EDUCATION

Preliminary Design Report. Project Title: Search and Destroy

Optical Theremin CDR

Debugging a Boundary-Scan I 2 C Script Test with the BusPro - I and I2C Exerciser Software: A Case Study

Intro To Engineering II for ECE: Lab 7 The Op Amp Erin Webster and Dr. Jay Weitzen, c 2014 All rights reserved.

Development of a MATLAB Data Acquisition and Control Toolbox for BASIC Stamp Microcontrollers

ENGN Analogue Electronics Digital PC Oscilloscope

Single-phase Variable Frequency Switch Gear

Name EGR 2131 Lab #2 Logic Gates and Boolean Algebra Objectives Equipment and Components Part 1: Reading Pin Diagrams 7400 (TOP VIEW)

THE PENNSYLVANIA STATE UNIVERSITY. Lab 2: Designing Optical Theremin Instrument. EE 300W Section 001. Nathaniel Houtz, Ji Eun Shin, Peter Wu 2/22/2013

ECE2049: Embedded Systems in Engineering Design Lab Exercise #4 C Term 2018

Design and Fabrication of High Frequency Linear Function Generator with Digital Frequency Counter using MAX038 and a PIC microcontroller

EE 300W Lab 2: Optical Theremin Critical Design Review

High Voltage Waveform Sensor

DEPARTMENT OF ELECTRICAL ENGINEERING LAB WORK EE301 ELECTRONIC CIRCUITS

Lab Exercise 6: Digital/Analog conversion

Single-phase Variable Frequency Switch Gear

I hope you have completed Part 2 of the Experiment and is ready for Part 3.

BINARY AMPLITUDE SHIFT KEYING

Lab Exercise # 9 Operational Amplifier Circuits

Total Hours Registration through Website or for further details please visit (Refer Upcoming Events Section)

MAE106 Laboratory Exercises Lab # 1 - Laboratory tools

KUMU A O CUBESAT: THERMAL SENSORS ON A CUBESAT

DC Motor and Servo motor Control with ARM and Arduino. Created by:

Understanding the Arduino to LabVIEW Interface

LABORATORY EXPERIMENT. Infrared Transmitter/Receiver

9 Feedback and Control

Lab #10: Finite State Machine Design

University of North Carolina-Charlotte Department of Electrical and Computer Engineering ECGR 3157 Electrical Engineering Design II Fall 2013

EE 300W 001 Lab 2: Optical Theremin. Cole Fenton Matthew Toporcer Michael Wilson

Experiment # 4. Frequency Modulation

2.0 Discussion: 2.1 Approach:

Operational Amplifiers

Data Conversion and Lab Lab 3 Spring Analog to Digital Converter

Oscillator/Demodulator to Fit on Flexible PCB

νµθωερτψυιοπασδφγηϕκλζξχϖβνµθωερτ ψυιοπασδφγηϕκλζξχϖβνµθωερτψυιοπα σδφγηϕκλζξχϖβνµθωερτψυιοπασδφγηϕκ χϖβνµθωερτψυιοπασδφγηϕκλζξχϖβνµθ

University of California at Berkeley Donald A. Glaser Physics 111A Instrumentation Laboratory

Analog-to-Digital Converter. Student's name & ID (1): Partner's name & ID (2): Your Section number & TA's name

Modulation is the process of impressing a low-frequency information signal (baseband signal) onto a higher frequency carrier signal

SPI, Talking to Chips, and Minimizing Noise

6. HARDWARE PROTOTYPE AND EXPERIMENTAL RESULTS

ESE 350 Microcontroller Laboratory Lab 5: Sensor-Actuator Lab

LABORATORY 3 v1 CIRCUIT ELEMENTS

E85: Digital Design and Computer Architecture

University of Pennsylvania. Department of Electrical and Systems Engineering. ESE Undergraduate Laboratory. Analog to Digital Converter

A Solar-Powered Wireless Data Acquisition Network

Lab 1: Non-Ideal Operational Amplifier and Op-Amp Circuits

University of Portland EE 271 Electrical Circuits Laboratory. Experiment: Op Amps

DEPARTMENT OF ELECTRICAL ENGINEERING LAB WORK EE301 ELECTRONIC CIRCUITS

Each individual is to report on the design, simulations, construction, and testing according to the reporting guidelines attached.

EE445L Fall 2011 Quiz 2A Page 1 of 6

EE 110 Introduction to Engineering & Laboratory Experience Saeid Rahimi, Ph.D. Lab 6 Diodes: Half-Wave and Full-Wave Rectifiers Converting AC to DC

ADVANCED EMBEDDED MONITORING SYSTEM FOR ELECTROMAGNETIC RADIATION

CHAPTER IV DESIGN AND ANALYSIS OF VARIOUS PWM TECHNIQUES FOR BUCK BOOST CONVERTER

Lab 1: Non-Ideal Operational Amplifier and Op-Amp Circuits

EE 314 Spring 2003 Microprocessor Systems

Single-phase Variable Frequency Switch Gear

EE 462G Laboratory #1 Measuring Capacitance

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Hands-On Introduction to EE Lab Skills Laboratory No. 2 BJT, Op Amps IAP 2008

GCSE (9-1) WJEC Eduqas GCSE (9-1) in ELECTRONICS ACCREDITED BY OFQUAL DESIGNATED BY QUALIFICATIONS WALES SAMPLE ASSESSMENT MATERIALS

Electronics I. laboratory measurement guide

Hearing Aid Redesign: Test Plans ELECTRICAL TESTING

In this lecture, we will look at how different electronic modules communicate with each other. We will consider the following topics:

RC Filters and Basic Timer Functionality

EE 308 Lab Spring 2009

LABORATORY 5 v3 OPERATIONAL AMPLIFIER

Experiment No. 3 Pre-Lab Phase Locked Loops and Frequency Modulation

Curve Tracer Design for Measuring Semiconductor Components Dionisius Adrianta Wardhana

LAB #10: Analog Interfacing

Figure 1: One Possible Advanced Control System

University of North Carolina, Charlotte Department of Electrical and Computer Engineering ECGR 3157 EE Design II Fall 2009

Sequential Logic Circuits

Serial Communication AS5132 Rotary Magnetic Position Sensor

EE43 43/100 Fall Final Project: 1: Audio Amplifier, Part Part II II. Part 2: Audio Amplifier. Lab Guide

RFID Door Unlocking System

EE-110 Introduction to Engineering & Laboratory Experience Saeid Rahimi, Ph.D. Labs Introduction to Arduino

Waveform Generators and Oscilloscopes. Lab 6

INTRODUCTION. Figure 1 Three-terminal op amp symbol.

Experiment # 1 Introduction to Lab Equipment

Laboratory 2. Lab 2. Instrument Familiarization and Basic Electrical Relations. Required Components: 2 1k resistors 2 1M resistors 1 2k resistor

Experiment 5: Basic Digital Logic Circuits

Combinational logic: Breadboard adders

EE 210 Lab Exercise #3 Introduction to PSPICE

CENG4480 Embedded System Development and Applications The Chinese University of Hong Kong Laboratory 1: Op Amp (I)

Sonoma State University Department of Engineering Science Spring 2017

Generation of Gaussian Pulses using FPGA for Simulating Nuclear Counting System

Non_Inverting_Voltage_Follower -- Overview

EE 233 Circuit Theory Lab 3: First-Order Filters

Electronics. RC Filter, DC Supply, and 555

Physics 309 Lab 3 Bipolar junction transistor

Transcription:

Digital-to-Analog Converter Lab 3 Final Report The Ion Cannons: Shrinand Aggarwal Cameron Francis Nicholas Polito Section 2 May 1, 2017 1

Table of Contents Introduction..3 Rationale..3 Theory of Operation.3 Theory of Interfaces.3 Implementation 4 Explanation of Code and Circuitry..4 Verification Testing.4 Validation Testing...4 Results from Integrated System...5 Discussion...5 Value Statement...6 Conclusion...6 Appendices...7 Appendix A: Code, Block Diagrams, and Pinouts..7 Appendix B: Bill of Materials 13 Appendix C: Gantt Chart...14 References..14 2

Introduction In Lab 3, we explored the process of working with embedded systems. It is common in industry to take a large project and break it into multiple smaller projects in order to create smaller and easier problems. For this lab, our project was broken into four subsystems that were integrated together to determine what component was in the black box. The subsystems were the keypad which controlled the actions done by the system, a Digital-to-Analog Converter, a Digital Potentiometer, and an Analog-to-Digital Converter. The system diagram can be found in Appendix A. Our group, The Ion Cannons, was assigned to the Digital-to-Analog Converter (DAC). The DAC accepted digital signals from the keypad and outputted an analog signal to the digital potentiometer. The outputs from the DAC were either a sinusoid or a square wave with 1 or 10 Hz frequency. This was determined by what the input from the keypad was. These inputs determined the type of wave, the frequency of the wave, and when to start and stop sampling. The analog signal created by the DAC was significant because it allowed the DigiPot and black box to manipulate the signal. After the signal was manipulated, the ADC outputted a digital signal that we used to successfully determine the characteristics of the black box. Rationale The DAC subsystem generates specific waveforms and receives messages from the keypad. Theory of Implementation The main function of DAC is to convert a digital signal to a corresponding analog sinusoidal or square wave. It allows the user to start, stop, and select the frequency and type of the output waveform. The waves oscillate at a frequency of 1 Hz or 10 Hz with an amplitude ranging from 0±0.05 V to 1±0.05 V. The DAC communicates with the Mbed LPC1768 microcontroller to output the waveforms. The waveforms will then communicate with the DAC MCP4725 chip through I 2 C serial communication. The converted analog signal from the DAC will then be output as the input for the DigiPot subsystem. Theory of Interfaces The DAC uses the CAN bus interface to read the commands from the keypad. The DAC and the CAN follow I 2 C communication protocol. I 2 C is synchronous and operates on masterslave format. The CAN uses a 3.3V TTL logic signal to take inputs from the keypad and the DAC output waveforms to the digital potentiometer. 3

Implementation Explanation of Code and Circuitry In order to realize the Digital-Analog Converter (DAC) system we used a LCP1768 Mbed Microcontroller, a MCP4725 DAC, and a MCP2551 CAN Bus. The Mbed held the main code and sent commands to the DAC and the CAN bus to convert and transmit the signals needed by the keypad. To do this, we connected the DAC to pins 9 and 10 of the Mbed to utilize the I2C communication protocols. This allowed us to use the Fast 400 khz mode. We connected the CAN bus to the CAN rd and td terminals to pins 30 and 29 respectively. This allowed our circuit to read the commands sent from the keypad. Using C code as shown in Figure 1, we instantiated the DAC output to achieve the 400 khz mode of the I2C bus and utilized the functionality of pins 9 and 10. The device address was determined to be 0x62. The serial instantiation and CAN instantiation allows for communication between the computer and the Mbed, and between the Mbed and the CAN Bus respectively. We reserved and defined some variables to keep the code aesthetic. As shown in Figure 2, the DAC initiates as soon as the can bus sends 1 byte of data. Next, we coded a 1 Hz sine wave that initiates as soon as the keypad sends a value of 2. The can bus reads the data from the keypad and starts a for loop nested within a while loop that creates a 1 volt peak-to-peak wave. This signal is outputted to the DigiPot and modified by that circuit. The output continues until the stop command is sent to the DAC. In Figure 3, we coded a 10 Hz sine wave that initiates as soon as the keypad sends a value of 4 using the same process as the 1 Hz wave. For the 1 Hz square wave, we coded a repeating step function from 0 to 1 Volt. The wave initiates when the keypad sends a value of 1. In Figure 4, we used the same process to create a 10 Hz square wave when the keypad sends a value of 3. Lastly, we coded an interrupt to bring all outputs to 0 V, when a value of 12 is received from the keypad. Verification Testing Our circuit and code was fully functioning at the end of verification testing. We went through the code and tested each wave to see if it was reaching the right voltage peak-to-peak using an oscilloscope. We made sure that the frequency was correct and that there were no lapses in the output waves. Next, we tested to see how well it communicated with the keypad. The signal was not being read by our CAN bus, due to incorrectly wiring the received and transmitted pins. Once resolved, the code responded to all inputs upon command. Validation Testing During integration testing, there were no major problems from our DAC module. All waves were output continuously and stopped upon demand. The Digipot module had a few problems due to the components frequently malfunctioning. It worked a few times and it was 4

able to manipulate all the waves sent out by our DAC. Figure 5 shows all components of the system during integration testing. Results Our DAC group successfully completed our module. We were able to determine that the black box inverted the signal and modulated the amplitude to be ¼ of the original signal as shown in Figure 6. The Keypad was able to send all five signals essential to operate the DAC. We output the signals to the DigiPot to be modified and those signals were input into the black box. The ADC read the output of the black box and output the voltage values coming from the black box. The ADC output the data onto a graph that showed the modified wave. Discussion Approach to Module, Network Interface, and Debugging Our team started working on the project and familiarized ourselves with the operations and requirements of the DAC. After familiarizing ourselves with the data sheets of the DAC, microcontroller, and the CAN bus, we observed that I2C communication protocols had to be used to communicate within the Digital to Analog converter subsystem and CAN bus to communicate with the keypad. The debugging process mainly consisted of CAN bus related circuitry. We struggled to get the right connection for successful communication with other subsystems. After changing some lines in the code and integrating our DAC with other subsystems, the systems communicated successfully. The I2C bus master slave configuration is convenient for intra-circuit communication whereas the CAN bus is efficient and inexpensive. SPI can also be used to communicate with other subsystems. In our project, SPI would have not been the best choice since, the keypad needs to communicate with only one subsystem at a time. Modification to Design during Integration The only modification our team made after integration and verification testing was to change a few lines in the code. Since the DAC s input depends upon the keypad, it was crucial to get the right command values. After changing the input values in the code, our DAC successfully received commands from the keypad and could output the waveforms to the DigiPot. Changes to be made if Lab was Done Again There were no major flaws that our team experienced as a whole. But minor changes on the organization of the project teams might help. Our group was ahead of the schedule and were waiting on the keypad team to give us the command values required to integrate the two subsystems. Since the keypad was not ready to communicate with other subsystems, we could 5

not test or validate the DAC for a week past the schedule. If there was a set of common ground rules and protocols, the efficiency of all teams would have improved. Value Statement The DAC subsystem played an integral role in the functionality of the whole system and the determining of the black box. The outputs were created using the Mbed microcontroller, Mbed compiler based on C code, CAN bus communication, DAC interface, and a simple physical circuit. The Mbed online compiler was user-friendly and led to easy coding, testing, and debugging. The DAC interface and Mbed microcontroller had easy pinouts which helped simplify our subsystem. Overall, the experience of collaborating with other small projects for the full system was engaging, interesting, and fun. Our team feels that other people who complete this lab will find the same benefits. Conclusion The efforts of all four teams working together led us to the successful completion of the project. Individually, we reached our goals in a timely fashion and verified the functionality of our modules. The factors that kept us successful were good communication and a strong commitment to the work at hand. Integration was the most stressful part of the project, but we believe we all came out as better engineers because of the complications that we faced. We will take these experiences and learn from them to improve our understanding of technology well into our professional careers. 6

Appendices Appendix A: Code, Block Diagrams, and Pinouts Figure 1: First Section of Code Figure 2: Second Section of Code 7

Figure 3: Third Section of Code Figure 4: Fourth Section of Code 8

Figure 5: Integration Testing Figure 6: Oscilloscope Capture of System Output with Black Box 9

Figure 7: Diagnostics System Block Diagram Figure 8: Communication Requirements 10

Figure 9: MBED Pinout Figure 10: DAC Pinout Figure 11: CAN Bus Transceiver 11

Figure 12: CAN Bus Pinout Figure 13: Black Box Pinout Figure 14: Black Box Pin Specifications 12

Appendix B: Bill of Materials Item Price Breadboard $20.00 120Ω Resistor $0.01 LCP1768 MBED Microcontroller $64.00 MCP4725 DAC $4.95 MCP2551 CAN Bus $1.22 TOTAL PRICE $90.18 13

Appendix C: Gantt Chart Section Task Week 1 Week 2 Week 3 Week 4 Week 5 Week 6 Week 7 Introduction Understanding the MBED Team Inventory Individual Subsystem Learning about DAC Programming DAC Building DAC Circuit Testing DAC Programming CAN Bus Testing CAN Bus Entire Subsystem Integration of all subsystems Testing entire system Wrap-Up Demonstration CDR writing References EE 300W Canvas Page and Resources. Online Mbed compiler. <https://developer.mbed.org/compiler/> CAN Bus Datasheet. <http://ww1.microchip.com/downloads/en/devicedoc/21667f.pdf> 14