Lab 1 I/O, timers, interrupts on the eZ430-RF2500 Thomas Watteyne EE290Q – Spring 2010

Slides:



Advertisements
Similar presentations
Serial Communications (Chapter 10)
Advertisements

UBI >> Contents Chapter 7 Timers Laboratories MSP430 Teaching Materials Texas Instruments Incorporated University of Beira Interior (PT) Pedro Dinis Gaspar,
Outline MSP430 LaunchPad MSP430 Microcontroller
Chung-Ta King National Tsing Hua University
Chapter 3 Hardware Development tools
Chung-Ta King National Tsing Hua University
ARM development environment Modified Content Philips LPC2106 ARM chip ARM target board PSPad customised development environment Troubleshooting.
MICRO-CONTROLLER: A microcontroller is the brain of the robot: These are: 1. Integrated Circuits (ICs) 2. Programmable.
ECE 447 Fall 2009 Lecture 9: TI MSP430 Interrupts & Low Power Modes.
Notes on the ez430-RF2500. Sources
Timers in Hardware ECE152. Overview Why are timers important – Watchdog – Task switching – Accurate time of day Can use polling or interrupts.
1 Thomas EDERC LPRF in Practice.
Read Chapter 3 (David E. Simon, An Embedded Software Primer)
Network and Systems Laboratory nslab.ee.ntu.edu.tw.
Chung-Ta King National Tsing Hua University
Engineering 1040: Mechanisms & Electric Circuits Fall 2011 Introduction to Embedded Systems.
Introduction to the Orbit Edu Board Ahmad Rahmati Teaching Assistant, ELEC424 Rice Efficient Computing Group Sep 12, 2007.
LAB 7: WDT+ and Low-Power Optimization
Silicon Labs ToolStick Development Platform
Department of Electronic & Electrical Engineering Embedded system Aims: Introduction to: Hardware. Software Ideas for projects ? Robotics/Control/Sensors.
EE 1106: Introduction to EE Freshman Practicum
NetBurner MOD 5282 Network Development Kit MCF 5282 Integrated ColdFire 32 bit Microcontoller 2 DB-9 connectors for serial I/O supports: RS-232, RS-485,
Objectives How Microcontroller works
Clock Options and Sleep Modes. Clock Sources Flash Fuse bits can be programmed to choose one of the following Clock sources: 1. External RC Osc. f = 1/(3RC).
Lecture 11: TI MSP430 Timers Compare Modes
Dan O. Popa, Freshman Seminar Spring 2015 EE 1105 : Introduction to EE Freshman Seminar Lab-Lecture: Op Amp Circuits, Embedded Computing.
Lecturers: Professor John Devlin Mr Robert Ross
Lab 2 energy consumption, wireless chat Thomas Watteyne EE290Q – Spring 2010
MICROCONTROLLER SYSTEMS Part 1. Figure 1.1Elements of a digital controller CPU Central Processing Unit Input Peripherals Output Peripherals ROM Read Only.
ATtiny23131 A SEMINAR ON AVR MICROCONTROLLER ATtiny2313.
EA PROJETO EM ELETRÔNICA APLICADA Bruno Mourão Siqueira.
Components of a typical full-featured microcontroller.
Product Overview 박 유 진박 유 진.  Nordic Semiconductor ASA(Norway 1983)  Ultra Low Power Wireless Communication System Solution  Short Range Radio Communication(20.
Microcontrollers JULES CALELLA. Microcontrollers vs Microprocessors  Microprocessors – do not contain RAM, ROM, I/O  Microcontrollers – The whole package.
NAM S.B MDLAB. Electronic Engineering, Kangwon National University 1.
BY Names of team mates and USN numbers TITLE OF YOUR PROJECT college logo example.
Low Power Sensor Node Design with MSP430 + CC2520 YoonMo Yeon
CEng3361/18 CENG 336 INT. TO EMBEDDED SYSTEMS DEVELOPMENT Spring 2007 Recitation 01.
HOME SECURITY USING WIRELESS SENSOR NETWORK UNDER THE ESTEEMED GUIDANCE OF: P.RAMESH D.SIVOM( ) KANMANI RAVI( ) B.SAI RAJSEKHAR( )
박 유 진.  2.4-GHz IEEE Compliant RF Transceiver  Excellent Receiver Sensitivity ( -97dBm) and Robustness to Interference  6-mm × 6-mm QFN40.
UNIT 2. CPUXV2 20-bit addressing User-definable Boot Strap Loader RAM starts at 0x1C00 Beginning of MAIN flash moves according to RAM Vector table starts.
ECE 382 Lesson 32 Lesson Outline Lab 6 Introduction Pulse Width Modulation Capture / Compare Example Lab 6 Tips Admin Lab#6 “prelab” due BOC lesson 33.
Outline Introduction to NuMaker TRIO Programming environment setup
Introduction to MSP430G2553 and MPU6050
CC2430 module Jinho Son Real-Time System Lab.
Introduction Why low power?
CS4101 嵌入式系統概論 General Purpose IO
Lecture 8: TI MSP430 Interrupts, ISRs
CPE/EE 421 Microcomputers: The MSP430 Introduction
Code review: GPIO, timer, and ISR
Microcontrollers & GPIO
CS4101 Introduction to Embedded Systems Lab 6: Low-Power Optimization
Chapter 6 General Purpose Input/Output
CS4101 Introduction to Embedded Systems Lab 1: General Purpose IO
Prof. Chung-Ta King Department of Computer Science
CS4101 嵌入式系統概論 General Purpose IO
Introduction to the Orbit Edu Board
The Arduino Microcontroller: Atmel AVR Atmega 328
Subject Name: Microcontroller Subject Code: 10ES42
ADC32RF45 with KCU105 Internal Clock GHz.
Introduction to Microprocessors and Microcontrollers
Lecturer: Reza Arjmandi Autumn 2015
Lecture 9: TI MSP430 Interrupts & Low Power Modes
AVR – ATmega103(ATMEL) Architecture & Summary
8051 Micro Controller.
CS4101 Introduction to Embedded Systems Lab 2: Basic IO and Timer
Prof. Chung-Ta King Department of Computer Science
MSP430 Clock System and Timer
Introduction to Arduino
A modular robot for use in the RoboSumo lab
Presentation transcript:

Lab 1 I/O, timers, interrupts on the eZ430-RF2500 Thomas Watteyne EE290Q – Spring

2 MSP430 “Heart” of the eZ430- RF2500 – 16-bit 16MHz RISC – 32kB ROM, 1kB RAM – 2 Timers, USCI, 10-bit ADCs Debug capabilities using JTAG Low Power Operation

3 CC2500 Any frequency on the GHz band – Not compliant Wake-on-radio support – Preamble sampling in hardware 47 configuration registers – Switch Tx/Rx/idle – TXBUF, RXBUF – Tx power and frequency Follows a state machine SmartRF Studio

4 Interconnection 4 Chip Select Clock SPI interface interrupts

5 eZ430-RF LEDs pushbutton CC2500 chip antenna 26MHz crystal for radio extension ports MSP430 USB programmer: Power Debug (JTAG) Interface (serial)

6 Extension Pins P1: GND P2: VCC_EXT P3: P2.0I/O, ACLK, OA010 P4: P2.1I/O, Timer_A3.INCLK, SMCLK, OA0O P5: P2.2I/O, Timer_A3.CCI0B, Timer_A3.TA0, OA P6: P2.3I/O, Timer_A3.CCI1B, Timer_A3.TA1, OA P7: P2.4I/O, Timer_A3.TA2, OA P8: P4.3I/O, Timer_B3.CCI0B, Timer_B3.TB0, OA P9: P4.4I/O, Timer_B3.CCI1B, Timer_B3.TB1, OA P10: P4.5I/O, Timer_B3.TB2, OA P11: P4.6I/O, OA P12: GND P13: GDO0I/O from the CC2500 (configurable) P14: GDO2I/O from the CC2500 (configurable) P15: P3.2I/O, UC1SOMI P16: P3.3I/O, UC1CLK P17: P3.0I/O P18: P3.1I/O, UC1SIMO

7 IAR Kickstart project file navigator compile open files

8 Talking with your mote over “USB” Use Windows Device Manager to idenfify the COM port the eZ430-RF2500 is on Use PuTTY to connect to that port

9 Operations on binary data A = 0b ~A = 0b A |= 0b => A=0b A &=~0b => A=0b A ^= 0b => A=0b A A=0b A>>2 => A=0b

10 I/O port registers P1DIR: direction, 0=in, 1=out P1OUT: set output P1IN: read input

11 A steady LED led_steady Disable watchdog timer P1.0 and P1.1 as output P1.0=1 and P1.1=1 Continue executing #include "io430.h" #include "in430.h" int main( void ) { WDTCTL = WDTPW + WDTHOLD; P1DIR |= 0x03; P1OUT |= 0x03; while(1); }

12 Active Waiting Loop led_loop #include "io430.h" #include "in430.h" int main( void ) { WDTCTL = WDTPW + WDTHOLD; int i; P1DIR |= 0x03; while (1) { P1OUT ^= 0x03; for (i=0;i<10000;i++) { __no_operation(); } P1.0 and P1.1 as output Change Led state (aka toggle)

13 Interrupt Interrupt only when both – General interrupt enabled in status register – Specific interrupt enabled in specific register Interrupt Service Routine written as: #pragma vector=TIMERA0_VECTOR ISR sometimes needs to clear an interrupt flag in a specific register

14 Button-Driven Toggle Through Interrupts led_button #include "io430.h" #include "in430.h" int main( void ) { WDTCTL = WDTPW + WDTHOLD; P1DIR |= 0x03; P1DIR &= ~0x04; P1REN |= 0x04; P1IE |= 0x04; __bis_SR_register(GIE); while(1); } #pragma vector=PORT1_VECTOR __interrupt void Port_1 (void) { P1IFG &= ~0x04; P1OUT ^= 0x03; } P1.2 as input enable resistor (for button) enable interrupt for P1.2 globally enable interrupts (do this last) Executed when interrupt from P1 Actual function name has no importance Clear interrupt flag (mandatory) Toggle LEDs

15 Timer A timer is a counter which – Counts in a certain way (up, down, continuous) – At every clock tick Can be used in two ways: – Triggers interrupts when reaching a given value (compare mode) or – Records its timer value on other interrupts (capture mode)

16 Timer-Driven Toggle Through Timer Interrupts led_timer #include "io430.h" #include "in430.h" int main( void ) { WDTCTL = WDTPW + WDTHOLD; P1DIR |= 0x03; TACCTL0 = CCIE; TACCR0 = 1000; TACTL = TASSEL_1 + MC_1; __bis_SR_register(GIE+LPM3_bits); } #pragma vector=TIMERA0_VECTOR __interrupt void Timer_A (void) { P1OUT ^= 0x03; } Timer_A interrupt enable Capture Compare to 1000 Count following ACLK Count in up mode interrupt Globally enable interrupt low power mode, waiting for interrupts Executed at each Timer_A interrupt