Top Banner
1 EECS 373 Design of Microprocessor-Based Systems Ronald Dreslinski University of Michigan Lecture 14: Memory and Peripheral Busses PCB design/terminology Slides developed in part by Prof. Dutta & Brehob
54

Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

Apr 05, 2018

Download

Documents

trinhkhanh
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

1

EECS 373 Design of Microprocessor-Based Systems Ronald Dreslinski University of Michigan Lecture 14: Memory and Peripheral Busses

PCB design/terminology

Slides developed in part by Prof. Dutta & Brehob

Page 2: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

Administrative

•  Milestone Meeting 1 –  Thur/Friday of this week

•  Group Lecture Presentations –  Details on Thursday –  Start on Mar. 22nd

•  No Lecture Next Tuesday (3/20) –  Work on projects

2

Page 3: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

Outline

•  Memory review

•  AHB bus

•  PCB material

3

Page 4: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

Memory basics

•  Read only

•  Volatile –  Dynamic

•  Wearout

•  Latencies

4

Page 5: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

Memory array types

5

Memory Arrays

Random Access Memory Serial Access Memory Content Addressable Memory(CAM)

Read/Write Memory(RAM)

(Volatile)

Read Only Memory(ROM)

(Nonvolatile)

Static RAM(SRAM)

Dynamic RAM(DRAM)

Shift Registers Queues

First InFirst Out(FIFO)

Last InFirst Out(LIFO)

Serial InParallel Out

(SIPO)

Parallel InSerial Out

(PISO)

Mask ROM ProgrammableROM

(PROM)

ErasableProgrammable

ROM(EPROM)

ElectricallyErasable

ProgrammableROM

(EEPROM)

Flash ROM

Page 6: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

•  Ferroelectric RAM

•  Phase change memory

•  Magnetoreseistive RAM

•  Programmable metallization cell

6

Page 7: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

Outline

•  Memory review

•  AHB-Lite bus

•  Start on PCB material (time allowing)

7

Page 8: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

Modern embedded systems have multiple busses

8

Atmel SAM3U

Today

Page 9: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

Advanced Microcontroller Bus Architecture (AMBA) - Advanced High-performance Bus (AHB) - Advanced Peripheral Bus (APB)

AHB •  High performance •  Pipelined operation •  Burst transfers •  Multiple bus masters •  Split transactions

APB •  Low power •  Latched address/control •  Simple interface •  Suitable of many

peripherals

9

Page 10: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

10

Actel SmartFusion system/bus architecture

Page 11: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

11

AHB-Lite supports single bus master and provides high-bandwidth operation

•  Burst transfers

•  Single clock-edge operation

•  Non-tri-state implementation like APB

•  Configurable bus width

Most figures in this section from AMBA 3 AHB-Lite Protocol v1.0 You have to register with ARM (trivial) for this, we can’t post it.

Page 12: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

12

AHB-Lite bus master/slave interface

•  Global signals –  HCLK –  HRESETn

•  Master out/slave in –  HADDR (address) –  HWDATA (write data) –  Control

•  HWRITE •  HSIZE •  HBURST •  HPROT •  HTRANS •  HMASTLOCK

•  Slave out/master in –  HRDATA (read data) –  HREADY –  HRESP

Page 13: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

13

AHB-Lite signal definitions

•  Global signals –  HCLK: the bus clock source (rising-edge triggered) –  HRESETn: the bus (and system) reset signal (active low)

•  Master out/slave in –  HADDR[31:0]: the 32-bit system address bus –  HWDATA[31:0]: the system write data bus –  Control

•  HWRITE: indicates transfer direction (Write=1, Read=0) •  HSIZE[2:0]: indicates size of transfer (byte, halfword, or word) •  HBURST[2:0]: burst transfer size/order (1, 4, 8, 16 beats or undefined) •  HPROT[3:0]: provides protection information (e.g. I or D; user or handler) •  HTRANS: indicates current transfer type (e.g. idle, busy, nonseq, seq) •  HMASTLOCK: indicates a locked (atomic) transfer sequence

•  Slave out/master in –  HRDATA[31:0]: the slave read data bus –  HREADY: indicates previous transfer is complete –  HRESP: the transfer response (OKAY=0, ERROR=1)

Page 14: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

14

Key to timing diagram conventions (As APB)

•  Timing diagrams –  Clock –  Stable values –  Transitions –  High-impedance

•  Signal conventions –  Lower case ‘n’ denote

active low (e.g. RESETn) –  Prefix ‘H’ denotes AHB –  Prefix ‘P’ denotes APB

Page 15: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

15

Basic read and write transfers with no wait states

Pipelined Address & Data Transfer

Page 16: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

16

Read transfer with two wait states

Two wait states added by slave by asserting HREADY low

Valid data produced

Page 17: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

17

Write transfer with one wait state

One wait state added by slave by asserting HREADY low

Valid data held stable

Page 18: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

18

Wait states extend the address phase of next transfer

One wait state added by slave by asserting HREADY low

Address stage of the next transfer is also extended

Page 19: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

19

Transfers can be of four types (HTRANS[1:0])

