Texas Instruments Mixed Signal Processor Tutorial Abstract

Similar documents
Lab 4: Interrupt. CS4101 Introduction to Embedded Systems. Prof. Chung-Ta King. Department of Computer Science National Tsing Hua University, Taiwan

Lecture 5: MSP430 Interrupt

Interrupts, Low Power Modes

// 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

Getting Started with the Texas Instruments ez430

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

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

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

Copyright 2015 by Stephen A. Zajac & Gregory M. Wierzba. All rights reserved..spring 2015.

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

Timer Module Timer A. ReadMeFirst

What is an Interrupt?

6. General purpose Input/Output

CPE 323: MSP430 Timers

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

MSP430. More on MSP430

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

Create and Add the Source File

Why embedded systems?

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

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

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

ECGR 4101/5101, Fall 2016: Lab 1 First Embedded Systems Project Learning Objectives:

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

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

Wireless Sensor Networks (WSN)

Hacettepe University

15.1 Timer_A Introduction

Hacettepe University

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

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

Lecture test next week

Block diagram of processor (Harvard)

MCU: Interrupts and Timers. Ganesh Pitchiah

Introduction to the Texas Instruments ez430. By: Naren Anand

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

5xx Active & Low Power Mode Operation

Code Composer Studio. MSP Project Setup

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

Installation tutorial for the Skomer IDE


Lab 4 Interrupts ReadMeFirst

Using peripherals on the MSP430 (if time)

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

FAE Summit Interfacing the ADS8361 to the MSP430F449 Low Power Micro Controller

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

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

DAVE 3 Hands on / Quick Start Tutorial. Presentation Tutorial Start 1 v1.1: Creating a simple Project using PWM and Count Apps

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

Timer 32. Last updated 8/7/18

ECE2049: Embedded Computing in Engineering Design C Term Spring Lecture #7: More Digital IO

Embedded Technosolutions

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

Reading: Davies , 8.3-4, , MSP430x55xx User's Guide Ch. 5,17, MSP430F5529 Launchpad User's Guide

CONTENTS: Program 1 in C:

Introduction to ARDUINO/SIMULINK

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

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

Getting Started in C Programming with Keil MDK-ARM Version 5

The Embedded computing platform. Four-cycle handshake. Bus protocol. Typical bus signals. Four-cycle example. CPU bus.

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

Lab 0 Introduction to the MSP430F5529 Launchpad-based Lab Board and Code Composer Studio

Chapter 2. Overview of Architecture and Microcontroller-Resources

F28069 ControlCard Lab1

High Reliability Systems. Lloyd Moore, President

F28335 ControlCard Lab1

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

ECE2049 Embedded Computing in Engineering Design. Lab #0 Introduction to the MSP430F5529 Launchpad-based Lab Board and Code Composer Studio

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

Getting Started in C Programming with Keil MDK-ARM Version 5

IAR PowerPac RTOS for Texas Instruments MSP430 Microcontroller Family

Getting Started in C Programming with Keil MDK-ARM Version 5

MSP430 Teaching Materials

Lab 1: Space Invaders. The Introduction

Using Code Composer Studio IDE with MSP432

Lab 1: Simon. The Introduction

Getting Started with the MSP430 IAR Assembly

The digital I/O is configured with user software. The setup and operation of the digital I/O is discussed in the following sections.

PSoC Designer Quick Start Guide

Software Setup and Introductory Assembly programs for the MSP430 *

CPE/EE 323 Introduction to Embedded Computer Systems Homework V

Chapter 5 - Input / Output

The modules in this lab room are 4 line by 16 character display modules. The data sheet/users manual for the module is posted on My.Seneca.

MSP430 Interface to LMP91000 Code Library

F28027 USB Stick Lab1_3

Reading: Davies , 8.3-4, , MSP430x55xx User's Guide Ch. 5,17

Review Activity 1 CALL and RET commands in assembler

Before next weeks lab:

MSP430 Interface to LMP91000 Code Library

Product Update. Errata to Z8 Encore! 8K Series Silicon. Z8 Encore! 8K Series Silicon with Date Codes 0402 and Later

Microcontroller & Interfacing

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

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

Interrupt/Timer/DMA 1

Migrating from CubeSuite+ to Eclipse RL78 Family

Design UART Loopback with Interrupts

MPLAB SIM. MPLAB IDE Software Simulation Engine Microchip Technology Incorporated MPLAB SIM Software Simulation Engine

Network Embedded Systems Sensor Networks Fall Hardware. Marcus Chang,

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

Transcription:

Texas Instruments Mixed Signal Processor Tutorial Abstract This tutorial goes through the process of writing a program that uses buttons to manipulate LEDs. One LED will be hard connected to the output of a compare register, yielding a PWM blinking at 1KHz. The other 3 LEDs will simply toggle on or off, as a demonstration how to directly write to the port. Two buttons will allow to increment and decrement the duty cycle. The two other buttons toggle the remaining 3 LEDs.

Texas Instruments Mixed Signal Processor Tutorial Marshall Taylor marshall.taylor@vandals.uidaho.edu Contents 0.1 Physical connections 0.2 Block diagram The Process 1.0 Creating a workspace 1.1 Program code 1.2 Debugging

