digital control applications in power electronics

27
Simone Buso - University of Padova September 1999 Lesson #1 1 Digital Digital Control Applications in Control Applications in Power Electronics Power Electronics Simone Buso Simone Buso University of Padova University of Padova - - Italy Italy Department of Electronics and Informatics Department of Electronics and Informatics Power Electronics Laboratory Power Electronics Laboratory e- e- mail mail: simone simone @dei. @dei.unipd unipd.it it September 1999 Simone Buso - University of Padova - Lesson 1 2 Lesson Lesson 1 1 Digital Digital Control Tools Control Tools: Microcontrollers Microcontrollers and and Digital Digital Signal Processors Signal Processors.

Upload: others

Post on 03-Oct-2021

3 views

Category:

Documents


0 download

TRANSCRIPT

Simone Buso - University of Padova September 1999

Lesson #1 1

DigitalDigital Control Applications in Control Applications inPower ElectronicsPower Electronics

Simone BusoSimone Buso

University of PadovaUniversity of Padova - - Italy ItalyDepartment of Electronics and InformaticsDepartment of Electronics and Informatics

Power Electronics LaboratoryPower Electronics Laboratory

e-e-mailmail:: simone simone@[email protected]

September 1999 Simone Buso - University of Padova - Lesson 1 2

LessonLesson 1 1

DigitalDigital Control Tools Control Tools:: Microcontrollers Microcontrollersandand Digital Digital Signal Processors Signal Processors..

Simone Buso - University of Padova September 1999

Lesson #1 2

September 1999 Simone Buso - University of Padova - Lesson 1 3

IntroductionIntroduction

DigitalDigital Control Advantages Control Advantages::•• Flexibility Flexibility•• Ease ofEase of upgrade upgrade•• Man toMan to Machine Machine Interface (MMI) Interface (MMI)•• Sophisticated control techniques Sophisticated control techniques•• Reduced number of components Reduced number of components•• Unsensitivity Unsensitivity to to components’ ageing components’ ageing … …

DigitalDigital Control Disadvantages Control Disadvantages::•• Design complexityDesign complexity•• CostCost•• DynamicDynamic performance ( performance (sampling frequencysampling frequency,,

quantizationquantization...)...)

September 1999 Simone Buso - University of Padova - Lesson 1 4

IntroductionIntroduction

Available toolsAvailable tools for digital for digital control implementation control implementation

•• Microcontrollers Microcontrollers ( (µµµµCC))♦♦ CISCCISC ( (CComplexomplex I Instructionnstruction S Setet C Computeromputer))

machinesmachines (micro- (micro-coded instructionscoded instructions))♦♦ RISC (RISC (RReducededuced I Instructionnstruction S Set et CComputeromputer))