•  IDLE (b00) –  No data transfer is required –  Slave must OKAY w/o waiting –  Slave must ignore IDLE

•  BUSY (b01) –  Master inserts idle cycles in a burst (wait states) –  Burst will continue afterward –  Address/control reflects next transfer in burst –  Slave must OKAY w/o waiting –  Slave must ignore BUSY

•  NONSEQ (b10) –  Indicates single transfer or first transfer of a burst –  Address/control unrelated to prior transfers

•  SEQ (b11) –  Remaining transfers in a burst –  Addr = prior addr + transfer size

Page 20: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

HTRANS

20

Page 21: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

21

A four beat burst with master busy and slave wait

One wait state added by slave by asserting HREADY low

Master busy indicated by HTRANS[1:0]

Page 22: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

22

Controlling the size (width) of a transfer

•  HSIZE[2:0] encodes the size

•  The cannot exceed the data bus width (e.g. 32-bits)

•  HSIZE + HBURST is determines wrapping boundary for wrapping bursts

•  HSIZE must remain constant throughout a burst transfer

Page 23: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

23

Controlling the burst beats (length) of a transfer

•  Burst of 1, 4, 8, 16, and undef number of beats

•  HBURST[2:0] encodes the type

•  Incremental burst

•  Wrapping bursts –  4 beats x 4-byte words wrapping –  Wraps at 16 byte boundary –  E.g. 0x34, 0x38, 0x3c, 0x30,…

•  Bursts must not cross 1KB address boundaries

Page 24: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

24

A four beat wrapping burst (WRAP4)

Page 25: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

25

A four beat incrementing burst (INCR4)

Page 26: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

26

An eight beat wrapping burst (WRAP8)

Page 27: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

27

An eight beat incrementing burst (INCR8) using half-word transfers

Page 28: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

28

An undefined length incrementing burst (INCR)

Page 29: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

29

Multi-master AHB-Lite requires a multi-layer interconnect

•  AHB-Lite is single-master

•  Multi-master operation –  Must isolate masters –  Each master assigned to layer –  Interconnect arbitrates slave

accesses

•  Full crossbar switch often unneeded –  Slaves 1, 2, 3 are shared –  Slaves 4, 5 are local to Master 1

Page 30: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

AHB-Lite takeaways

•  AHB-Lite is a pipelined bus –  Address of one transaction at the same time as data of

another transaction

•  AHB-Lite deals with real-world problems –  Critical-word first (for caches) –  Longer data phases (burst) to reduce overhead. –  Locks

•  Still has flow control

30

Page 31: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

SoyouwanttomakeaPrintedCircuitBoard…

•  AttheendofthedayaPCBisjustasetofwiresthatconnectcomponents.–  Buttherearesomeissues

•  Thewireshaverestricteddimensionality

•  Thewiresareverythin–  Sohighresistance(as

conductorsgo)

•  Theboardneedstoincludeholes(orpads)forthedevices.

•  Youcan’teasilychangethingsonceyoubuildit.

hEp://www.linkwitzlab.com/Pluto/supplies-subw.htm,hEp://www.musicfromouterspace.com/analogsynth/SINGLEBUSSKEYBOARD2007/SINGLEBUSSKEYBOARD2007.php

PCBs–basicterminology

Page 32: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

BasicTerminology•  Thewiresyouarelayingout

arecalled“traces”or“tracks”•  Insideofagiven“layer”

traceswhichcrossareelectricallyconnected.–  Ifyouhavetracesonbothsides

oftheboard,youaresaidtohavetwolayers.

•  Through-hole:HavingholesinthePCBdesignedtohavepinsputthroughthehole–  Contrastwithsurfacemount

wheredevicegoesontop.

PCBs–basicterminology

Page 33: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

33

PartsofaPCB

Drill holes Via Bottom side

Silkscreen (white)

Copper (pads & traces)

Soldermask (green)

PCBs–basicterminology

Page 34: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

Vias

•  Some]mesyouneedtoconnecttwotracesontwodifferentlayers.– Todothisweuseavia.–  Itisjustaaplatedthroughhole•  Generallysmallerthanathroughholeforapart.

PCBs–basicterminology

Page 35: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

Clearances

•  Therewillbespacebetweenthetraces,platedholesandeachother.– Youneedtomeettherequirementofthemanufacturer.

PCBs–basicterminology

Page 36: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

Thelayeredconstruc]onofaPCB:Asixlayerboard

36

PCBs–basicterminology

Figurefromal]um.com

Page 37: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

So,howdoIdesignaPCB?

1.  Createschema]c

2.  Placeparts

3.  Routeinterconnect

4.  Generatefiles

PCBs–designsteps

Page 38: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

Step1:Createschema]c

•  Thefirstthingyouwantissomethingthatlookslikeatextbookcircuitdiagram.Itjustshowsthedevicesandhowtheyareconnected.– Some]mesyouwillworryaboutpinoutshere(saywhenworkingwithamicroprocessormaybe)

– Butusuallyyoudon’t•  Nono%onoflayoutbelongshere!

PCBs–designsteps:schema]c

Page 39: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

Exampleschema]cPCBs–designsteps:schema]c

