15
Microprocessor or Microprocessor or Microcontroller Not just a case of “you say tomar to and I say tomay to” M. Smith, ECE University of Calgary, Canada Information taken from Analog Devices On-line Manuals with permission http://www.analog.com/processors/resources/technicalLibrary/manuals/ Information furnished by Analog Devices is believed to be accurate and reliable. However, Analog Devices assumes no responsibility for its use or for Devices assumes no responsibility for its use or for any infringement of any patent other rights of any third party which may result from its use. No license is granted by implication or otherwise under any is granted by implication or otherwise under any patent or patent right of Analog Devices. Copyright © Analog Devices, Inc. All rights reserved. 13 September 2006 Differences between a microprocessor and a microcontroller M. Smith, University of Calgary, Canada 2/ 29

Microprocessor orMicroprocessor or Microcontrollerpeople.ucalgary.ca/...23_10/.../10_Sep15_MicroprocessorMicrocontro… · MicroPROCESSOR – Basic concept CONTROL ... Give an example

  • Upload
    dokhanh

  • View
    224

  • Download
    4

Embed Size (px)

Citation preview

Microprocessor orMicroprocessor or MicrocontrollerNot just a case of “you say tomarto and I say tomayto”

M. Smith, ECEUniversity of Calgary, Canada

Information taken from Analog Devices On-line gManuals with permission http://www.analog.com/processors/resources/technicalLibrary/manuals/

Information furnished by Analog Devices is believed to be accurate and reliable. However, Analog Devices assumes no responsibility for its use or forDevices assumes no responsibility for its use or for any infringement of any patent other rights of any third party which may result from its use. No license is granted by implication or otherwise under anyis granted by implication or otherwise under any patent or patent right of Analog Devices. Copyright © Analog Devices, Inc. All rights reserved.

13 September 2006Differences between a microprocessor and a microcontroller

M. Smith, University of Calgary, Canada 2/ 29

To be tackled today

Basic microprocessorBasic microprocessorConcept of a microcontrollerDifference between the BlackfinDifference between the Blackfin microcontroller and Blackfin Ez-Kit Lite evaluation boardCapabilities of the ADSP-BF533 Blackfin Ez-Kit Lite evaluation boardVarious acronyms that will be used in the course

13 September 2006Differences between a microprocessor and a microcontroller

M. Smith, University of Calgary, Canada 3/ 29

Microprocessor – Basic conceptADDRESS BUS 32-bit / 64-bit wide

CPU

containsCCU

CONTROL BUSCCUALU

data registersand

Timing signals, ready signals,interrupts etc

pointer registers

DATA BUS – bidirectional8 / 16 / 32 / 1288-bit / 16-bit / 32-bit / 128-bit

Microprocessor, by-itself, completely uselessMust have external peripherals (screen, buttons, LED, keyboard, SPI, internet, USB)

13 September 2006Differences between a microprocessor and a microcontroller

M. Smith, University of Calgary, Canada 4/ 29

Must have external peripherals (screen, buttons, LED, keyboard, SPI, internet, USB) to interact with outside world

MicroPROCESSOR – Basic conceptCONTROL BUSCONTROL BUS

ADDRESSBUS

CPU

containsCCU

BOOTROM Instruction

KeyboardScreenUARTDataCCU

ALUdata registers

and

Used at startup

(program)ROM

TransducersUART

Parallelinterface

etc

DataRAM

pointer registers

DATA BUSMicroprocessor, by-itself, completely useless – must have external peripherals toInteract with outside worldExternal peripherals completely useless – we must develop / understand code

13 September 2006Differences between a microprocessor and a microcontroller

M. Smith, University of Calgary, Canada 5/ 29

External peripherals completely useless we must develop / understand code that makes them work – initialize, read and write values or group of values

Every external device needs this amount of “ l l i ” ll l isupport “glue logic” to allow us to control it

ADDRESS BUS

DECODE LOGIC

•Address strobe •CS – chip select

External Device

Device itself with all necessary internal logic

to do the things it needs to do

•Data strobe

•Read/Write control

to do the things it needs to do

OEO t t

DATA BUS

Output Enable other signals

such as interrupt signals, etc

13 September 2006Differences between a microprocessor and a microcontroller

M. Smith, University of Calgary, Canada 6/ 29

How it worksYou code P0.L = lo(DeviceAddress); P0.H = hi(DeviceAddress); R0 = [P0];R0 [P0];

The processor fetches the two instructions to set pointer register

Third instruction works like this

F t h i t tiFetch instruction

CPU put out the value in P0 on address bus

