EMBEDDED SYSTEMS UNIT 4.

Slides:



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

Serial Communications (Chapter 10)
MSP430G2553 launchpad and MPU6050 Introduction
Chung-Ta King National Tsing Hua University
The 8051 Microcontroller Chapter 5 SERIAL PORT OPERATION.
1 Thomas EDERC Programming Tour.
Serial I/O - Programmable Communication Interface
ECE 447 Fall 2009 Lecture 9: TI MSP430 Interrupts & Low Power Modes.
Confidentiality/date line: 13pt Arial Regular, white Maximum length: 1 line Information separated by vertical strokes, with two spaces on either side Disclaimer.
LAB 6: Serial Communication
Notes on the ez430-RF2500. Sources
7-1 Digital Serial Input/Output Two basic approaches  Synchronous shared common clock signal all devices synchronised with the shared clock signal data.
Chapter 6 Serial Communications Objectives Introduce the RS232 standard and position it within the crowded field of serial communications standards. Configure.
CS4101 嵌入式系統概論 Timers and Clocks 金仲達教授 國立清華大學資訊工程學系 Materials from MSP430 Microcontroller Basics, John H. Davies, Newnes, 2008.
CS4101 嵌入式系統概論 Software UART Revisited Prof. Chung-Ta King Department of Computer Science National Tsing Hua University, Taiwan ( Materials from MSP430.
Network and Systems Laboratory nslab.ee.ntu.edu.tw.
UBI >> Contents Chapter 14 Communications USI Module MSP430 Teaching Materials Texas Instruments Incorporated University of Beira Interior (PT) Pedro Dinis.
Chung-Ta King National Tsing Hua University
Chapter 6 Serial Communications Objectives Introduce the RS232 standard and position it within the crowded field of serial communications standards. Configure.
SkyeTech SkyeModule M9 Size - 70x53x9 mm Frequency MHz Supply Voltage – 5 V Price - $80 Connection Type - TTL, USB, SPI & I2C.
LAB 7: WDT+ and Low-Power Optimization
Lecture 18: ADC Implementation Lecturers: Professor John Devlin.
4.0 rtos implementation part II
SC200x Peripherals Broadband Entertainment Division DTV Source Applications July 2001.
Lecture Set 9 MCS-51 Serial Port.
Universal Asynchronous Receiver/Transmitter (UART)
LAB 8: Program Design Pattern and Software Architecture
Ultra-low Power Motion Detection using the MSP430F2013.
Lab 2 energy consumption, wireless chat Thomas Watteyne EE290Q – Spring 2010
CE-2810 Dr. Mark L. Hornick 1 Serial Communications Sending and receiving data between devices.
Lab 4 CRC, PDR vs. distance, preamble sampling Thomas Watteyne EE290Q – Spring 2010
 The LPC2xxx devices currently have two on- chip UARTS.  Except UART1 has additional modem support.
Digital Logic Design Alex Bronstein
Chip Config & Drivers – Required Drivers:
Introduction to MSP430G2553 and MPU6050
Introduction Why low power?
Introduction Why low power?
CS4101 嵌入式系統概論 General Purpose IO
Chapter 6 Serial Communications
Recall the Container Thermometer
Serial mode of data transfer
ECE 382 Lesson 15 Lesson Outline S/W Delays Wrap up
I2C Protocol and RTC Interfacing
CS4101 嵌入式系統概論 Serial Communication
Lesson Outline Interrupts Admin Assignment #9 due next lesson
CS4101 Introduction to Embedded Systems Lab 6: Low-Power Optimization
EE 107 Fall 2017 Lecture 5 Serial Buses – UART & SPI
CS4101 Introduction to Embedded Systems Lab 1: General Purpose IO
Chapter 11: Inter-Integrated Circuit (I2C) Interface
Prof. Chung-Ta King Department of Computer Science
CS4101 嵌入式系統概論 General Purpose IO
SERIAL PORT PROGRAMMING
SPI Protocol and DAC Interfacing
Communication Lines Fundamentals.
Programming Microcontroller
Subject Name: Microcontroller Subject Code: 10ES42
CS4101 Introduction to Embedded Systems Lab 7: Serial Communication
Serial Communication Interface
CS4101 Introduction to Embedded Systems Lab 7: Serial Communication
Преглед Начин функционисања Имплементације
Lecture 9: TI MSP430 Interrupts & Low Power Modes
Lecture 8 USCI Module SPI & I2C Modes
CHAPTER SERIAL PORT PROGRAMMING. Basics of Serial Communication Computers transfer data in two ways: ◦ Parallel  Often 8 or more lines (wire.
EUSART Serial Communication.
CS4101 Introduction to Embedded Systems Lab 2: Basic IO and Timer
Prof. Chung-Ta King Department of Computer Science
MSP430 Clock System and Timer
Serial Communication 19th Han Seung Uk.
A modular robot for use in the RoboSumo lab
Presentation transcript:

EMBEDDED SYSTEMS UNIT 4

TTL level RTL level

UART

MSP430 communication peripherals F2xx,4xx 2xx Bit-Banging

SPI Motorola SSx SSx

USI IN SPI MODE

USCI IN SPI MODE

I2C Philips (now NXP) Semiconductors Drawback is ACK is sent for every byte transfer, we need to implement in s/w

Universal Serial Bus, USB The Universal Serial Bus industry standard was established in 1995, and then quickly adopted by Intel, Compaq, Microsoft and other companies. USB 1.x 12 Mbps USB 2.0 hi-speed USB 480 megabits per second (Mbps) USB 3.0 SuperSpeed USB 5.0 gigabits per second (Gbps) USB 3.1 SuperSpeed+ 10 Gbps USB Type-C same as USB 3.1 and is a reversible-plug   3 feet to just over 16 feet MODES Control-commands Isochronous-audio Bulk-printer Interrupt-keyboard

USCI in UART mode UCSYNC bit in UCA0CTL0. 4 asynchronous modes Standard UART mode, UCMODExx=00. Multiprocessor modes, UCMODExx=01 or 10. These are used to detect addresses when more than two devices are used on a bus, such as RS-485. Automatic baud rate detection, UCMODExx=11. This is particularly intended for LIN. UCIREN bit.-IrDA enable Setting the Baud Rate with the USCI_A BRCLK is the input to the module (SMCLK, ACLK, or UCA0CLK). BITCLK controls the rate at which bits are received and transmitted. Ideally its frequency should be the same as the baud rate, fBITCLK = fbaud. BITCLK16 is the sampling clock in oversampling mode, with a frequency fBITCLK16 = 16fBITCLK.

PROGRAMMING SPI

USCI IN SPI MODE

#include <msp430.h> volatile char received_ch = 0; int main(void) { WDTCTL = WDTPW + WDTHOLD; // Stop WDT P1DIR |= BIT5; P1OUT |= BIT5; P1SEL = BIT1 | BIT2 | BIT4; P1SEL2 = BIT1 | BIT2 | BIT4; UCA0CTL1 = UCSWRST UCA0CTL0 |= UCCKPH + UCMSB + UCMST + UCSYNC;//3-pin,8-bit SPI MST UCA0CTL1 |= UCSSEL_2; // SMCLK UCA0BR0 |= 0x02; // /2 UCA0BR1 = 0; // UCA0MCTL = 0; // No modulation UCA0CTL1 &= ~UCSWRST; // **Initialize USCI state machine** P1OUT &= (~BIT5); // Select Device while (!(IFG2 & UCA0TXIFG)); // USCI_A0 TX buffer ready? UCA0TXBUF = 0xAA; // Send 0xAA over SPI to Slave while (!(IFG2 & UCA0RXIFG)); // USCI_A0 RX Received? received_ch = UCA0RXBUF; // Store received data P1OUT |= (BIT5); // Unselect Device }

PROGRAMMING UART On the MSP430G2553 that is on the MSP430 Launchpad, UCA0 pins are present on pins P1.1 and P1.2 as UCA0RXD and UCA0TXD, respectively

#include <msp430.h> int main(void) { WDTCTL = WDTPW + WDTHOLD; // Stop WDT DCOCTL = 0; /* Use Calibration values for 1MHz Clock DCO*/ BCSCTL1 = CALBC1_1MHZ; DCOCTL = CALDCO_1MHZ; P1SEL = BIT1 | BIT2 ; /* Configure Pin Muxing P1.1 RXD and P1.2 TXD */ P1SEL2 = BIT1 | BIT2; UCA0CTL1 = UCSWRST; /* Place UCA0 in Reset to be configured */ /* Configure */ UCA0CTL1 |= UCSSEL_2; // SMCLK UCA0BR0 = 104; // 1MHz 9600 UCA0BR1 = 0; // 1MHz 9600 UCA0MCTL = UCBRS0; // Modulation UCBRSx = 1 UCA0CTL1 &= ~UCSWRST; /* Take UCA0 out of reset */ IE2 |= UCA0RXIE; /* Enable USCI_A0 RX interrupt */ __bis_SR_register(LPM0_bits + GIE); // Enter LPM0, interrupts enabled } /* Echo back RXed character, confirm TX buffer is ready first */ #pragma vector=USCIAB0RX_VECTOR __interrupt void USCI0RX_ISR(void) { while (!(IFG2&UCA0TXIFG)); // USCI_A0 TX buffer ready? UCA0TXBUF = UCA0RXBUF; // TX -> RXed character

CASE STUDY A Low-Power Battery-Less Wireless Temperature and Humidity Sensor for the TI PaLFI Device SHT21 relative humidity and temperature (RH&T) sensor from Sensirion MSP430F2274 microcontroller TMS37157(PaLFI) low-frequency device from TI. The complete power for the wireless sensor and the MSP430F2274 is provided by the RFID base station (ADR2) reader included in the eZ430-TMS37157 demo kit.