Page 40: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

Whyaschema]c?

•  Ingeneralitisdrawntobereadable.– Thisisprobablywhatyoursketchonpaperwouldlooklike.

– YoucanfindandfixbugsmoreeasilyherethanthePCBlayout.

PCBs–designsteps:schema]c

Page 41: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

Step2:Placeparts

•  YouneedtoplacethepaEernsontheboard.–  Youneedtonotoverlapthemtothatthecomponentscanactuallyfitontheboard.

–  Youwanttoleaveroomforthetracestoconnecteverything.

•  Thisisverymuchanartform.–  Infactyouwillfindpeoplewhorantabout“sloppy”or“unprofessional”placements.

•  Sometoolswilldothisforyou.Nooneseemstolikethem.

PCBs–designsteps:placement

Page 42: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

PaEerns•  Onceyouknowwhatitis

youwanttobuild,youneedtofigureouthowtolayitoutontheboard. –  Youneedtoknowhowbig

eachpieceis,andwheretheholesneedtobeplaced.

•  EachdevicehasapaEernwhichshowsexactlythat.–  Youwilloccasionallyneedto

createapaEern.

PCBs–designsteps:placement

Page 43: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

Step3:Routeinterconnect

•  Arouteisaconnec]onbetweendevices.–  Itmayconsistofmul]pletraces

•  Therearedesignruleswhichinclude:– Minimumtracewidth– Minimumspacingbetweentracesandholes– Minimumspacingbetweenholesandholes.

•  Theseruleswillvarybymanufacturer.– EvenbeEer,unitswillvarybymanufacturer!– Timeforabriefaside…

PCBs–designsteps:rou]ng

Page 44: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

Issuesofmeasure

•  PCBlandusessomeinteres]ngterminology.– A“thou”isathousandthofaninch.– A“mm”isamillimeter– A“mil”isathousandthofaninch.•  Thouisgenerallypreferredovermilltoavoidconfusion,butmosttools/vendorsusemill.

PCBs–anaside

Page 45: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

Tracewidth•  IngeneralmostPCBmanufacturesseemtohavetrace-widthminimumsof6-10thous.– Mostarewillingtogosmallerforaprice.

•  Aruleofthumbistousea50thouminimumforpower/groundand25foreverythingelse.–  Thisistodroptheresistanceofthetraces.–  Ingeneralyouareworriedaboutheatdissipa]on

•  Therearelotsofguidelinesforwidth/powerbutingeneralyouarelookingat:–  A10cmtraceneedstobe10thouwideifitwillcarry1amp.

–  5ampsat10cmwouldrequire110thou.

PCBs–anaside

Page 46: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

Tracewidthcon]nued

•  Theproblemwithwidetracesisthattheyarehardtoroute.–  Inpar]cularyoumightwishtogobetweenpinsofadevice.

•  Onesolu]onistobewidenormallyand“neckdown”whenyouhaveto.– Thisismorereasonablethanyouthink.•  Thinkresistorsinseries.

PCBs–anaside

Page 47: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

Rat’snest.

•  Arat’snestshowstheplacementofthedevicesandtheconnec]onsbutnottherou]ng–  Automa]callygeneratedforyou.•  Some]mesbeforeplacement,some]mesaler–  Variesbytool.

PCBs–designsteps:rou]ng

Page 48: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

Rou]ngforreal•  Youcanusean

autoroutertorouteyourtraces–  Somepeoplehatetheseasthedesignwillbe“ugly”

–  Savesalotof]me.–  Oddly,notasgoodasapersoncando.•  Butmuchfaster.

•  S]llgenerallyneedtodosome(orall)oftherou]ngbyhand–  Verytedious...

PCBs–designsteps:rou]ng

Page 49: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

Rou]ngqualityPCBs–designsteps:rou]ng

Page 50: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

Step4:Generatefiles•  Oncethedesignisdone,asetoffilesaregenerated.

–  Eachfiledescribessomethingdifferent(e.g.)•  Copperonagivenlayer•  Silkscreen•  Soldermask

– Mostfilesarein“Gerber”format•  Human-readable(barely)ASCIIformat•  Hascommandslikedrawandfill.

–  DrillfilesareadifferentformatcalledExcellon•  Alsohuman-readable(barely)ASCIIwithloca]onsanddiametersfortheholes.

•  GenerallyyouzipallthesefilesupandshipthemasasinglefiletothePCBmanufacturer.–  Olenagoodideatoincludethedesignfile(s)too.

PCBs–designsteps:generatefiles

Page 51: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

51

Theschema]ccapturesthelogicalcircuitdesignPCBs–closingexample

Page 52: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

52

Floorplanningcapturesthedesiredpartloca]onsPCBs–closingexample

Page 53: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

53

Theauto-routerplacestracksontheboard,saving]mePCBs–closingexample

Page 54: Design of Microprocessor-Based Systems • Memory review ... – HRESETn: the bus (and system) reset signal ... when working with a microprocessor maybe)

Thelayeredconstruc]onofaPCB:Asixlayerboard

54

PCBs–backtoasideview

Figurefromal]um.com