Every peripheral’s decode logic checks to see if thatEvery peripheral s decode logic checks to see if that address if the one it understands

If the address matches – peripheral puts a value on data bus

CPU puts that data bus value into R0

13 September 2006Differences between a microprocessor and a microcontroller

M. Smith, University of Calgary, Canada 7/ 29

Issues with external devices

Many pinsMany pinsMechanical failure rates increased

Design time increased – routing issues on boardDesign time increased routing issues on board

Cost increased, board size increased

Continually redesigning same thingContinually redesigning same thingCompatibility between parts

Upgrade partUpgrade part

Many similar options between different projects

In Real-life -- Don’t need “100% flexibility”

13 September 2006Differences between a microprocessor and a microcontroller

M. Smith, University of Calgary, Canada 8/ 29

In Real-life -- Don t need 100% flexibility

MicroCONTROLLER – Basic conceptCONTROL

ADDRESS

BOOTCPU

containsCCU

BOOTROM

Used at

Instruction(program)

ROM

UARTParallelinterface

DataRAM

CCUALU

data registersand

startup Transducers Etc

pointer registers

DATA

Microcontroller – put a limited amount of most commonly used resources “inside” the chip – a “limited” amount is often “enough” for many applications

13 September 2006Differences between a microprocessor and a microcontroller

M. Smith, University of Calgary, Canada 9/ 29

Advantages of microCONTROLLER over microPROCESSOR

Pin count downPin count down

Design time down, Board layout size down

Upgrade path easier matching betweenUpgrade path easier – matching between peripherals for speed

C t d b lk hCost down – bulk purchases

Reliability up

Common software / hardware design environment available from manufacturer

13 September 2006Differences between a microprocessor and a microcontroller

M. Smith, University of Calgary, Canada 10/ 29

Issues when using microcontroller