0.1 Physical connections On the expanded MSP USB stick, 8 I/0 pins are used: P1.0 through P1.7 on the above diagram. The 4 LEDs are connected P1.0 through P1.3, and are active on logic '1' on the port register P1OUT. The 4 buttons on P1.4 through P1.7 are active low, pushing a button yields a '0' on the port register P1IN. These buttons should not be pressed if the port is set to output rather than input, as it will BLOW THE LOGIC. Notice that pin 4 is labeled P1.2/TA1/A2. This signifies that the pin can be either P1.2, Timer A output, or Analog input 2. For this tutorial the pin is configured as timer A output, so it's never explicitly asserted but still lights. It is to note that manipulating the P1OUT register has no effect on this pin in timer A mode, as the pin is physically disconnected from P1OUT completely. 0.2 An example block diagram Texas instruments is a company founded by the top engineers that money can buy, resulting in technical documents that are dryer than this one. There are 2 documents required to program any device: slau144e.pdf overviews the entire family of MSP processors. Here, the logic blocks of internal hardware resources are examined. All potential hardware modules of the family are described, though individual chips only employ a handful. msp430f2012.pdf outlines the specifics of the f2012 device plugged into the thumb stick. It contains block diagrams of the individual pin logic and gives specifics on which hardware modules are actually present in the f2012. Here is the block diagram to a commonly used piece of hardware, timer A. It has been copied directly from slau144e.pdf

In this diagram, black squares signify control lines which are combined into control registers, described again in slau144e.pdf. Here's a rundown of basic modules. TAR: Is a counter, incrementing with the timer clock TASSELx: Selects the clock source, see the module of 'basic clock module+' for more info. IDx: Has the ability to divide the clock (or not) TACCR0, TACCR1, TACCR2: Contains compare registers, SEE slau144e.pdf!!!!! OUT2: This gets connected to P1.2 for hardware operation, SEE MSP430f2012.pdf!!! Ok, just read the documentation. All of the modules are laid out like this.

1.0 The Process 1.1 Creating a workspace Install the tools from the disk. Reading the installed material will direct you to a simple blinking light example, this is a good place to start. After starting the tools, a window will appear. Choose to start a new project in the current workspace. Next you will be prompted to use a template. Don't bother. Start an empty project and name it something, I used 4light. Now you are given the blank project. File-New document. Start by saving this, I chose 4light.c, the c is required. Right click on the main file in the left hand exploration bar. Expand Add to discover that your file 4light.c is an option to be added. Add it. Save the workspace. 1.2 Setting up the tool Drop down project and choose options. Two settings must be changed. Change the generic device to the one being used. Under debugger, change simulate to FET debugger (the thumb tool) 1.3 Program code Now the tool is ready to go (is the USB stick plugged in?) Enter this code in the c file you made: Source code should exist in this document s folder.

//Tutorial demonstration #include "msp430x20x2.h" interrupt void btn_isr(void); //The routine called upon interrupt. int press_cnt; int main(void) WDTCTL = WDTPW + WDTHOLD; enable_interrupt(); press_cnt = 10; //1:1 counter for button presses // Stop watchdog timer // Enables GIE, general interrupt bit P1DIR = BIT3 + BIT2 + BIT1 + BIT0;// Set P1 output direction (bit mask) 0=in, 1=out P1SEL = BIT2; // Connect output to timer P1IES = BIT7 + BIT6 + BIT5 + BIT4; // Set Interrupt Edge Select to "high to low" on bit3 (bit mask) P1IE = BIT7 + BIT6 + BIT5 + BIT4; // Enable interrupts on P1 (bit mask) BCSCTL2 = 0x00; //Select divide by one TACCTL0 = BITB; //Set compare 0 TACCR0 = 0x03E8; //Set.001 second interval TACCTL1 = BITB + BIT7 + BIT6 + BIT5; //Set compare 1 TACCR1 = 0x012C; //Default pulse width TACTL = BIT9 + BIT4 + BIT2; //SMCLK, /1, up, reset, disable TimerA interrupt while(1) //NOP #pragma vector=port1_vector interrupt void btn_isr(void) if(p1ifg & BIT4) //This checks for bit4 in the interrupt register if(press_cnt!= 0) press_cnt--; //If not too small, decrement else if(p1ifg & BIT5) //Check bit5 if(press_cnt < 19) press_cnt++; //If not too big, increment else if((p1ifg & BIT6) (P1IFG & BIT7)) //Check other two buttons P1OUT ^= (BIT3 + BIT1 + BIT0); //Toggle the other LEDs, (xor) else press_cnt = 10; //Counter get lost? return to 10 TACCR1 = (press_cnt * 50) + 25; //LOAD THE COMPARE VALUE P1IFG = 0x00; //reset the interrupt register. 1.4 Debugging Push ctrl-d or choose project-debug to start the debugger. This allows single stepping of the program and a bunch of other things. This bar controls execution, hover-over style.

The red dot to the right is a break point, stopping any free running program. Double clicking on the gray bar will toggle the break points (2 max) The Register and Watch windows can be turned on and off in the view menu (only in debug mode). The register allows viewing of the registers explained within slau144e.pdf. Red values are new since the previous program break. Interesting variables can be right clicked on and added to the watch window. These debug windows will not be updated unless the program is halted.