machinesmachines ( (withwith//withoutwithout hardware hardware multiplier multiplier))♦♦ 4 to 324 to 32 bit CPU bit CPU and and bus bus

•• Digital Digital Signal Processors Signal Processors (DSP) (DSP)♦♦ FixedFixed--pointpoint arithmeticarithmetic♦♦ FloatingFloating--point point arithmeticarithmetic

Simone Buso - University of Padova September 1999

Lesson #1 3

September 1999 Simone Buso - University of Padova - Lesson 1 5

IntroductionIntroduction

GeneralGeneral µµµµC featuresC features::

•• specifically designedspecifically designed for for control taskscontrol tasks•• A/DA/D converters converters almost always almost always included on chipincluded on chip•• capturecapture and and compare compare input pins available input pins available•• several programmableseveral programmable I/OI/O pins pins•• timerstimers and and counterscounters available available (PWM) (PWM)•• different kinds of different kinds of external memoryexternal memory available available (ROM, (ROM,

EEPROM, FLASH)EEPROM, FLASH)•• different different computational powerscomputational powers available available ( (fromfrom 3232 bit bit

RISC toRISC to simple simple 88 bit bit CPU’s and even CPU’s and even lessless))•• lots of third party development toolslots of third party development tools (EV-(EV-BoardsBoards,, in in--

circuit emulatorscircuit emulators ( (ICE’sICE’s))))

September 1999 Simone Buso - University of Padova - Lesson 1 6

IntroductionIntroduction

General DSPGeneral DSP features features::

•• notnot specifically designed specifically designed for for control tasks control tasks•• A/DA/D converters converters not alwaysnot always included on chipincluded on chip•• usefuluseful peripheral units peripheral units ( (CapComCapCom,, timers timers, PWM), PWM)

normally normally not present on chipnot present on chip•• very highvery high computational power available computational power available (32 bit RISC (32 bit RISC

CPU’s both fixed and floating pointCPU’s both fixed and floating point))•• relatively few third party development toolsrelatively few third party development tools (EV-(EV-

BoardsBoards))•• newnew DSP DSP solutionssolutions for for power electronic applications power electronic applications

areare now becoming now becoming available available (TMS320F240,(TMS320F240,ADMC401)ADMC401)

Simone Buso - University of Padova September 1999

Lesson #1 4

September 1999 Simone Buso - University of Padova - Lesson 1 7

MicrocontrollersMicrocontrollers

•• AA µµµµC is essentiallyC is essentially a a computingcomputing machine where machine where,, on the on thesame chipsame chip, a, a CPU CPU core core is interfaced with different is interfaced with differentperipheral unitsperipheral units,, allowing it allowing it to to perform various perform various controlcontrolfunctionsfunctions..

•• InIn modern modern µµµµC’sC’s,, the typical the typical CPU CPU architecture is the so architecture is the so--called called HarvardHarvard architecture architecture,, based on based on separateseparate programprogramandand data data memories and buses memories and buses.. An An hardwarehardware multiplier multiplier is isquitequite often present in often present in state of the artstate of the art products products..

•• The typical peripheral units includeThe typical peripheral units include::

♦♦ A\DA\D converters converters♦♦ Timers and countersTimers and counters♦♦ PWMPWM modulators modulators

September 1999 Simone Buso - University of Padova - Lesson 1 8

InIn the selection of the selection of a a µµµµC unitC unit for for any given control any given controlapplicationapplication some some key key parameters must beparameters must beconsideredconsidered::

•• performance performance parameters parameters•• cost parameters cost parameters

AsAs in any project in any project,, these two aspects typically have these two aspects typically have to tobe tradedbe traded--offoff..

MicrocontrollersMicrocontrollers

Simone Buso - University of Padova September 1999

Lesson #1 5

September 1999 Simone Buso - University of Padova - Lesson 1 9

MicrocontrollersMicrocontrollers

TypicalTypical performance performance parameters parameters are: are:

•• CPUCPU clock period clock period•• instruction cycle instruction cycle•• instruction set instruction set (RISC (RISC or or CISC) CISC)•• memory area memory area•• interrupt management interrupt management•• peripheral unit availability peripheral unit availability

The cost is indirectly determined also byThe cost is indirectly determined also by::

•• avaliability of development toolsavaliability of development tools•• cost of the evalution board cost of the evalution board, ICE,, ICE, etc etc.. etc etc..

and strongly depends on productionand strongly depends on production volume volume

September 1999 Simone Buso - University of Padova - Lesson 1 10

MicrocontrollersMicrocontrollers

•• The The µµµµC market is C market is very large and rich of productsvery large and rich of products.. A A lot lotof manufacturers offerof manufacturers offer completecomplete sets of sets of µµµµCC solutions solutions,,with increasing complexitywith increasing complexity,, level of level of performance performance and andcostcost..

•• AnAn exhaustiveexhaustive overview is practically overview is practically impossibleimpossible;;somesome examplesexamples can be shown of different products can be shown of different productswith different complexitieswith different complexities,, which allow which allow to to get get a aglimpseglimpse of what can be found on the market of what can be found on the market..

•• Common featuresCommon features in terms of in terms of system architecturesystem architecture and andperipheral unitsperipheral units can be easily identified can be easily identified..

Simone Buso - University of Padova September 1999

Lesson #1 6

September 1999 Simone Buso - University of Padova - Lesson 1 11

ExampleExample: ST6: ST6 microcontroller microcontroller [1] [1]

•• Very simpleVery simple (16(16 pins pins)) and low cost and low cost µµµµCC,, with with 8-bit CPU8-bit CPUandand 9 I/O9 I/O pins pins..

•• Low supply voltageLow supply voltage (3V, 6V). (3V, 6V).•• Low clock frequencyLow clock frequency (8Mhz (8Mhz max max.).)•• Minimum instruction cycleMinimum instruction cycle 1.625 1.625µµµµs.s.•• Low computational powerLow computational power:: only only 4040 simple instructions simple instructions

areare available available (no (no multiply instruction multiply instruction).).•• Peripheral units limitedPeripheral units limited to to Timer Timer andand A\D converterA\D converter (8(8

bit).bit).•• Typical applicationsTypical applications:: sequence control sequence control,, display display driver, driver,

simple and low speed closed loop controlssimple and low speed closed loop controls..

September 1999 Simone Buso - University of Padova - Lesson 1 12

ST6ST6 microcontroller block diagram microcontroller block diagram

Simone Buso - University of Padova September 1999

Lesson #1 7

September 1999 Simone Buso - University of Padova - Lesson 1 13

CPUCPU block diagram block diagram

ST6ST6 microcontroller microcontroller

September 1999 Simone Buso - University of Padova - Lesson 1 14

ExampleExample:: Siemens Siemens 8xC166 8xC166 µµµµCC [2] [2]

•• TypicalTypical ( (but but notnot widely used widely used) ) 16-bit16-bit µµµµCC..•• High clock frequencyHigh clock frequency (20MHz(20MHz maximum maximum ((internalinternal)).)).•• RISCRISC machine with machine with a a largelarge majority of single majority of single--cyclecycle

instructionsinstructions (100ns)(100ns) thanksthanks to to an internal an internal pipeline pipeline..•• Von Neumann Von Neumann architecturearchitecture (a (a single single memory space ismemory space is

usedused both both for datafor data and and program codeprogram code).).•• MediumMedium computational power computational power (no(no hardware hardware multiplier multiplier).).•• Available peripheral unitsAvailable peripheral units::

♦♦ 2 general2 general purpose purpose timerstimers 16 bit; 16 bit;♦♦ 22 independent independent serialserial communication channels communication channels;;♦♦ 1010 channels channels, 10-bit, 10, 10-bit, 10 µµµµss A\D A\D converter; converter;♦♦ 16 16 capturecapture and and compare compare (CAPCOM) (CAPCOM) channelschannels..

Simone Buso - University of Padova September 1999

Lesson #1 8

September 1999 Simone Buso - University of Padova - Lesson 1 15

SiemensSiemens 8xC166 series 8xC166 series overview overview

SABSAB

8080

8383

8888

C166C166

C166WC166W

C166C166

C166WC166W

C166C166

C166WC166W

(-)(-)

(-)(-)

55

55

55

55

MM

MM

MM

MM

MM

MM

(-)(-)T3T3(-)(-)T3T3T4T4

(-)(-)T3T3T4T4

(-)(-)T3T3

(-)(-)

(-)(-)

Prefix Memory Type Memory Package Temp. RangeType Code Designation Size Code Code Code

W = without prescaler M = Metric Quad Flatpack

ROMLess

Flash EEPROM

Metal Mask ROM

32KBytes

(-) no suffix

-40° / 110°

-40° / 85° 0° / 70°

-40° / 85° 0° / 70°

-40° / 110°-40° / 85° 0° / 70°-40° / 85° 0° / 70°

0° / 70°

0° / 70°

September 1999 Simone Buso - University of Padova - Lesson 1 16

SAB 80C166SAB 80C166 Block Diagram Block Diagram

up to

ROM /Flash -

EPROM

32 KByte

OSC

Po

rt

0

Po

rt

4

Port 1 Port 5 Port 3 Port 2

SAB 8xC166SAB 8xC166CPU CORE CPU CORE D

ual

Por

t

RAM

1 KByte

Interrupt Controller Watchdog

Peripheral Data

External Instr./Data

Instr./Data

External

Bus

Controller

10-BitADC

USART

ASCBRG BRG

ASC

GPT1

T3

T4

GPT2

T2

T5

T6

CAPCOM

Tim

er

1

Tim

er

0

16 10 16 16

16

2

16

16

16

1632

PEC

Interrupt Bus

Data

Data

USART

XTAL

16 Channels

19 ext. IR

Simone Buso - University of Padova September 1999

Lesson #1 9

September 1999 Simone Buso - University of Padova - Lesson 1 17

SAB 80C167SAB 80C167 Block Diagram Block Diagram

C166-CoreC166-Core

167

PLL(input: 5 MHz)

OSC(output: 20MHz)

2KBXRAM

Po

rt

6

Po

rt

0

Po

rt

4

Port 1 Port 5 Port 3 Port 2 Port 8 Port 7

CPU

Dua

l Por

t

RAM

2 KByte

Interrupt ControllerWatchdog

Peripheral Data

External Instr./Data

Instr./Data

USART

ASCBRG BRG

SSC

Sync.Channel

(SPI)

GPT1

T3

T4

GPT2T2

T5

T6

CAPCOM1, 2

32 Channels

Tim

er 7

Tim

er 1

Tim

er 0

Tim

er 8

PWM Module

PT 1

PT 2

PT 3

PT 4

16 16 16 16 8 8

16

8

8

16

16

16

1632

PEC

Interrupt Bus

Data

Data

EPROM

ROM /Flash

up to128 KByte

XB

US

(16

-bit

NO

N M

UX

Dat

a / A

ddre

sses

)

External Bus ,XBUS Control,

5 * CS Logic

Multi Funktional

10-BitADC

16 Channels

36 ext. IR

XTAL

September 1999 Simone Buso - University of Padova - Lesson 1 18

•• 22 GeneralGeneral Purpose Timer units Purpose Timer units (GPT1 & GPT2) (GPT1 & GPT2)♦♦ 55 Timers Timers (200/400ns) (200/400ns) with multiple Input with multiple Input/Output,/Output,

Reload andReload and Capture Capture functions and complex functions and complexconcatenation capabilitiesconcatenation capabilities

•• Capture/CompareCapture/Compare unit unit (CAPCOM) (CAPCOM)♦♦ 22 timers timers (400ns) (400ns) each with Reload register and each with Reload register and 16 16

independentindependent 16-bit Capture/Compare 16-bit Capture/Compare channels channelsprogrammableprogrammable to 6 to 6 modes of operation modes of operation

•• 44 high resolution high resolution PWMPWM channels channels♦♦ with independentwith independent time-base time-base of up of up to to 50ns50ns

resolution and programmable operation modesresolution and programmable operation modes•• ......

Peripherals Set of thePeripherals Set of the SAB 80C167 SAB 80C167

Simone Buso - University of Padova September 1999

Lesson #1 10

September 1999 Simone Buso - University of Padova - Lesson 1 19

•• Fast and accurateFast and accurate A/D ConverterA/D Converter♦♦ 10-bit10-bit resolution resolution, 10, 10 input channels input channels, 9.7µs, 9.7µs

conversionconversion time, time, continuous and scan modes continuous and scan modes•• I/OI/O Ports Ports

♦♦ 88 ports provide ports provide 111111 I/O I/O lines lines•• WatchdogWatchdog:: 16-bit 16-bit Reload Reload--timertimer causes causes reset on reset on

overflowoverflow•• 22 independent identical independent identical USARTsUSARTs

♦♦ maxmax 625KBaud 625KBaud asynchronous asynchronous♦♦ maxmax 2.5Mbit/ 2.5Mbit/sec synchronoussec synchronous data data transfer transfer

Peripherals Set of thePeripherals Set of the SAB 80C167 SAB 80C167

September 1999 Simone Buso - University of Padova - Lesson 1 20

•• 44 completely independent completely independent PWMPWM channels channels each with its each with itsownown time-base time-base

♦♦ 50ns50ns oror 12.8µs 12.8µs timer timer--resolutionresolution provides provides a a very verywide frequencywide frequency range to range to generate generate PWM PWM signals signals

♦♦ ProgrammableProgrammable output output polarity polarity♦♦ UpUp to to 7878 KHz at KHz at 8-bit PWM 8-bit PWM resolution resolution

•• Four operation modesFour operation modes♦♦ Standard,Standard, edgeedge--alignedaligned PWM PWM♦♦ SymmetricalSymmetrical,, centercenter--alignedaligned PWM PWM for for

asynchronousasynchronous motor motor control control♦♦ BurstBurst--modemode forfor modulated modulated PWM PWM signals signals♦♦ SingleSingle--shotshot mode mode

PulsePulse Width Modulation Unit Width Modulation Unit (PWM) (PWM)

FPWM = 1

2 x 50ns=78 KHz

8-bit

Simone Buso - University of Padova September 1999

Lesson #1 11

September 1999 Simone Buso - University of Padova - Lesson 1 21

PMW Unit Frequencies and Resolution in Mode 1 Operation (SYMMETRICAL)(SYMMETRICAL)

PMW Unit Frequencies and Resolution in Mode 0 Operation (EDGE-ALIGNED)(EDGE-ALIGNED)

Resolution Resolution Input Clock Input Clock (CPU @ 20 MHz)

8 Bit 10 Bit 12 Bit 14 Bit 16 Bit

CPU Clock (50ns Resolution)

CPU Clock / 64 (3.2µs Res.)

39.1 KHz

610 Hz

9.77 KHz

152.6 Hz

2.44 KHz

38.15 Hz

610 Hz

9.54 Hz

152.6 Hz

2.4 Hz

Resolution Resolution Input ClockInput Clock (CPU @ 20 MHz)

8 Bit 10 Bit 12 Bit 14 Bit 16 Bit

CPU Clock (50ns Resolution)

CPU Clock / 64 (3.2µs Res.)

78.1 KHz

1.22 KHz

19.5 KHz

305 Hz

4.88 KHz

76.3 Hz

1.22 KHz

13.1 Hz

305 Hz

4.77 Hz

PulsePulse Width Modulation Unit Width Modulation Unit (PWM) (PWM)

September 1999 Simone Buso - University of Padova - Lesson 1 22

PWMPWM unit Mode unit Mode 0 0 and and 1... 1...

Contents of the PWx Register

Interrupt Request andLatch of the Shadow Register

Contents of the PWxRegister

IR and Latch of theShadow Register

Timer Period

Timer P

eriod Timer Period

Contents of the Period Register (PPx)

PWM Mode 0: Standard PWM’s or Edge-Aligned PWM’s

PWM Mode 1: Symmetrical or Center-Aligned PWM’s

PWM Signal

If all channels are programmed to mode 0,edge-aligned PWM signals will be generated.A duty cycle from 0 to 100% is programmable

If all channels are programmed to mode 1,center-aligned PWM signals will be generated .A duty cycle from 0 to 100% is programmable

PWM Signal

Possible PWM Signals from other channels programmed to the same mode

PWMx

PWMy

Simone Buso - University of Padova September 1999

Lesson #1 12

September 1999 Simone Buso - University of Padova - Lesson 1 23

Burst Mode :Burst Sequence by combiningPWM channel 0 and 1

Single Shot : Only one PWM Pulse is generated Mode available for channel 2 and 3

Period Value Period Value

Pulse widthValue

PeriodValue

Internal Signalof Channel 0

Period ofTimer PT1

Int. Signalof Channel 1

Output Result: Channel 1 is modulated byChannel 0

OutputSignal

Timer isautomatically

stopped

Timer isreleased by

Software again

The Timer can be dynamicallychanged to lengthen (retrigger) orshorten the output pulse

Tim

er Perio

d

Timer Perio

d PT0

PWMPWM unit Mode unit Mode 0 0 and and 1 1

September 1999 Simone Buso - University of Padova - Lesson 1 24

ExampleExample:: Hitachi Hitachi H8S series [3] H8S series [3]

•• RecentRecent 16-bit16-bit µµµµCC ( (evolution ofevolution of H8/500H8/500 series). series).•• High clock frequencyHigh clock frequency (20MHz(20MHz and higher and higher).).•• Single cycle instructionsSingle cycle instructions (200ns @20MHz).(200ns @20MHz).•• Rich Rich set of instructionset of instruction (CISC (CISC machine machine).).•• HardwareHardware multiplier multiplier and and accumulatoraccumulator for DSP- for DSP-likelike

applicationsapplications..•• MediumMedium//highhigh computational power computational power..•• Available peripheral unitsAvailable peripheral units::

♦♦ timer timer unitunit for CAPCOM for CAPCOM or or PWM PWM functions functions♦♦ serialserial communication communication interface interface♦♦ 88 channel channel, 10-bit, 1, 10-bit, 1 µµµµss A\D A\D converter converter♦♦ 22 channel channel, 10, 10µµµµs D\A converters D\A converter ( (only inonly in some some

versionsversions))

Simone Buso - University of Padova September 1999

Lesson #1 13

September 1999 Simone Buso - University of Padova - Lesson 1 25

H83032H83032microcontrollermicrocontrollerblock diagramblock diagram

CPUCPU

TimerTimer

A\D ConverterA\D Converter

September 1999 Simone Buso - University of Padova - Lesson 1 26

•• State of the artState of the art 16-bit16-bit µµµµCC (5V (5V supplysupply,, standstand--bybycurrentcurrent < 1 < 1µµµµA).A).

•• High clock frequencyHigh clock frequency (33MHz(33MHz maximum maximum).).•• Single cycle instructionsSingle cycle instructions (121ns @33MHz).(121ns @33MHz).•• RISCRISC machinemachine (58(58 single single--wordword 16-bit16-bit instructions instructions).).•• Modified Harvard Modified Harvard architecture witharchitecture with hardwarehardware

multipliermultiplier..•• HighHigh computational power computational power..•• Available peripheral unitsAvailable peripheral units::

♦♦ 44 timerstimers 8-16 bit; 8-16 bit;♦♦ serialserial communication communication interface; interface;♦♦ 12-1612-16 channels channels, 10-bit, 16, 10-bit, 16 µµµµss A\D A\D converter; converter;♦♦ 3 PWM3 PWM 10 bit10 bit outputs outputs..

ExampleExample:: Microchip Microchip PIC17C7xx [4] PIC17C7xx [4]

Simone Buso - University of Padova September 1999

Lesson #1 14

September 1999 Simone Buso - University of Padova - Lesson 1 27

MicrochipMicrochipPIC17C7xxPIC17C7xx

September 1999 Simone Buso - University of Padova - Lesson 1 28

MicrochipMicrochipPIC17C7xxPIC17C7xx

CPUCPU

DataData memory memory

Program memoryProgram memory

Simone Buso - University of Padova September 1999

Lesson #1 15

September 1999 Simone Buso - University of Padova - Lesson 1 29

ExampleExample:: Hitachi Hitachi SH7000 Series [3] SH7000 Series [3]

•• State of the artState of the art 32-bit32-bit µµµµCC (5V (5V or or 3.3V 3.3V supplysupply).).•• High clock frequencyHigh clock frequency (28MHz @(28MHz @ V Vcccc = 5V). = 5V).•• RISCRISC machinemachine (61(61 single single--wordword 16-bit16-bit instructions instructions).).•• Single cycle instructionsSingle cycle instructions (35ns)(35ns) thanksthanks to to internal internal

fivefive--stage pipelinestage pipeline..•• Modified Harvard Modified Harvard architecture witharchitecture with hardwarehardware

multipliermultiplier (MAC: 32x32 bit, 64 bit (MAC: 32x32 bit, 64 bit →→→→ 64 bit). 64 bit).•• HighHigh computational power computational power..•• Available peripheral unitsAvailable peripheral units::

♦♦ 16 bit, 516 bit, 5 channels channels multifunction multifunction timer unittimer unit(PWM);(PWM);

♦♦ 16 bit,16 bit, 22 channel channel compare compare and match and match;;♦♦ 88 channels channels, 10-bit, 2.9, 10-bit, 2.9 µµµµss, A\D, A\D converter; converter;♦♦ watchdog timerwatchdog timer..

September 1999 Simone Buso - University of Padova - Lesson 1 30

SH7040 A\DSH7040 A\Dconverterconverter

Simone Buso - University of Padova September 1999

Lesson #1 16

September 1999 Simone Buso - University of Padova - Lesson 1 31

DigitalDigital Signal Processors Signal Processors [5] [5]

First development in theFirst development in the late 70’s (TMS320C10 - late 70’s (TMS320C10 - 1979).1979).Typically designedTypically designed for for open loop open loop digital digital signal processing signal processinge.g.:e.g.:

•• real time FFTreal time FFT calculation calculation;;•• digital digital filtering of sampled signals filtering of sampled signals..

The marketThe market for for this kind of applications is this kind of applications is enormousenormous (10(10billionbillion US$/ US$/yearyear)) and is and is steadily growingsteadily growing,, including includingtelecom and consumer electronicstelecom and consumer electronics..

Applications inApplications in industrial industrial electronics electronics ( (control taskscontrol tasks) are) arerather insignificant inrather insignificant in volume. volume. The manifacturers offer veryThe manifacturers offer veryfew control oriented solutionsfew control oriented solutions..

September 1999 Simone Buso - University of Padova - Lesson 1 32

DigitalDigital Signal Processors Signal Processors

Two types of DSP’s can be foundTwo types of DSP’s can be found::

•• fixed pointfixed point DSP (16, 24 bit); DSP (16, 24 bit);•• floating point floating point ( (typicallytypically 32 bit 32 bit or or more). more).

ForFor control applications control applications,, fixed point DSP’sfixed point DSP’s are are very very closeclose to tomodern topmodern top--level level µµµµC’sC’s (RISC (RISC machines with Harvard machines with Harvardarchitecture andarchitecture and hardware hardware multiplier multiplier)) in terms of in terms ofperformance.performance. They They are are normally normally muchmuch less effectiveless effective in interms of terms of peripheralsperipherals.. Globally Globally,, they appear they appear moremore expensive expensive..

Floating point DSP’sFloating point DSP’s are are very advantageousvery advantageous,, but only but only for forthose applications where those applications where high costhigh cost for for the control system the control systemcan be affordedcan be afforded.. The The lacklack of peripheral units is almost of peripheral units is almost totaltotal((⇒⇒⇒⇒ you you mustmust add add themthem).).

Simone Buso - University of Padova September 1999

Lesson #1 17

September 1999 Simone Buso - University of Padova - Lesson 1 33

DigitalDigital Signal Processors Signal Processors

InstructionInstructionMemoryMemory

InstructionInstructionProcessorProcessor

ProcessingProcessingUnitUnit

DataDataMemoryMemory

Schematic diagram ofSchematic diagram of a aDSPDSP with with HarvardHarvardarchitecturearchitecture..

ParallelParallel processing of processing ofinstructions andinstructions and data data is isallowed by allowed by multiplemultiple bus busarchitecturearchitecture..

The instructionThe instructionprocessor takes care ofprocessor takes care ofaddress computationsaddress computations..

InstructionInstructionStreamStream

InstructionInstructionStreamStream

DataDataStreamStream

September 1999 Simone Buso - University of Padova - Lesson 1 34

DigitalDigital Signal Processors Signal Processors

Modern DSP’s normally adopt Modern DSP’s normally adopt modifiedmodified Harvard Harvardarchitectures featuringarchitectures featuring::

•• improvedimproved instruction processors with instruction processors with more more than than a asingle single address generatoraddress generator;;

•• improved processing units with improved processing units with multiplemultipleindependent independent logic unitslogic units (ALU, MAC, SHIFT); (ALU, MAC, SHIFT);

•• application specificapplication specific hardware moduleshardware modules (e.g. (e.g.registersregisters,, timers etc timers etc. ). ) in the in the CPU to CPU to speedspeed--upuptypical calculationstypical calculations (e.g. (e.g. DFT);DFT);

•• different different internal memory structuresinternal memory structures with with multiplemultipledatadata memories and buses memories and buses or or mixed program andmixed program anddatadata memories memories ( (usefuluseful for for filter coefficients filter coefficients).).

Simone Buso - University of Padova September 1999

Lesson #1 18

September 1999 Simone Buso - University of Padova - Lesson 1 35

ExampleExample:: Analog Devices Analog Devices ADSP2186 [5] ADSP2186 [5]

•• State of the art State of the art fixed pointfixed point DSP. DSP.•• 2525 ns ns instruction cycle instruction cycle for for 40 MIPS40 MIPS performance. performance.•• SingleSingle--cyclecycle instruction execution instruction execution..•• SingleSingle--cyclecycle context switch context switch..•• 3-bus3-bus architecture architecture for for dualdual operand operand fetchfetch in every in every

instruction cycleinstruction cycle..•• DualDual address generator address generator..•• IndependentIndependent ALU, MACALU, MAC and and SHIFTERSHIFTER units units..•• 4040 kbyte kbyte on chip on chip RAM. RAM.•• DualDual purpose purpose program memory allowing both program memory allowing both

instructioninstruction and and datadata storage storage..

September 1999 Simone Buso - University of Padova - Lesson 1 36

ExampleExample:: Analog Devices Analog Devices ADSP2186 ADSP2186

1:1: Address Address Bus Bus

2: Data Bus2: Data Bus

3:3: Internal Result Internal Result Bus Bus

Simone Buso - University of Padova September 1999

Lesson #1 19

September 1999 Simone Buso - University of Padova - Lesson 1 37

ExampleExample:: Analog Devices Analog Devices ADSP2186 ADSP2186

AA very highvery high level of level of parallelismparallelism is achieved by means is achieved by meansof of multiple processing unitsmultiple processing units,, multiple busesmultiple buses and andcomplex address generatorscomplex address generators.. In a In a single cycle the single cycle the DSP DSPcancan::

•• generategenerate the next program address the next program address;;•• fetchfetch the next instruction the next instruction;;•• performperform one or two one or two data moves;data moves;•• updateupdate one or two one or two data data address pointersaddress pointers;;•• performperform a a computational computational operationoperation..

The program sequencer allowsThe program sequencer allows conditional jumps conditional jumps,,subroutine calls subroutine calls and and returns returns inin a a single cycle single cycle..

September 1999 Simone Buso - University of Padova - Lesson 1 38

ExampleExample:: Analog Devices Analog Devices ADSP21060 [5] ADSP21060 [5]

•• State of the art State of the art floating pointfloating point DSP. DSP.•• 2525 ns ns instruction cycle instruction cycle for for 40 MIPS40 MIPS performance. performance.•• SingleSingle--cyclecycle instruction execution instruction execution..•• 32 bit32 bit single precision and single precision and 40 bit40 bit extended precision extended precision

IEEEIEEE floating point floating point data data format format (24 bit (24 bit mantissa mantissa 8 bit 8 bitexponentexponent / 11 bit / 11 bit exponent exponent)) or or 32 bit32 bit fixed pointfixed point data dataformatformat..

•• 48 bit48 bit instruction wordinstruction word for for various parallel operations various parallel operations..•• 44 independent buses independent buses for dual data for dual data fetch fetch,, instruction instruction

fetch andfetch and I/O (super- I/O (super-Harvard architectureHarvard architecture).).•• 33 independent independent 32 bit32 bit floating point floating point computational computational

unitsunits..•• Specific instructionsSpecific instructions for for accelerated accelerated FFT FFT computation computation..

Simone Buso - University of Padova September 1999

Lesson #1 20

September 1999 Simone Buso - University of Padova - Lesson 1 39

ExampleExample:: Analog Devices Analog Devices ADSP21060 [5] ADSP21060 [5]

September 1999 Simone Buso - University of Padova - Lesson 1 40

NewNew DSP DSP solutions solutions

RecentlyRecently,, newnew DSP DSP solutions solutions have been proposed have been proposedbyby some some manufacturers which merge the manufacturers which merge the DSPDSPcomputational capabilitiescomputational capabilities with with some some typical typical µµµµCCperipheral unitsperipheral units..The idea isThe idea is to to provide the provide the designer designer with with a a controlcontrolorientedoriented DSP, DSP, allowing the direct implementation of allowing the direct implementation ofclosed loopclosed loop digital digital control of power converters control of power converters withwithminimum additionalminimum additional interface interface circuitry circuitry..The main advantage with respectThe main advantage with respect to to any any µµµµC is in theC is in thevery high computational capabilityvery high computational capability of the of the DSP. DSP.Since these devicesSince these devices areare not not very very popular popular yet yet,, the thecostcost factor may be their factor may be their weakweak point point..

Simone Buso - University of Padova September 1999

Lesson #1 21

September 1999 Simone Buso - University of Padova - Lesson 1 41

ExampleExample:: Analog Devices Analog Devices ADMC401 [5] ADMC401 [5]

•• FixedFixed--pointpoint DSP core DSP core features features::♦♦ 26 MIPS26 MIPS performance; performance;♦♦ ADSP 21xxADSP 21xx compatible compatible;;♦♦ Single cycleSingle cycle instruction execution instruction execution

(38.5(38.5 ns ns @ 13 @ 13 MHz clock frequency MHz clock frequency););♦♦ 16 bit16 bit arithmetic and logic unit arithmetic and logic unit;;♦♦ Single CycleSingle Cycle 16 bit X 16 bit 16 bit X 16 bit MAC.MAC.

•• BuiltBuilt--in peripheral unitsin peripheral units::♦♦ HighHigh resolution resolution multimulti--channelchannel ADC;ADC;♦♦ ThreeThree--phasephase 16 bit 16 bit PWMPWM generation generation unit unit;;♦♦ dualdual channel channel event timer unit event timer unit (CAPCOM);(CAPCOM);♦♦ IncrementalIncremental encoderencoder interface interface unit unit..

September 1999 Simone Buso - University of Padova - Lesson 1 42

ExampleExample:: Analog Devices Analog Devices ADMC401 ADMC401

Functional Block DiagramFunctional Block Diagram

21xx core21xx core µµµµC peripheral unitsC peripheral units

Simone Buso - University of Padova September 1999

Lesson #1 22

September 1999 Simone Buso - University of Padova - Lesson 1 43

ADMC401:ADMC401: Analog Analog to Digital Converter to Digital Converter

•• 88 analog inputs analog inputs..•• 12 bit12 bit resolution resolution..•• conversionconversion time: time: 22 µµµµss ( (allall

channels thankschannels thanks to to four fourstage stage pipeline pipeline architecturearchitecture).).

•• 4 V p-p4 V p-p input voltage input voltage range range•• 22 channels channels can be can be

simultaneouslysimultaneously sampled sampled..•• conversion can beconversion can be

synchronizedsynchronized to to PWMPWM ororexternally externally triggeredtriggered..

September 1999 Simone Buso - University of Padova - Lesson 1 44

ADMC401: PWMADMC401: PWM Generation Unit Generation Unit

•• 66 PWM PWM outputs outputs..•• 16 bit16 bit counter resolution counter resolution..•• programmableprogrammable outputoutput

polaritypolarity..•• static or choppedstatic or chopped outputoutput

signalssignals..•• programmableprogrammable dead dead-time-time andand

minimumminimum pulse pulse width width..•• single updatesingle update and and doubledouble

updateupdate mode mode (for (forasymmetricalasymmetrical PWM PWM patterns patterns).).

•• switching frequency fromswitching frequency from 198198HzHz to to 102 kHz.102 kHz.

Simone Buso - University of Padova September 1999

Lesson #1 23

September 1999 Simone Buso - University of Padova - Lesson 1 45

ADMC401: IncrementalADMC401: Incremental Encoder Encoder Interface Interface

•• 16 bit16 bit upup--down counterdown counter((frequency and direction offrequency and direction ofrotation detectionrotation detection).).

•• programmableprogrammable input noise input noisefilterfilter (to(to avoid spurious avoid spurioustriggeringtriggering).).

•• two two additionaladditional strobe strobeinputsinputs (to(to latch the counter latch the countercontents into registerscontents into registers).).

•• 16 bit16 bit loop timer loop timer ((positionpositionand speed loops set pointand speed loops set pointgenerationgeneration).).

September 1999 Simone Buso - University of Padova - Lesson 1 46

ADMC401:ADMC401: Event Timer Unit Event Timer Unit

•• 16 bit16 bit dedicated dedicated timer timer withwithprogrammable frequencyprogrammable frequency..

•• 22 independentindependent channels channels..•• 22 programmable programmable ( (rising edgerising edge

oror falling edge falling edge)) events events forforeach channeleach channel..

•• single shotsingle shot and and freefree--runningrunningmodes of operationmodes of operation..

•• onlyonly capturecapture function function,, no nopossibility ofpossibility of comparecompare mode mode..

Simone Buso - University of Padova September 1999

Lesson #1 24

September 1999 Simone Buso - University of Padova - Lesson 1 47

ADMC401:ADMC401: Other Ancillary Fuctions Other Ancillary Fuctions

•• 22 auxiliaryauxiliary 8 bit 8 bit PWMPWM timers timers•• 16 bit16 bit watchdog watchdog timertimer•• ProgrammableProgrammable digital digital I/OI/O port port (12 (12 pin pin))•• 22 synchronous synchronous serial serial ports ports

September 1999 Simone Buso - University of Padova - Lesson 1 48

ExampleExample: Texas: Texas Instruments Instruments TMS320F240 [6] TMS320F240 [6]

•• FixedFixed--pointpoint DSP core DSP core features features::♦♦ 20 MIPS20 MIPS performance; performance;♦♦ TMS320C25TMS320C25 source code compatiblesource code compatible;;♦♦ Single cycleSingle cycle instruction execution instruction execution

(50(50 ns ns @ 20 @ 20 MHz MHz CPU CPU clock frequency clock frequency););♦♦ 16 bit16 bit arithmetic and logic unit arithmetic and logic unit;;♦♦ Single CycleSingle Cycle 16 bit X 16 bit 16 bit X 16 bit signed productsigned product..

•• Main builtMain built--in peripheral unitsin peripheral units::♦♦ 10 bit10 bit resolution resolution,, 16 16 channelchannel ADC;ADC;♦♦ 1212 channel channel 16 bit 16 bit PWMPWM generation generation unit unit;;♦♦ 33 16 bit16 bit general general purpose purpose timerstimers;;♦♦ 44 independent independent capturecapture circuits circuits..

Simone Buso - University of Padova September 1999

Lesson #1 25

September 1999 Simone Buso - University of Padova - Lesson 1 49

TMS320F240TMS320F240 Functional Block Diagram Functional Block Diagram

CentralCentral Arithmetic ArithmeticLogic UnitLogic Unit (CALU) (CALU)

Event ManagerEvent Manager::TimersTimersCompareCompare Units Units ... ...

Dual 10 bit ADCDual 10 bit ADC

September 1999 Simone Buso - University of Padova - Lesson 1 50

TMS320F240 CentralTMS320F240 Central Arithmetic and Logic Unit Arithmetic and Logic Unit

•• Advanced Advanced HarvardHarvardarchitecture witharchitecture with multiple multiplebus.bus.

•• 16 bit X 16 bit 16 bit X 16 bit hardwarehardwaremultiplier withmultiplier with 32 bit 32 bitaccumulatoraccumulator (1(1 cycle cycleexecutionexecution).).

•• 16 bit16 bit input scalinginput scaling shifter shifter((usedused for for datadata alignment alignmentbefore logic or arithmeticbefore logic or arithmeticoperationsoperations).).

Simone Buso - University of Padova September 1999

Lesson #1 26

September 1999 Simone Buso - University of Padova - Lesson 1 51

TMS320F240TMS320F240 Event Manager Event Manager

•• 3 3 generalgeneral purpose purpose timers timers forfor16 bit16 bit up up//down counts anddown counts andcomparecompare functionsfunctions ( (includingincludingadditionaladditional PWMPWM generation generation).).

•• 66 full full compare compare ouputsouputs for forPWMPWM applications applications with dead with dead--timetime generatorsgenerators (0 to 102 (0 to 102µµµµs).s).

•• 33 simple simple compare compare unitsunits..•• TheThe 12 12 availableavailable PWM PWM outputs outputs

have allhave all 50 50 ns resolution ns resolution andand16 bit16 bit dynamicdynamic range. range.

•• 44 channel channel capturecapture unit unitoperating onoperating on GPT1GPT1 or or GPT2, GPT2,withwith 22 level level FIFO. FIFO.

September 1999 Simone Buso - University of Padova - Lesson 1 52

TMS320F240TMS320F240 Analog Analog to Digital Converter to Digital Converter

•• 2 10 bit2 10 bit ADC’s with ADC’s withbuiltbuilt--inin S/H S/H circuits circuits..

•• 1616 input channels input channelsavailableavailable,, but only but only 22can be sampledcan be sampledsimultaneouslysimultaneously..

•• Minimum conversionMinimum conversiontime time 6.16.1 µµµµss..

•• Single shot Single shot ororcontinuous continuous mode ofmode ofoperationoperation..

•• 22 level level FIFOFIFO for for result resultstoringstoring..

Simone Buso - University of Padova September 1999

Lesson #1 27

September 1999 Simone Buso - University of Padova - Lesson 1 53

TMS320F240TMS320F240 Ancillary Peripheral Functions Ancillary Peripheral Functions

•• 44 pin pin serialserial peripheral peripheral interface interface•• watchdogwatchdog timer timer•• QuadratureQuadrature - - encoder encoder pulse pulse circuit circuit•• 2828 programmable programmable I/OI/O pins pins

September 1999 Simone Buso - University of Padova - Lesson 1 54

ReferencesReferences

[1] [1] STST 1999 1999 Product and Company Information Product and Company Information[2][2] SiemensSiemens 1999 1999 Technical Product Information Technical Product Information - - EditionEdition 7 7[3][3] HitachiHitachi 1998 1998 Electronic Components Databook Electronic Components Databook

[4][4] MicrochipMicrochip 1999 1999 Technical Library Technical Library[5] P.[5] P. Pirsch Pirsch, , ““ArchitecturesArchitectures for Digital for Digital Signal Processing Signal Processing”,”, 1998, 1998,

John Wiley andJohn Wiley and Sons (ISBN 0-471-97145-6) Sons (ISBN 0-471-97145-6)[6][6] Analog DevicesAnalog Devices Winter Winter 1999 Designers’ 1999 Designers’ Reference Reference Manual Manual[7] [7] TexasTexas Instruments Instruments 1999 TMS320 DSP 1999 TMS320 DSP Solutions Solutions CD-ROM CD-ROM