Two types of memory – speed issues when usingOn-chip – fast, easy to access, “almost as fast as using a register”, limited amount of on-chip memory availableOff-chip – slower to access – additional costUse on-chip memory in a “cache” mode (copy off-chip data to on-Use on-chip memory in a cache mode (copy off-chip data to on-chip when processing data, then copy back)

External components still thereE.g. Video CODECs – need to use DMA – Direct Memory Access g y– so that the controller can get on with the “processing” and let something else worry about moving data in and out of the chip

Real time environmentEvent driven can’t WAIT for a device to become ready can’tEvent driven – can t WAIT for a device to become ready, can t POLL to see if device is ready, interrupt handling is key

All these resources are “power hungry” and compete for resources (data busses etc) – special features to control power

13 September 2006Differences between a microprocessor and a microcontroller

M. Smith, University of Calgary, Canada 11/ 29

use

Components of the Blackfin BoardFrom smallest to largest

Processor CoreProcessor CoreOne core on Blackfin ADSP-BF533 processor

Two cores on Blackfin ADSP-BF561 processorTwo cores on Blackfin ADSP BF561 processor

Processor itselfcore + some memory + some other builtcore + some memory + some other built incapability

Blackfin Evaluation boardBlackfin Evaluation boardDon’t forget the software development package VisualDSP++

13 September 2006Differences between a microprocessor and a microcontroller

M. Smith, University of Calgary, Canada 12/ 29

Blackfin ADSP-BF533 CORE

REMINDERREMINDER TO SELF

THIS IS

13 September 2006Differences between a microprocessor and a microcontroller

M. Smith, University of Calgary, Canada 13/ 29

THIS ISANIMATED

Some key discussed elements from the previous slide

Why did the processor designers allow 2 loads fromWhy did the processor designers allow 2 loads from memory at the same time, a load and store at the same time, but not two stores at the same time?

Why would the processor designers make 8-bit ALUs operations available on a processor that has 32 bit registers?32-bit registers?

Give an example of an instruction where four 8-bit ALU operations occur at the same timeALU operations occur at the same time

Give an example of an instruction where two 16-bit ALU operations occur at the same time

13 September 2006Differences between a microprocessor and a microcontroller

M. Smith, University of Calgary, Canada 14/ 29

CORE

13 September 2006Differences between a microprocessor and a microcontroller

M. Smith, University of Calgary, Canada 15/ 29The “chip” itself, we need to code all

Enter the key elements from previous slide

Will you learn to “flash” memory in this class,Will you learn to flash memory in this class, and how would you do it and why?What does a watch-dog timer do – and “how gdo you find out how to feed it?”What does the acronym MMU stand for?What does the acronym SPI stand for, and in what labs will we be using the SPI?When is the PPI used?What’s a real time clock?

13 September 2006Differences between a microprocessor and a microcontroller

M. Smith, University of Calgary, Canada 16/ 29

13 September 2006Differences between a microprocessor and a microcontroller

M. Smith, University of Calgary, Canada 17/ 29EVALUATION BOARD

Lab. 1 – demonstration of microcontroller capability

Use the microcontrollerUse the microcontrollerConfigure the FLASH memory

Contains memory and also I/O components (input / y p ( poutput)

Use the FLASH memory I/O capability to control th LEDthe LED

Configure the PF I/O lines (Programmable flags)Used to control many of the external devices (chip selectUsed to control many of the external devices (chip select and timing lines)

Used as input (Lab. 2) and / or interrupt lines (Lab. 3)

13 September 2006Differences between a microprocessor and a microcontroller

M. Smith, University of Calgary, Canada 18/ 29

Push-button switches (PF lines)LED (controlled by FLASH memory logic)

13 September 2006Differences between a microprocessor and a microcontroller

M. Smith, University of Calgary, Canada 19/ 29

Need to learn how to “configure” the flash memory so thatWe can control the LEDs

If we can control the LED’s then we have signals thatcould be used for a “radio-controlled” car

Parallel interfacespresent on the FLASH memorymemory chips

13 September 2006Differences between a microprocessor and a microcontroller

M. Smith, University of Calgary, Canada 20/ 29

Configure the PF lines (Programmable Flags – Input and output pins)

ReminderTo self

Animated

Replace one button input with the input of a temperature transducer and you have designed a “Software controlled gthermometer”

TMP03 will be used in Laboratory 2

13 September 2006Differences between a microprocessor and a microcontroller

M. Smith, University of Calgary, Canada 21/ 29

TMP03 will be used in Laboratory 2

Control of the PF lines – how / why?FIO_FLAG_D – Data registerFIO_EDGE -- Edge registerFIO DIR Di ti i tFIO_DIR -- Direction registerFIO_POLAR -- Polarity register

13 September 2006Differences between a microprocessor and a microcontroller

M. Smith, University of Calgary, Canada 22/ 29

PF lines being used already to control other devices – “We are not alone in using peripherals!!”

When we change the FIO_FLAG_D register has 16 I/O pinsPF registers bits, we must ONLY change those over which we have control

(Flag pins) available

have controlPF8, PF9, PF10, PF11

M t l thMust learn the instructions to safely change some register bits and not othersbits and not others (AND and OR instructions)

13 September 2006Differences between a microprocessor and a microcontroller

M. Smith, University of Calgary, Canada 23/ 29

Enter the key elements from previous slide

Which A/D is used on the Blackfin board?Which A/D is used on the Blackfin board?

Why are the signals that control the LED’s coming from the FLASH?coming from the FLASH?

What does SPORT1 means, and what external device is being controlled by it?external device is being controlled by it?

How does the SPORT device allow “time sharing” of the bus by several differentsharing of the bus by several different external devices?

13 September 2006Differences between a microprocessor and a microcontroller

M. Smith, University of Calgary, Canada 24/ 29

Audio-Video Interaction of ADSP-BF533 Ez-Kit Lite with the outside world

13 September 2006Differences between a microprocessor and a microcontroller

M. Smith, University of Calgary, Canada 25/ 29

13 September 2006Differences between a microprocessor and a microcontroller

M. Smith, University of Calgary, Canada 26/ 29

Review quiz

CPU stands forCPU stands for

CCU stands forCCU stands for

ALU stands for

DMA stands for

13 September 2006Differences between a microprocessor and a microcontroller

M. Smith, University of Calgary, Canada 27/ 29

Review Quiz

How come the FLASH memory must be used to ycontrol the LEDs and not the GPIO register pins (general purpose I/O)?

Why can’t we use PF0 line in Lab. 2 to read temperature transducer input signals?p p g

Why will AND and OR operations be necessary h t l th PF I/O li ?when we control the PF I/O lines?

What does PF stand for?

13 September 2006Differences between a microprocessor and a microcontroller

M. Smith, University of Calgary, Canada 28/ 29

What does PF stand for?

Tackled today

Basic microprocessorBasic microprocessorConcept of a microcontrollerDifference between the BlackfinDifference between the Blackfin microcontroller and Blackfin Ez-Kit Lite evaluation boardCapabilities of the ADSP-BF533 Blackfin Ez-Kit Lite evaluation boardVarious acronyms that will be used in the course

13 September 2006Differences between a microprocessor and a microcontroller

M. Smith, University of Calgary, Canada 29/ 29