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

Similar documents
CPE/EE 323 Introduction to Embedded Computer Systems Homework V

063[[[0LFURFRQWUROOHUV 63,

USB Connectivity using MSP430 and TUSB3410

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

Using peripherals on the MSP430 (if time)

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

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

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)

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

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

@databasescaling Wednesday, 18 th April 2013

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

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

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

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

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

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

MSP430. More on MSP430

CPE/EE 421 Microcomputers

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

4 Degrees of Freedom MEMS Sensor Improvements

Auto-Alignment Laser Mirrors First Semester Report Fall Semester 2013

Texas Instruments Microcontroller HOW-TO GUIDE Interfacing Keypad with MSP430F5529

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

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

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.

CONTENTS: Program 1 in C:

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

CPE 323: MSP430 Timers

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

Network Embedded Systems Sensor Networks Fall Hardware. Marcus Chang,

Analog Peripherals. Introduction. Objectives

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

Lecture test next week

2002 Mixed Signal Products SLAU056B

ECE2049: Embedded Computing in Engineering Design A Term Fall Lecture #8: Making it work: LEDs, Buttons & Keypad

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

Why embedded systems?

Maximizing Runtime Performance in Peripheral-Rich MSP430 Applications

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

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

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

Texas Instruments Mixed Signal Processor Tutorial Abstract

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

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

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

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

ArduCAM-M-2MP Camera Shield

Wireless Sensor Networks (WSN)

8051 Microcontroller

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

ECE2049-E18 Lecture 6 Notes 1. ECE2049: Embedded Computing in Engineering Design E Term Lecture #6: Exam Review

ECE2049: Embedded Computing in Engineering Design A Term Fall Lecture #9: Exam Review w/ Solutions

Two Wire Interface (TWI) also commonly called I2C

Design Implementation Of A Microcontroller Based External Facility Access Control System

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

MSP430FG4618 Programming Reference Revision 3

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

Hands-On: Implementing an RF link with MSP430 and CC1100

Lecture 5: MSP430 Interrupt

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

ECE2049: Embedded Computing in Engineering Design C Term Spring 2018

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

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

PIC Microcontroller Introduction

CSE 466 Exam 1 Winter, 2010

What is an Interrupt?

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

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

ADC to I 2 C. Data Sheet. 10 Channel Analog to Digital Converter. with output via I 2 C

Serial Peripheral Interface (SPI)

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

Interrupts, Low Power Modes

ECE2049-E17 Lecture 6 1. ECE2049: Embedded Computing in Engineering Design E Term Lecture #6: Exam Review

Getting Started with the MSP430 LaunchPad

Review Activity 1 CALL and RET commands in assembler

MSP430F149 P3.4/UTXD0 P3.5/URXD0 P1.5 P1.6 P1.7 MSP430F149 P1.0 P5.4 P5.3 P5.2 P5.1. Figure B-1. BSL Replicator Block Diagram

Designing for Ultra-Low Power with MSP430

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

RFID A1 Module User Manual V1.183

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

description F435, F436, and F437 devices F447, F448, and F449 devices

DRPC100-OLED UART PROTOCOL SPECIFICATION

LC-E201A. Application note. 1. Mechanical Specification: LC-E021A-application note page 1 of 16 Revision:

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

EECS 373 Midterm 2 Fall 2018

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

Zigbee Development Board (Z- DB001) with Z-001 or Z-002 Module

CPE/EE 421 Microcomputers

CPE 323: MSP430 Serial Communication

CyberAtom X-202 USER MANUAL. Copyrights Softexor 2015 All Rights Reserved.

ATmega Interrupts. Reading. The AVR Microcontroller and Embedded Systems using Assembly and C) by Muhammad Ali Mazidi, Sarmad Naimi, and Sepehr Naimi

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

Block diagram of processor (Harvard)

Getting Started with the Texas Instruments ez430

Getting Started with the MSP430 LaunchPad

Graphical LCD Display Datasheet EB

Decisions II. Switch Statement. If else allows a 2 way decision Switch allows for n-way decisions

Transcription:

Description: This project addresses the concern and problem of pedestrians walking with automotive traffic. I walk to and from a bus stop every morning and evening for work. There is usually low light due to the sun setting or raising. This is where the WalkSafe project comes into play. It flashes five LED s of different colors to alert motorists that you are walking in the area and to be careful to avoid hitting you. Flashing LED s is not the only thing that is accomplished by the WalkSafe system. It also has a triple axis accelerometer to measure your steps and movement, a LED display to display a menu for selecting different modes and settings, a temperature sensor which is built into the microcontroller, and an ambient light level sensor for automatically turning the LED s on and off. The brain of the system is a TI MSP430F169 microcontroller. The accelerometer is a Freescale MMA7361LT. The data the is gathered from the accelerometer and ambient light sensor is stored in a 64Mbit flash memory chip. The flash memory chip is from Microchip SST25VF064C. The memory chip interface is SPI. The ambient light sensor is from Vishay TEMT6000. Lastly the LED display is from SparkFun electronics COM-09767 it is interfaced through SPI as well. The system uses low power parts and the MSP430 microcontroller has low power modes, which makes the whole system ideal for battery-powered operation. The LED s are driven with a ULN2003A transistor array IC. Three push button switches are used to navigate the LED display menu. The WalkSafe system works as fallows. WalkSafe is placed in the walk mode. In walk mode the LED s flash and movement, temperature, and light levels are recorded to memory. If a high light level is sensed for several seconds the LED s will turn off. Once the memory is filled with data the WalkSafe can be placed into download mode. This will download the data onto your computer to be analyzed. To erase the data off of the WalkSafe it must be placed into the erase mode. This will erase the whole memory chip of any data. The last mode can manually turn the LED s off.

Schematic: Schematic of the WalkSafe system.

Bill of Materials: Part Value Device Package Description C1 3.3nF CAP0603-CAP 0603-CAP Capacitor C2 3.3nF CAP0603-CAP 0603-CAP Capacitor C3 3.3nF CAP0603-CAP 0603-CAP Capacitor C4 0.1uF CAP0603-CAP 0603-CAP Capacitor IC1 ULN2003ADULN2003AD SO16 DRIVER ARRAY JP1 M08 1X08 Header 8 LED1 LED5MM LED5MM LED LED2 LED5MM LED5MM LED LED3 LED5MM LED5MM LED LED4 LED5MM LED5MM LED LED5 LED5MM LED5MM LED R1 100 R-US_0207/10 0207/10 RESISTOR, American symbol R2 100 R-US_0207/10 0207/10 RESISTOR, American symbol R3 100 R-US_0207/10 0207/10 RESISTOR, American symbol R4 100 R-US_0207/10 0207/10 RESISTOR, American symbol R5 100 R-US_0207/10 0207/10 RESISTOR, American symbol R6 10k R-US_0207/10 0207/10 RESISTOR, American symbol R7 10k R-US_0207/10 0207/10 RESISTOR, American symbol R8 10k R-US_0207/10 0207/10 RESISTOR, American symbol R9 10k R-US_0207/10 0207/10 RESISTOR, American symbol S1 TAC_SWITCHPTH TACTILE-PTH Momentary Switch S2 TAC_SWITCHPTH TACTILE-PTH Momentary Switch S3 TAC_SWITCHPTH TACTILE-PTH Momentary Switch U$1 F16X---PM64 F16X---PM64 PM/PAG64 *** MSP430F169 *** PM64 U$2 MMA7361MMA7361 LGA14 U$3 TEMT6000TEMT6000 TEMT6000-SEN Ambient Light Sensor U1 SST64MBIT SST16SOICW

Source code: //*************************************************************************** *** // //*************************************************************************** *** #include<io.h> #define orange 16 #define purple1 2 #define purple2 4 #define blue 8 #define green 1 #defineupbutton 128 #defineenterbutton 64 #definedownbutton 32 voiddevset(volatilecharreg, volatilechar setting); void send(int data); void wait(void); //delay function voidswait(void); void flashy(void); voidspi_send(char data); void display(char data[]); void main(void) WDTCTL = WDTPW + WDTHOLD; // Stop WDT staticunsignedint results[128]; staticunsignedchar message[] = 0x16,0x26,0x36,0x46; //static unsigned inta1results[100]; //static unsigned inta2results[100]; //static unsigned inta3results[100]; staticunsignedint A0results; staticunsignedint A1results; staticunsignedint A2results; staticunsignedint A3results; //static char message[] = "Hello World"; staticcharhighb, lowb; volatileunsignedinti, x, z, index, tempdata, button, exef, stop; P1DIR = 0xFF; P1OUT = 0x01; P3SEL = 0x30; // P3.4,5 = USART0 TXD/RXD P4DIR=0xFF;

P4SEL=0x00; P4OUT=0x00; P5SEL = 0x0E; P5DIR = 0x0B; P5OUT = 0x01; P6SEL = 0x0F; P2DIR = 0x1F; P2OUT = 0; //control lines // P5.1,2,3 SPI option select // unselect memory chip // Enable A/D channel inputs //LEDs and buttons index = 0; x = 0; tempdata = 0; z = 0; exef = 0; BCSCTL1 &= ~XT2OFF; do IFG1 &= ~OFIFG; for (i = 0xFF; i>0; i--); while ((IFG1 & OFIFG)); BCSCTL2 = SELM_2 + SELS; // XT2on // Clear OSCFault flag // Time for flag to set // OSCFault flag still set? // MCLK = SMCLK = XT2 (safe) //UART0 ME1 = UTXE0 + URXE0; // Enable USART0 TXD/RXD UCTL0 = CHAR; // 8-bit character UTCTL0 = SSEL1; // UCLK = SMCLK UBR00 = 0xA0; // 8Mhz/19200 ~ 417 UBR10 = 0x01; // UMCTL0 = 0x00; // no modulation UCTL0 = 0x01; // Initialize USART state machine TXBUF0 = 0x00; UCTL0 &= 0x10; //ADC ADC12CTL0 = ADC12ON+MSC+SHT0_8; time // to avoid overflow of results ADC12CTL1 = SHP+CONSEQ_3; sequence //ADC12CTL1 = 0xE0; ADC12MCTL0 = INCH_0; ADC12MCTL1 = INCH_1; ADC12MCTL2 = INCH_2; ADC12MCTL3 = INCH_3+EOS; seq. //ADC12IE = 0x08; ADC12CTL0 = ENC; // Turn on ADC12, extend sampling // Use sampling timer, repeated // ref+=avcc, channel = A0 // ref+=avcc, channel = A1 // ref+=avcc, channel = A2 // ref+=avcc, channel = A3, end // Enable ADC12IFG.3 // Enable conversions

//SPI ME2 = USPIE1; UCTL1 = CHAR + SYNC + MM + SWRST; UTCTL1 = SSEL1 +SSEL0 + STC; //UTCTL1 = CKPL + SSEL1 +SSEL0 + STC; UBR10 = 0x64; UBR11 = 0x00; UMCTL1 = 0x00; UCTL1 &= ~SWRST; // Module enable // 8-bit, SPI, Master // Polarity, SMCLK, 3-wire // Polarity, SMCLK, 3-wire // SPICLK = SMCLK/2 // SPI enable P2OUT = 0xFF; //configure control lines devset(1,0); devset(2,0); devset(3,0); devset(4,0); wait(); devset(4,1); ADC12CTL0 = ADC12SC; //main loop //LED test //self test on //disable sleep //1.5g selected //reset memory //set memory to run // Start conversion while(1) // wait(); // wait(); display(message); //wait(); // wait(); while(!exef) button = P2IN &0xE0; if(upbutton) //increament command z = z + 1; if(downbutton) //decrement command z = z + 1; if(enterbutton) //extcute command exef = 1; if(z <4)

z = 0; //run main program //command 1 LED's off //command 2 exe main program //command 3 download data //command 4 erase all of external memory switch(z) case1: P2OUT = 0; //turn off LED's cleared cleared cleared cleared case2: button = P2IN &0xE0; while(!(button&0x40)) while(!(adc12ifg &0x08)); A0results = ADC12MEM0; A1results = ADC12MEM1; A2results = ADC12MEM2; A3results = ADC12MEM3; results[index] = A0results; index = index + 1; results[index] = A1results; index = index + 1; results[index] = A2results; index = index + 1; results[index] = A3results; // Move A0 results, IFG is // Move A1 results, IFG is // Move A2 results, IFG is // Move A3 results, IFG is //move results to TX buffer // Increment results index // Increment results index // Increment results index if(index <128) for(i=0;i<128;i++) lowb = results[i]; //try? highb = results[i] >>8; spi_send(lowb); spi_send(highb); index = 0; flashy(); default:

void display(char data[]) char message[] = 0x11,0x11,0x11,0x11; volatileinti; P1OUT = 0x00; for(i=0;i<5;i++) P1OUT = 0x00; while ((UTCTL1 & TXEPT) ==0); U1TXBUF = message[i]; P1OUT = 0x01; voidspi_send(char data) while ((UTCTL1 & TXEPT) ==0); U1TXBUF = data; //while ((IFG2 & URXIFG1)==0); void wait(void) //delay function volatileinti; //declare i as volatile int for(i=0;i<32000;i++); //repeat 32000 times voidswait(void) volatileinti; //declare i as volatile int for(i=0;i<20;i++); //repeat 2000 times void send(int data) volatileunsignedchar out[] = 0x00,0x00,0x0D, temp; volatileinti; //out[0] = ','; out[2] = 0x0D; out[0] = data &0x00FF; temp = data &0xFF00; out[1] = temp >>8; for(i=0;i<3;i++)

while(!(utctl0 &0x01)); TXBUF0 = out[i]; void flashy(void) //flashes the led's P2OUT = orange + green; P2OUT &= orange; P2OUT = orange + green; P2OUT = 0; wait(); P2OUT = orange + purple1; P2OUT &= orange; P2OUT = orange + purple1; P2OUT = 0; wait(); P2OUT = orange + blue; P2OUT &= orange; P2OUT = orange + blue; P2OUT = 0; wait(); P2OUT = orange + purple2; P2OUT &= 0; P2OUT = orange + purple2; P2OUT = 0; wait(); wait(); P2OUT = orange; voiddevset(volatilecharreg, volatilechar setting) switch(reg) case0x01: //self test if(setting) P4OUT=P4OUT 0x01; //self test on

else P4OUT=P4OUT &0xFE; //self test off case0x02: //sleep accelerometer if(setting) P4OUT=P4OUT &0xFD; //enable sleep else P4OUT=P4OUT 0x02; //dis enable sleep case0x03: //g-select if(setting) P4OUT=P4OUT 0x04; //6g range else P4OUT=P4OUT &0xFB; //1.5g range case0x04: //memory chip reset if(setting) P4OUT = P4OUT 0x08; //normal run else P4OUT = P4OUT &0xF7; //reset default: Pictures:

Name: Clint Furrer Project Number: TI003 System

Name: Clint Furrer Project Number: TI003 SensorBoard

Name: Clint Furrer Project Number: TI003 FlashyLED s

Name: Clint Furrer Project Number: TI003 MewithProject