Shared Custom Instructions for Multiprocessor Systems

Download Report

Transcript Shared Custom Instructions for Multiprocessor Systems

Notes developed by Jason Long
www.engenuics.com/mpghome.php
Slides developed by Erin Johnston as an accompaniment to notes
Delivered Oct. 17th, 2011 – UBC Okanagan

Getting Set Up
Microprocessor vs Microcontroller
 The 32-bit Processor
 The Clock
 Microcontroller Programs

◦ Interrupts

Development Tools
2

Order your hardware now!
http://www.engenuics.com/mpghardware.php
◦ Order the “MPG Remote MPG Level 1 ARM7
Razor Development Board Completed”
◦ Should come out to $47.25 with GST and no
shipping charges
◦ Make sure to create an Engenuics account so
orders get matched up with people and
schools
3

Start installing your software
http://www.engenuics.com/mpgstuff.php
◦ IAR may not work properly (should install
fine though)
‘Like’ Engenuics on Facebook!
 Bookmark the MPG home page

http://www.engenuics.com/mpghome.php
4
5
RAM
Sound
card
Microprocessor
Disk
drives
Video
card
6
Microcontroller
Timers,
Communications
hardware, etc
7


LPC2142 from NXP Semiconductors
ARM7TDMI processor core
◦
◦
◦
◦
Original iPod
PSP
Nintendo DS
Cell phone
8


Communicates via 32-bit wide “bus”
Harvard architecture
◦ Single bus for instructions and data

Von Neumann
◦ Separate buses for instruction and data
◦ ARM7TDMI
8-bit data bus: 255 bytes of memory addressed
32-bit data bus: 4GB+ of memory addressed
9
Fetch
Op Code
travels
on local
bus
Decode
Data
retrieved
from
memory
Execute
Logic
moves
through
functions
10
11

Maximum clock speed:
◦ Max propagation delay = 1us
◦ Max clock speed = 1/1us = 1MHz

Propagation delay calculated at extremes
◦ Min supply voltage
◦ Max temperature
◦ Poorest conductor quality
12

Crystal oscillator
◦ Expensive, 2 carefully selected capacitors
◦ Precise, no drift over power supply ranges,
temperature, etc

Resistor-capacitor (RC) oscillator
◦ Imprecise, depends on temperature, supply voltage,
etc
Speed example: 20 k ohm resistor, 100 pF capacitor
Speed = 1/(RC) = 500kHz
13

Is 60 MHz really that slow?
1 MHz clock
1 Million cycles per second
T = 1/f
T = 1/1MHz
T = 1us per instruction cycle
8 to 10 cycles per evaluation
1us x 10 cycles = 10us
10us for something useful!!
14
C Code
Assembly
Machine
15

Flash Memory
◦ Non-volatile: retained when no power is applied

Electrically Erasable and Programmable Read
Only Memory (EEPROM)
◦ Electrically readable and writeable

One-Time Programmable (OTP) Memory
◦ One shot to program

EPROM
◦ Erased by shining UV light on chips
16
0x0
0x04
0x08
•add R1, R2, R3
PC
•mov 5, R4
PC
•and R4, R3, R4
PC
17


Interrupts take control of the system and
force a special function
Interrupt Service Routine (ISR)
◦ Not called by a line of code, initiated by event
◦ Regular program resumes from where it left off
18




Interrupt sources include input pins, onboard peripherals, core
Interrupt enable bit tells processor to activate
or ignore the interrupt
Interrupt flag tells when interrupt event has
occurred
Global interrupt enable (GIE) disables all
interrupts simultaneously
19




Interrupt sources include input pins, onboard peripherals, core
Interrupt enable bit tells processor to activate
or ignore the interrupt
Interrupt flag tells when interrupt event has
occurred
Global interrupt enable (GIE) disables all
interrupts simultaneously
20

IAR development system tools

Integrated development environment (IDE)

Embedded Workbench (EW)
21