CPE/EE 323 Introduction to Embedded Computer Systems Homework V

Similar documents
CPE 323 Introduction to Embedded Computer Systems: ADC12 and DAC12. Instructor: Dr Aleksandar Milenkovic Lecture Notes

CPE 325: Embedded Systems Laboratory Laboratory #11 Tutorial Analog-to-Digital Converter and Digital-to-Analog Converter

Name: Clint Furrer Project Number: TI003 Project Description: Safety Walking Lights. Description:

CPE 323 Introduction to Embedded Computer Systems: MSP430 System Architecture An Overview

ECE 492 WINTER 2015 GROUP 2. Texas Instruments MSP430-FR Bit ADC Setup Guide

CPE 325: Embedded Systems Laboratory Laboratory #7 Tutorial MSP430 Timers, Watchdog Timer, Timers A and B

// Conditions for 9600/4=2400 Baud SW UART, SMCLK = 1MHz #define Bitime_5 0x05*4 // ~ 0.5 bit length + small adjustment #define Bitime 13*4//0x0D

Analog Peripherals. Introduction. Objectives

CPE/EE 421 Microcomputers

CPE 323: MSP430 Timers

ECE 492 WINTER 2015 GROUP 2. Texas Instruments MSP430-FR Bit ADC Setup Guide

MSP430 Teaching Materials

ECE2049: Embedded Computing in Engineering Design A Term Fall 2017 Lecture #16: Interrupts and Event Driven Code

ECE2049: Embedded Computing in Engineering Design C Term Spring 2019 Lecture #22: MSP430F5529 Operating Mode & the WDT

ECE2049: Embedded Computing in Engineering Design C Term Spring 2018 Lecture #15: More ADC Examples

MSP430. More on MSP430

CONTENTS: Program 1 in C:

Abstract. SD Card Standard. Comparison with Other Technologies. SD Electrical Interface. F. Foust Dept. of Electrical and Computer Engineering

C Language Programming through the ADC and the MSP430 (ESCAPE)

2002 Mixed Signal Products SLAU056B

5xx Active & Low Power Mode Operation

Interfacing CMA3000-D01 to an MSP430 ultra low-power microcontroller

USB Connectivity using MSP430 and TUSB3410

ECE PRACTICE EXAM #2 Clocks, Timers, and Digital I/O

