Docsity

Microprocessors and Assembly Language, Lecture notes of Computer Architecture and Organization

Partial preview of the text

Download Microprocessors and Assembly Language and more Lecture notes Computer Architecture and Organization in PDF only on Docsity!

2.996/6.971 Biomedical Devices Design

Laboratory

Lecture 5: Microprocessors I

Instructor: Dr. Hong Ma

Sept. 26, 2007

Analogy: A Complex Machine with Lots of Knobs

Courtesy of NASA.

Trends in Sensor Architectures

-^

Single processor

Æ

distributed processors

The MSP430F2xx Family

•^

Optimized for low-power

and versatility

•^

Modern architecture, simple to program

-^

Many peripheral devices – designed to notrequire input from the CPU

-^

Unified address space, no paging

-^

Device emulates itself

-^

Inexpensive development tools

-^

Highly optimized code, designed for C compiler

-^

Low cost, price >$0.

MSP430F2274 Pinout

Port Functions

•^

Digital input

-^

Digital output

-^

Pulled-up / Pulled-down

-^

Peripheral input / output

-^

Interrupt on edge

Memory Map

Von Neuman Architecture

Hardware(Switchesand I/O)

“Software”(Instructions forflipping theswitches)

Registers

Hex Numbers and Memory

MSP430 Memory^ • 8-bit addressing

resolution

Bit-wise Operators

  • Bit-wise “OR”: |

Æ

  • Bit-wise “AND”: &

Æ

  • Bit-wise “NOT”: ~

Æ

  • Bit-wise “XOR”: ^

– 1001 ^ 0101

Æ

Assigning Individual Bits

  • Assigning all 8-bits at once
    • P1OUT = 0xA
      • Assigning individual bits high
        • P1OUT |= 0x
          • Assigning individual bits low
            • P1OUT &= ~0x
              • Toggling individual bits
                • P1OUT ^= 0x

Configuring Ports

Main(){ ...P1DIR |= BIT0 + BIT1 + BIT2 + BIT3 + BIT4 + BIT5;//Set output modeP1SEL |= BIT1 + BIT2;//Output Timer_A1 and Timer_A2P1REN |= BIT6 + BIT7;//Enable pull-up/down resistors

for BIT6 and BIT

P1OUT |= BIT0 + BIT6//Output high on BIT0; Pull-up BIT6P1OUT &= BIT3 + BIT4 + BIT5 + BIT7//Output low on BIT3, BIT4,

and BIT5; Pull-down BIT

...}

Next Topic: Clocks

Crystal Oscillators

  • Extremely accurate – standard frequency

tolerance = 20ppm

  • Many frequencies: 20kHz – GHz • Real Time Clock: 32.768kHz • Requires 2 external capacitors • LFXT1 has integrated capacitors • Ceramic resonator
    • Smaller, cheaper cousin – Frequency tolerance ~ 0.5%

Photo removed due to copyright restrictions.

DCO (Digital Controlled Oscillator)

-^

0 to 16 MHz

-^

Fast start-up <1uS

-^

±3% tolerance

-^

±6% tolerance overtemperature

-^

Factory calibration inFlash

-^

Good enough forUART

-^

Application: watch

Images removed due to copyright restrictions.