063[[[0LFURFRQWUROOHUV 63,

Using peripherals on the MSP430 (if time)

ECE2049 Homework #4 Analog-to-Digital Conversion and the ADC12 (Due Thursday 2/15/2018 to box outside AK-011 by 9 am)

Interfacing CMR3000-D01 to an MSP430 ultra low-power microcontroller

Designing for Ultra-Low Power with MSP430

AVR XMEGA Product Line Introduction AVR XMEGA TM. Product Introduction.

2.996/6.971 Biomedical Devices Design Laboratory Lecture 6: Microprocessors II

Getting Started with the Texas Instruments ez430

CPE 323: MSP430 Serial Communication

@databasescaling Wednesday, 18 th April 2013

MSP430FG4618 Programming Reference Revision 3

Network Embedded Systems Sensor Networks Fall Hardware. Marcus Chang,

University of Texas at El Paso Electrical and Computer Engineering Department. EE 3176 Laboratory for Microprocessors I.

Chapter USART Introduction: UART Mode USART Operation: UART Mode USART Registers: UART Mode...

Alex Milenkovich 1. CPE/EE 421 Microcomputers: The MSP430 Introduction. Outline

ECE2049: Embedded Computing in Engineering Design C Term Spring Lecture #11: More Clocks and Timers

Wireless Sensor Networks (WSN)

IV B.Tech. I Sem (R13) ECE : Embedded Systems : UNIT -2 1 UNIT 2

Design and development of embedded systems for the Internet of Things (IoT) Fabio Angeletti Fabrizio Gattuso

Lab 4 Interrupts ReadMeFirst

Chapter 1 MSP430 Microcontroller Family

EEL 4924 Electrical Engineering Design (Senior Design) Team Baudiophile. Wireless Headphones

Timers and Clocks CS4101 嵌入式系統概論. Prof. Chung-Ta King. Department of Computer Science National Tsing Hua University, Taiwan

Lab 1: I/O, timers, interrupts on the ez430-rf2500

TAxCTL Register

What is an Interrupt?

Fall. Accelerometer RGB LED control Vishal Shah Rebel Sequeira Pratiksha Patil Pranali Dhuru Chris Blackden. George Mason University

Block diagram of processor (Harvard)

CPE/EE 421 Microcomputers

AVR XMEGA TM. A New Reference for 8/16-bit Microcontrollers. Ingar Fredriksen AVR Product Marketing Director

volatile int results[5]; // variables para la interrupcion del acelerometro //Funciones del acelerometro para mandar y recibir información

Embedded Systems. 3. Hardware Software Interface. Lothar Thiele. Computer Engineering and Networks Laboratory

Auto-Alignment Laser Mirrors First Semester Report Fall Semester 2013

UC Berkeley EE40/100 Lab Lab 6: Microcontroller Input/Output B. Boser, etc.

University of Texas at El Paso Electrical and Computer Engineering Department. EE 3176 Laboratory for Microprocessors I.

Design Document. May Logging DC Wattmeter. Team Member: Advisor : Ailing Mei. Collin Christy. Andrew Kom. Client: Chongli Cai

Texas Instruments Mixed Signal Processor Tutorial Abstract

MSP430 Interrupts. Change value of internal variable (count) Read a data value (sensor, receive) Write a data value (actuator, send)

University of Texas at El Paso Electrical and Computer Engineering Department. EE 3176 Laboratory for Microprocessors I.

The 16-bit timer/counter register, TAR, increments or decrements (depending on mode of operation) with each rising edge of the clock signal.

MICROPROCESSOR BASED SYSTEM DESIGN

XMEGA Series Of AVR Processor. Presented by: Manisha Biyani ( ) Shashank Bolia (

Welcome to this presentation of the STM32 direct memory access controller (DMA). It covers the main features of this module, which is widely used to

Asservissement en température numérique d'une cavité ultra-stable au LPL pour le Strontium

CPE/EE 421 Microcomputers

Interconnects, Memory, GPIO

Why embedded systems?

063[[[0LFURFRQWUROOHUV /RZ3RZHU0RGHV &3($GYDQFHG0LFURFRPSXWHU7HFKQLTXHV 'U(PLO-RYDQRY /RZ3RZHU. Power: A First-Class Architectural Design Constraint

3. (a) Explain the steps involved in the Interfacing of an I/O device (b) Explain various methods of interfacing of I/O devices.

Design Implementation Of A Microcontroller Based External Facility Access Control System

Introduction to Microcontroller Apps for Amateur Radio Projects Using the HamStack Platform.

ECE2049: Embedded Computing in Engineering Design C Term Spring 2018 Lecture #20: Using SPI The DAC

Chapter 26 Topic Page 26.1 ADC12 Introduction

EE445L Fall 2010 Final Version A Page 1 of 10

8. Power Management and Sleep Modes

Clock and Fuses. Prof. Prabhat Ranjan Dhirubhai Ambani Institute of Information and Communication Technology, Gandhinagar

Design of a Simple 3-Lead ECG Acquisition System Based on MSP430F149

description I2C is a registered trademark of Philips Incorporated.

Microcontrollers. Principles and Applications. Ajit Pal +5 V 2K 8. 8 bit dip switch. P2 8 Reset switch Microcontroller AT89S52 100E +5 V. 2.

Physics 319 Spring 2015: Introduction to the Programming and Use of Microprocessors

Supporting Information for. Simultaneous Atomic-Level Visualization and High Precision

MIDTERM#1. 2-(3pts) What is the difference between Von Neumann & Harvard processor architectures?

Interrupts, Low Power Modes

CM5000 DATASHEET v0.1

ECE2049 Homework #2 The MSP430 Architecture & Basic Digital IO (DUE Friday 9/8/17 at 4 pm in class)

Lecture 5: MSP430 Interrupt

ECE2049: Embedded Computing in Engineering Design C Term Spring 2018

Introducing STM32 L0x Series. April

Designing for Ultra-Low Power with MSP430

SYSTEM DESIGN SPECIFICATIONS ZIGBEE BASIC SYSTEM

Serial Peripheral Interface (SPI) Last updated 8/7/18

Team 3. By: Miriel Garcia. Microcontrollers/ TI MSP430F5438A. ECE 480 senior Design. Application Note 4/3/15

Embedded Systems and Software

EE445L Fall 2018 Final EID: Page 1 of 7

Serial Peripheral Interface (SPI)

2006 Mixed Signal Products SLAU049F

Transcription:

CPE/EE 323 Introduction to Embedded Computer Systems Homework V 1(15) 2(15) 3(25) 4(25) 5(20) Total Problem #1 (15 points) Power, Low power systems A sensor platform features a microcontroller, a sensor, and a wireless radio interface. Your application operates with system frequency of 50 Hz, repeating the following sequence. The microcontroller samples an analog signal from the sensor, process the samples, and send the data to the radio chip. The radio then transmits the data to the network coordinator. After the data are sent wirelessly, the system goes into a sleep mode (the sensor, the microcontroller, and radio chip are all in low power mode). Assume that all devices wake up in the active mode when the time comes for the next application cycle, and stay active until the whole application cycle is completed. The radio chip is in the receive mode unless it transmits the data. From corresponding reference manuals we extracted information about the current drawn by each device when it is in active mode and when it is the low-power mode. Device Active mode I [ma] current Low-power mode I -- current Sensor 0.3 3 ua Microcontroller 5 50 ua Radio transmit 18 10 ua Radio receive 20 10 ua By performing performance profiling of our application we found the following execution times: Type of operation Execution Time Sample sensor signals 0.2 ms Process samples 2 ms Send data to radio 1.8 ms Radio transmission 2 ms A. (10 points) Calculate the total execution time and the total sleep time during one application cycle. Calculate the average current drawn by the platform while in the active mode (IAM) and in the low-power mode (ILPM). Calculate the total average current drawn by the platform ITOTAL. B. (5 points) Calculate the total power P consumed (in milliwatts) if we power the platform by two AA batteries (Vsupply = 3.0 V). Determine the system operating time in days if we know that the battery capacity is 2400mAh. How would you further reduce the power consumption and consequently extend the operating time of the given system? Explain.

Problem #5. (15 points). ADC, DAC A (2.5 points). A sensor device gives an analog voltage that is directly proportional to atmospheric pressure. The sensor output voltage is always in the range of 0.5 V (min) to 1.5 V (max). How would you configure the MSP430 s ADC12 to perform analog-to-digital conversion with maximum resolution? What is the digital value that corresponds to 1.25 V input voltage? Explain. B (2.5 points). What is the analog voltage at the output of the MSP430 s DAC if we use 2.5 V reference voltage and 9-bit resolution? The data register DAC12_DATA = 0x007A. C (10 points). Analyze the following code. Add missing comments in the code below. What does this program do? ACLK = 32kHz, MCLK = SMCLK = default DCO 1048576Hz, ADC12CLK = ADC12OSC MSP430xG461x ----------------- XIN - Vin0 --> P6.0/A0 32kHz Vin1 --> P6.1/A1 XOUT - Vin2 --> P6.2/A2 Vin3 --> P6.3/A3 ****************************************************************************** #include "msp430xg46x.h" volatile unsigned int A0results[8]; volatile unsigned int A1results[8]; volatile unsigned int A2results[8]; volatile unsigned int A3results[8]; unsigned int Index; void main(void) WDTCTL = WDTPW + WDTHOLD; P6SEL = 0x0f; ADC12CTL0 = SHT0_8 + MSC + ADC12ON; ADC12CTL1 = SHP + CONSEQ_3; ADC12IE = 0x08; ADC12MCTL0 = INCH_0; ADC12MCTL1 = INCH_1; ADC12MCTL2 = INCH_2; ADC12MCTL3 = EOS + INCH_3; while (1) ADC12CTL0 = ENC; ADC12CTL0 = ADC12SC; bis_sr_register(lpm0_bits + GIE); LPM0 Stop watchdog Enable A/D inputs #pragma vector = ADC12_VECTOR interrupt void ADC12_ISR(void) A0results[Index] = ADC12MEM0; A1results[Index] = ADC12MEM1; A2results[Index] = ADC12MEM2; A3results[Index] = ADC12MEM3; Index = (Index + 1) & 0x7; no_operation(); SET BREAKPOINT HERE bic_sr_register_on_exit(lpm0_bits); Exit LPM0

Problem #3 (25 points) DMA Controller A (5 points). Sketch a block diagram illustrating main registers for a single channel in the MSP430. For each register describe its purpose and the initialization process. Circle the correct answer for the following questions. B (2 points) The DMA controller allows to: (i) Move data from one location to another without CPU intervention (ii) Increase the throughput of peripheral modules (iii) Reduce system power consumption (CPU in low power mode) (iv) All of above C (2 points) The upper byte of a byte-to-word transfer: (i) Remains with the previous value (ii) Is cleared (iii) Is loaded with the same values as the lower byte (iv) None of above D (2 points) When the DMA transfer mode DMAxTSELx = 1 is selected: (i) Each transfer requires a trigger (ii) A complete block is transferred with one trigger (iii) CPU activity is interleaved with a block transfer (iv) None of above E (2 points). NMI interrupts interrupt the DMA controller when: (i) GIE bit is set (ii) DMAIE is set (iii) ENNMI bit is set (iv) DMAEN is set F (2 points). The DMA destination address when the DMADSTBYTE = 1 and DMDSTINCRx = 3: (i) Remains unchanged (ii) Increments by one (iii) Decrements by two (iv) Increments by two

G (10 points). Analyze the following code. Add missing comments in the program. What does this program do? ACLK = UCLK 32768Hz, MCLK = SMCLK = default DCO 1048576Hz Baud rate divider with 32768hz XTAL @9600 = 32768Hz/9600 = 3.41 (000Dh 4Ah) MSP430xG461x ----------------- / \ XIN - 32768Hz -- RST XOUT - P4.0 ------------> "Hello World" 9600-8N1 ****************************************************************************** #include "msp430xg46x.h" const char String1[13] = "\nhello World"; void main(void) WDTCTL = WDT_ADLY_1000; IE1 = WDTIE; P4SEL = 0x03; ME2 = UTXE1 + URXE1; UCTL1 = CHAR; UTCTL1 = SSEL0; UBR01 = 0x03; UBR11 = 0x00; UMCTL1 = 0x04A; UCTL1 &= ~SWRST; DMACTL0 = DMA0TSEL_10; DMA0SA = (int)string1; DMA0DA = TXBUF1_; DMA0SZ = 0014; WDT 1000ms, ACLK, interval timer Enable WDT interrupt P4.0,1 = USART1 TXD/RXD DMA0CTL = DMASRCINCR_3 + DMASBDB + DMALEVEL; bis_sr_register(lpm3_bits + GIE); Enter LPM3 w/ interrupts #pragma vector = WDT_VECTOR interrupt void WDT_ISR(void) DMA0CTL = DMAEN;

Problem #4 (25 points) Communication A (5 points). What is synchronous and asynchronous serial communication? Give an example for each, and sketch the block diagram to illustrate main connections between the transmitter and receiver. B (10 points). Your task is to initialize the USART0 device to carry out asynchronous serial communication with 9600 bit/sec using 32768 Hz as the source clock. Assume that we use 8-bit characters with a parity bit, and 2 stop bits. Will this communication work properly without modulation? How do you determine value in the modulation register? Use illustrations to support your answer including timing waveforms.

C (10 points). Illustrate the USART operation in SPI mode. Sketch the master, slave(s), and relevant registers in each module. Explain the sequence of steps in typical communication scenarios.

Problem #5 (20 points) LCD Display A (10 points). Light number 7 on the LCD in the static mode. Illustrate waveforms on relevant segment lines and common lines. How many writes into the LCD memory is required to display number 7 on the LCD?

B (10 points). Light number 7 on the LCD in the 4-mux mode. Illustrate waveforms on relevant segment lines and common lines. How many writes into the LCD memory is required to display number 7 on the LCD?