02.08.2013 Views

Embedded SDK - Freescale Semiconductor

Embedded SDK - Freescale Semiconductor

Embedded SDK - Freescale Semiconductor

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

© Motorola, Inc., 2003. All rights reserved.<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Embedded</strong> <strong>SDK</strong><br />

(Software Development Kit)<br />

Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

<strong>SDK</strong>126/D<br />

Rev. 4, 03/21/2003<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Contents<br />

About This Book<br />

Audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xlvii<br />

Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xlvii<br />

Suggested Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xlvii<br />

Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xlviii<br />

References. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xlix<br />

Chapter 1<br />

Introduction<br />

1.1 Before You Start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-1<br />

1.2 Quick Start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-1<br />

1.2.1 Install CodeWarrior Development Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-1<br />

1.2.2 Install DSP56F80xEVM Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-2<br />

1.2.3 Install <strong>SDK</strong> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-2<br />

1.2.4 Build Released Software. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-3<br />

Chapter 2<br />

Directory Structure<br />

2.1 DSP56F80x <strong>SDK</strong> Directory Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-1<br />

Chapter 3<br />

Target Configuration for DSP56F80x<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3.1 <strong>SDK</strong> Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-1<br />

3.1.1 3DES. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-1<br />

3.1.2 ADC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-2<br />

3.1.3 AEC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-2<br />

3.1.4 BLDC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-2<br />

3.1.5 BSP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-3<br />

3.1.6 BUTTON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-3<br />

3.1.7 CALLER_ID. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-4<br />

3.1.8 CAN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-4<br />

3.1.9 CAS_DETECT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-4<br />

3.1.10 COP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-5<br />

3.1.11 CORE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-5<br />

3.1.12 CPT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-5<br />

3.1.13 DAC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-6<br />

3.1.14 DECODER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-6<br />

3.1.15 DES. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-7<br />

MOTOROLA Table of Contents<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

i<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

3.1.16<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSPFUNC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-7<br />

3.1.17 DTMF_DET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-8<br />

3.1.18 DTMF_GEN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-8<br />

3.1.19 FILEIO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-9<br />

3.1.20 FLASH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-9<br />

3.1.21 G.165. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-10<br />

3.1.22 G.711. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-10<br />

3.1.23 G.726. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-10<br />

3.1.24 GPIO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-11<br />

3.1.25 IO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-11<br />

3.1.26 ITCN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-12<br />

3.1.27 LED. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-12<br />

3.1.28 MCFUNC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-13<br />

3.1.29 MEMORY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-13<br />

3.1.30 PCMASTER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-14<br />

3.1.31 PLL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-14<br />

3.1.32 PWM. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-15<br />

3.1.33 QUAD_TIMER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-15<br />

3.1.34 SCI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-16<br />

3.1.35 SIM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-16<br />

3.1.36 SPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-17<br />

3.1.37 SRM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-17<br />

3.1.38 STACK_CHECK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-18<br />

3.1.39 SWITCH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-18<br />

3.1.40 TIMER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-19<br />

3.1.41 VAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-19<br />

3.1.42 V.8bis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-19<br />

3.1.43 V.22bis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-20<br />

3.1.44 V.42bis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-20<br />

3.2 Memory Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-21<br />

3.2.1 External Memory Operation for DSP56F801 & DSP56F802 . . . . . . . . . . . .3-21<br />

3.2.2 External Memory Operation for DSP56F803 & DSP56F805 . . . . . . . . . . . .3-21<br />

3.2.2.1 Linker Command File. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-21<br />

3.2.2.2 Linking: Set Up Memory Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-24<br />

3.2.2.3 Programming Target Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-25<br />

3.2.3 External Memory Operation for DSP56F807. . . . . . . . . . . . . . . . . . . . . . . . .3-26<br />

3.2.3.1 Linker Command File. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-26<br />

3.2.3.2 Linking: Set Up Memory Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-29<br />

3.2.3.3 Programming Target Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-30<br />

3.2.4 Internal (Flash) Memory Operation for DSP56F801 & DSP56802 . . . . . . . .3-31<br />

3.2.4.1 Linker Command File. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-31<br />

3.2.4.2 Linking: Set Up Memory Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-34<br />

3.2.4.3 Linking: Initialized Data for Data RAM. . . . . . . . . . . . . . . . . . . . . . . . . .3-35<br />

3.2.4.4 Programming Target Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-36<br />

3.2.5 Internal (Flash) Memory Operation for DSP56F803 and DSP56F805 . . . . .3-37<br />

ii Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

3.2.6<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Internal (Flash) Memory Operation for DSP56F807 . . . . . . . . . . . . . . . . . . .3-37<br />

3.2.6.1 Linker Command File. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-37<br />

3.2.6.2 Linking: Set Up Memory Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-40<br />

3.2.6.3 Programming Target Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-41<br />

3.3 DSP56F80x Boot Sequence Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-42<br />

3.3.1 Start-up Sequence Without Bootloader . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-42<br />

3.3.1.1 Step 1: Power-up/Reset. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-43<br />

3.3.1.2 Step 2: Start-up Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-43<br />

3.3.2 Start-up Sequence with Bootloader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-43<br />

3.3.2.1 Step 1: Power-up/Reset. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-45<br />

3.3.2.2 Step 2: Transition to Application’s Entry Point . . . . . . . . . . . . . . . . . . . .3-45<br />

3.3.2.3 Step 3: Start-up Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-45<br />

3.4 Clock (PLL) Configuration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-46<br />

Chapter 4<br />

Interrupt Processing for the DSP56F80x<br />

4.1 Interrupt Dispatcher . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-1<br />

4.1.1 Super Fast Interrupt Dispatcher . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-1<br />

4.1.2 Fast Interrupt Dispatcher . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-1<br />

4.1.3 Normal Interrupt Dispatcher. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-1<br />

4.1.4 <strong>SDK</strong> ISR Overhead. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-2<br />

4.1.5 <strong>SDK</strong> ISR Stack Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-3<br />

4.2 Nested Interrupts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-3<br />

4.3 Interrupt Priorities. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-5<br />

4.4 Device Drivers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-5<br />

4.4.1 ADC Driver. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-5<br />

4.4.2 Button Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-6<br />

4.4.3 CAN Driver. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-6<br />

4.4.4 DAC Driver. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-6<br />

4.4.5 Decoder Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-6<br />

4.4.6 File I/O Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-6<br />

4.4.7 Flash Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-7<br />

4.4.8 GPIO Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-7<br />

4.4.9 LED Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-7<br />

4.4.10 PC Master Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-7<br />

4.4.11 PWM Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-7<br />

4.4.12 Quad Timer Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-7<br />

4.4.13 SCI Driver. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-8<br />

4.4.14 SPI Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-8<br />

4.4.15 Switch Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-8<br />

4.4.16 Timer Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-8<br />

MOTOROLA Table of Contents<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

iii<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Chapter 5<br />

On-Chip Drivers<br />

5.1 SPI Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-1<br />

5.1.1 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-1<br />

5.1.2 Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-1<br />

5.1.3 API Definition. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-2<br />

5.1.4 SPI Device Independent I/O API Specifications . . . . . . . . . . . . . . . . . . . . . . .5-3<br />

5.1.4.1 open. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-4<br />

5.1.4.2 write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-5<br />

5.1.4.3 read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-6<br />

5.1.4.4 close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-7<br />

5.1.4.5 ioctl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-8<br />

5.1.5 SPI Low-Level I/O API Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-10<br />

5.1.6 SPI Driver Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-10<br />

5.2 Flash Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-12<br />

5.2.1 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-12<br />

5.2.2 Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-13<br />

5.2.3 API Definition. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-14<br />

5.2.4 FLASH Device-Independent I/O API Specifications. . . . . . . . . . . . . . . . . . .5-16<br />

5.2.4.1 open. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-17<br />

5.2.4.2 write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-18<br />

5.2.4.3 read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-19<br />

5.2.4.4 close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-20<br />

5.2.4.5 ioctl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-21<br />

5.2.5 Flash Low-Level I/O Specification. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-22<br />

5.2.6 Flash Driver Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-22<br />

5.3 SCI Driver. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-22<br />

5.3.1 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-22<br />

5.3.2 Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-22<br />

5.3.3 API Definition. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-24<br />

5.3.4 SCI Device Independent I/O API Specifications . . . . . . . . . . . . . . . . . . . . . .5-26<br />

5.3.4.1 open. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-27<br />

5.3.4.2 write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-28<br />

5.3.4.3 read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-29<br />

5.3.4.4 close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-30<br />

5.3.4.5 ioctl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-31<br />

5.3.5 SCI Low-Level I/O Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-34<br />

5.3.6 SCI Driver Application. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-34<br />

5.4 ADC Driver. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-35<br />

5.4.1 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-35<br />

5.4.2 Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-35<br />

5.4.3 API Definition. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-38<br />

5.4.4 ADC Device-Independent I/O API Specifications . . . . . . . . . . . . . . . . . . . . .5-40<br />

5.4.4.1 open. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-41<br />

5.4.4.2 read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-42<br />

5.4.4.3 close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-43<br />

5.4.4.4 ioctl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-44<br />

iv Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

5.4.5<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

ADC Low-Level I/O API Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-46<br />

5.4.5.1 adcOpen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-47<br />

5.4.5.2 adcRead. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-48<br />

5.4.5.3 adcClose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-49<br />

5.4.5.4 adcIoctl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-50<br />

5.4.6 ADC Driver Application. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-52<br />

5.5 Quad Timer Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-53<br />

5.5.1 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-53<br />

5.5.2 Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-53<br />

5.5.3 API Definition. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-55<br />

5.5.4 Quad Device-Independent I/O API Specifications. . . . . . . . . . . . . . . . . . . . .5-59<br />

5.5.4.1 open. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-60<br />

5.5.4.2 close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-61<br />

5.5.4.3 ioctl and qtIoctl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-62<br />

5.5.5 Quad Timer Low-Level I/O API Specifications. . . . . . . . . . . . . . . . . . . . . . .5-66<br />

5.5.5.1 qtOpen. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-67<br />

5.5.5.2 qtClose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-68<br />

5.5.5.3 qtIoctl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-69<br />

5.5.6 Quad Timer Driver Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-70<br />

5.6 GPIO Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-71<br />

5.6.1 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-71<br />

5.6.2 Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-71<br />

5.6.3 API Definition. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-71<br />

5.6.4 GPIO Device-Independent I/O API Specifications . . . . . . . . . . . . . . . . . . . .5-73<br />

5.6.4.1 open. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-74<br />

5.6.4.2 close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-75<br />

5.6.4.3 ioctl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-76<br />

5.6.5 GPIO Low-Level I/O API Specifications. . . . . . . . . . . . . . . . . . . . . . . . . . . .5-79<br />

5.6.5.1 gpioOpen. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-80<br />

5.6.5.2 gpioClose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-81<br />

5.6.5.3 gpioIoctl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-82<br />

5.6.6 GPIO Driver Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-83<br />

5.7 Quadrature Decoder Driver. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-83<br />

5.7.1 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-83<br />

5.7.2 Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-83<br />

5.7.3 API Definition. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-83<br />

5.7.4 Quadrature Decoder Device-Independent I/O API Specification. . . . . . . . . .5-86<br />

5.7.4.1 open. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-87<br />

5.7.4.2 close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-88<br />

5.7.4.3 decIoctl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-89<br />

5.7.5 Low-Level Device Driver I/O API Specification . . . . . . . . . . . . . . . . . . . . . .5-97<br />

5.7.5.1 decoderOpen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-98<br />

5.7.5.2 decoderClose. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-99<br />

5.7.5.3 decoderIoctl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-100<br />

5.7.6 Quadrature Decoder Driver Application. . . . . . . . . . . . . . . . . . . . . . . . . . . .5-100<br />

MOTOROLA Table of Contents<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

v<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.8<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

PWM Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-101<br />

5.8.1 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-101<br />

5.8.2 Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-101<br />

5.8.3 API Definition. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-103<br />

5.8.4 PWM Device-Independent I/O API Specification . . . . . . . . . . . . . . . . . . . .5-106<br />

5.8.4.1 open. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-107<br />

5.8.4.2 close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-108<br />

5.8.4.3 pwmIoctl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-109<br />

5.8.5 Low-Level Device Driver I/O API Specification . . . . . . . . . . . . . . . . . . . . .5-120<br />

5.8.5.1 pwmOpen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-121<br />

5.8.5.2 pwmClose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-122<br />

5.8.6 PWM Driver Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-123<br />

5.9 PLL Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-124<br />

5.9.1 API Definition. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-125<br />

5.9.2 API Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-126<br />

5.9.2.1 plldrvInitialize. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-127<br />

5.9.2.2 plldrvCalibrate - (DSP56F801 and DSP56F802 only) . . . . . . . . . . . . . .5-131<br />

5.9.3 PLL Test Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-132<br />

5.9.4 PLL Status Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-132<br />

5.9.5 DSP56F801 and DSP56802 Clock Operation . . . . . . . . . . . . . . . . . . . . . . .5-132<br />

5.9.5.1 DSP56F801 Clock Switch-Over Procedure . . . . . . . . . . . . . . . . . . . . . .5-133<br />

5.9.5.1.1 Disabling EXTAL and XTAL Pull Up Resistors . . . . . . . . . . . . . . .5-135<br />

5.9.5.1.2 External Crystal Oscillator Stabilization Delay . . . . . . . . . . . . . . . .5-135<br />

5.9.5.1.3 External Crystal Oscillator Select. . . . . . . . . . . . . . . . . . . . . . . . . . .5-135<br />

5.9.5.2 Internal Oscillator Control Register (IOSCTL) . . . . . . . . . . . . . . . . . . .5-135<br />

5.10 Computer Operating Properly (COP) Driver . . . . . . . . . . . . . . . . . . . . . . . . . . .5-137<br />

5.10.1 Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-137<br />

5.10.2 API Definition. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-139<br />

5.10.2.1 copInitialize() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-140<br />

5.10.2.2 copReload(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-141<br />

5.10.2.3 copForceReset() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-142<br />

5.10.2.4 copGetSysStatus() and copClrSysStatus() . . . . . . . . . . . . . . . . . . . . . . .5-143<br />

5.10.3 COP Driver Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-145<br />

5.11 Core Configuration Registers (CORE) Driver . . . . . . . . . . . . . . . . . . . . . . . . . .5-147<br />

5.12 Interrupt Controller (ITCN) Driver. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-147<br />

5.13 System Integration Module (SIM) Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-149<br />

5.13.1 Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-150<br />

5.14 CAN Driver. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-151<br />

5.15 Timer Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-151<br />

Chapter 6<br />

Off-Chip Drivers<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

6.1 LED Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-1<br />

6.1.1 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-1<br />

6.1.2 Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-1<br />

6.1.3 API Definition. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-1<br />

vi Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

6.1.4<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

LED Device-Independent I/O API Specifications . . . . . . . . . . . . . . . . . . . . . .6-2<br />

6.1.4.1 open. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-3<br />

6.1.4.2 close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-4<br />

6.1.4.3 ioctl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-5<br />

6.1.5 Low-Level Device Drivers I/O API Specifications . . . . . . . . . . . . . . . . . . . . .6-7<br />

6.1.5.1 ledOpen. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-8<br />

6.1.5.2 ledClose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-9<br />

6.1.5.3 ledIoctl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-10<br />

6.1.6 LED Driver Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-10<br />

6.2 FILE I/O Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-11<br />

6.2.1 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-11<br />

6.2.2 Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-11<br />

6.2.3 API Definition. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-12<br />

6.2.4 File I/O Device-Independent I/O API Specifications . . . . . . . . . . . . . . . . . . .6-13<br />

6.2.4.1 open. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-14<br />

6.2.4.2 write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-15<br />

6.2.4.3 read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-16<br />

6.2.4.4 close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-17<br />

6.2.4.5 ioctl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-18<br />

6.2.5 Low-Level I/O Services API Specifications. . . . . . . . . . . . . . . . . . . . . . . . . .6-19<br />

6.2.6 FILE I/O Driver Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-19<br />

6.3 PC Master SCI Communication Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-20<br />

6.3.1 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-20<br />

6.3.2 Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-20<br />

6.3.3 API Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-20<br />

6.3.4 PC Master Driver Low-Level I/O API Specification . . . . . . . . . . . . . . . . . . .6-23<br />

6.3.4.1 pcmasterdrvInit - Initialize PC Master Driver Communication . . . . . . . .6-24<br />

6.3.4.2 pcmasterdrvGetAppCmdSts - Get Application Command Status . . . . . .6-25<br />

6.3.4.3 pcmasterWriteAppCmdSts - Write Application Command Status. . . . . .6-26<br />

6.3.4.4 pcmasterdrvIsr - Main communication function . . . . . . . . . . . . . . . . . . .6-27<br />

6.3.4.5 pcmasterdrvRecorder - Sample recorded variables . . . . . . . . . . . . . . . . .6-28<br />

6.3.5 PC Master Driver Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-29<br />

6.4 Switch Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-29<br />

6.4.1 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-29<br />

6.4.2 Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-29<br />

6.4.3 API Definition. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-29<br />

6.4.4 Switch Device-Independent I/O API Specifications . . . . . . . . . . . . . . . . . . .6-30<br />

6.4.4.1 open. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-31<br />

6.4.4.2 close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-32<br />

6.4.4.3 ioctl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-33<br />

6.4.5 Low-Level I/O Services API Specifications. . . . . . . . . . . . . . . . . . . . . . . . . .6-35<br />

6.4.5.1 switchOpen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-36<br />

6.4.5.2 switchClose. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-37<br />

6.4.5.3 switchIoctl. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-38<br />

6.4.6 Low-Level I/O Services API Specification . . . . . . . . . . . . . . . . . . . . . . . . . .6-39<br />

6.4.7 Switch Driver Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-39<br />

6.4.8 Switch Driver Considerations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-39<br />

MOTOROLA Table of Contents<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

vii<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

6.5<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Brake Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-40<br />

6.5.1 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-40<br />

6.5.2 Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-40<br />

6.5.3 API Definition. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-40<br />

6.5.4 Brake Device-Independent I/O API Specifications . . . . . . . . . . . . . . . . . . . .6-41<br />

6.5.4.1 open. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-42<br />

6.5.4.2 close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-43<br />

6.5.4.3 ioctl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-44<br />

6.5.5 Brake Driver Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-45<br />

6.6 Button Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-46<br />

6.6.1 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-46<br />

6.6.2 Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-46<br />

6.6.3 API Definition. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-46<br />

6.6.4 Button Device-Independent I/O API Specifications. . . . . . . . . . . . . . . . . . . .6-47<br />

6.6.4.1 open. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-48<br />

6.6.4.2 close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-49<br />

6.6.5 Low-Level I/O Services API Specifications. . . . . . . . . . . . . . . . . . . . . . . . . .6-50<br />

6.6.5.1 buttonOpen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-51<br />

6.6.5.2 buttonClose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-52<br />

6.6.6 Button Driver Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-53<br />

6.7 Digital to Analog Converter (DAC) Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-53<br />

6.7.1 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-53<br />

6.7.2 Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-53<br />

6.7.3 API Definition. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-53<br />

6.7.4 DAC Device-Independent I/O API Specification. . . . . . . . . . . . . . . . . . . . . .6-54<br />

6.7.4.1 open. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-55<br />

6.7.4.2 write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-56<br />

6.7.4.3 close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-57<br />

6.7.4.4 ioctl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-58<br />

6.7.5 Low-Level I/O Services API Specification . . . . . . . . . . . . . . . . . . . . . . . . . .6-59<br />

6.7.5.1 dacOpen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-60<br />

6.7.5.2 dacWrite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-61<br />

6.7.5.3 dacClose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-62<br />

6.7.5.4 dacIoctl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-63<br />

6.7.6 DAC Driver Application. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-64<br />

Chapter 7<br />

Libraries<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

7.1 Signal Processing Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-1<br />

7.1.1 DSP Functional Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-2<br />

7.1.1.1 Trigonometric Math Function Performance . . . . . . . . . . . . . . . . . . . . . . . .7-2<br />

7.1.1.2 Signal Processing Function Performance . . . . . . . . . . . . . . . . . . . . . . . . . .7-2<br />

7.1.1.2.1 autoCorr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-3<br />

7.1.1.2.2 cbitrev . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-3<br />

7.1.1.2.3 cfft. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-3<br />

7.1.1.2.4 cifft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-4<br />

7.1.1.2.5 corr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-5<br />

viii Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

7.1.2<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

fir. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-5<br />

7.1.2.1 iir. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-5<br />

7.1.2.2 rfft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-6<br />

7.1.2.3 rifft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-7<br />

7.2 Motor Control Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-7<br />

7.2.1 Motor Control Function Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-7<br />

7.2.2 AC Induction Motor Library. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-8<br />

7.2.3 Switched Reluctance Motor Library. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-8<br />

7.2.4 Brushless DC Motor Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-8<br />

7.3 Modem Libraries. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-8<br />

7.3.1 V.8bis Library. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-8<br />

7.3.1.1 Background. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-9<br />

7.3.1.2 Features and Performance. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-9<br />

7.3.2 V.21 Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-10<br />

7.3.2.1 Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-10<br />

7.3.3 V.22bis Library. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-11<br />

7.3.3.1 Background. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-11<br />

7.3.3.2 Features and Performance. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-12<br />

7.3.4 V.42bis Library. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-13<br />

7.3.4.1 Features and Performance. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-13<br />

7.4 Security Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-14<br />

7.4.1 Data Encryption Standard (DES) Library. . . . . . . . . . . . . . . . . . . . . . . . . . . .7-14<br />

7.4.2 Triple Data Encryption Standard (3DES) Library . . . . . . . . . . . . . . . . . . . . .7-16<br />

7.4.3 RSA Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-17<br />

7.5 Telephony Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-18<br />

7.5.1 Acoustic Echo Canceller Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-18<br />

7.5.2 Caller ID Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-19<br />

7.5.3 CAS Detect Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-20<br />

7.5.4 CPT Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-21<br />

7.5.5 Common Tone Generation Library. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-21<br />

7.5.6 DTMF Generation Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-22<br />

7.5.7 DTMF Detection Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-22<br />

7.5.8 G.165 Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-23<br />

7.5.9 G.168 Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-24<br />

7.5.9.1 Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-24<br />

7.5.10 G.711 Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-25<br />

7.5.11 G.726 Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-26<br />

7.5.12 MFCR2 Detection Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-26<br />

7.5.12.1 Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-27<br />

7.5.13 VAD Library. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-27<br />

7.6 Speech Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-28<br />

7.6.1 Voice Recognition (VRLite-1) Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-28<br />

MOTOROLA Table of Contents<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

ix<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Chapter 8<br />

Library Tests<br />

8.1 System Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8-1<br />

8.1.1 System Test. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8-1<br />

8.1.1.1 Set-up for System Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8-1<br />

8.1.1.2 Procedure for System Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8-1<br />

8.2 Tools Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8-2<br />

8.2.1 FIFO Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8-2<br />

8.2.1.1 Set-up for FIFO Test. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8-2<br />

8.2.1.2 Procedure for FIFO Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8-2<br />

8.3 DSP Functions Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8-2<br />

8.3.1 Math Tests. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8-2<br />

8.3.1.1 Set-up for Math Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8-2<br />

8.3.1.2 Procedures for Math Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8-3<br />

8.3.2 Filter Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8-3<br />

8.3.2.1 Set-up for Filter Test. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8-3<br />

8.3.2.2 Procedure for Filter Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8-3<br />

8.3.3 RFFT Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8-3<br />

8.3.3.1 Set-up for RFFT Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8-3<br />

8.3.3.2 Procedure for RFFT Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8-4<br />

8.3.4 CFFT Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8-4<br />

8.3.4.1 Set-up for CFFT Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8-4<br />

8.3.4.2 Procedure for CFFT Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8-4<br />

Chapter 9<br />

DSP56F801/802 Applications<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

9.1 Porting 801 Applications to 802 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-1<br />

9.2 Common Hardware Configuration for Motor Control Applications . . . . . . . . . . .9-1<br />

9.2.1 Settings for EVM Trimpots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-1<br />

9.3 BLDC Sensorless with Back-EMF Zero Crossing Using ADC Application . . . . .9-2<br />

9.3.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-2<br />

9.3.2 Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-3<br />

9.3.3 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-5<br />

9.3.3.1 EVM Jumper Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-5<br />

9.3.4 Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-6<br />

9.3.5 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-7<br />

9.4 3-Phase AC Induction Motor Control V/Hz Application - Open Loop . . . . . . . . .9-7<br />

9.4.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-8<br />

9.4.2 Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-8<br />

9.4.3 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-13<br />

9.4.3.1 EVM Jumper Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-13<br />

9.4.4 Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-14<br />

9.4.5 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-15<br />

9.5 Serial Bootloader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-16<br />

9.5.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-16<br />

9.5.2 Target Configuration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-16<br />

x Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

9.5.3<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-17<br />

9.5.3.1 EVM Jumper Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-17<br />

9.5.4 Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-17<br />

9.5.4.1 Download into Boot Flash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-17<br />

9.5.4.2 Host Terminal Program Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-18<br />

9.5.5 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-18<br />

9.5.6 Requirements for a Loaded Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-19<br />

9.6 ADC Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-20<br />

9.7 COP Driver Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-20<br />

9.8 PWM Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-21<br />

9.9 Quad Timer Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-21<br />

9.10 SCI Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-21<br />

9.11 Timer Application. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-21<br />

9.11.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-21<br />

9.11.2 Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-21<br />

9.11.3 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-22<br />

9.11.4 Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-22<br />

9.11.5 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-22<br />

Chapter 10<br />

DSP56F803 Applications<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

10.1 Common Hardware Configuration for Motor Control Applications . . . . . . . . . .10-1<br />

10.1.1 Settings for EVM Trimpots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-1<br />

10.1.2 Communication Port Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-2<br />

10.2 BLDC Motor Control Application with Hall Sensors . . . . . . . . . . . . . . . . . . . . .10-2<br />

10.2.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-2<br />

10.2.2 Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-3<br />

10.2.3 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-7<br />

10.2.3.1 EVM Jumper Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-7<br />

10.2.4 Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-9<br />

10.2.5 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-10<br />

10.3 BLDC Motor Control Application with Quadrature Encoder . . . . . . . . . . . . . .10-10<br />

10.3.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-10<br />

10.3.2 Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-11<br />

10.3.3 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-15<br />

10.3.3.1 EVM Jumper Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-15<br />

10.3.4 Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-17<br />

10.3.5 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-18<br />

10.4 Synchro PM Motor Control Application with Quadrature Encoder. . . . . . . . . .10-18<br />

10.4.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-18<br />

10.4.2 Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-19<br />

10.4.3 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-23<br />

10.4.3.1 PM Synchronous Motor Versus BLDC Motor . . . . . . . . . . . . . . . . . . . .10-23<br />

10.4.3.2 EVM Jumper Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-23<br />

10.4.4 Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-25<br />

10.4.5 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-26<br />

MOTOROLA Table of Contents<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

xi<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

10.5<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

BLDC Sensorless with Back-EMF Zero Crossing Application . . . . . . . . . . . . .10-27<br />

10.5.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-27<br />

10.5.2 Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-27<br />

10.5.3 Set-Up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-30<br />

10.5.3.1 EVM Jumper Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-33<br />

10.5.4 Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-35<br />

10.5.5 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-35<br />

10.6 BLDC Sensorless with Back-EMF Zero Crossing Using AD Converter<br />

Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-36<br />

10.6.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-36<br />

10.6.2 Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-36<br />

10.6.3 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-40<br />

10.6.3.1 EVM Jumper Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-42<br />

10.6.4 Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-44<br />

10.6.5 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-44<br />

10.7 3-Phase PM Synchronous Motor Vector Control . . . . . . . . . . . . . . . . . . . . . . . .10-45<br />

10.7.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-45<br />

10.7.2 Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-45<br />

10.7.3 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-52<br />

10.7.3.1 PM Synchronous Motor Versus BLDC Motor. . . . . . . . . . . . . . . . . . . .10-54<br />

10.7.3.2 EVM Jumper Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-54<br />

10.7.4 .Build. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-55<br />

10.7.5 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-56<br />

10.7.6 PC Master Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-57<br />

10.8 3-Phase SR Motor Control Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-58<br />

10.8.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-58<br />

10.8.2 Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-58<br />

10.8.3 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-61<br />

10.8.3.1 EVM Jumper Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-63<br />

10.8.4 .Build. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-65<br />

10.8.5 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-66<br />

10.9 3-Phase SR Sensorless Motor Control Application . . . . . . . . . . . . . . . . . . . . . .10-67<br />

10.9.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-67<br />

10.9.2 Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-68<br />

10.9.3 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-73<br />

10.9.3.1 EVM Jumper Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-73<br />

10.9.4 Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-75<br />

10.9.5 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-76<br />

10.9.6 PC Master Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-77<br />

10.10 3-Phase SR Motor Control with Encoder Application . . . . . . . . . . . . . . . . . . .10-78<br />

10.10.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-78<br />

10.10.2 Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-79<br />

10.10.3 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-82<br />

10.10.3.1 EVM Jumper Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-83<br />

10.10.4 .Build. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-85<br />

10.10.5 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-86<br />

10.10.6 PC Master Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-87<br />

xii Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

10.11 3-Phase AC Induction Motor Control V/Hz Application - Open Loop . . . . . . .10-87<br />

10.11.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-87<br />

10.11.2 Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-88<br />

10.11.3 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-93<br />

10.11.3.1 EVM Jumper Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-93<br />

10.11.4 Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-95<br />

10.11.5 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-95<br />

10.12 3-Phase AC Induction Motor Control V/Hz Application - Closed Loop . . . . . .10-96<br />

10.12.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-96<br />

10.12.2 Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-96<br />

10.12.3 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-103<br />

10.12.3.1 EVM Jumper Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-104<br />

10.12.4 Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-105<br />

10.12.5 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-105<br />

10.13 3-Phase ACIM Vector Control Application . . . . . . . . . . . . . . . . . . . . . . . . . . .10-106<br />

10.13.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-106<br />

10.13.2 Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-106<br />

10.13.3 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-113<br />

10.13.3.1 EVM Jumper Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-115<br />

10.13.4 Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-116<br />

10.13.5 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-117<br />

10.13.6 PC Master Software Control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-118<br />

10.14 Digital Power Factor Correction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-118<br />

10.14.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-118<br />

10.14.2 Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-119<br />

10.14.3 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-121<br />

10.14.3.1 EVM Jumper Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-121<br />

10.14.4 Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-123<br />

10.14.5 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-123<br />

10.15 Digital Power Factor Correction for 3-phase AC Motor V/Hz Open Loop . . .10-124<br />

10.15.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-124<br />

10.15.2 Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-124<br />

10.15.3 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-125<br />

10.15.3.1 EVM Jumper Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-126<br />

10.15.4 Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-126<br />

10.15.5 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-126<br />

10.16 Serial Bootloader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-126<br />

10.16.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-126<br />

10.16.2 Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-127<br />

10.16.3 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-127<br />

10.16.3.1 EVM Jumper Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-127<br />

10.16.4 Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-127<br />

10.16.4.1 Download into Boot Flash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-128<br />

10.16.4.2 Host Terminal Program Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-128<br />

10.16.5 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-128<br />

10.16.6 Requirements for a Loaded Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-129<br />

10.16.7 DSP Peripheral Usage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-130<br />

MOTOROLA Table of Contents<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

xiii<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

10.17 ADC Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-131<br />

10.18 COP Driver Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-131<br />

10.19 PWM Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-131<br />

10.20 Quad Timer Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-131<br />

10.21 SCI Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-131<br />

10.22 Timer Application. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-131<br />

10.22.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-131<br />

10.22.2 Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-132<br />

10.22.3 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-132<br />

10.22.4 Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-132<br />

10.22.5 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-133<br />

10.23 CAN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-133<br />

10.24 Flash Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-133<br />

Chapter 11<br />

DSP56F805 Applications<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

11.1 Common Hardware Configuration for Motor Control Applications . . . . . . . . . .11-1<br />

11.1.1 Settings for EVM Trimpots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-1<br />

11.1.2 Communication Port Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-2<br />

11.2 BLDC Motor Control Application with Hall Sensors . . . . . . . . . . . . . . . . . . . . .11-2<br />

11.2.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-2<br />

11.2.2 Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-3<br />

11.2.3 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-7<br />

11.2.3.1 EVM Jumper Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-7<br />

11.2.4 Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-9<br />

11.2.5 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-10<br />

11.3 BLDC Motor Control Application with Quadrature Encoder . . . . . . . . . . . . . .11-11<br />

11.3.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-11<br />

11.3.2 Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-11<br />

11.3.3 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-15<br />

11.3.3.1 EVM Jumper Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-15<br />

11.3.4 Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-17<br />

11.3.5 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-18<br />

11.4 Synchro PM Motor Control Application with Quadrature Encoder. . . . . . . . . .11-19<br />

11.4.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-19<br />

11.4.2 Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-19<br />

11.4.3 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-24<br />

11.4.3.1 PM Synchronous Motor versus BLDC Motor . . . . . . . . . . . . . . . . . . . .11-24<br />

11.4.3.2 EVM Jumper Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-24<br />

11.4.4 Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-26<br />

11.4.5 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-27<br />

11.5 BLDC Sensorless with Back-EMF Zero Crossing Application . . . . . . . . . . . . .11-28<br />

11.5.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-28<br />

11.5.2 Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-28<br />

11.5.3 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-32<br />

11.5.3.1 EVM Jumper Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-34<br />

11.5.4 Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-36<br />

xiv Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

11.5.5<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-36<br />

11.6 BLDC Sensorless with Back-EMF Zero Crossing Using AD Converter<br />

Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-37<br />

11.6.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-37<br />

11.6.2 Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-38<br />

11.6.3 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-41<br />

11.6.3.1 EVM Jumper Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-43<br />

11.6.4 Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-45<br />

11.6.5 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-45<br />

11.7 3-Phase PM Synchronous Motor Vector Control . . . . . . . . . . . . . . . . . . . . . . . .11-46<br />

11.7.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-46<br />

11.7.2 Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-47<br />

11.7.3 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-53<br />

11.7.3.1 PM Synchronous Motor Versus BLDC Motor. . . . . . . . . . . . . . . . . . . .11-55<br />

11.7.3.2 EVM Jumper Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-55<br />

11.7.4 Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-56<br />

11.7.5 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-57<br />

11.7.6 PC Master Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-58<br />

11.8 3-Phase SR Motor Control Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-59<br />

11.8.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-59<br />

11.8.2 Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-60<br />

11.8.3 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-63<br />

11.8.3.1 EVM Jumper Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-65<br />

11.8.4 Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-67<br />

11.8.5 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-68<br />

11.9 3-Phase SR Sensorless Motor Control Application . . . . . . . . . . . . . . . . . . . . . .11-69<br />

11.9.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-69<br />

11.9.2 Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-70<br />

11.9.3 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-74<br />

11.9.3.1 EVM Jumper Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-74<br />

11.9.4 Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-76<br />

11.9.5 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-77<br />

11.9.6 PC Master Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-78<br />

11.10 3-Phase SR Motor Control with Encoder Application . . . . . . . . . . . . . . . . . . .11-79<br />

11.10.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-79<br />

11.10.2 Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-79<br />

11.10.3 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-84<br />

11.10.3.1 EVM Jumper Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-84<br />

11.10.4 Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-86<br />

11.10.5 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-87<br />

11.10.6 PC Master Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-88<br />

11.11 3-Phase AC Induction Motor Control V/Hz Application - Open Loop . . . . . . .11-88<br />

11.11.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-88<br />

11.11.2 Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-89<br />

11.11.3 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-94<br />

11.11.3.1 EVM Jumper Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-95<br />

11.11.4 Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-97<br />

MOTOROLA Table of Contents<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

xv<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

11.11.5<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-98<br />

11.12 3-Phase AC Induction Motor Control V/Hz Application - Closed Loop . . . . . .11-98<br />

11.12.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-98<br />

11.12.2 Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-99<br />

11.12.3 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-104<br />

11.12.3.1 EVM Jumper Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-105<br />

11.12.4 Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-107<br />

11.12.5 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-107<br />

11.13 3-Phase ACIM Vector Control Application . . . . . . . . . . . . . . . . . . . . . . . . . . .11-108<br />

11.13.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-108<br />

11.13.2 Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-109<br />

11.13.3 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-115<br />

11.13.3.1 EVM Jumper Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-117<br />

11.13.4 Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-118<br />

11.13.5 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-119<br />

11.13.6 PC Master Software Control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-120<br />

11.14 Digital Power Factor Correction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-121<br />

11.14.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-121<br />

11.14.2 Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-121<br />

11.14.3 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-123<br />

11.14.3.1 EVM Jumper Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-124<br />

Note: Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-126<br />

11.14.4 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-126<br />

11.15 Digital Power Factor Correction for 3-phase AC Motor V/Hz Open Loop . . .11-127<br />

11.15.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-127<br />

11.15.2 Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-128<br />

11.15.3 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-128<br />

11.15.3.1 EVM Jumper Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-129<br />

11.15.3.2 Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-130<br />

11.15.4 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-130<br />

11.16 Serial Bootloader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-130<br />

11.16.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-130<br />

11.16.2 Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-131<br />

11.16.3 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-131<br />

11.16.3.1 EVM Jumper Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-131<br />

11.16.4 Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-131<br />

11.16.4.1 Download into Boot Flash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-131<br />

11.16.4.2 Host Terminal Program Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-132<br />

11.16.5 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-132<br />

11.16.6 Requirements for a Loaded Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-133<br />

11.16.7 DSP Peripheral Usage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-134<br />

11.17 ADC Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-135<br />

11.18 COP Driver Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-135<br />

11.19 PWM Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-135<br />

11.20 Quad Timer Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-135<br />

11.21 SCI Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-135<br />

xvi Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

11.22 Timer Application. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-135<br />

11.22.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-135<br />

11.22.2 Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-136<br />

11.22.3 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-136<br />

11.22.4 Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-136<br />

11.22.5 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-137<br />

11.23 CAN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-137<br />

11.24 Flash Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-137<br />

11.25 DAC Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-137<br />

11.26 SPI Application. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-137<br />

Chapter 12<br />

DSP56F807 Applications<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

12.1 Common Hardware Configuration for Motor Control Applications . . . . . . . . . .12-1<br />

12.1.1 Settings for EVM Trimpots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-1<br />

12.1.2 Communication Port Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-2<br />

12.2 BLDC Motor Control Application with Hall Sensors . . . . . . . . . . . . . . . . . . . . .12-2<br />

12.2.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-2<br />

12.2.2 Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-3<br />

12.2.3 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-7<br />

12.2.3.1 EVM Jumper Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-7<br />

12.2.4 Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-9<br />

12.2.5 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-10<br />

12.3 BLDC Motor Control Application with Quadrature Encoder . . . . . . . . . . . . . .12-10<br />

12.3.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-10<br />

12.3.2 Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-11<br />

12.3.3 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-15<br />

12.3.3.1 EVM Jumper Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-15<br />

12.3.4 Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-17<br />

12.3.5 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-18<br />

12.4 Synchro PM Motor Control Application with Quadrature Encoder. . . . . . . . . .12-19<br />

12.4.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-19<br />

12.4.2 Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-19<br />

12.4.3 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-23<br />

12.4.3.1 PM Synchronous Motor versus BLDC Motor . . . . . . . . . . . . . . . . . . . .12-23<br />

12.4.3.2 EVM Jumper Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-23<br />

12.4.4 Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-25<br />

12.4.5 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-26<br />

12.5 BLDC Sensorless with Back-EMF Zero Crossing Application . . . . . . . . . . . . .12-26<br />

12.5.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-26<br />

12.5.2 Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-27<br />

12.5.3 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-30<br />

12.5.3.1 EVM Jumper Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-33<br />

12.5.4 Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-35<br />

12.5.5 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-36<br />

MOTOROLA Table of Contents<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

xvii<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

12.6<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

BLDC Sensorless with Back-EMF Zero Crossing Using AD Converter<br />

Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-37<br />

12.6.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-37<br />

12.6.2 Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-37<br />

12.6.3 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-40<br />

12.6.3.1 EVM Jumper Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-43<br />

12.6.4 Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-45<br />

12.6.5 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-46<br />

12.7 3-Phase PM Synchronous Motor Vector Control . . . . . . . . . . . . . . . . . . . . . . . .12-47<br />

12.7.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-47<br />

12.7.2 Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-47<br />

12.7.3 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-54<br />

12.7.3.1 PM Synchronous Motor versus BLDC Motor . . . . . . . . . . . . . . . . . . . .12-56<br />

12.7.3.2 EVM Jumper Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-56<br />

12.7.4 Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-57<br />

12.7.5 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-58<br />

12.7.6 PC Master Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-59<br />

12.8 3-Phase SR Motor Control Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-60<br />

12.8.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-60<br />

12.8.2 Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-60<br />

12.8.3 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-63<br />

12.8.3.1 EVM Jumper Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-65<br />

12.8.4 Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-67<br />

12.8.5 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-68<br />

12.9 3-Phase SR Sensorless Motor Control Application . . . . . . . . . . . . . . . . . . . . . .12-69<br />

12.9.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-69<br />

12.9.2 Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-70<br />

12.9.3 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-74<br />

12.9.3.1 EVM Jumper Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-75<br />

12.9.4 Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-77<br />

12.9.5 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-78<br />

12.9.6 PC Master Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-79<br />

12.10 3-Phase SR Motor Control with Encoder Application . . . . . . . . . . . . . . . . . . .12-80<br />

12.10.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-80<br />

12.10.2 Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-81<br />

12.10.3 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-85<br />

12.10.3.1 EVM Jumper Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-85<br />

12.10.4 Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-87<br />

12.10.5 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-88<br />

12.10.6 PC Master Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-89<br />

12.11 3-Phase AC Induction Motor Control V/Hz Application - Open Loop . . . . . . .12-89<br />

12.11.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-90<br />

12.11.2 Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-90<br />

12.11.3 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-96<br />

12.11.3.1 EVM Jumper Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-96<br />

12.11.4 Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-98<br />

12.11.5 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-99<br />

xviii Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

12.12 3-Phase AC Induction Motor Control V/Hz Application - Closed Loop . . . . .12-100<br />

12.12.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-100<br />

12.12.2 Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-100<br />

12.12.3 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-106<br />

12.12.3.1 EVM Jumper Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-107<br />

12.12.4 Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-109<br />

12.12.5 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-110<br />

12.13 3-Phase ACIM Vector Control Application . . . . . . . . . . . . . . . . . . . . . . . . . . .12-111<br />

12.13.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-111<br />

12.13.2 Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-111<br />

12.13.3 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-118<br />

12.13.3.1 EVM Jumper Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-119<br />

12.13.4 Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-121<br />

12.13.5 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-122<br />

12.13.6 PC Master Software Control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-123<br />

12.14 Digital Power Factor Correction Application. . . . . . . . . . . . . . . . . . . . . . . . . .12-123<br />

12.14.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-123<br />

12.14.2 Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-124<br />

12.14.3 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-126<br />

12.14.3.1 EVM Jumper Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-127<br />

12.14.4 Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-129<br />

12.14.5 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-130<br />

12.15 Digital Power Factor Correction for 3-phase AC Motor V/Hz Open Loop<br />

Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-131<br />

12.15.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-131<br />

12.15.2 Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-132<br />

12.15.3 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-132<br />

12.15.3.1 EVM Jumper Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-133<br />

12.15.3.2 Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-133<br />

12.15.4 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-134<br />

12.16 Serial Bootloader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-134<br />

12.16.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-134<br />

12.16.2 Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-135<br />

12.16.3 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-135<br />

12.16.3.1 EVM Jumper Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-135<br />

12.16.4 Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-135<br />

12.16.4.1 Download into Boot Flash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-135<br />

12.16.4.2 Host Terminal Program Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-136<br />

12.16.5 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-136<br />

12.16.6 Requirements for a Loaded Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-137<br />

12.16.7 DSP Peripheral Usage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-138<br />

12.17 ADC Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-139<br />

12.18 COP Driver Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-139<br />

12.19 PWM Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-139<br />

12.20 Quad Timer Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-139<br />

12.21 SCI Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-139<br />

MOTOROLA Table of Contents<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

xix<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

12.22 Timer Application. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-139<br />

12.22.1 Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-139<br />

12.22.2 Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-140<br />

12.22.3 Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-140<br />

12.22.4 Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-140<br />

12.22.5 Execute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-141<br />

12.23 CAN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-141<br />

12.24 Flash Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-141<br />

12.25 DAC Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-141<br />

12.26 SPI Application. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-141<br />

xx Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

List of Tables<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 3-1 DSP56F80x OMR Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7<br />

Table 3-2 DSP56F80x SR Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7<br />

Table 4-1 <strong>SDK</strong> ISR Overhead for DSP56F80x (running from internal memory) . . . . . . . 4-2<br />

Table 4-2 <strong>SDK</strong> ISR Overhead for DSP56F80x (running from external memory) . . . . . . . 4-2<br />

Table 4-3 <strong>SDK</strong> ISR Stack Requirements for DSP56F80x . . . . . . . . . . . . . . . . . . . . . . . . . 4-3<br />

Table 5-1 SPI Data Structure Members . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2<br />

Table 5-2 SPI Driver open Arguments - open. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-4<br />

Table 5-3 SPI Driver Arguments - write. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-5<br />

Table 5-4 SPI Driver Arguments - read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-6<br />

Table 5-5 SPI Driver Arguments - close. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-7<br />

Table 5-6 SPI Driver Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-8<br />

Table 5-7 SPI ioctl Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-8<br />

Table 5-8 Flash Driver appconfig.h Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-13<br />

Table 5-9 Flash Driver open Arguments - open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-17<br />

Table 5-10 Flash Driver Arguments - write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-18<br />

Table 5-11 Flash Driver Arguments - read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-19<br />

Table 5-12 Flash Driver Arguments - close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-20<br />

Table 5-13 Flash Driver Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-21<br />

Table 5-14 Flash ioctl Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-21<br />

Table 5-15 SCI Configuration Items for appconfig.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-23<br />

Table 5-16 SCI Data Structure Members . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-25<br />

Table 5-17 SCI Control Register bit masks, SciCntl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-25<br />

Table 5-18 SCI Driver open Arguments - open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-27<br />

Table 5-19 SCI Devices for Specific DSP56F80x Chips . . . . . . . . . . . . . . . . . . . . . . . . . . 5-27<br />

Table 5-20 SCI Driver Arguments - write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-28<br />

Table 5-21 SCI Driver Arguments - read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-29<br />

Table 5-22 SCI Driver Arguments - close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-30<br />

Table 5-23 SCI Driver Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-31<br />

Table 5-24 SCI ioctl Commands. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-31<br />

Table 5-25 ADC appconfig.h Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-35<br />

Table 5-26 ADC Data Structure Members . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-39<br />

Table 5-27 ADC Driver Arguments - open. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-41<br />

Table 5-28 ADC Driver Arguments - read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-42<br />

Table 5-29 ADC Driver Arguments - close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-43<br />

MOTOROLA List of Tables<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

xxi<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Table 5-30<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

ADC Driver Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-44<br />

Table 5-31 ADC ioctl Commands. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-44<br />

Table 5-32 ADC Driver Arguments - open. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-47<br />

Table 5-33 adcRead driver Arguments - read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-48<br />

Table 5-34 ADC Driver Arguments - close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-49<br />

Table 5-35 GPIO Driver Arguments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-50<br />

Table 5-36 Pin Availability of Quad Timers for Specific Chips. . . . . . . . . . . . . . . . . . . . . 5-53<br />

Table 5-37 Quad Timers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-54<br />

Table 5-38 Quad Timer Data Structure Members. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-56<br />

Table 5-39 Quad Driver Arguments - open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-60<br />

Table 5-40 Quad Timer Driver Arguments - close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-61<br />

Table 5-41 Quad Timer Driver Arguments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-62<br />

Table 5-42 Quad Timer ioctl/qIoctl Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-62<br />

Table 5-43 Quad Timer Driver Arguments - open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-67<br />

Table 5-44 Quad Timer Driver Arguments - close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-68<br />

Table 5-45 GPIO Driver open Arguments - open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-74<br />

Table 5-46 GPIO Ports Available for Specific DSP56F80x Chips. . . . . . . . . . . . . . . . . . . 5-74<br />

Table 5-47 GPIO Driver Arguments - close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-75<br />

Table 5-48 GPIO Driver Arguments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-76<br />

Table 5-49 GPIO ioctl Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-76<br />

Table 5-50 GPIO Driver Arguments - gpioOpen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-80<br />

Table 5-51 GPIO Driver Arguments - close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-81<br />

Table 5-52 GPIO Driver Arguments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-82<br />

Table 5-53 decoder_sCallback Data Structure Members . . . . . . . . . . . . . . . . . . . . . . . . . . 5-84<br />

Table 5-54 decoder_sState Data Structure Members . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-84<br />

Table 5-55 decoder_sEncScale Data Structure Members . . . . . . . . . . . . . . . . . . . . . . . . . . 5-84<br />

Table 5-56 decoder_sEncSignals Data Structure Members . . . . . . . . . . . . . . . . . . . . . . . . 5-85<br />

Table 5-57 Quadrature Decoder Driver open Arguments - open . . . . . . . . . . . . . . . . . . . . 5-87<br />

Table 5-58 Quadrature Decoder Driver Arguments - close . . . . . . . . . . . . . . . . . . . . . . . . 5-88<br />

Table 5-59 Quadrature Decoder Driver Arguments - decIoctl . . . . . . . . . . . . . . . . . . . . . . 5-89<br />

Table 5-60 Low-Level Quadrature Decoder Driver open Arguments - open . . . . . . . . . . . 5-98<br />

Table 5-61 Low-Level Quadrature Decoder Driver Arguments - decoderClose . . . . . . . . 5-99<br />

Table 5-62 Low-Level Quadrature Decoder Driver Arguments - decoderIoctl . . . . . . . . 5-100<br />

Table 5-63 PWM appconfig.h Configuration Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-101<br />

Table 5-64 pwm_sCallback Data Structure Members . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-104<br />

Table 5-65 pwm_sComplementaryValues Data Structure Members . . . . . . . . . . . . . . . . 5-104<br />

Table 5-66 pwm_sIndependentValues Data Structure Members . . . . . . . . . . . . . . . . . . . 5-104<br />

Table 5-67 pwm_sOutputControl Data Structure Members . . . . . . . . . . . . . . . . . . . . . . . 5-104<br />

Table 5-68 pwm_sUpdateValueSetVlmode Data Structure Members . . . . . . . . . . . . . . . 5-105<br />

xxii Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Table 5-69<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

pwm_sChannelControl Data Structure Members . . . . . . . . . . . . . . . . . . . . . . 5-105<br />

Table 5-70 PWM Driver Arguments - open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-107<br />

Table 5-71 PWM Devices for Specific DSP56F80x Chips . . . . . . . . . . . . . . . . . . . . . . . 5-107<br />

Table 5-72 PWM Driver Arguments - close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-108<br />

Table 5-73 PWM Driver Arguments - pwmIoctl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-109<br />

Table 5-74 Low-Level PWM Driver Arguments - pwmOpen . . . . . . . . . . . . . . . . . . . . . 5-121<br />

Table 5-75 Low-Level PWM Driver Arguments - pwmClose . . . . . . . . . . . . . . . . . . . . . 5-122<br />

Table 5-76 PLL Driver Arguments - plldrvInitialize . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-127<br />

Table 5-77 PLL Control Register Definitions - ControlReg. . . . . . . . . . . . . . . . . . . . . . . 5-127<br />

Table 5-78 PLL Divide-By Register - DivideReg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-127<br />

Table 5-79 PLL Test Register - TestReg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-128<br />

Table 5-80 PLL Select Register - SelectReg. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-128<br />

Table 5-81 COP Control Register (COPCTL) Default Configuration . . . . . . . . . . . . . . . 5-137<br />

Table 5-82 COP Timeout Register (COPTO) Default Configuration. . . . . . . . . . . . . . . . 5-137<br />

Table 5-83 COP Driver Arguments - copInitialize() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-140<br />

Table 5-84 COP Driver Arguments - copGetSysStatus() and copClrSysStatus() . . . . . . 5-143<br />

Table 5-85 CORE Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-147<br />

Table 5-86 ITCN Default Configuration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-148<br />

Table 5-87 SYS_CNTL Default Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-150<br />

Table 5-88 Configuration Items for appconfig.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-151<br />

Table 6-1 LED Driver Arguments - open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-3<br />

Table 6-2 LED Driver Arguments - close. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-4<br />

Table 6-3 LED Driver Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-5<br />

Table 6-4 LEDs for Specific EVM Boards (pParams - input parameter) . . . . . . . . . . . . . . 6-5<br />

Table 6-5 LED ioctl Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-5<br />

Table 6-6 Low-Level LED Driver Arguments - open. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-8<br />

Table 6-7 LED Driver Arguments - ledClose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-9<br />

Table 6-8 Low-Level LED Driver Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-10<br />

Table 6-9 File I/O Driver open Arguments - open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-14<br />

Table 6-10 File I/O Driver Arguments - write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-15<br />

Table 6-11 File I/O Driver Arguments - read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-16<br />

Table 6-12 File I/O Driver Arguments - close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-17<br />

Table 6-13 File I/O Driver Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-18<br />

Table 6-14 File I/O ioctl Commands. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-18<br />

Table 6-15 PC Master Driver appconfig.h Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-20<br />

Table 6-16 sPCMasterComm structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-22<br />

Table 6-17 timeBase format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-22<br />

Table 6-18 pcmasterdrvInit parameters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-24<br />

Table 6-19 pcmasterdrvWriteAppCmdSts arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-26<br />

MOTOROLA List of Tables<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

xxiii<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Table 6-20<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Switch DriverArguments - open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-31<br />

Table 6-21 Switch Driver Arguments - close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-32<br />

Table 6-22 Switch Driver Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-33<br />

Table 6-23 Switch ioctl Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-33<br />

Table 6-24 Low-Level Switch Driver Arguments - open . . . . . . . . . . . . . . . . . . . . . . . . . . 6-36<br />

Table 6-25 Low-Level Switch Driver Arguments - close. . . . . . . . . . . . . . . . . . . . . . . . . . 6-37<br />

Table 6-26 Low-Level Switch Driver Arguments - switchIotcl . . . . . . . . . . . . . . . . . . . . . 6-38<br />

Table 6-27 Brake Driver open Arguments - open. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-42<br />

Table 6-28 Availability of Brake Devices for Specific Platforms . . . . . . . . . . . . . . . . . . . 6-42<br />

Table 6-29 Brake Driver Arguments - close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-43<br />

Table 6-30 Brake ioctl Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-44<br />

Table 6-31 Brake ioctl Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-44<br />

Table 6-32 Button Driver Arguments - open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-48<br />

Table 6-33 Availability of Button Devices for Specific Platforms. . . . . . . . . . . . . . . . . . . 6-48<br />

Table 6-34 Button Driver Arguments - close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-49<br />

Table 6-35 Button Driver Arguments - open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-51<br />

Table 6-36 Button Driver Arguments - close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-52<br />

Table 6-37 DAC Driver Arguments - open. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-55<br />

Table 6-38 DAC Driver Arguments - write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-56<br />

Table 6-39 DAC Driver Arguments - close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-57<br />

Table 6-40 DAC Driver Arguments - ioctl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-58<br />

Table 6-41 DAC ioctl Commands. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-58<br />

Table 6-42 dacOpen Driver Arguments - dacOpen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-60<br />

Table 6-43 Low Level dacWrite Driver Arguments - dacWrite . . . . . . . . . . . . . . . . . . . . . 6-61<br />

Table 6-44 Low-Level dacClose Driver Arguments - dacClose. . . . . . . . . . . . . . . . . . . . . 6-62<br />

Table 6-45 DAC Driver Arguments - ioctl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-63<br />

Table 7-1 Trigonometric Math Function Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2<br />

Table 7-2 autoCorr Performance. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-3<br />

Table 7-3 cbitrev Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-3<br />

Table 7-4 cfft Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-4<br />

Table 7-5 cifft Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-4<br />

Table 7-6 corr Performance. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-5<br />

Table 7-7 iir Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-6<br />

Table 7-8 rfft Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-6<br />

Table 7-9 rifft Performance. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-7<br />

Table 7-10 V.8bis Memory and MIPS Requirements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-9<br />

Table 7-11 MIPS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-10<br />

Table 7-12 Frequencies Used in V.21. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-10<br />

Table 7-13 V.21 Memory and MIPS Requirements for Internal Memory on the<br />

DSP5680x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-11<br />

xxiv Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Table 7-14<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

V.22bis Operating Range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-12<br />

Table 7-15 V.22bis Memory and MIPS Requirements. . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-12<br />

Table 7-16 V.42bis Memory and MIPS Requirements. . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-13<br />

Table 7-17 V.42bis Cycle Count. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-14<br />

Table 7-18 DES Memory and MIPs Requirements for External Memory on the<br />

DSP56F80x. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-15<br />

Table 7-19 DES Cycle Counts for External Memory on the DSP56F80x . . . . . . . . . . . . . 7-15<br />

Table 7-20 3DES Memory and MIPS Requirements for External Memory on the<br />

DSP56F80x. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-16<br />

Table 7-21 3DES Cycle Count for External Memory on the DSP56F80x . . . . . . . . . . . . . 7-16<br />

Table 7-22 RSA Memory and MIPS Requirements for External Memory on the<br />

DSP56F80x. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-18<br />

Table 7-23 RSA Cycle Count for External Memory on the DSP56F80x . . . . . . . . . . . . . . 7-18<br />

Table 7-24 AEC Memory and MIPS Requirements for External Memory on the<br />

DSP56F80x. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-19<br />

Table 7-25 Caller ID Memory and MIPS Requirements for External Memory on the<br />

DSP56F80x. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-20<br />

Table 7-26 CAS Detect Memory and MIPS for External Memory on the DSP56F80x. . . 7-20<br />

Table 7-27 CPT Memory and MIPS Requirements for External Memory on the<br />

DSP56F80x. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-21<br />

Table 7-28 CTG MIPS and Memory Requirements for External Memory on the<br />

DSP56F80x. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-21<br />

Table 7-29 MIPS and Memory Requirements for External Memory on the DSP56F80x . 7-22<br />

Table 7-30 MIPS and Memory Requirements for External Memory on the DSP56F80x . 7-23<br />

Table 7-31 G.165 Memory and MIPs Requirements for External Memory on the<br />

DSP56F80x. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-23<br />

Table 7-32 G.168 Memory and MIPS Requirements for Internal Memory on the<br />

DSP56F80x. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-24<br />

Table 7-33 G.711 Memory and MIPS for External Memory on the DSP56F80x . . . . . . . 7-25<br />

Table 7-34 G726 Memory and MIPS Requirements for External Memory on the<br />

DSP56F80x. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-26<br />

Table 7-35 MFCR2 Detection Memory and MIPS for Internal Memory on the<br />

DSP56F80x. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-27<br />

Table 7-36 VAD Memory and MIPS Requirements for External Memory on the<br />

DSP56F80x. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-28<br />

Table 7-37 VRLite-1 Memory and MIPS Requirements for External Memory on the<br />

DSP56F80x. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-30<br />

Table 7-38 Instruction Cycle Counts for External Memory on the DSP56F80x . . . . . . . . 7-30<br />

Table 9-1 Trimpot Settings for EVM Motor Board BLDC Motor Control Application . . 9-2<br />

Table 9-2 DSP56F801EVM Jumper Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-6<br />

MOTOROLA List of Tables<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

xxv<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

9.4 3-Phase AC Induction Motor Control V/Hz Application - Open Loop . . . . . . . . . . 9-7<br />

Table 9-3 Motor--Brake Specifications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-9<br />

Table 9-4 Motor Application States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-11<br />

Table 9-5 DSP56F801EVM Jumper Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-14<br />

Table 9-6 Error Codes for the Serial Bootloader Application . . . . . . . . . . . . . . . . . . . . . 9-19<br />

Table 10-1 Trimpot Settings for EVM Motor Board BLDC Motor Control Application . 10-1<br />

Table 10-2 Trimpot Settings for Low-Voltage BLDC Motor Control Application . . . . . . 10-1<br />

10.2 BLDC Motor Control Application with Hall Sensors . . . . . . . . . . . . . . . . . . . . . . . 10-2<br />

Table 10-3 Trimpot Settings for High-Voltage BLDC Motor Control Application. . . . . . 10-2<br />

Table 10-4 Motor Application States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-4<br />

Table 10-5 DSP56F803EVM Jumper Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-8<br />

10.3 BLDC Motor Control Application with Quadrature Encoder. . . . . . . . . . . . . . . 10-10<br />

Table 10-6 Motor Application States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-13<br />

Table 10-7 DSP56F803EVM Jumper Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-16<br />

10.4 Synchro PM Motor Control Application with Quadrature Encoder . . . . . . . . . 10-18<br />

Table 10-8 Motor Application States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-21<br />

Table 10-9 DSP56F803EVM Jumper Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-24<br />

10.5 BLDC Sensorless with Back-EMF Zero Crossing Application . . . . . . . . . . . . . . 10-27<br />

Table 10-10 DSP56F803EVM Jumper Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-34<br />

10.6 BLDC Sensorless with Back-EMF Zero Crossing Using AD Converter<br />

Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-36<br />

Table 10-11 DSP56F803EVM Jumper Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-43<br />

10.73-Phase PM Synchronous Motor Vector Control . . . . . . . . . . . . . . . . . . . . . . . . . 10-45<br />

Table 10-12 Motor - Brake Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-46<br />

Table 10-13 Application States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-50<br />

Table 10-14 DSP56F803EVM Jumper Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-54<br />

10.8 3-Phase SR Motor Control Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-58<br />

Table 10-15 DSP56F803EVM Jumper Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-64<br />

10.9 3-Phase SR Sensorless Motor Control Application . . . . . . . . . . . . . . . . . . . . . . . . 10-67<br />

Table 10-16 DSP56F803EVM Jumper Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-74<br />

10.10 3-Phase SR Motor Control with Encoder Application. . . . . . . . . . . . . . . . . . . . . 10-78<br />

Table 10-17 DSP56F803EVM Jumper Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-84<br />

xxvi Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

10.11 3-Phase AC Induction Motor Control V/Hz Application - Open Loop . . . . . . . . 10-87<br />

Table 10-18 Motor - Brake Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-89<br />

Table 10-19 Motor Application States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-91<br />

Table 10-20 DSP56F803EVM Jumper Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-94<br />

10.12 3-Phase AC Induction Motor Control V/Hz Application - Closed Loop. . . . . . . 10-96<br />

Table 10-21 Motor - Brake Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-98<br />

Table 10-22 Motor Application States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-100<br />

Table 10-23 DSP56F803EVM Jumper Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-104<br />

10.13 3-Phase ACIM Vector Control Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-106<br />

Table 10-24 Motor - Brake Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-107<br />

Table 10-25 Motor Application States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-111<br />

Table 10-26 DSP56F803EVM Jumper Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-115<br />

10.14 Digital Power Factor Correction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-118<br />

Table 10-27 DSP56F803EVM Jumper Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-122<br />

10.15 Digital Power Factor Correction for 3-phase AC Motor V/Hz Open Loop . . . 10-124<br />

10.16 Serial Bootloader. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-126<br />

Table 10-28 Error Codes for the Serial Bootloader Application . . . . . . . . . . . . . . . . . . . 10-129<br />

Table 11-1 Trimpot Settings for EVM Motor Board BLDC Motor Control Application . 11-1<br />

Table 11-2 Trimpot Settings for Low-Voltage BLDC Motor Control Application . . . . . . 11-1<br />

11.2 BLDC Motor Control Application with Hall Sensors . . . . . . . . . . . . . . . . . . . . . . . 11-2<br />

Table 11-3 Trim Pot Settings for High-Voltage BLDC Motor Control Application . . . . . 11-2<br />

Table 11-4 Motor Application States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-4<br />

Table 11-5 DSP56F805EVM Jumper Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-8<br />

11.3 BLDC Motor Control Application with Quadrature Encoder. . . . . . . . . . . . . . . 11-11<br />

Table 11-6 Motor Application States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-13<br />

Table 11-7 DSP56F805EVM Jumper settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-16<br />

11.4 Synchro PM Motor Control Application with Quadrature Encoder . . . . . . . . . 11-19<br />

Table 11-8 Motor Application States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-21<br />

Table 11-9 DSP56F805EVM Jumper settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-25<br />

11.5 BLDC Sensorless with Back-EMF Zero Crossing Application . . . . . . . . . . . . . . 11-28<br />

Table 11-10 DSP56F805EVM Jumper Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-35<br />

11.6 BLDC Sensorless with Back-EMF Zero Crossing Using AD Converter<br />

Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-37<br />

Table 11-11 DSP56F805EVM Jumper Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-44<br />

MOTOROLA List of Tables<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

xxvii<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

11.73-Phase PM Synchronous Motor Vector Control . . . . . . . . . . . . . . . . . . . . . . . . . 11-46<br />

Table 11-12 Motor--Brake Specifications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-48<br />

Table 11-13 Application States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-51<br />

Table 11-14 DSP56F805EVM Jumper Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-56<br />

11.8 3-Phase SR Motor Control Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-59<br />

Table 11-15 DSP56F805EVM Jumper Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-66<br />

11.9 3-Phase SR Sensorless Motor Control Application . . . . . . . . . . . . . . . . . . . . . . . . 11-69<br />

Table 11-16 DSP56F805EVM Jumper Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-75<br />

11.10 3-Phase SR Motor Control with Encoder Application. . . . . . . . . . . . . . . . . . . . . 11-79<br />

Table 11-17 DSP56F805EVM Jumper Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-85<br />

11.11 3-Phase AC Induction Motor Control V/Hz Application - Open Loop . . . . . . . . 11-88<br />

Table 11-18 Motor--Brake Specifications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-90<br />

Table 11-19 Motor Application States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-92<br />

Table 11-20 DSP56F805EVM Jumper Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-96<br />

11.12 3-Phase AC Induction Motor Control V/Hz Application - Closed Loop. . . . . . . 11-98<br />

Table 11-21 Motor--Brake Specifications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-100<br />

Table 11-22 Motor Application States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-102<br />

Table 11-23 DSP56F805EVM Jumper Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-106<br />

11.13 3-Phase ACIM Vector Control Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-108<br />

Table 11-24 Motor--Brake Specifications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-110<br />

Table 11-25 Application States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-113<br />

Table 11-26 DSP56F805EVM Jumper Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-117<br />

11.14 Digital Power Factor Correction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-121<br />

Table 11-27 DSP56F805EVM Jumper Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-125<br />

11.15 Digital Power Factor Correction for 3-phase AC Motor V/Hz Open Loop . . . 11-127<br />

11.16 Serial Bootloader. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-130<br />

Table 11-28 Error Codes for the Serial Bootloader Application . . . . . . . . . . . . . . . . . . . 11-133<br />

Table 12-1 Trimpot Settings for EVM Motor Board BLDC Motor Control Applications. 12-1<br />

Table 12-2 Trimpot Settings for Low-Voltage BLDC Motor Control Applications . . . . . 12-1<br />

12.2 BLDC Motor Control Application with Hall Sensors . . . . . . . . . . . . . . . . . . . . . . . 12-2<br />

Table 12-3 Trimpot Settings for High-Voltage BLDC Motor Control Applications . . . . . 12-2<br />

Table 12-4 Motor Application States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-5<br />

Table 12-5 BLDC Motor Control Application with Hall Sensors Jumper Settings . . . . . . 12-8<br />

xxviii Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

12.3 BLDC Motor Control Application with Quadrature Encoder. . . . . . . . . . . . . . . 12-10<br />

Table 12-6 Motor Application States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-13<br />

Table 12-7 DSP56F807EVM Jumper Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-16<br />

12.4 Synchro PM Motor Control Application with Quadrature Encoder . . . . . . . . . 12-19<br />

Table 12-8 Motor Application States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-21<br />

Table 12-9 DSP56F807EVM Jumper Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-24<br />

12.5 BLDC Sensorless with Back-EMF Zero Crossing Application . . . . . . . . . . . . . . 12-26<br />

Table 12-10 DSP56F807EVM Jumper Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-34<br />

12.6 BLDC Sensorless with Back-EMF Zero Crossing Using AD Converter<br />

Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-37<br />

Table 12-11 DSP56F807EVM Jumper Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-44<br />

12.73-Phase PM Synchronous Motor Vector Control . . . . . . . . . . . . . . . . . . . . . . . . . 12-47<br />

Table 12-12 Motor--Brake Specifications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-49<br />

Table 12-13 Application States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-52<br />

Table 12-14 DSP56F807EVM Jumper Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-56<br />

Table 12-15 DSP56F807EVM Jumper Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-66<br />

12.9 3-Phase SR Sensorless Motor Control Application . . . . . . . . . . . . . . . . . . . . . . . . 12-69<br />

Table 12-16 DSP56F807EVM Jumper Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-76<br />

12.10 3-Phase SR Motor Control with Encoder Application. . . . . . . . . . . . . . . . . . . . . 12-80<br />

Table 12-17 DSP56F807EVM Jumper Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-86<br />

12.11 3-Phase AC Induction Motor Control V/Hz Application - Open Loop . . . . . . . . 12-89<br />

Table 12-18 Motor---Brake Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-91<br />

Table 12-19 Motor Application States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-94<br />

Table 12-20 DSP56F807EVM Jumper Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-97<br />

12.12 3-Phase AC Induction Motor Control V/Hz Application - Closed Loop. . . . . . 12-100<br />

Table 12-21 Motor - Brake Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-102<br />

Table 12-22 Motor Application States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-104<br />

Table 12-23 DSP56F807EVM Jumper Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-108<br />

12.13 3-Phase ACIM Vector Control Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-111<br />

Table 12-24 Motor - Brake Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-112<br />

Table 12-25 Motor Application States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-116<br />

Table 12-26 DSP56F807EVM Jumper Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-120<br />

MOTOROLA List of Tables<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

xxix<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

12.14 Digital Power Factor Correction Application . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-123<br />

Table 12-27 DSP56F807EVM Jumper Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-128<br />

12.15 Digital Power Factor Correction for 3-phase AC Motor V/Hz Open Loop<br />

Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-131<br />

12.16 Serial Bootloader. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-134<br />

Table 12-28 Error Codes for the Serial Bootloader Application . . . . . . . . . . . . . . . . . . . 12-137<br />

xxx Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

List of Figures<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 1-1 Launch CodeWarrior Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3<br />

Figure 1-2 Select File/Open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3<br />

Figure 1-3 Select ...\sdk\src\dsp56F80xevm\nos Directory . . . . . . . . . . . . . . . . . . . . . . . . . 1-4<br />

Figure 1-4 Select buildall.mcp Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-4<br />

Figure 1-5 Buildall.mcp Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-4<br />

Figure 1-6 Execute Make Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-5<br />

Figure 2-1 DSP56F80x Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1<br />

Figure 3-1 Setup of DSP56F803/DSP56F805 Memory Partitions. . . . . . . . . . . . . . . . . . . 3-24<br />

Figure 3-2 Programming Target Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-25<br />

Figure 3-3 Set Up DSP56F807 Memory Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-29<br />

Figure 3-4 Programming Target Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-30<br />

Figure 3-5 Set Up DSP56F801/802 Memory Partitions. . . . . . . . . . . . . . . . . . . . . . . . . . . 3-34<br />

Figure 3-6 Linking: Initialized Data for Data RAM. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-35<br />

Figure 3-7 Programming Target Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-36<br />

Figure 3-8 Set Up DSP56F807 Memory Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-40<br />

Figure 3-9 Programming Target Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-41<br />

Figure 3-10 DSP56F80x Boot Sequence without Bootloader . . . . . . . . . . . . . . . . . . . . . . . 3-42<br />

Figure 3-11 DSP56F80x Boot Sequence with Bootloader. . . . . . . . . . . . . . . . . . . . . . . . . . 3-44<br />

Figure 3-12 <strong>SDK</strong> Clock Configuration for DSP56F80x . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-46<br />

Figure 5-1 Trim Pots Pins (Top View). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-10<br />

Figure 5-2 DSP56F805EVM Board Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-11<br />

Figure 5-3 DSP56F805EVM Board: Connector J20 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-11<br />

Figure 5-4 1kHz Sine Wave Output of Digital to Analog Converter. . . . . . . . . . . . . . . . . 5-12<br />

Figure 5-5 OCCS Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-124<br />

Figure 5-6 Internal Oscillator Control Register (IOSCTL) . . . . . . . . . . . . . . . . . . . . . . . 5-136<br />

Figure 6-1 Basic Set-up for File I/O Utilization. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-11<br />

Figure 7-1 Typical Speaker-Dependent Speech Recognition Block Diagram . . . . . . . . . . 7-29<br />

Figure 9-1 Trimpot Pins (Top View) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-2<br />

Figure 9-2 RUN/STOP Switch and IRQA Button . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-4<br />

Figure 9-3 Set-up of the EVM motor board BLDC Motor Control Application . . . . . . . . . 9-5<br />

Figure 9-4 DSP56F801EVM Jumper Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-6<br />

Figure 9-5 Execute Make Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-7<br />

MOTOROLA List of Figures<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

xxxi<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

9.4 3-Phase AC Induction Motor Control V/Hz Application - Open Loop . . . . . . . . . . 9-7<br />

Figure 9-6 RUN/STOP Switch and UP/DOWN Buttons . . . . . . . . . . . . . . . . . . . . . . . . . . 9-11<br />

Figure 9-7 PC Master Software Control Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-12<br />

Figure 9-8 Set-up of the 3-phase AC Induction Motor Control Application - Open Loop 9-13<br />

Figure 9-9 DSP56F801EVM Jumper Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-14<br />

Figure 9-10 Execute Make Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-15<br />

Figure 9-11 Execute Make Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-22<br />

Figure 10-1 Trimpot Pins (Top View) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-1<br />

10.2 BLDC Motor Control Application with Hall Sensors . . . . . . . . . . . . . . . . . . . . . . . 10-2<br />

Figure 10-2 RUN/STOP Switch and UP/DOWN Buttons . . . . . . . . . . . . . . . . . . . . . . . . . . 10-4<br />

Figure 10-3 USER and PWM LEDs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-4<br />

Figure 10-4 PC Master Software Control Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-6<br />

Figure 10-5 BLDC Motor Control Application Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-7<br />

Figure 10-6 DSP56F803EVM Jumper Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-8<br />

Figure 10-7 Target Build Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-9<br />

Figure 10-8 Execute Make Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-9<br />

10.3 BLDC Motor Control Application with Quadrature Encoder. . . . . . . . . . . . . . . 10-10<br />

Figure 10-9 RUN/STOP Switch and UP/DOWN Buttons . . . . . . . . . . . . . . . . . . . . . . . . . 10-12<br />

Figure 10-10 USER and PWM LEDs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-12<br />

Figure 10-11 PC Master Software Control Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-14<br />

Figure 10-12 BLDC Motor Control Application Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-15<br />

Figure 10-13 DSP56F803EVM Jumper Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-16<br />

Figure 10-14 Target Build Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-17<br />

Figure 10-15 Execute Make Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-17<br />

10.4 Synchro PM Motor Control Application with Quadrature Encoder . . . . . . . . . 10-18<br />

Figure 10-16 RUN/STOP Switch and UP/DOWN Buttons . . . . . . . . . . . . . . . . . . . . . . . . . 10-20<br />

Figure 10-17 USER and PWM LEDs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-20<br />

Figure 10-18 PC Master Software Control Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-22<br />

Figure 10-19 Set-up of the Synchro PM Motor Control Application. . . . . . . . . . . . . . . . . . 10-23<br />

Figure 10-20 DSP56F803EVM Jumper Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-24<br />

Figure 10-21 Target Build Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-25<br />

Figure 10-22 Execute Make Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-26<br />

10.5 BLDC Sensorless with Back-EMF Zero Crossing Application . . . . . . . . . . . . . . 10-27<br />

Figure 10-23 RUN/STOP Switch and UP/DOWN Buttons . . . . . . . . . . . . . . . . . . . . . . . . . 10-28<br />

Figure 10-24 USER and PWM LED . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-29<br />

Figure 10-25 PC Master Software Control Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-30<br />

xxxii Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 10-26<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Set-up of the EVM Motor Board BLDC Motor Control Application . . . . . . 10-31<br />

Figure 10-27 Set-up of the Low-Voltage BLDC Motor Control Application . . . . . . . . . . . 10-32<br />

Figure 10-28 Set-up of the High-Voltage BLDC Motor Control Application. . . . . . . . . . . 10-33<br />

Figure 10-29 DSP56F803EVM Jumper Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-34<br />

Figure 10-30 Execute Make Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-35<br />

10.6 BLDC Sensorless with Back-EMF Zero Crossing Using AD Converter<br />

Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-36<br />

Figure 10-31 RUN/STOP Switch and UP/DOWN Buttons . . . . . . . . . . . . . . . . . . . . . . . . . 10-37<br />

Figure 10-32 USER and PWM LED . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-38<br />

Figure 10-33 PC Master Software Control Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-39<br />

Figure 10-34 Set-up of the EVM motor board BLDC Motor Control Application . . . . . . . 10-40<br />

Figure 10-35 Set-upof the Low-Voltage BLDC Motor Control Application. . . . . . . . . . . . 10-41<br />

Figure 10-36 Set-up of the High-Voltage BLDC Motor Control Application. . . . . . . . . . . 10-42<br />

Figure 10-37 DSP56F803EVM Jumper Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-43<br />

Figure 10-38 Execute Make Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-44<br />

10.73-Phase PM Synchronous Motor Vector Control . . . . . . . . . . . . . . . . . . . . . . . . . 10-45<br />

Figure 10-39 RUN/STOP Switch and UP/DOWN Buttons . . . . . . . . . . . . . . . . . . . . . . . . . 10-49<br />

Figure 10-40 USER and PWM LEDs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-50<br />

Figure 10-41 PC Master Software Control Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-51<br />

Figure 10-42 Set-up of the 3-phase PM Synchronous Motor Control Application . . . . . . . 10-53<br />

Figure 10-43 DSP56F803EVM Jumper Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-54<br />

Figure 10-44 Target Build Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-55<br />

Figure 10-45 Execute Make Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-56<br />

10.8 3-Phase SR Motor Control Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-58<br />

Figure 10-46 RUN/STOP Switch and UP/DOWN Buttons . . . . . . . . . . . . . . . . . . . . . . . . . 10-59<br />

Figure 10-47 USER and PWM LEDs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-60<br />

Figure 10-48 PC Master Software Control Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-61<br />

Figure 10-49 Set-up of the 3-phase HV SR Motor Control Application . . . . . . . . . . . . . . . 10-62<br />

Figure 10-50 Set-up of the 3-phase LV SR Motor Control Application . . . . . . . . . . . . . . . 10-63<br />

Figure 10-51 DSP56F803EVM Jumper Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-64<br />

Figure 10-52 Target Build Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-65<br />

Figure 10-53 Execute Make Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-66<br />

10.9 3-Phase SR Sensorless Motor Control Application . . . . . . . . . . . . . . . . . . . . . . . . 10-67<br />

Figure 10-54 RUN/STOP Switch and UP/DOWN Buttons . . . . . . . . . . . . . . . . . . . . . . . . . 10-70<br />

Figure 10-55 USER and PWM LEDs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-70<br />

Figure 10-56 PC Master Software Control Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-72<br />

MOTOROLA List of Figures<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

xxxiii<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 10-57<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Set-up of the 3-phase HV SR Motor Control Application . . . . . . . . . . . . . . . 10-73<br />

Figure 10-58 DSP56F803EVM Jumper Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-74<br />

Figure 10-59 Target Build Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-75<br />

Figure 10-60 Execute Make Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-76<br />

10.10 3-Phase SR Motor Control with Encoder Application. . . . . . . . . . . . . . . . . . . . . 10-78<br />

Figure 10-61 RUN/STOP Switch and UP/DOWN Buttons . . . . . . . . . . . . . . . . . . . . . . . . . 10-80<br />

Figure 10-62 USER and PWM LEDs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-81<br />

Figure 10-63 PC Master Software Control Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-82<br />

Figure 10-64 Set-up of the 3-phase HV SR Motor Control Application . . . . . . . . . . . . . . . 10-83<br />

Figure 10-65 DSP56F803EVM Jumper Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-84<br />

Figure 10-66 Target Build Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-85<br />

Figure 10-67 Execute Make Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-86<br />

10.11 3-Phase AC Induction Motor Control V/Hz Application - Open Loop . . . . . . . . 10-87<br />

Figure 10-68 RUN/STOP Switch and UP/DOWN Buttons . . . . . . . . . . . . . . . . . . . . . . . . . 10-90<br />

Figure 10-69 USER and PWM LEDs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-91<br />

Figure 10-70 PC Master Software Control Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-92<br />

Figure 10-71 Set-up of the 3-phase AC Induction Motor Control Application -<br />

Open Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-93<br />

Figure 10-72 DSP56F803EVM Jumper Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-94<br />

Figure 10-73 Execute Make Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-95<br />

10.12 3-Phase AC Induction Motor Control V/Hz Application - Closed Loop. . . . . . . 10-96<br />

Figure 10-74 RUN/STOP Switch and UP/DOWN Buttons . . . . . . . . . . . . . . . . . . . . . . . . . 10-99<br />

Figure 10-75 USER and PWM LEDs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-100<br />

Figure 10-76 PC Master Software Control Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-102<br />

Figure 10-77 Set-up of the 3-phase AC Induction Motor Control Application -<br />

Closed Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-103<br />

Figure 10-78 DSP56F803EVM Jumper Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-104<br />

Figure 10-79 Execute Make Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-105<br />

10.13 3-Phase ACIM Vector Control Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-106<br />

Figure 10-80 RUN/STOP Switch and UP/DOWN Buttons . . . . . . . . . . . . . . . . . . . . . . . . 10-110<br />

Figure 10-81 USER and PWM LEDs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-111<br />

Figure 10-82 PC Master Software Control Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-113<br />

Figure 10-83 Set-up of the 3-phase ACIM Vector Control Application . . . . . . . . . . . . . . 10-114<br />

Figure 10-84 DSP56F803EVM Jumper Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-115<br />

Figure 10-85 Target Build Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-116<br />

Figure 10-86 Execute Make Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-117<br />

xxxiv Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

10.14 Digital Power Factor Correction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-118<br />

Figure 10-87 RUN/STOP Switch and UP/DOWN Buttons . . . . . . . . . . . . . . . . . . . . . . . . 10-120<br />

Figure 10-88 USER and PWM LEDs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-120<br />

Figure 10-89 Set-up of the Digital PFC Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-121<br />

Figure 10-90 DSP56F803EVM Jumper Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-122<br />

Figure 10-91 Execute Make Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-123<br />

10.15 Digital Power Factor Correction for 3-phase AC Motor V/Hz Open Loop . . . 10-124<br />

Figure 10-92 Set-up of the Digital PFC for 3-phase AC Motor V/Hz Open Loop<br />

Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-125<br />

10.16 Serial Bootloader. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-126<br />

Figure 10-93 Execute Make Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-133<br />

Figure 11-1 Trimpot Pins (Top view). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-1<br />

11.2 BLDC Motor Control Application with Hall Sensors . . . . . . . . . . . . . . . . . . . . . . . 11-2<br />

Figure 11-2 RUN/STOP Switch and UP/DOWN Buttons . . . . . . . . . . . . . . . . . . . . . . . . . . 11-3<br />

Figure 11-3 USER and PWM LEDs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-4<br />

Figure 11-4 PC Master Software Control Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-6<br />

Figure 11-5 Set-up of the BLDC Motor Control Application . . . . . . . . . . . . . . . . . . . . . . . 11-7<br />

Figure 11-6 DSP56F805EVM Jumper Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-8<br />

Figure 11-7 Target Build Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-9<br />

Figure 11-8 Execute Make Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-10<br />

11.3 BLDC Motor Control Application with Quadrature Encoder. . . . . . . . . . . . . . . 11-11<br />

Figure 11-9 RUN/STOP Switch and UP/DOWN Buttons . . . . . . . . . . . . . . . . . . . . . . . . . 11-12<br />

Figure 11-10 USER and PWM LEDs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-13<br />

Figure 11-11 PC Master Software Control Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-14<br />

Figure 11-12 Set-up of the BLDC Motor Control Application . . . . . . . . . . . . . . . . . . . . . . 11-15<br />

Figure 11-13 DSP56F805EVM Jumper Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-16<br />

Figure 11-14 Target Build Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-17<br />

Figure 11-15 Execute Make Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-18<br />

11.4 Synchro PM Motor Control Application with Quadrature Encoder . . . . . . . . . 11-19<br />

Figure 11-16 RUN/STOP Switch and UP/DOWN Buttons . . . . . . . . . . . . . . . . . . . . . . . . . 11-20<br />

Figure 11-17 USER and PWM LEDs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-21<br />

Figure 11-18 PC Master Software Control Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-23<br />

Figure 11-19 Synchro PM Motor Control Application Set-up. . . . . . . . . . . . . . . . . . . . . . . 11-24<br />

Figure 11-20 DSP56F805EVM Jumper Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-25<br />

Figure 11-21 Target Build Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-26<br />

Figure 11-22 Execute Make Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-27<br />

MOTOROLA List of Figures<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

xxxv<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

11.5 BLDC Sensorless with Back-EMF Zero Crossing Application . . . . . . . . . . . . . . 11-28<br />

Figure 11-23 RUN/STOP Switch and UP/DOWN Buttons . . . . . . . . . . . . . . . . . . . . . . . . . 11-29<br />

Figure 11-24 USER and PWM LEDs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-30<br />

Figure 11-25 PC Master Software Control Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-31<br />

Figure 11-26 Set-up of the EVM Motor Board BLDC Motor Control Application . . . . . . 11-32<br />

Figure 11-27 Set-up of the Low-Voltage BLDC Motor Control Application . . . . . . . . . . . 11-33<br />

Figure 11-28 Set-up of the High-Voltage BLDC Motor Control Application. . . . . . . . . . . 11-34<br />

Figure 11-29 DSP56F805EVM Jumper Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-35<br />

Figure 11-30 Execute Make Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-36<br />

11.6 BLDC Sensorless with Back-EMF Zero Crossing Using AD Converter<br />

Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-37<br />

Figure 11-31 RUN/STOP Switch and UP/DOWN Buttons . . . . . . . . . . . . . . . . . . . . . . . . . 11-38<br />

Figure 11-32 USER and PWM LEDs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-39<br />

Figure 11-33 PC Master Software Control Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-40<br />

Figure 11-34 EVM Motor Board BLDC Motor Control Application Set-up. . . . . . . . . . . . 11-41<br />

Figure 11-35 Low-Voltage BLDC Motor Control Application Set-up . . . . . . . . . . . . . . . . 11-42<br />

Figure 11-36 High-Voltage BLDC Motor Control Application Set-up . . . . . . . . . . . . . . . . 11-43<br />

Figure 11-37 DSP56F805EVM Jumper Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-44<br />

Figure 11-38 Execute Make Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-45<br />

11.73-Phase PM Synchronous Motor Vector Control . . . . . . . . . . . . . . . . . . . . . . . . . 11-46<br />

Figure 11-39 RUN/STOP Switch and UP/DOWN Buttons . . . . . . . . . . . . . . . . . . . . . . . . . 11-50<br />

Figure 11-40 USER and PWM LEDs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-51<br />

Figure 11-41 PC Master Software Control Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-53<br />

Figure 11-42 Set-up of the 3-phase PM Synchronous Motor Control Application . . . . . . . 11-54<br />

Figure 11-43 DSP56F805EVM Jumper Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-55<br />

Figure 11-44 Target Build Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-57<br />

Figure 11-45 Execute Make Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-57<br />

11.8 3-Phase SR Motor Control Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-59<br />

Figure 11-46 RUN/STOP Switch and UP/DOWN Buttons . . . . . . . . . . . . . . . . . . . . . . . . . 11-61<br />

Figure 11-47 USER and PWM LEDs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-61<br />

Figure 11-48 PC Master Software Control Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-63<br />

Figure 11-49 Setup of the 3-phase HV SR Motor Control Application Set-up . . . . . . . . . . 11-64<br />

Figure 11-50 Set-up of the 3-phase LV SR Motor Control Application . . . . . . . . . . . . . . . 11-65<br />

Figure 11-51 DSP56F805EVM Jumper Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-66<br />

Figure 11-52 Target Build Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-67<br />

Figure 11-53 Execute Make Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-68<br />

xxxvi Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

11.9 3-Phase SR Sensorless Motor Control Application . . . . . . . . . . . . . . . . . . . . . . . . 11-69<br />

Figure 11-54 RUN/STOP Switch and UP/DOWN Buttons . . . . . . . . . . . . . . . . . . . . . . . . . 11-71<br />

Figure 11-55 USER and PWM LEDs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-72<br />

Figure 11-56 PC Master Software Control Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-73<br />

Figure 11-57 Setup of the 3-phase HV SR Sensorless Motor Control Application Set-up . 11-74<br />

Figure 11-58 DSP56F805EVM Jumper Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-75<br />

Figure 11-59 Target Build Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-76<br />

Figure 11-60 Execute Make Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-77<br />

11.10 3-Phase SR Motor Control with Encoder Application. . . . . . . . . . . . . . . . . . . . . 11-79<br />

Figure 11-61 RUN/STOP Switch and UP/DOWN Buttons . . . . . . . . . . . . . . . . . . . . . . . . . 11-81<br />

Figure 11-62 USER and PWM LEDs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-82<br />

Figure 11-63 PC Master Software Control Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-83<br />

Figure 11-64 Setup of the 3-phase HV SR Sensorless Motor Control Application Set-up . 11-84<br />

Figure 11-65 DSP56F805EVM Jumper Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-85<br />

Figure 11-66 Target Build Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-86<br />

Figure 11-67 Execute Make Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-87<br />

11.11 3-Phase AC Induction Motor Control V/Hz Application - Open Loop . . . . . . . . 11-88<br />

Figure 11-68 RUN/STOP Switch and UP/DOWN Buttons . . . . . . . . . . . . . . . . . . . . . . . . . 11-91<br />

Figure 11-69 USER and PWM LEDs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-92<br />

Figure 11-70 PC Master Software Control Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-94<br />

Figure 11-71 Set-up of the 3-phase AC Ind. Motor Control Application Open Loop . . . . . 11-95<br />

Figure 11-72 DSP56F805EVM Jumper Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-96<br />

Figure 11-73 Execute Make Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-97<br />

11.12 3-Phase AC Induction Motor Control V/Hz Application - Closed Loop. . . . . . . 11-98<br />

Figure 11-74 RUN/STOP Switch and UP/DOWN Buttons . . . . . . . . . . . . . . . . . . . . . . . . 11-101<br />

Figure 11-75 USER and PWM LEDs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-102<br />

Figure 11-76 PC Master Software Control Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-104<br />

Figure 11-77 Set-up of the 3-phase AC Induction Motor Control Application -<br />

Closed Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-105<br />

Figure 11-78 DSP56F805EVM Jumper Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-106<br />

Figure 11-79 Execute Make Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-107<br />

11.13 3-Phase ACIM Vector Control Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-108<br />

Figure 11-80 RUN/STOP Switch and UP/DOWN Buttons . . . . . . . . . . . . . . . . . . . . . . . . 11-112<br />

Figure 11-81 USER and PWM LEDs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-113<br />

Figure 11-82 PC Master Software Control Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-115<br />

Figure 11-83 Set-up of the 3-phase ACIM Vector Control Application . . . . . . . . . . . . . . 11-116<br />

Figure 11-84 DSP56F805EVM Jumper Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-117<br />

MOTOROLA List of Figures<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

xxxvii<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 11-85<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Target Build Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-119<br />

Figure 11-86 Execute Make Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-119<br />

11.14 Digital Power Factor Correction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-121<br />

Figure 11-87 RUN/STOP Switch and UP/DOWN Buttons . . . . . . . . . . . . . . . . . . . . . . . . 11-122<br />

Figure 11-88 USER and PWM LEDs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-123<br />

Figure 11-89 Digital PFC Application Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-124<br />

Figure 11-90 DSP56F805EVM Jumper Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-125<br />

Figure 11-91 Execute Make Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-126<br />

11.15 Digital Power Factor Correction for 3-phase AC Motor V/Hz Open Loop . . . 11-127<br />

Figure 11-92 Digital PFC for 3-phase AC Motor V/Hz Open Loop Application Set-up . 11-129<br />

11.16 Serial Bootloader. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-130<br />

Figure 11-93 Execute Make Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-136<br />

Figure 12-1 Trimpot Pins (Top view). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-1<br />

12.2 BLDC Motor Control Application with Hall Sensors . . . . . . . . . . . . . . . . . . . . . . . 12-2<br />

Figure 12-2 RUN/STOP Switch and UP/DOWN Buttons . . . . . . . . . . . . . . . . . . . . . . . . . . 12-4<br />

Figure 12-3 USER and PWM LEDs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-5<br />

Figure 12-4 PC Master Software Control Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-6<br />

Figure 12-5 Set-up of the BLDC Motor Control Application with Hall Sensors. . . . . . . . . 12-7<br />

Figure 12-6 DSP56F807 Jumper Reference. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-8<br />

Figure 12-7 Target Build Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-9<br />

Figure 12-8 Execute Make Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-9<br />

12.3 BLDC Motor Control Application with Quadrature Encoder. . . . . . . . . . . . . . . 12-10<br />

Figure 12-9 RUN/STOP Switch and UP/DOWN Buttons . . . . . . . . . . . . . . . . . . . . . . . . . 12-12<br />

Figure 12-10 USER and PWM LEDs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-12<br />

Figure 12-11 PC Master Software Control Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-14<br />

Figure 12-12 Set-up of the BLDC Motor Control Application with Quadrature Encoder. . 12-15<br />

Figure 12-13 DSP56F807EVM Jumper Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-16<br />

Figure 12-14 Target Build Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-17<br />

Figure 12-15 Execute Make Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-18<br />

12.4 Synchro PM Motor Control Application with Quadrature Encoder . . . . . . . . . 12-19<br />

Figure 12-16 RUN/STOP Switch and UP/DOWN Buttons . . . . . . . . . . . . . . . . . . . . . . . . . 12-20<br />

Figure 12-17 USER and PWM LEDs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-21<br />

Figure 12-18 PC Master Software Control Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-22<br />

Figure 12-19 Set-up of the Synchro PM Motor Control Application with Quadrature<br />

Encoder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-23<br />

Figure 12-20 DSP56F807EVM Jumper Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-24<br />

xxxviii Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 12-21<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Target Build Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-25<br />

Figure 12-22 Execute Make Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-25<br />

12.5 BLDC Sensorless with Back-EMF Zero Crossing Application . . . . . . . . . . . . . . 12-26<br />

Figure 12-23 RUN/STOP Switch and UP/DOWN Buttons . . . . . . . . . . . . . . . . . . . . . . . . . 12-28<br />

Figure 12-24 USER and PWM LEDs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-28<br />

Figure 12-25 PC Master Software Control Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-30<br />

Figure 12-26 Set-up of the BLDC Sensorless with Back-EMF Zero Crossing<br />

Application EVM Motor Board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-31<br />

Figure 12-27 Set-up of BLDC Sensorless with Back-EMF Zero Crossing Application<br />

Low-Voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-32<br />

Figure 12-28 Set-up of BLDC Sensorless with Back-EMF Zero Crossing Application<br />

High-Voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-33<br />

Figure 12-29 DSP56F807EVM Jumper Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-34<br />

Figure 12-30 Target Build Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-35<br />

Figure 12-31 Execute Make Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-36<br />

12.6 BLDC Sensorless with Back-EMF Zero Crossing Using AD Converter<br />

Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-37<br />

Figure 12-32 RUN/STOP Switch and UP/DOWN Buttons . . . . . . . . . . . . . . . . . . . . . . . . . 12-38<br />

Figure 12-33 USER and PWM LEDs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-39<br />

Figure 12-34 PC Master Software Control Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-40<br />

Figure 12-35 Set-up of the BLDC Sensorless with Back-EMF Zero Crossing using AD<br />

Converter Application EVM Motor Board. . . . . . . . . . . . . . . . . . . . . . . . 12-41<br />

Figure 12-36 Set-up of the BLDC Sensorless with Back-EMF Zero Crossing using AD<br />

Converter Application Low-Voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-42<br />

Figure 12-37 Set-up of the BLDC Sensorless with Back-EMF Zero Crossing using AD<br />

Converter Application High-Voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-43<br />

Figure 12-38 DSP56F807EVM Jumper Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-44<br />

Figure 12-39 Target Build Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-45<br />

Figure 12-40 Execute Make Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-46<br />

12.73-Phase PM Synchronous Motor Vector Control . . . . . . . . . . . . . . . . . . . . . . . . . 12-47<br />

Figure 12-41 RUN/STOP Switch and UP/DOWN Buttons . . . . . . . . . . . . . . . . . . . . . . . . . 12-51<br />

Figure 12-42 USER and PWM LEDs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-52<br />

Figure 12-43 PC Master Software Control Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-53<br />

Figure 12-44 Set-up of the 3-phase PM Synchronous Motor Control Application . . . . . . . 12-55<br />

Figure 12-45 DSP56F807EVM Jumper Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-56<br />

Figure 12-46 Target Build Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-57<br />

Figure 12-47 Execute Make Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-58<br />

Figure 12-48 RUN/STOP Switch and UP/DOWN Buttons . . . . . . . . . . . . . . . . . . . . . . . . . 12-61<br />

Figure 12-49 USER and PWM LEDs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-62<br />

MOTOROLA List of Figures<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

xxxix<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 12-50<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

PC Master Software Control Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-63<br />

Figure 12-51 Set-up of the 3-Phase SR Motor Control Application High-Voltage . . . . . . . 12-64<br />

Figure 12-52 Set-up of the 3-Phase SR Motor Control Application Low-Voltage . . . . . . . 12-65<br />

Figure 12-53 DSP56F807EVM Jumper Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-66<br />

Figure 12-54 Target Build Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-67<br />

Figure 12-55 Execute Make Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-68<br />

12.9 3-Phase SR Sensorless Motor Control Application . . . . . . . . . . . . . . . . . . . . . . . . 12-69<br />

Figure 12-56 RUN/STOP Switch and UP/DOWN Buttons . . . . . . . . . . . . . . . . . . . . . . . . . 12-72<br />

Figure 12-57 USER and PWM LEDs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-73<br />

Figure 12-58 PC Master Software Control Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-74<br />

Figure 12-59 Set-up of the 3-Phase SR Motor Control Application High-Voltage . . . . . . . 12-75<br />

Figure 12-60 DSP56F807EVM Jumper Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-76<br />

Figure 12-61 Target Build Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-77<br />

Figure 12-62 Execute Make Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-78<br />

12.10 3-Phase SR Motor Control with Encoder Application. . . . . . . . . . . . . . . . . . . . . 12-80<br />

Figure 12-63 RUN/STOP Switch and UP/DOWN Buttons . . . . . . . . . . . . . . . . . . . . . . . . . 12-82<br />

Figure 12-64 USER and PWM LEDs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-83<br />

Figure 12-65 PC Master Software Control Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-84<br />

Figure 12-66 Set-up of the 3-Phase SR Motor Control Application High-Voltage . . . . . . . 12-85<br />

Figure 12-67 DSP56F807EVM Jumper Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-86<br />

Figure 12-68 Target Build Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-87<br />

Figure 12-69 Execute Make Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-88<br />

12.11 3-Phase AC Induction Motor Control V/Hz<br />

Application - Open Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-89<br />

Figure 12-70 RUN/STOP Switch and UP/DOWN Buttons . . . . . . . . . . . . . . . . . . . . . . . . . 12-93<br />

Figure 12-71 USER and PWM LEDs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-94<br />

Figure 12-72 PC Master Software Control Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-95<br />

Figure 12-73 Set-up of the 3-phase AC Induction Motor Control V/Hz Application -<br />

Open Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-96<br />

Figure 12-74 DSP56F807EVM Jumper Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-97<br />

Figure 12-75 Target Build Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-98<br />

Figure 12-76 Execute Make Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-99<br />

12.12 3-Phase AC Induction Motor Control V/Hz Application - Closed Loop. . . . . . 12-100<br />

Figure 12-77 RUN/STOPSwitch and UP/DOWN Buttons . . . . . . . . . . . . . . . . . . . . . . . . 12-103<br />

Figure 12-78 USER and PWM LEDs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-104<br />

Figure 12-79 PC Master Software Control Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-106<br />

xl Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 12-80<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Set-up of the 3-phase AC Induction Motor Control V/Hz Application -<br />

Closed Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-107<br />

Figure 12-81 DSP56F807EVM Jumper Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-108<br />

Figure 12-82 Target Build Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-109<br />

Figure 12-83 Execute Make Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-110<br />

12.13 3-Phase ACIM Vector Control Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-111<br />

Figure 12-84 RUN/STOP Switch and UP/DOWN Buttons . . . . . . . . . . . . . . . . . . . . . . . . 12-115<br />

Figure 12-85 USER and PWM LEDs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-116<br />

Figure 12-86 PC Master Software Control Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-118<br />

Figure 12-87 Set-up of the 3-phase AC Ind. Vector Control Application . . . . . . . . . . . . . 12-119<br />

Figure 12-88 DSP56F807EVM Jumper Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-120<br />

Figure 12-89 Target Build Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-121<br />

Figure 12-90 Execute Make Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-122<br />

12.14 Digital Power Factor Correction Application . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-123<br />

Figure 12-91 RUN/STOP Switch and UP/DOWN Buttons . . . . . . . . . . . . . . . . . . . . . . . . 12-125<br />

Figure 12-92 USER and PWM LEDs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-126<br />

Figure 12-93 Set-up of the Digital Power Factor Correction Application . . . . . . . . . . . . . 12-127<br />

Figure 12-94 DSP56F807EVM Jumper Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-128<br />

Figure 12-95 Target Build Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-129<br />

Figure 12-96 Execute Make Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-130<br />

12.15 Digital Power Factor Correction for 3-phase AC Motor V/Hz Open Loop<br />

Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-131<br />

Figure 12-97 Set-up of the Digital PFC for 3-phase AC Motor V/Hz Open Loop<br />

Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-133<br />

12.16 Serial Bootloader. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-134<br />

Figure 12-98 Execute Make Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-140<br />

MOTOROLA List of Figures<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

xli<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

xlii Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

List of Examples<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Code Example 3-1 3DES - appconfig.h file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1<br />

Code Example 3-2 ADC - appconfig.h file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2<br />

Code Example 3-3 AEC - appconfig.h file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2<br />

Code Example 3-4 BLDC - appconfig.h file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2<br />

Code Example 3-5 BSP - appconfig.h file. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3<br />

Code Example 3-6 BUTTON - appconfig.h file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3<br />

Code Example 3-7 CALLER_ID - appconfig.h file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4<br />

Code Example 3-8 CAN - appconfig.h file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4<br />

Code Example 3-9 CAS_DETECT - appconfig.h file. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4<br />

Code Example 3-10 COP - appconfig.h file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5<br />

Code Example 3-11 CORE appconfig.h file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5<br />

Code Example 3-12 CPT - appconfig.h file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5<br />

Code Example 3-13 DAC - appconfig.h file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6<br />

Code Example 3-14 DECODER - appconfig.h file. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6<br />

Code Example 3-15 DES - appconfig.h file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7<br />

Code Example 3-16 DSPFUNC - appconfig.h file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7<br />

Code Example 3-17 DTMF_DET - appconfig.h file. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8<br />

Code Example 3-18 DTMF_GEN - appconfig.h file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8<br />

Code Example 3-19 FILEIO - appconfig.h file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-9<br />

Code Example 3-20 FLASH - appconfig.h file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-9<br />

Code Example 3-21 G.165 - appconfig.h file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-10<br />

Code Example 3-22 G.711 - appconfig.h file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-10<br />

Code Example 3-23 G.726 - appconfig.h file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-10<br />

Code Example 3-24 GPIO - appconfig.h file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-11<br />

Code Example 3-25 IO - appconfig.h file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-11<br />

Code Example 3-26 ITCN - appconfig.h file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-12<br />

Code Example 3-27 LED - appconfig.h file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-12<br />

Code Example 3-28 MCFUNC - appconfig.h file. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-13<br />

Code Example 3-29 MEMORY - appconfig.h file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-13<br />

Code Example 3-30 PCMASTER - appconfig.h file. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-14<br />

Code Example 3-31 PLL - appconfig.h file. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-14<br />

Code Example 3-32 PWM - appconfig.h file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-15<br />

Code Example 3-33 QUAD_TIMER - appconfig.h file . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-15<br />

Code Example 3-34 SCI - appconfig.h file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-16<br />

MOTOROLA List of Examples<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

xliii<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Code Example 3-35 SIM - appconfig.h file. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-16<br />

Code Example 3-36 SPI - appconfig.h file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-17<br />

Code Example 3-37 SRM - appconfig.h file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-17<br />

Code Example 3-38 STACK_CHECK - appconfig.h file . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-18<br />

Code Example 3-39 SWITCH - appconfig.h file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-18<br />

Code Example 3-40 TIMER - appconfig.h file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-19<br />

Code Example 3-41 VAD - appconfig.h file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-19<br />

Code Example 3-42 V.8bis - appconfig.h file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-19<br />

Code Example 3-43 V.22bis - appconfig.h file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-20<br />

Code Example 3-44 V.42bis - appconfig.h file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-20<br />

Code Example 3-45 appconfig.h file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-47<br />

Code Example 4-1 Example appconfig.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3<br />

Code Example 4-2 Additions to Code for Super Fast Interrupt . . . . . . . . . . . . . . . . . . . . . . 4-4<br />

Code Example 5-1 SPI Driver Usage with ioctl call . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-7<br />

Code Example 5-2 SPI Driver Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-9<br />

Code Example 5-3 Flash Driver Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-20<br />

Code Example 5-4 Flash Driver Usage with IOCTL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-21<br />

Code Example 5-5 SCI Driver Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-32<br />

Code Example 5-6 ADC Driver Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-45<br />

Code Example 5-7 ADC Low-Level Driver Usage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-50<br />

Code Example 5-8 qt_sState . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-58<br />

Code Example 5-9 Quad Timer Driver Usage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-63<br />

Code Example 5-10 Low-Level Quad Timer Driver Usage<br />

(See also: Code Example 5-9). . . . . . . . . . . . . . . . . . . . . . . . . . . 5-69<br />

Code Example 5-11 GPIO Driver Usage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-78<br />

Code Example 5-12 GPIO Driver Usage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-82<br />

Code Example 5-13 decIoctl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-95<br />

Code Example 5-14 Quadrature Decoder Driver Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-95<br />

Code Example 5-15 Low-Level Quadrature Decoder Driver Usage<br />

(See also Code Example 5-14) . . . . . . . . . . . . . . . . . . . . . . . . . 5-100<br />

Code Example 5-16 Data Structure for Callback Functions . . . . . . . . . . . . . . . . . . . . . . . . 5-105<br />

Code Example 5-17 PWMioctl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-117<br />

Code Example 5-18 PWM Driver Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-118<br />

Code Example 5-19 Low-Level PWM Driver Usage (See also Code Example 5-18). . . . . . 5-122<br />

Code Example 5-20 Reconfigure the PLL_CONTROL_REG . . . . . . . . . . . . . . . . . . . . . . 5-129<br />

Code Example 5-21 PLL Lock Detect, plldrv.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-129<br />

Code Example 5-22 Reconfiguring the PLL Divide-By Register . . . . . . . . . . . . . . . . . . . . 5-130<br />

Code Example 5-23 Reconfiguring the PLL Select Register . . . . . . . . . . . . . . . . . . . . . . . 5-130<br />

Code Example 5-24 Dynamically setting the PLL Test Register (TESTR) . . . . . . . . . . . . 5-132<br />

xliv Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Code Example 5-25 Selecting External Clock in appconfig.h File . . . . . . . . . . . . . . . . . . . 5-133<br />

Code Example 5-26 DSP56F801 Clock switch-over procedure, plldrv.c . . . . . . . . . . . . . . 5-134<br />

Code Example 5-27 copInitialize() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-140<br />

Code Example 5-28 Owerwriting Default COP Driver Settings in appconfig.h. . . . . . . . . 5-143<br />

Code Example 5-29 COP Driver API usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-144<br />

Code Example 6-1 LED Driver Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-6<br />

Code Example 6-2 Low-Level LED Driver Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-10<br />

Code Example 6-3 File I/O Driver Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-18<br />

Code Example 6-4 Switch Driver Usage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-33<br />

Code Example 6-5 Low-Level Switch Driver Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-38<br />

Code Example 6-6 Brake Driver Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-44<br />

Code Example 6-7 Button Driver Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-49<br />

Code Example 6-8 Low-Level Button Driver Example . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-52<br />

Code Example 6-9 DAC open Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-55<br />

Code Example 6-10 DAC write Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-56<br />

Code Example 6-11 DAC close Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-57<br />

Code Example 6-12 DAC ioctl Usage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-58<br />

Code Example 6-13 Low-Level DAC dacIoctl Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-63<br />

Code Example 9-1 Internal Clock Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-1<br />

MOTOROLA List of Examples<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

xlv<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

xlvi Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

About This Book<br />

This manual describes how to use the Motorola <strong>Embedded</strong> Software Development Kit (<strong>SDK</strong>) to<br />

develop software for Motorola DSP56F80x processors (801, 803, 805, 807).<br />

Audience<br />

This document targets software developers using the Motorola <strong>Embedded</strong> Software Development<br />

Kit (<strong>SDK</strong>) to develop applications for Motorola DSP56F80x processors (801, 803, 805, 807).<br />

Organization<br />

• Chapter 1, Introduction,—provides a brief overview of this document<br />

• Chapter 2, Directory Structure,—provides a description of the required core directories<br />

• Chapter 3, Target Configuration for DSP56F80x,—focuses on DSP5680x specifics<br />

• Chapter 4, Interrupt Processing for the DSP56F80x,—describes specifically how to<br />

implement interrupts on the DSP5680x<br />

• Chapter 5, On-Chip Drivers,—isolates all chip-specific functionality into a set of libraries<br />

that are part of a Board Support Package<br />

• Chapter 6, Off-Chip Drivers,—isolates all evaluation module functionality into a set of<br />

libraries that are part of a Board Support Package<br />

• Chapter 7, Libraries,—describes all of the <strong>SDK</strong> libraries that are not part of the core<br />

libraries and are part of the <strong>SDK</strong> DSP56F80x release<br />

• Chapter 8, Library Tests,—describes the tests available to confirm that <strong>SDK</strong> libraries are<br />

operating properly<br />

• Chapter 9, DSP56F801/802 Applications,—describes common hardware configurations for<br />

using the DSP56F801 and DSP56F802 in motor control applications<br />

• Chapter 10, DSP56F803 Applications,—describes common hardware configurations for<br />

using the DSP56F803 in motor control applications<br />

• Chapter 11, DSP56F805 Applications,—describes common hardware configurations for<br />

using the DSP56F805 in motor control applications<br />

• Chapter 12, DSP56F807 Applications,—describes common hardware configurations for<br />

using the DSP56F807 in motor control applications<br />

Suggested Reading<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

We recommend that you have a copy of the following references:<br />

• DSP56800 Family Manual, DSP56800FM/AD<br />

• DSP56F80x User’s Manual, DSP56F801-7UM/AD<br />

• Inside CodeWarrior: Core Tools, Metrowerks Corp.<br />

MOTOROLA Preface<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

xlvii<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Conventions<br />

This document uses the following notational conventions:<br />

Typeface,<br />

Symbol or Term<br />

Courier<br />

Monospaced<br />

Type<br />

Italic Directory names,<br />

project names,<br />

calls,<br />

functions,<br />

statements,<br />

procedures,<br />

routines,<br />

arguments,<br />

file names,<br />

applications,<br />

variables,<br />

directives,<br />

code snippets<br />

in text<br />

Bold Reference sources,<br />

paths,<br />

emphasis<br />

Meaning Examples<br />

Code examples //Process command for line flash<br />

...and contains these core directories:<br />

applications contains applications software...<br />

...CodeWarrior project, 3des.mcp is...<br />

...the pConfig argument....<br />

...defined in the C header file, aec.h....<br />

...refer to the Targeting DSP56F80x Platform<br />

manual....<br />

...see: C:\Program Files\Motorola\<strong>Embedded</strong><br />

<strong>SDK</strong>\help\tutorials<br />

Blue Text Linkable on-line ...refer to Chapter 7, License....<br />

Number Any number is considered<br />

a positive value,<br />

unless preceded by a<br />

minus symbol to signify<br />

a negative value<br />

ALL CAPITAL<br />

LETTERS<br />

# defines/<br />

defined constants<br />

3V<br />

-10<br />

DES -1<br />

# define INCLUDE_STACK_CHECK<br />

Brackets [...] Function keys ...by pressing function key [F7]<br />

Quotation<br />

marks, “...”<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Returned messages ...the message, “Test Passed” is displayed....<br />

...if unsuccessful for any reason, it will return<br />

“NULL”...<br />

xlviii Targeting Motorola DSP5680x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Definitions, Acronyms, and Abbreviations<br />

The following list defines the acronyms and abbreviations used in this document. As this template<br />

develops, this list will be generated from the document. As we develop more group resources,<br />

these acronyms will be easily defined from a common acronym dictionary. Please note that while<br />

the acronyms are in solid caps, terms in the definition should be initial capped ONLY IF they are<br />

trademarked names or proper nouns.<br />

CID Caller ID<br />

DSP Digital Signal Processor or Digital Signal Processing<br />

FFT Fast Fourier Transforms<br />

FIR Finite Impulse Response<br />

I/O Input/Output<br />

IDE Integrated Development Environment<br />

IIR Infinite Impulse Response<br />

LSB Least Significant Bit<br />

MAC Multiply/Accumulate<br />

MIPS Million Instructions Per Second<br />

MSB Most Significant Bit<br />

OnCE On-Chip Emulation<br />

OMR Operating Mode Register<br />

PC Program Counter<br />

<strong>SDK</strong> Software Development Kit<br />

SP Stack Pointer<br />

SPI Serial Peripheral Interface<br />

SR Status Register<br />

SRC Source<br />

References<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The following sources were used to produce this book:<br />

1. DSP56800 Family Manual, DSP56800FM/AD<br />

2. DSP56F80x User’s Manual, DSP56F801-7UM/AD<br />

3. <strong>Embedded</strong> <strong>SDK</strong> Programmer’s Guide, <strong>SDK</strong> 101/D<br />

4. DSP Function Library, <strong>SDK</strong>107/D<br />

5. Motor Control Library, <strong>SDK</strong>109/D<br />

6. V.8bis Library, <strong>SDK</strong>120/D<br />

7. V.22Library, <strong>SDK</strong>108/D<br />

8. V.42bis Library, <strong>SDK</strong>121/D<br />

9. DES Library, <strong>SDK</strong>110/D<br />

10. 3DES Library, <strong>SDK</strong>119/D<br />

11. Acoustic Echo Canceller Library, <strong>SDK</strong>125/D<br />

12. Caller ID Detection Library, <strong>SDK</strong>112/D<br />

MOTOROLA Preface<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

xlix<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

13. CAS Detect Library, <strong>SDK</strong>124/D<br />

14. CPT Detection Library, <strong>SDK</strong>123/D<br />

15. DTMF Generation Library, <strong>SDK</strong>114/D<br />

16. DTMF Detection Library, <strong>SDK</strong>113/D<br />

17. G.165 Line Echo Canceller Library, <strong>SDK</strong>115/D<br />

18. G.711 Log-PCM Library, <strong>SDK</strong>117/D<br />

19. G.726 Speech Codec Library, <strong>SDK</strong>118/D<br />

20. Voice Activity Detection Library, <strong>SDK</strong>122/D<br />

21. DSP56F803 Evaluation Module Hardware User’s Manual, DSP56F803EVMUM/D<br />

22. DSP56F805 Evaluation Module Hardware User’s Manual, DSP56F805EVMUM/D<br />

23. DSP56F807 Evaluation Module Hardware User’s Manual, DSP56F807EVMUM/D<br />

l Targeting Motorola DSP5680x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Chapter 1<br />

Introduction<br />

This manual describes how to use the Motorola <strong>Embedded</strong> Software Development Kit (<strong>SDK</strong>) to<br />

develop software for Motorola DSP56F80x processors (801, 802, 803, 805, 807).<br />

1.1 Before You Start<br />

This manual contains information specific to the <strong>SDK</strong> only as it applies to Motorola DSP56F80x<br />

software development, so the user must be familiar with the <strong>SDK</strong> as described in the<br />

Programmer’s Guide, before continuing.<br />

Motorola <strong>Embedded</strong> <strong>SDK</strong> is designed for and fully integrated with Metrowerks CodeWarrior<br />

development tools. Before you can start exploring the full feature set of the <strong>SDK</strong>, you must first<br />

install and become familiar with the CodeWarrior development environment.<br />

1.2 Quick Start<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

This chapter gives you the information you need to install and run the <strong>SDK</strong>.<br />

1.2.1 Install CodeWarrior Development Tools<br />

As previously mentioned, Motorola’s <strong>Embedded</strong> <strong>SDK</strong> is designed for and fully integrated with<br />

Metrowerks CodeWarrior development tools. Using CodeWarrior tools, users can build <strong>SDK</strong><br />

libraries, applications and other software included as part of the <strong>SDK</strong> release. Once the software<br />

is built, CodeWarrior tools will allow <strong>SDK</strong> users to download executable images into the target<br />

platform and run/debug downloaded code.<br />

To start the installation process, perform the following steps:<br />

1. Insert the CodeWarrior CD-ROM into your computer's CD-ROM drive.<br />

If Auto Install is disabled on your computer, click the Start button, select Run, and<br />

type the CD-ROM's drive letter and \Setup.exe in the Open: text box. (e.g.<br />

D:\Setup.exe)<br />

2. Follow the CodeWarrior software installation instructions on your screen.<br />

NOTE: After installing CodeWarrior, remember to restart the computer to ensure that<br />

MOTOROLA Introduction<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

1-1<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Introduction<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

newly-installed drivers will be available for use.<br />

3. Register CodeWarrior<br />

— Click the Start button, then select CodeWarrior Registration from the CodeWarrior<br />

group. This runs the MWRegister.exe program.<br />

— Enter your registration number and contact information. If you do not have a<br />

registration number, leave the Registration Number text box blank.<br />

— Click OK and send the resulting text file (e.g. MWRegistration.txt) to<br />

license@MetroWerks.com. A license key will be sent to you via E-mail.<br />

4. Install the license key.<br />

— Locate the license.dat file in the CodeWarrior installation directory and open this file<br />

with any standard text editor; for example, Notepad.<br />

— Copy or type the key, starting on a new line at the bottom of the license.dat file.<br />

— Save the license.dat file.<br />

— For more detailed instructions, see the License_Install.txt file in the Licensing<br />

directory.<br />

1.2.2 Install DSP56F80xEVM Hardware<br />

The <strong>SDK</strong> for DSP56F80x has been designed and tested with DSP56F80xEVM target hardware. If<br />

you want to quickly exercise the software applications included with <strong>SDK</strong>, the DSP56F80xEVM<br />

hardware must be installed.<br />

The DSP56F80xEVM installation information is provided with CodeWarrior installation and can<br />

be found in the following document located in the CodeWarrior installation directory:<br />

\CodeWarrior Documentation\PDF\Targeting_DSP56800.pdf<br />

It is recommended that all <strong>SDK</strong> users read through this document before proceeding with<br />

software development.<br />

NOTE: The DSP56F802 processor is supported by the DSP56F801EVM target hardware.<br />

1.2.3 Install <strong>SDK</strong><br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

In order for the <strong>SDK</strong> to integrate itself with development tools, CodeWarrior tools must be<br />

installed prior to the <strong>SDK</strong> installation (see Section 1.2). If the <strong>SDK</strong> is installed while CodeWarrior<br />

is not present, users can only browse installed <strong>SDK</strong> software, but will not be able to build,<br />

download and run released code.<br />

NOTE: If CodeWarrior is installed after the <strong>SDK</strong>, the <strong>SDK</strong> must be removed and reinstalled<br />

after CodeWarrior installation or the <strong>SDK</strong> will not function properly.<br />

To start the installation process, perform the following steps:<br />

1. Execute Setup.exe from the CD.<br />

2. Follow the <strong>SDK</strong> software installation instructions on your screen.<br />

1-2 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

1.2.4 Build Released Software<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Quick Start<br />

Once the <strong>SDK</strong> is installed, users can build all released software for DSP56F80x by opening and<br />

building the top-level project, buildall.mcp, using the CodeWarrior development environment.<br />

Step 1: Launch Metrowerks CodeWarrior IDE; refer to Figure 1-1.<br />

Figure 1-1. Launch CodeWarrior Tools<br />

Step 2: Using the File/Open command (Figure 1-2), select the ...\sdk\src\dsp56F80xevm\nos<br />

directory (Figure 1-3) and the buildall.mcp folder (Figure 1-4), to open the buildall.mcp project<br />

(Figure 1-5).<br />

Figure 1-2. Select File/Open<br />

MOTOROLA Introduction<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

1-3<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Introduction<br />

.<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 1-3. Select ...\sdk\src\dsp56F80xevm\nos Directory<br />

Figure 1-4. Select buildall.mcp Project<br />

Figure 1-5. Buildall.mcp Project<br />

1-4 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Quick Start<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Step 3: Execute the build by pressing function key [F7] or by choosing the Make command from<br />

the menu; see Figure 1-6.<br />

Figure 1-6. Execute Make Command<br />

At this point, the buildall.mcp project will build every library and application that is part of the<br />

<strong>SDK</strong> DSP56F80x release.<br />

MOTOROLA Introduction<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

1-5<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Introduction<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

1-6 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Chapter 2<br />

Directory Structure<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

2.1 DSP56F80x <strong>SDK</strong> Directory Structure<br />

Figure 2-1. DSP56F80x Directories<br />

In the <strong>SDK</strong> DSP56F80xEVM release, there are several domain-specific directories:<br />

• motioncontrol contains libraries specific to motion control<br />

• signal contains a variety of signal processing libraries<br />

MOTOROLA Directory Structure<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

2-1<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Directory Structure<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

2-2 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Chapter 3<br />

Target Configuration for DSP56F80x<br />

The <strong>SDK</strong> is a scalable software infrastructure that defines and implements such services as Board Support<br />

Package; Interrupt Handling; Memory Management; Input and Output; and Timers. These services are the<br />

building blocks of the <strong>SDK</strong>, and each service has its own configuration and startup requirement. While the<br />

Programmer’s Guide covers target configuration in great detail, this section acts as an extension<br />

of that manual, focusing on the DSP56F80x specifics. The user should be familiar with Target<br />

Configuration in general, as described in the Programmer’s Guide, before continuing.<br />

3.1 <strong>SDK</strong> Configuration<br />

The configuration file appconfig.h contains the following <strong>SDK</strong> components and services that a user can<br />

include in the executable program: 3DES, ADC, AEC, BLDC, BSP, BUTTON, CALLER_ID, CAN,<br />

CAS_DETECT, COP, CORE, CPT, DAC, DECODER, DES, DSPFUNC, DTMF_DET,<br />

DTMF_GEN, FILEIO, FLASH, G.165, G.165, G.726, GPIO, IO, ITCN, LED, MCFUNC,<br />

MEMORY, PCMASTER, PLL, PWM, QUAD_TIMER, SCI, SIM, SPI, SRM, STACK_CHECK,<br />

SWITCH, VAD, V.8bis, V.22bis, V.42bis. Each of these components is described below.<br />

3.1.1 3DES<br />

Macro(s):<br />

INCLUDE_3DES<br />

Description: When INCLUDE_3DES is defined and included in the appconfig.h file as shown<br />

below, the Triple Data Encryption Standard (3DES) Library will be included in the application.<br />

Default: Undefined and not included.<br />

Compatibility: All DSP56F80x platforms.<br />

Code Example 3-1. 3DES - appconfig.h file<br />

#define INCLUDE_3DES<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

MOTOROLA Target Configuration for DSP56F80x<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

3-1<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Target Configuration for DSP56F80x<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3.1.2 ADC<br />

Macro(s):<br />

INCLUDE_ADC<br />

INCLUDE_IO_ADC<br />

Description: When INCLUDE_ADC or INCLUDE_IO_ADC is defined and included in the<br />

appconfig.h file as shown below, ADC Driver (Analog-to-Digital Converter) support will be<br />

included in the application.<br />

Default: Undefined and not included.<br />

Compatibility: All DSP56F80x platforms.<br />

Special Issues: When INCLUDE_IO_ADC is used, IO service is automatically included in the<br />

application to provide a device-independent interface for the ADC Driver.<br />

Code Example 3-2. ADC - appconfig.h file<br />

#define INCLUDE_ADC<br />

3.1.3 AEC<br />

Macro(s):<br />

INCLUDE_AEC<br />

Description: When INCLUDE_AEC is defined and included in the appconfig.h file as shown<br />

below, the Acoustic Echo Canceller Library will be included in the application.<br />

Default: Undefined and not included.<br />

Compatibility: All DSP56F80x platforms.<br />

Code Example 3-3. AEC - appconfig.h file<br />

#define INCLUDE_AEC<br />

3.1.4 BLDC<br />

Macro(s):<br />

INCLUDE_BLDC<br />

Description: When INCLUDE_BLDC is defined and included in the appconfig.h file as shown<br />

below, the Brushless DC Motor Library will be included in the application.<br />

Default: Undefined and not included.<br />

Compatibility: All DSP56F80x platforms.<br />

Code Example 3-4. BLDC - appconfig.h file<br />

#define INCLUDE_BLDC<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

3-2 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3.1.5 BSP<br />

Macro(s):<br />

INCLUDE_BSP<br />

<strong>SDK</strong> Configuration<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Description: When INCLUDE_BSP is defined and included in the appconfig.h file as shown<br />

below, the Board Specific Peripheral drivers are included in the application. BSP support includes<br />

Computer Operating Properly (COP) Driver, Core Configuration Registers (CORE) Driver, and<br />

PLL Driver support.<br />

Default: Undefined and not included.<br />

Compatibility: All DSP56F80x platforms.<br />

Special Issues: When BSP component is used, PLL, SIM, COP, ITCN, and CORE components<br />

will automatically be included in the application.<br />

Code Example 3-5. BSP - appconfig.h file<br />

#define INCLUDE_BSP<br />

3.1.6 BUTTON<br />

Macro(s):<br />

INCLUDE_BUTTON<br />

INCLUDE_IO_BUTTON<br />

Description: When INCLUDE_BUTTON or INCLUDE_IO_BUTTON is defined and included in<br />

the appconfig.h file as shown below, the Button Driver will be included in the application.<br />

Default: Undefined and not included.<br />

Compatibility: All DSP56F80x platforms.<br />

Special Issues: When the BUTTON component is used, the TIMER component will<br />

automatically be included in the application. Also, when the INCLUDE_IO_BUTTON is used, IO<br />

service is automatically included in the application to provide device-independent interface for<br />

the Button Driver.<br />

Code Example 3-6. BUTTON - appconfig.h file<br />

#define INCLUDE_BUTTON<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

MOTOROLA Target Configuration for DSP56F80x<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

3-3<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Target Configuration for DSP56F80x<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3.1.7 CALLER_ID<br />

Macro(s):<br />

INCLUDE_CALLER_ID<br />

Description: When INCLUDE_CALLER_ID is defined and included in the appconfig.h file as<br />

shown below, the Caller ID Library will be included in the application.<br />

Default: Undefined and not included.<br />

Compatibility: All DSP56F80x platforms.<br />

Code Example 3-7. CALLER_ID - appconfig.h file<br />

#define INCLUDE_CALLER_ID<br />

3.1.8 CAN<br />

Macro(s):<br />

INCLUDE_CAN<br />

INCLUDE_IO_CAN<br />

Description: When INCLUDE_CAN or INCLUDE_IO_CAN is defined and included in the<br />

appconfig.h file as shown below, the CAN Driver will be included in the application.<br />

Default: Undefined and not included.<br />

Compatibility: DSP56F803, DSP56F805, and DSP56F807 platforms only.<br />

Special Issues: When INCLUDE_IO_CAN is used, IO service is automatically included in the<br />

application to provide a device-independent interface for the CAN Driver.<br />

Code Example 3-8. CAN - appconfig.h file<br />

#define INCLUDE_CAN<br />

3.1.9 CAS_DETECT<br />

Macro(s):<br />

INCLUDE_CAS_DETECT<br />

Description: When INCLUDE_CAS_DETECT is defined and included in the appconfig.h file as<br />

shown below, the CAS Detect Library will be included in the application.<br />

Default: Undefined and not included.<br />

Compatibility: All DSP56F80x platforms.<br />

Code Example 3-9. CAS_DETECT - appconfig.h file<br />

#define INCLUDE_CAS_DETECT<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

3-4 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3.1.10 COP<br />

Macro(s):<br />

INCLUDE_COP<br />

<strong>SDK</strong> Configuration<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Description: When INCLUDE_COP is defined and included in the appconfig.h file as shown<br />

below, the Computer Operating Properly (COP) Driver will be included in the application.<br />

Default: Undefined and not included.<br />

Compatibility: All DSP56F80x platforms.<br />

Special Issues: This component is automatically included if the BSP component is defined.<br />

Code Example 3-10. COP - appconfig.h file<br />

#define INCLUDE_COP<br />

3.1.11 CORE<br />

Macro(s):<br />

INCLUDE_CORE<br />

Description: When INCLUDE_CORE is defined and included in the appconfig.h file as shown<br />

below, the Core Configuration Registers (CORE) Driver will be included in the application.<br />

Default: Undefined and not included.<br />

Compatibility: All DSP56F80x platforms.<br />

Special Issues: This component is automatically included if the BSP component is defined.<br />

Code Example 3-11. CORE appconfig.h file<br />

#define INCLUDE_CORE<br />

3.1.12 CPT<br />

Macro(s):<br />

INCLUDE_CPT<br />

Description: When INCLUDE_CPT is defined and included in the appconfig.h file as shown<br />

below, the CPT Library will be included in the application.<br />

Default: Undefined and not included.<br />

Compatibility: All DSP56F80x platforms.<br />

Code Example 3-12. CPT - appconfig.h file<br />

#define INCLUDE_CPT<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

MOTOROLA Target Configuration for DSP56F80x<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

3-5<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Target Configuration for DSP56F80x<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3.1.13 DAC<br />

Macro(s):<br />

INCLUDE_DAC<br />

INCLUDE_IO_DAC<br />

Description: When INCLUDE_DAC or INCLUDE_IO_DAC is defined and included in the<br />

appconfig.h file as shown below, the Digital to Analog Converter (DAC) Driver will be included in<br />

the application.<br />

Default: Undefined and not included.<br />

Compatibility: DSP56F805 and DSP56F807 platforms only.<br />

Special Issues: When the DAC component is used, the SPI component will automatically<br />

beincluded in the application. Also, when INCLUDE_IO_DAC is used, IO service is<br />

automatically included in the application to provide device-independent interface for the Digital to<br />

Analog Converter (DAC) Driver.<br />

Code Example 3-13. DAC - appconfig.h file<br />

#define INCLUDE_DAC<br />

3.1.14 DECODER<br />

Macro(s):<br />

INCLUDE_DECODER<br />

INCLUDE_IO_DECODER<br />

Description: When INCLUDE_DECODER or INCLUDE_IO_DECODER is defined and<br />

included in the appconfig.h file as shown below, the Quadrature Decoder Driver will be included<br />

in the application.<br />

Default: Undefined and not included.<br />

Compatibility: DSP56F803, DSP56F805, and DSP56F807 platforms.<br />

Special Issues: When INCLUDE_IO_DECODER is used, IO service is automatically included in<br />

the application to provide device-independent interface for the Quadrature Decoder Driver.<br />

Code Example 3-14. DECODER - appconfig.h file<br />

#define INCLUDE_DECODER<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

3-6 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3.1.15 DES<br />

Macro(s):<br />

INCLUDE_DES<br />

<strong>SDK</strong> Configuration<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Description: When INCLUDE_DES is defined and included in the appconfig.h file as shown<br />

below, the Data Encryption Standard (DES) Library will be included in the application.<br />

Default: Undefined and not included.<br />

Compatibility: All DSP56F80x platforms.<br />

Code Example 3-15. DES - appconfig.h file<br />

#define INCLUDE_DES<br />

3.1.16 DSPFUNC<br />

Macro(s):<br />

INCLUDE_DSPFUNC<br />

Description: When INCLUDE_DSPFUNC is defined and included in the appconfig.h file as<br />

shown below, the DSPFUNC will be included in the application.<br />

Default: Undefined and not included.<br />

Compatibility: All DSP56F80x platforms.<br />

Special Issues: The following DSP56F80x core registers will be changed:<br />

Code Example 3-16. DSPFUNC - appconfig.h file<br />

#define INCLUDE_DSPFUNC<br />

Table 3-1. DSP56F80x OMR Configuration<br />

Operating Mode Register Definition<br />

Saturation bit (SA) bit 4<br />

Rounding bit (R) bit 5<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Enables automatic saturation on 32-bit arithmetic result<br />

Enables two’s complement rounding (round up)<br />

Table 3-2. DSP56F80x SR Configuration<br />

Status Register Definition<br />

Limit (L) bit 6 Resets or clears the limit bit<br />

MOTOROLA Target Configuration for DSP56F80x<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

3-7<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Target Configuration for DSP56F80x<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3.1.17 DTMF_DET<br />

Macro(s):<br />

INCLUDE_DTMF_DET<br />

Description: When INCLUDE_DTMF_DET is defined and included in the appconfig.h file as<br />

shown below, the DTMF Detection Library will be included in the application.<br />

Default: Undefined and not included.<br />

Compatibility: All DSP56F80x platforms.<br />

Code Example 3-17. DTMF_DET - appconfig.h file<br />

#define INCLUDE_DTMF_DET<br />

3.1.18 DTMF_GEN<br />

Macro(s):<br />

INCLUDE_DTMF_GEN<br />

Description: When INCLUDE_DTMF_GEN is defined and included in the appconfig.h file as<br />

shown below, the DTMF Generation Library will be included in the application.<br />

Default: Undefined and not included.<br />

Compatibility: All DSP56F80x platforms.<br />

Code Example 3-18. DTMF_GEN - appconfig.h file<br />

#define INCLUDE_DTMF_GEN<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

3-8 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3.1.19 FILEIO<br />

Macro(s):<br />

INCLUDE_FILEIO<br />

INCLUDE_IO_FILEIO<br />

<strong>SDK</strong> Configuration<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Description: When INCLUDE_FILEIO or INCLUDE_IO_FILEIO is defined and included in the<br />

appconfig.h file as shown below, the FILE I/O Driver will be included in the application.<br />

Default: Undefined and not included.<br />

Compatibility: All DSP56F80x platforms.<br />

Special Issues: When the FILEIO component is used, SCI and MEMORY components will<br />

automatically be included in the application. Also, when INCLUDE_IO_FILEIO is used, IO<br />

service is automatically included in the application to provide device-independent interface for<br />

the FILE I/O Driver.<br />

Code Example 3-19. FILEIO - appconfig.h file<br />

#define INCLUDE_FILEIO<br />

3.1.20 FLASH<br />

Macro(s):<br />

INCLUDE_FLASH<br />

INCLUDE_IO_FLASH<br />

Description: When INCLUDE_FLASH or INCLUDE_IO_FLASH is defined and included in the<br />

appconfig.h file as shown below, the Flash Driver will be included in the application.<br />

Default: Undefined and not included.<br />

Compatibility: All DSP56F80x platforms.<br />

Special Issues: When INCLUDE_IO_FLASH is used, IO service is automatically included in the<br />

application to provide device-independent interface for the Flash Driver.<br />

Code Example 3-20. FLASH - appconfig.h file<br />

#define INCLUDE_FLASH<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

MOTOROLA Target Configuration for DSP56F80x<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

3-9<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Target Configuration for DSP56F80x<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3.1.21 G.165<br />

Macro(s):<br />

INCLUDE_G165<br />

Description: When INCLUDE_G165 is defined and included in the appconfig.h file as shown<br />

below, the G.165 Library will be included in the application.<br />

Default: Undefined and not included.<br />

Compatibility: All DSP56F80x platforms.<br />

Code Example 3-21. G.165 - appconfig.h file<br />

#define INCLUDE_G165<br />

3.1.22 G.711<br />

Macro(s):<br />

INCLUDE_G711<br />

Description: When INCLUDE_G711 is defined and included in the appconfig.h file as shown<br />

below, the G.711 Library will be included in the application.<br />

Default: Undefined and not included.<br />

Compatibility: All DSP56F80x platforms.<br />

Code Example 3-22. G.711 - appconfig.h file<br />

#define INCLUDE_G711<br />

3.1.23 G.726<br />

Macro(s):<br />

INCLUDE_G726<br />

Description: When INCLUDE_G726 is defined and included in the appconfig.h file as shown<br />

below, the G.726 Library will be included in the application.<br />

Default: Undefined and not included.<br />

Compatibility: All DSP56F80x platforms.<br />

Code Example 3-23. G.726 - appconfig.h file<br />

#define INCLUDE_G726<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

3-10 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3.1.24 GPIO<br />

Macro(s):<br />

INCLUDE_GPIO<br />

INCLUDE_IO_GPIO<br />

<strong>SDK</strong> Configuration<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Description: When INCLUDE_GPIO or INCLUDE_IO_GPIO is defined and included in the<br />

appconfig.h file as shown below, the GPIO Driver will be included in the application.<br />

Default: Undefined and not included.<br />

Compatibility: All DSP56F80x platforms.<br />

Special Issues: When INCLUDE_IO_GPIO is used, IO service is automatically included in the<br />

application to provide device-independent interface for the GPIO Driver. Also, the GPIO<br />

component is automatically included if the LED or SWITCH component is defined.<br />

Code Example 3-24. GPIO - appconfig.h file<br />

#define INCLUDE_GPIO<br />

3.1.25 IO<br />

Macro(s):<br />

INCLUDE_IO<br />

Description: When INCLUDE_IO is defined and included in the appconfig.h file as shown<br />

below, <strong>SDK</strong> IO services will be included in the application. Refer to the Chapter 5, and Chapter 6<br />

in this manual and to the Programmer’s Guide for more details about this service.<br />

Default: Undefined and not included.<br />

Compatibility: All DSP56F80x platforms.<br />

Code Example 3-25. IO - appconfig.h file<br />

#define INCLUDE_IO<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

MOTOROLA Target Configuration for DSP56F80x<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

3-11<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Target Configuration for DSP56F80x<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3.1.26 ITCN<br />

Macro(s):<br />

INCLUDE_ITCN<br />

Description: When INCLUDE_ITCN is defined and included in the appconfig.h file as shown<br />

below, the Interrupt Controller (ITCN) Driver will be included in the application.<br />

Default: Undefined and not included.<br />

Compatibility: All DSP56F80x platforms.<br />

Special Issues: This component is automatically included if the BSP component is defined.<br />

Code Example 3-26. ITCN - appconfig.h file<br />

#define INCLUDE_ITCN<br />

3.1.27 LED<br />

Macro(s):<br />

INCLUDE_LED<br />

INCLUDE_IO_LED<br />

Description: When INCLUDE_LED or INCLUDE_IO_LED is defined and included in the<br />

appconfig.h file as shown below, the LED Driver will be included in the application.<br />

Default: Undefined and not included.<br />

Compatibility: All DSP56F80x platforms.<br />

Special Issues: When the LED component is used, the GPIO component will automatically be<br />

included in the application. Also, when INCLUDE_IO_LED is used, IO service is automatically<br />

included in the application to provide device-independent interface for the LED Driver.<br />

Code Example 3-27. LED - appconfig.h file<br />

#define INCLUDE_LED<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

3-12 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3.1.28 MCFUNC<br />

Macro(s):<br />

INCLUDE_MCFUNC<br />

<strong>SDK</strong> Configuration<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Description: When INCLUDE_MCFUNC is defined and included in the appconfig.h file as<br />

shown below, the MCFUNC will be included in the application.<br />

Default: Undefined and not included.<br />

Compatibility: All DSP56F80x platforms.<br />

Code Example 3-28. MCFUNC - appconfig.h file<br />

#define INCLUDE_MCFUNC<br />

3.1.29 MEMORY<br />

Macro(s):<br />

INCLUDE_MEMORY<br />

Description: When INCLUDE_MEMORY is defined and included in the appconfig.h file as<br />

shown below, <strong>SDK</strong> Memory services will be included in the application. Refer to the<br />

Programmer’s Guide for more details about this service.<br />

Default: Undefined and not included.<br />

Compatibility: All DSP56F80x platforms.<br />

Special Issues: This component is automatically included if the FILEIO component is defined.<br />

Code Example 3-29. MEMORY - appconfig.h file<br />

#define INCLUDE_MEMORY<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

MOTOROLA Target Configuration for DSP56F80x<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

3-13<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Target Configuration for DSP56F80x<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3.1.30 PCMASTER<br />

Macro(s):<br />

INCLUDE_PCMASTER<br />

Description: When INCLUDE_PCMASTER is defined and included in the appconfig.h file as<br />

shown below, the PC Master SCI Communication Driver will be included in the application.<br />

Default: Undefined and not included.<br />

Compatibility: All DSP56F80x platforms.<br />

Special Issues: When the PCMASTER component is used, the SCI component will automatically<br />

be included in the application.<br />

Code Example 3-30. PCMASTER - appconfig.h file<br />

#define INCLUDE_PCMASTER<br />

3.1.31 PLL<br />

Macro(s):<br />

INCLUDE_PLL<br />

Description: When INCLUDE_PLL is defined and included in the appconfig.h file as shown<br />

below, the PLL Driver will be included in the application. See Section 3.4 for more information<br />

about PLL.<br />

Default: Undefined and not included.<br />

Compatibility: All DSP56F80x platforms.<br />

Special Issues: This component is automatically included if the BSP component is defined.<br />

Code Example 3-31. PLL - appconfig.h file<br />

#define INCLUDE_PLL<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

3-14 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3.1.32 PWM<br />

Macro(s):<br />

INCLUDE_PWM<br />

INCLUDE_IO_PWM<br />

<strong>SDK</strong> Configuration<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Description: When INCLUDE_PWM or INCLUDE_IO_PWM is defined and included in the<br />

appconfig.h file as shown below, the PWM Driver will be included in the application.<br />

Default: Undefined and not included.<br />

Compatibility: All DSP56F80x platforms.<br />

Special Issues: When INCLUDE_IO_PWM is used, IO service is automatically included in the<br />

application to provide device-independent interface for the PWM Driver.<br />

Code Example 3-32. PWM - appconfig.h file<br />

#define INCLUDE_PWM<br />

3.1.33 QUAD_TIMER<br />

Macro(s):<br />

INCLUDE_QUAD_TIMER<br />

INCLUDE_IO_QUAD_TIMER<br />

Description: When INCLUDE_QUAD_TIMER or INCLUDE_IO_QUAD_TIMER is defined and<br />

included in the appconfig.h file as shown below, the Quad Timer Driver will be included in the<br />

application.<br />

Default: Undefined and not included.<br />

Compatibility: All DSP56F80x platforms.<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Special Issues: When INCLUDE_IO_QUAD_TIMER is used, IO service is automatically<br />

included in the application to provide device-independent interface for the Quad Timer Driver.<br />

Also, the QUAD_TIMER component is automatically included if the TIMER component is<br />

defined.<br />

Code Example 3-33. QUAD_TIMER - appconfig.h file<br />

#define INCLUDE_QUAD_TIMER<br />

MOTOROLA Target Configuration for DSP56F80x<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

3-15<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Target Configuration for DSP56F80x<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3.1.34 SCI<br />

Macro(s):<br />

INCLUDE_SCI<br />

INCLUDE_IO_SCI<br />

Description: When INCLUDE_SCI or INCLUDE_IO_SCI is defined and included in the<br />

appconfig.h file as shown below, the SCI Driver will be included in the application.<br />

Default: Undefined and not included.<br />

Compatibility: All DSP56F80x platforms.<br />

Special Issues: When INCLUDE_IO_SCI is used, IO service is automatically included in the<br />

application to provide device-independent interface for the SCI Driver. Also, the SCI component<br />

is automatically included if the FILEIO or PCMASTER component is defined.<br />

Code Example 3-34. SCI - appconfig.h file<br />

#define INCLUDE_SCI<br />

3.1.35 SIM<br />

Macro(s):<br />

INCLUDE_SIM<br />

Description: When INCLUDE_SIM is defined and included in the appconfig.h file as shown<br />

below, the System Integration Module (SIM) Driver will be included in the application.<br />

Default: Undefined and not included.<br />

Compatibility: All DSP56F80x platforms.<br />

Special Issues: This component is automatically included if the BSP component is defined.<br />

Code Example 3-35. SIM - appconfig.h file<br />

#define INCLUDE_SIM<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

3-16 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3.1.36 SPI<br />

Macro(s):<br />

INCLUDE_SPI<br />

INCLUDE_IO_SPI<br />

<strong>SDK</strong> Configuration<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Description: When INCLUDE_SPI or INCLUDE_IO_SPI is defined and included in the<br />

appconfig.h file as shown below, the SPI Driver will be included in the application.<br />

Default: Undefined and not included.<br />

Compatibility: All DSP56F80x platforms.<br />

Special Issues: When INCLUDE_IO_SPI is used, IO service is automatically included in the<br />

application to provide device-independent interface for the SPI Driver. Also, the SPI component<br />

is automatically included if the DAC component is defined.<br />

Code Example 3-36. SPI - appconfig.h file<br />

#define INCLUDE_SPI<br />

3.1.37 SRM<br />

Macro(s):<br />

INCLUDE_SRM<br />

Description: When INCLUDE_SRM is defined and included in the appconfig.h file as shown<br />

below, the Switched Reluctance Motor Library will be included in the application.<br />

Default: Undefined and not included.<br />

Compatibility: All DSP56F80x platforms.<br />

Code Example 3-37. SRM - appconfig.h file<br />

#define INCLUDE_SRM<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

MOTOROLA Target Configuration for DSP56F80x<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

3-17<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Target Configuration for DSP56F80x<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3.1.38 STACK_CHECK<br />

Macro(s):<br />

INCLUDE_STACK_CHECK<br />

Description: When INCLUDE_STACK_CHECK is defined and included in the appconfig.h file<br />

as shown below, <strong>SDK</strong> stack check services will be included in the application. Refer to the<br />

Programmer’s Guide for more details about this service.<br />

Default: Undefined and not included.<br />

Compatibility: All DSP56F80x platforms.<br />

Code Example 3-38. STACK_CHECK - appconfig.h file<br />

#define INCLUDE_MEMORY<br />

3.1.39 SWITCH<br />

Macro(s):<br />

INCLUDE_SWITCH<br />

INCLUDE_IO_SWITCH<br />

Description: When INCLUDE_SWITCH or INCLUDE_IO_SWITCH is defined and included in<br />

the appconfig.h file as shown below, the Switch Driver will be included in the application.<br />

Default: Undefined and not included.<br />

Compatibility: All DSP56F80x platforms.<br />

Special Issues: When INCLUDE_IO_SWITCH is used, IO service is automatically included in<br />

the application to provide device-independent interface for the Switch Driver.<br />

Code Example 3-39. SWITCH - appconfig.h file<br />

#define INCLUDE_SWITCH<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

3-18 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3.1.40 TIMER<br />

Macro(s):<br />

INCLUDE_TIMER<br />

<strong>SDK</strong> Configuration<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Description: When INCLUDE_TIMER is defined and included in the appconfig.h file as shown<br />

below, <strong>SDK</strong> Timer services will be included in the application. Refer to the Programmer’s Guide<br />

for more details about this service.<br />

Default: Undefined and not included.<br />

Compatibility: All DSP56F80x platforms.<br />

Special Issues: When the TIMER component is used, the QUAD_TIMER component will be<br />

automatically included in the application. Also, the TIMER component is automatically included<br />

if the BUTTON component is defined.<br />

Code Example 3-40. TIMER - appconfig.h file<br />

#define INCLUDE_TIMER<br />

3.1.41 VAD<br />

Macro(s):<br />

INCLUDE_VAD<br />

Description: When INCLUDE_VAD is defined and included in the appconfig.h file as shown<br />

below, the VAD Library will be included in the application.<br />

Default: Undefined and not included.<br />

Compatibility: All DSP56F80x platforms.<br />

Code Example 3-41. VAD - appconfig.h file<br />

#define INCLUDE_VAD<br />

3.1.42 V.8bis<br />

Macro(s):<br />

INCLUDE_V8BIS<br />

Description: When INCLUDE_V8BIS is defined and included in the appconfig.h file as shown<br />

below, the V.8bis will be included in the application.<br />

Default: Undefined and not included.<br />

Compatibility: All DSP56F80x platforms.<br />

Code Example 3-42. V.8bis - appconfig.h file<br />

#define INCLUDE_V8BIS<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

MOTOROLA Target Configuration for DSP56F80x<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

3-19<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Target Configuration for DSP56F80x<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3.1.43 V.22bis<br />

Macro(s):<br />

INCLUDE_V22<br />

Description: When INCLUDE_V22 is defined and included in the appconfig.h file as shown<br />

below, the V.22bis will be included in the application.<br />

Default: Undefined and not included.<br />

Compatibility: All DSP56F80x platforms.<br />

Code Example 3-43. V.22bis - appconfig.h file<br />

#define INCLUDE_V22<br />

3.1.44 V.42bis<br />

Macro(s):<br />

INCLUDE_V42BIS<br />

Description: When INCLUDE_V42BIS is defined and included in the appconfig.h file as shown<br />

below, the V.42bis will be included in the application.<br />

Default: Undefined and not included.<br />

Compatibility: All DSP56F80x platforms.<br />

Code Example 3-44. V.42bis - appconfig.h file<br />

#define INCLUDE_V42BIS<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

3-20 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Memory Configuration<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3.2 Memory Configuration<br />

As explained in the Programmer’s Guide, the <strong>SDK</strong> supports a variety of memory configurations<br />

by providing different Linker Command Files with directives targeted for a particular memory<br />

model. For the DSP56F80x platform, the <strong>SDK</strong> includes Linker Command Files configured for the<br />

following memory models: External Memory Operation and Internal (Flash) Memory Operation.<br />

3.2.1 External Memory Operation for DSP56F801 &<br />

DSP56F802<br />

Since the DSP56F801 and DSP56F802 processors do not have an external memory interface, the<br />

<strong>SDK</strong> provides no support for External Memory Operation.<br />

3.2.2 External Memory Operation for DSP56F803 &<br />

DSP56F805<br />

Section 6.3, Memory Configuration, of the Programmer’s Guide explains and shows an<br />

example of memory configuration using the Linker Command File. The current chapter<br />

documents only the differences that are specific to the DSP56F803 and DSP56F805 platforms.<br />

3.2.2.1 Linker Command File<br />

# Linker.cmd file for DSP56F803EVM/DSP56F805EVM External RAM<br />

# using both internal and external data memory (EX = 0)<br />

# and using external program memory (Mode = 3)<br />

#*******************************************************************************<br />

MEMORY {<br />

.pInterruptVector (RX) : ORIGIN = 0x0000, LENGTH = 0x0086<br />

.pExtRAM (RWX) : ORIGIN = 0x0086, LENGTH = 0xFF7A<br />

.xAvailable (RW) : ORIGIN = 0x0000, LENGTH = 0x0030<br />

.xCWRegisters (RW) : ORIGIN = 0x0030, LENGTH = 0x0010<br />

.xIntRAM_DynamicMem (RW) : ORIGIN = 0x0040, LENGTH = 0x07C0<br />

.xReserved (R) : ORIGIN = 0x0800, LENGTH = 0x0400<br />

.xPeripherals (RW) : ORIGIN = 0x0C00, LENGTH = 0x0400<br />

.xFlash (R) : ORIGIN = 0x1000, LENGTH = 0x1000<br />

.xExtRAM (RW) : ORIGIN = 0x2000, LENGTH = 0xC000<br />

.xExtRAM_DynamicMem (RW) : ORIGIN = 0xE000, LENGTH = 0x1000<br />

.xStack (RW) : ORIGIN = 0xF000, LENGTH = 0x0F80<br />

.xCoreRegisters (RW) : ORIGIN = 0xFF80, LENGTH = 0x0080<br />

}<br />

#*******************************************************************************<br />

FORCE_ACTIVE {FconfigInterruptVector}<br />

SECTIONS {<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

#*******************************************************************************<br />

#<br />

MOTOROLA Target Configuration for DSP56F80x<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

3-21<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Target Configuration for DSP56F80x<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

# Data (X) Memory Layout<br />

#<br />

_EX_BIT = 0;<br />

# Internal Memory Partitions (for mem.h partitions)<br />

_NUM_IM_PARTITIONS = 1; # IM_ADDR_1 (no IM_ADDR_2 )<br />

# External Memory Partition (for mem.h partitions)<br />

_NUM_EM_PARTITIONS = 1; # EM_ADDR_1<br />

#*******************************************************************************<br />

.ApplicationInterruptVector :<br />

{<br />

vector.c (.text)<br />

} > .pInterruptVector<br />

#*******************************************************************************<br />

.ApplicationCode :<br />

{<br />

# Place all code into Program RAM<br />

* (.text)<br />

* (rtlib.text)<br />

* (fp_engine.text)<br />

* (user.text)<br />

# <strong>SDK</strong> data to be placed into Program RAM<br />

F_Pdata_start_addr_in_ROM = 0;<br />

F_Pdata_start_addr_in_RAM = .;<br />

pramdata.c (.data)<br />

F_Pdata_ROMtoRAM_length = 0;<br />

F_Pbss_start_addr = .;<br />

_P_BSS_ADDR = .;<br />

pramdata.c (.bss)<br />

F_Pbss_length = . - _P_BSS_ADDR;<br />

} > .pExtRAM<br />

#*******************************************************************************<br />

.ApplicationData :<br />

{<br />

# Define variables for C initialization code<br />

F_Xdata_start_addr_in_ROM = ADDR(.xFlash) + SIZEOF(.xFlash) / 2;<br />

F_StackAddr = ADDR(.xStack);<br />

F_StackEndAddr = ADDR(.xStack) + SIZEOF(.xStack)/2 - 1;<br />

F_Xdata_start_addr_in_RAM = .;<br />

# Define variables for <strong>SDK</strong> mem library<br />

FmemEXbit = .;<br />

3-22 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Memory Configuration<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

WRITEH(_EX_BIT);<br />

FmemNumIMpartitions = .;<br />

WRITEH(_NUM_IM_PARTITIONS);<br />

FmemNumEMpartitions = .;<br />

WRITEH(_NUM_EM_PARTITIONS);<br />

FmemIMpartitionList = .;<br />

WRITEH(ADDR(.xIntRAM_DynamicMem));<br />

WRITEH(SIZEOF(.xIntRAM_DynamicMem) / 2);<br />

FmemEMpartitionList = .;<br />

WRITEH(ADDR(.xExtRAM_DynamicMem));<br />

WRITEH(SIZEOF(.xExtRAM_DynamicMem) /2);<br />

# Place rest of the data into External RAM<br />

* (.data)<br />

* (fp_state.data)<br />

* (rtlib.data)<br />

F_Xdata_ROMtoRAM_length = 0;<br />

F_Xbss_start_addr = .;<br />

_X_BSS_ADDR = .;<br />

* (rtlib.bss.lo)<br />

* (.bss)<br />

F_Xbss_length = . - _X_BSS_ADDR; # Copy DATA<br />

} > .xExtRAM<br />

#*******************************************************************************<br />

}S<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

FArchIO = ADDR(.xPeripherals);<br />

FArchCore = ADDR(.xCoreRegisters);<br />

MOTOROLA Target Configuration for DSP56F80x<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

3-23<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Target Configuration for DSP56F80x<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3.2.2.2 Linking: Set Up Memory Partitions<br />

Using memory directives in the Linker Command File, the DSP56F803/DSP56F805 are set up to<br />

use External Program RAM for code and any data that must be put into Program memory, as well<br />

as to use a combination of External and Internal Data RAM for initialized and uninitialized data.<br />

application.o Program Ext. RAM<br />

data<br />

bss<br />

text<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

.pInterruptVector<br />

appconfig.o<br />

data<br />

bss<br />

text<br />

appconst.o<br />

data<br />

Step 1<br />

bss<br />

.pExtRAM<br />

text<br />

config.o<br />

data<br />

bss<br />

text<br />

const.o<br />

data<br />

Linker<br />

Command<br />

File<br />

bss<br />

text Data Int. RAM<br />

MEMORY {<br />

.pInterruptVector (RX) : ORIGIN = Ox0000, LENGTH = 0x0086<br />

pramdata.o<br />

.xAvailable<br />

.pExtRAM (RWX): ORIGIN = 0x0086, LENGTH = 0xFF7A<br />

data<br />

bss<br />

text<br />

vector.o<br />

data<br />

bss<br />

Used by<br />

.xCWRegisters<br />

CodeWarrior<br />

Used by <strong>SDK</strong><br />

.xIntRAM_DynamicMem<br />

Memory Manager<br />

Data Ext. RAM<br />

.xAvailable (RW) : ORIGIN = 0x0000, LENGTH = 0x0030<br />

.xCWRegisters (RW) : ORIGIN = 0x0030, LENGTH = 0x0010<br />

.xIntRAM_DynamicMem (RW) : ORIGIN = 0x0040, LENGTH = 0x07C0<br />

.xReserved (R) : ORIGIN = 0x0800, LENGTH = 0x0400<br />

.xPeripherals (RW) : ORIGIN = 0x0C00, LENGTH = 0x0400<br />

.xFlash (R) : ORIGIN = 0x1000, LENGTH = 0x1000<br />

.xExtRAM (RW) : ORIGIN = 0x2000, LENGTH = 0xC000<br />

.xExtRAM_DynamicMem (RW) : ORIGIN = 0xE000, LENGTH = 0x1000<br />

text<br />

.xStack (RW) : ORIGIN = 0xF000, LENGTH = 0x0F80<br />

<strong>SDK</strong> Libraries<br />

.xCoreRegisters (RW) : ORIGIN = 0xFF80, LENGTH = 0x0080<br />

}<br />

data<br />

bss<br />

text<br />

.xExtRAM<br />

CW Run-Time Libs<br />

Used by <strong>SDK</strong><br />

data Memory Manager<br />

bss<br />

text Software Stack<br />

.xExtRAM_DynamicMem<br />

.xStack<br />

Figure 3-1. Setup of DSP56F803/DSP56F805 Memory Partitions<br />

3-24 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Memory Configuration<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3.2.2.3 Programming Target Memory<br />

Figure 3-2 demonstrates how an executable file (which is configured for external memory<br />

operation) will be mapped into physical memory on the DSP56F805 target. This process will<br />

work on the DSP56F803 tatget as well.<br />

Program Ext. RAM<br />

Interrupt Vector<br />

Code<br />

Initialized Data for<br />

Program RAM<br />

Uninitialized Data<br />

for Program RAM<br />

Data Int. RAM<br />

Used by <strong>SDK</strong><br />

CodeWarrior<br />

Used by <strong>SDK</strong><br />

Memory Manager<br />

Data Ext. RAM<br />

Initialized &<br />

Uninitialized Data<br />

for Data RAM<br />

Used by <strong>SDK</strong><br />

Memory Manager<br />

Software Stack<br />

Application.elf (Application.elf.S)<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Load<br />

DSP56F805<br />

Memory<br />

(Using<br />

CodeWarrior<br />

Tools or Serial<br />

Bootloader)<br />

Program Memory<br />

External RAM<br />

Data Memory<br />

Reserved<br />

Peripherals<br />

External RAM<br />

DSP56F805 Memory Map<br />

Figure 3-2. Programming Target Memory<br />

Core Registers 0xFF80 - 0xFFFF<br />

MOTOROLA Target Configuration for DSP56F80x<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

3-25<br />

RAM<br />

Flash<br />

0x0000 - 0xFFFF<br />

0x0000 - 0x07FF<br />

0x0800 - 0x0BFF<br />

0x0C00 - 0x0FFF<br />

0x1000 - 0x1FFF<br />

0x2000 - 0xFF7F<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Target Configuration for DSP56F80x<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3.2.3 External Memory Operation for DSP56F807<br />

Section 6.3, Memory Configuration, in the Programmer’s Guide explains and shows an<br />

example of memory configuration using the Linker Command File. The current chapter<br />

documents only the differences that are specific to the DSP56F807 platform.<br />

3.2.3.1 Linker Command File<br />

# Linker.cmd file for DSP56F807EVM External RAM<br />

# using both internal and external data memory (EX = 0)<br />

# and using external program memory (Mode = 3)<br />

#*******************************************************************************<br />

MEMORY {<br />

.pInterruptVector (RX) : ORIGIN = 0x0000, LENGTH = 0x0086<br />

.pExtRAM (RWX) : ORIGIN = 0x0086, LENGTH = 0xFF7A<br />

.xAvailable (RW) : ORIGIN = 0x0000, LENGTH = 0x0030<br />

.xCWRegisters (RW) : ORIGIN = 0x0030, LENGTH = 0x0010<br />

.xIntRAM_DynamicMem (RW) : ORIGIN = 0x0040, LENGTH = 0x0FC0<br />

.xPeripherals (RW) : ORIGIN = 0x1000, LENGTH = 0x0800<br />

.xReserved (R) : ORIGIN = 0x1800, LENGTH = 0x0800<br />

.xFlash (R) : ORIGIN = 0x2000, LENGTH = 0x2000<br />

.xExtRAM (RW) : ORIGIN = 0x4000, LENGTH = 0xA000<br />

.xExtRAM_DynamicMem (RW) : ORIGIN = 0xE000, LENGTH = 0x1000<br />

.xStack (RW) : ORIGIN = 0xF000, LENGTH = 0x0F80<br />

.xCoreRegisters (RW) : ORIGIN = 0xFF80, LENGTH = 0x0080<br />

}<br />

#*******************************************************************************<br />

/* Special function required for 807 to accomodate Flash programming in Mode A */<br />

FORCE_ACTIVE {FhardwareAndWatchdogResetVector}<br />

FORCE_ACTIVE {FconfigInterruptVector}<br />

SECTIONS {<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

#*******************************************************************************<br />

#<br />

# Data (X) Memory Layout<br />

#<br />

_EX_BIT = 0;<br />

# Internal Memory Partitions (for mem.h partitions)<br />

_NUM_IM_PARTITIONS = 1; # IM_ADDR_1 (no IM_ADDR_2 )<br />

# External Memory Partition (for mem.h partitions)<br />

_NUM_EM_PARTITIONS = 1; # EM_ADDR_1<br />

#*******************************************************************************<br />

.ApplicationInterruptVector :<br />

3-26 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

{<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Memory Configuration<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

vectorreset.c (.text)<br />

vector.c (.text)<br />

} > .pInterruptVector<br />

#*******************************************************************************<br />

.ApplicationCode :<br />

{<br />

# Place all code into Program RAM<br />

* (.text)<br />

* (rtlib.text)<br />

* (fp_engine.text)<br />

* (user.text)<br />

# <strong>SDK</strong> data to be placed into Program RAM<br />

F_Pdata_start_addr_in_ROM = 0;<br />

F_Pdata_start_addr_in_RAM = .;<br />

pramdata.c (.data)<br />

F_Pdata_ROMtoRAM_length = 0;<br />

F_Pbss_start_addr = .;<br />

_P_BSS_ADDR = .;<br />

pramdata.c (.bss)<br />

F_Pbss_length = . - _P_BSS_ADDR;<br />

} > .pExtRAM<br />

#*******************************************************************************<br />

.ApplicationData :<br />

{<br />

# Define variables for C initialization code<br />

F_Xdata_start_addr_in_ROM = ADDR(.xFlash) + SIZEOF(.xFlash) / 2;<br />

F_StackAddr = ADDR(.xStack);<br />

F_StackEndAddr = ADDR(.xStack) + SIZEOF(.xStack)/2 - 1;<br />

F_Xdata_start_addr_in_RAM = .;<br />

# Define variables for <strong>SDK</strong> mem library<br />

FmemEXbit = .;<br />

WRITEH(_EX_BIT);<br />

FmemNumIMpartitions = .;<br />

WRITEH(_NUM_IM_PARTITIONS);<br />

FmemNumEMpartitions = .;<br />

WRITEH(_NUM_EM_PARTITIONS);<br />

FmemIMpartitionList = .;<br />

WRITEH(ADDR(.xIntRAM_DynamicMem));<br />

WRITEH(SIZEOF(.xIntRAM_DynamicMem) / 2);<br />

FmemEMpartitionList = .;<br />

WRITEH(ADDR(.xExtRAM_DynamicMem));<br />

WRITEH(SIZEOF(.xExtRAM_DynamicMem) /2);<br />

MOTOROLA Target Configuration for DSP56F80x<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

3-27<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Target Configuration for DSP56F80x<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

# Place rest of the data into External RAM<br />

* (.data)<br />

* (fp_state.data)<br />

* (rtlib.data)<br />

F_Xdata_ROMtoRAM_length = 0;<br />

F_Xbss_start_addr = .;<br />

_X_BSS_ADDR = .;<br />

* (rtlib.bss.lo)<br />

* (.bss)<br />

F_Xbss_length = . - _X_BSS_ADDR; # Copy DATA<br />

} > .xExtRAM<br />

#*******************************************************************************<br />

}<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

FArchIO = ADDR(.xPeripherals);<br />

FArchCore = ADDR(.xCoreRegisters);<br />

3-28 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Memory Configuration<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3.2.3.2 Linking: Set Up Memory Partitions<br />

Using memory directives in the Linker Command File, the DSP56F807 is set up to use External<br />

Program RAM for code and any data that must be put into Program memory, as well as to use a<br />

combination of External and Internal Data RAM for initialized and uninitialized data.<br />

application.o Program Ext. RAM<br />

data<br />

bss<br />

text<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

.pInterruptVector<br />

appconfig.o<br />

data<br />

bss<br />

text<br />

appconst.o<br />

data<br />

Step 1<br />

bss<br />

.pExtRAM<br />

text<br />

config.o<br />

data<br />

bss<br />

text<br />

const.o<br />

data<br />

Linker<br />

Command<br />

File<br />

bss<br />

text Data Int. RAM<br />

MEMORY {<br />

pramdata.o<br />

data<br />

bss<br />

text<br />

vector.o<br />

data<br />

bss<br />

.xAvailable<br />

Used by<br />

.xCWRegisters<br />

CodeWarrior<br />

Used by <strong>SDK</strong><br />

.xIntRAM_DynamicMem<br />

Memory Manager<br />

Data Ext. RAM<br />

.pInterruptVector (RX) : ORIGIN = Ox0000, LENGTH = 0x0086<br />

.pExtRAM (RWX): ORIGIN = 0x0086, LENGTH = 0xFF7A<br />

.xAvailable (RW) : ORIGIN = 0x0000, LENGTH = 0x0030<br />

.xCWRegisters (RW) : ORIGIN = 0x0030, LENGTH = 0x0010<br />

.xIntRAM_DynamicMem (RW) : ORIGIN = 0x0040, LENGTH = 0x0FC0<br />

.xPeripherals (RW) : ORIGIN = 0x1000, LENGTH = 0x0800<br />

.xReserved (R) : ORIGIN = 0x1800, LENGTH = 0x0800<br />

.xFlash (R) : ORIGIN = 0x2000, LENGTH = 0x2000<br />

.xExtRAM (RW) : ORIGIN = 0x4000, LENGTH = 0xA000<br />

text<br />

.xExtRAM_DynamicMem (RW) : ORIGIN = 0xE000, LENGTH = 0x1000<br />

<strong>SDK</strong> Libraries<br />

.xStack (RW) : ORIGIN = 0xF000, LENGTH = 0x0F80<br />

.xCoreRegisters (RW) : ORIGIN = 0xFF80, LENGTH = 0x0080<br />

data<br />

bss<br />

text<br />

.xExtRAM<br />

}<br />

CW Run-Time Libs<br />

Used by <strong>SDK</strong><br />

data Memory Manager<br />

bss<br />

text Software Stack<br />

.xExtRAM_DynamicMem<br />

.xStack<br />

Figure 3-3. Set Up DSP56F807 Memory Partitions<br />

MOTOROLA Target Configuration for DSP56F80x<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

3-29<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Target Configuration for DSP56F80x<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3.2.3.3 Programming Target Memory<br />

Figure 3-4 demonstrates how an executable file (which is configured for external memory<br />

operation) will be mapped into physical memory on the DSP56F807 target.<br />

Program Ext. RAM<br />

Interrupt Vector<br />

Code<br />

Initialized Data for<br />

Program RAM<br />

Uninitialized Data<br />

for Program RAM<br />

Data Int. RAM<br />

Used by <strong>SDK</strong><br />

CodeWarrior<br />

Used by <strong>SDK</strong><br />

Memory Manager<br />

Data Ext. RAM<br />

Initialized &<br />

Uninitialized Data<br />

for Data RAM<br />

Used by <strong>SDK</strong><br />

Memory Manager<br />

Software Stack<br />

Application.elf (Application.elf.S)<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Load<br />

DSP56F807<br />

Memory<br />

(Using<br />

CodeWarrior<br />

Tools or Serial<br />

Bootloader)<br />

Program Memory<br />

External RAM<br />

Data Memory<br />

Reserved<br />

Peripherals<br />

External RAM<br />

DSP56F805 Memory Map<br />

Figure 3-4. Programming Target Memory<br />

Core Registers 0xFF80 - 0xFFFF<br />

3-30 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

RAM<br />

Flash<br />

0x0000 - 0xFFFF<br />

0x0000 - 0x0FFF<br />

0x1000 - 0x17FF<br />

0x1800 - 0x1FFF<br />

0x2000 - 0x3FFF<br />

0x4000 - 0xFF7F<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Memory Configuration<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3.2.4 Internal (Flash) Memory Operation for DSP56F801 &<br />

DSP56802<br />

Section 6.3, Memory Configuration, in the Programmer’s Guide explains and shows an<br />

example of memory configuration using the Linker Command File. The current chapter<br />

documents only the differences that are specific to the DSP56F801 platform. The DSP56802 has<br />

the same memory map as the DSP56F801 and therefore their linker command files are identical.<br />

3.2.4.1 Linker Command File<br />

# Linker.cmd file for DSP56F801EVM<br />

# using internal data memory only ( EX = 0, Boot Mode 0A )<br />

#*******************************************************************************<br />

MEMORY {<br />

.pInterruptVector (RX) : ORIGIN = 0x0000, LENGTH = 0x0086<br />

.pFlash (RX) : ORIGIN = 0x0086, LENGTH = 0x1F7A<br />

.pIntRAM (RWX) : ORIGIN = 0x7C00, LENGTH = 0x0400<br />

.pIntRAM_Mirror (RWX) : ORIGIN = 0x7C00, LENGTH = 0x0400<br />

.pBootFlash (RX) : ORIGIN = 0x8000, LENGTH = 0x0800<br />

.pReserved (RX) : ORIGIN = 0x8800, LENGTH = 0x7800<br />

.xAvailable (RW) : ORIGIN = 0x0000, LENGTH = 0x0030<br />

.xCWRegisters (RW) : ORIGIN = 0x0030, LENGTH = 0x0010<br />

.xIntRAM (RW) : ORIGIN = 0x0040, LENGTH = 0x02C0<br />

.xIntRAM_Mirror (RW) : ORIGIN = 0x0040, LENGTH = 0x02C0<br />

.xStack (RW) : ORIGIN = 0x0300, LENGTH = 0x0100<br />

.xReserved1 (R) : ORIGIN = 0x0400, LENGTH = 0x0800<br />

.xPeripherals (RW) : ORIGIN = 0x0C00, LENGTH = 0x0400<br />

.xFlash (R) : ORIGIN = 0x1000, LENGTH = 0x0800<br />

.xReserved2 (R) : ORIGIN = 0x1800, LENGTH = 0x0800<br />

.xExtRAM (R) : ORIGIN = 0x2000, LENGTH = 0xDF80<br />

.xCoreRegisters (RW) : ORIGIN = 0xFF80, LENGTH = 0x0080<br />

}<br />

#*******************************************************************************<br />

FORCE_ACTIVE {FconfigInterruptVector}<br />

SECTIONS {<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

#*******************************************************************************<br />

.ApplicationInterruptVector :<br />

{<br />

vector.c (.text)<br />

} > .pInterruptVector<br />

#*******************************************************************************<br />

.ApplicationCode :<br />

{<br />

# Place all code into Program Flash<br />

* (.text)<br />

* (rtlib.text)<br />

* (fp_engine.text)<br />

MOTOROLA Target Configuration for DSP56F80x<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

3-31<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Target Configuration for DSP56F80x<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

* (user.text)<br />

} > .pFlash<br />

#*******************************************************************************<br />

.InitializedDataForProgramRAM : AT (ADDR(.pFlash)+1+SIZEOF(.pFlash) / 2)<br />

{<br />

# Define variables for C initialization code of Program RAM data<br />

F_Pdata_start_addr_in_ROM = ADDR(.pFlash)+1 + SIZEOF(.pFlash) / 2;<br />

F_Pdata_start_addr_in_RAM = .;<br />

_P_DATA_ADDR = .;<br />

# <strong>SDK</strong> initialized data to be placed into Program RAM<br />

pramdata.c (.data)<br />

F_Pdata_ROMtoRAM_length = . - _P_DATA_ADDR;<br />

} > .pIntRAM_Mirror<br />

#*******************************************************************************<br />

.InitializedConstData :<br />

{<br />

const.c (.data)<br />

appconst.c (.data)<br />

} > .xFlash<br />

#*******************************************************************************<br />

.ApplicationInitialzedData : AT (ADDR(.xFlash) + 1 + SIZEOF(.xFlash) / 2)<br />

{<br />

# Define variables for C initialization code<br />

F_Xdata_start_addr_in_ROM = ADDR(.xFlash)+1 + SIZEOF(.xFlash) / 2;<br />

F_StackAddr = ADDR(.xStack);<br />

F_StackEndAddr = ADDR(.xStack)+SIZEOF(.xStack) / 2 - 1;<br />

F_Xdata_start_addr_in_RAM = .;<br />

_X_DATA_ADDR = .;<br />

# Place rest of the data into Internal Data RAM<br />

* (.data)<br />

* (fp_state.data)<br />

* (rtlib.data)<br />

F_Xdata_ROMtoRAM_length = . - _X_DATA_ADDR;<br />

} > .xIntRAM_Mirror<br />

#*******************************************************************************<br />

.DataForProgramRAM :<br />

{<br />

# allocates space for .InitializedDataForProgramRAM section<br />

. = (ADDR(.pIntRAM_Mirror) + SIZEOF(.pIntRAM_Mirror) / 2) + 1;<br />

# Define variables for C initialization code of Program RAM bss<br />

3-32 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Memory Configuration<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

F_Pbss_start_addr = .;<br />

_P_BSS_ADDR = .;<br />

# <strong>SDK</strong> uninitialized data to be placed into Program RAM<br />

pramdata.c (.bss)<br />

F_Pbss_length = . - _P_BSS_ADDR;<br />

} > .pIntRAM<br />

#*******************************************************************************<br />

.DataForDataRAM :<br />

{<br />

# allocates space for .ApplicationInitializedData section<br />

. = (ADDR(.xIntRAM_Mirror) + SIZEOF(.xIntRAM_Mirror) / 2);<br />

# Define variables for C initialization code<br />

F_Xbss_start_addr = .;<br />

_X_BSS_ADDR = .;<br />

# .bss sections<br />

* (rtlib.bss.lo)<br />

* (.bss)<br />

F_Xbss_length = . - _X_BSS_ADDR;<br />

} > .xIntRAM<br />

#*******************************************************************************<br />

}<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

FArchIO = ADDR(.xPeripherals);<br />

FArchCore = ADDR(.xCoreRegisters);<br />

MOTOROLA Target Configuration for DSP56F80x<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

3-33<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Target Configuration for DSP56F80x<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3.2.4.2 Linking: Set Up Memory Partitions<br />

Using memory directives in the Linker Command File, the DSP56F801 and DSP56802 are set up<br />

to use Internal Program RAM and Program Flash for code and any data that must be put into<br />

Program memory, as well as to use a combination of Data Flash and Internal Data RAM for<br />

initialized and uninitialized data.<br />

application.o Program Flash<br />

data<br />

bss<br />

text<br />

appconfig.o<br />

data<br />

bss<br />

text<br />

appconst.o<br />

data<br />

bss<br />

text<br />

config.o<br />

data<br />

bss<br />

text<br />

const.o<br />

data<br />

bss<br />

text<br />

pramdata.o<br />

data<br />

bss<br />

text<br />

vector.o<br />

data<br />

bss<br />

text<br />

<strong>SDK</strong> Libraries<br />

data<br />

bss<br />

text<br />

CW Run-Time Libs<br />

data<br />

bss<br />

text<br />

Program Int. RAM<br />

Data Int. RAM<br />

Used by<br />

CodeWarrior<br />

Data Flash<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

.pInterruptVector<br />

.pFlash<br />

.pIntRAM<br />

.pIntRAM_Mirror<br />

.xAvailable<br />

Software Stack .xStack<br />

.xCWRegisters<br />

.xIntRAM<br />

.xIntRAM_Mirror<br />

.xFlash<br />

Linker<br />

Command<br />

File<br />

Step 1<br />

MEMORY {<br />

.pInterruptVector (RX) : ORIGIN = Ox0000, LENGTH = 0x0086<br />

.pFlash (RX) : ORIGIN = 0x0086, LENGTH = 0x1F7A<br />

.pIntRAM (RWX): ORIGIN = 0x7C00, LENGTH = 0x0400<br />

{ .pIntRAM_Mirror (RWX): ORIGIN = 0x7C00, LENGTH = 0x0400<br />

.pBootFlash (RX) : ORIGIN = 0x8000, LENGTH = 0x0800<br />

.pReserved (RX) : ORIGIN = 0x8800, LENGTH = 0x7800<br />

.xAvailable (RW) : ORIGIN = 0x0000, LENGTH = 0x0030<br />

.xCWRegisters (RW) : ORIGIN = 0x0030, LENGTH = 0x0010<br />

.xIntRAM (RW) : ORIGIN = 0x0040, LENGTH = 0x02C0<br />

{ .xIntRAM_Mirror (RW) : ORIGIN = 0x0040, LENGTH = 0x02C0<br />

.xStack (RW) : ORIGIN = 0x0300, LENGTH = 0x0100<br />

.xReserved1 (R) : ORIGIN = 0x0400, LENGTH = 0x0800<br />

.xPeripherals (RW) : ORIGIN = 0x0C00, LENGTH = 0x0400<br />

.xFlash (R) : ORIGIN = 0x1000, LENGTH = 0x0800<br />

.xReserved2 (R) : ORIGIN = 0x1800, LENGTH = 0x0800<br />

.xExtRAM (R) : ORIGIN = 0x2000, LENGTH = 0xDF80<br />

.xCoreRegisters (RW) : ORIGIN = 0xFF80, LENGTH = 0x0080<br />

}<br />

Figure 3-5. Set Up DSP56F801/802 Memory Partitions<br />

3-34 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Memory Configuration<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3.2.4.3 Linking: Initialized Data for Data RAM<br />

Linking initialized data for Data RAM is one of the major differences between the memory<br />

configuration example in the Programmer’s Guide and internal memory configuration for the<br />

DSP56F801 and DSP56F802 platforms. In this example, values for the initialized data for Data<br />

RAM are placed into Data Flash (not Program Flash, as in the Programmer’s Guide).<br />

application.o<br />

data<br />

bss<br />

appconfig.o<br />

data<br />

bss<br />

appconst.o<br />

bss<br />

config.o<br />

data<br />

bss<br />

const.o<br />

bss<br />

pramdata.o<br />

bss<br />

vector.o<br />

data<br />

bss<br />

<strong>SDK</strong> Libraries<br />

data<br />

bss<br />

CW Run-Time Libs<br />

data<br />

bss<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Program Flash<br />

Interrupt Vector<br />

Code<br />

Program Data<br />

Values<br />

Program Int. RAM<br />

Program Data<br />

Symbols<br />

Data Int. RAM<br />

Used by<br />

CodeWarrior<br />

Software Stack .xStack<br />

Data Flash<br />

Const Data<br />

.pInterruptVector<br />

.pFlash<br />

.pIntRAM<br />

.pIntRAM_Mirror<br />

.xAvailable<br />

.xCWRegisters<br />

.xIntRAM<br />

.xIntRAM_Mirror<br />

.xFlash<br />

Symbols<br />

located<br />

here<br />

Values<br />

located<br />

here<br />

Linker<br />

Command<br />

File<br />

Step 7<br />

.ApplicationInitializedData : AT (ADDR(.xFlash) + 1 +<br />

SIZEOF(.xFlash) / 2)<br />

{<br />

F_Xdata_start_addr_in_ROM = ADDR(.xFlash) + 1 +<br />

SIZEOF(.pFlash)/2;<br />

F_StackAddr = ADDR(.xStack)<br />

F_StackEndAddr = ADDR(xStack) +<br />

SIZEOF(.xStack) / 2 - 1;<br />

F_Xdata_start_addr_in_RAM = .;<br />

_X_DATA_ADDR = .;<br />

* (.data)<br />

* (fp_state.data)<br />

* (rtlib.data)<br />

F_Xdata_ROMtoRAM_lentgh = . - _X_DATA_ADDR;<br />

} > .xIntRAM_Mirror<br />

Figure 3-6. Linking: Initialized Data for Data RAM<br />

MOTOROLA Target Configuration for DSP56F80x<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

3-35<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Target Configuration for DSP56F80x<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3.2.4.4 Programming Target Memory<br />

Figure 3-7 demonstrates how an executable file (configured for internal memory operation) will<br />

be mapped into physical memory on the DSP56F801 and DSP56F802 targets.<br />

Program Flash<br />

Interrupt Vector<br />

Code<br />

Program Data<br />

Values<br />

Program Int. RAM<br />

Program Data<br />

Symbols<br />

Program<br />

Unitialized Data<br />

Data Int. RAM<br />

Used by<br />

CodeWarrior<br />

Data Symbols<br />

Uninitialized Data<br />

Software Stack<br />

Data Flash<br />

Const Data<br />

Data Values<br />

Application.elf (Application.elf.S)<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Load<br />

DSP56F801<br />

Memory<br />

(Using<br />

CodeWarrior<br />

Tools or Serial<br />

Bootloader)<br />

Program Memory<br />

Boot Flash<br />

Data Memory<br />

Reserved<br />

Peripherals<br />

External RAM<br />

Figure 3-7. Programming Target Memory<br />

Core Registers 0xFF80 - 0xFFFF<br />

3-36 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Flash<br />

Reserved<br />

RAM<br />

Boot Flash<br />

Reserved<br />

RAM<br />

Flash<br />

Reserved<br />

DSP56F801/802 Memory<br />

0x0000 - 0x0003<br />

0x0004 - 0x1FFF<br />

0x2000 - 0x7BFF<br />

0x7C00 - 0x7FFF<br />

0x8000 - 0x87FF<br />

0x8800 - 0xFFFF<br />

0x0000 - 0x03FF<br />

0x0400 - 0x0BFF<br />

0x0C00 - 0x0FFF<br />

0x1000 - 0x17FF<br />

0x1800 - 0x1FFF<br />

0x2000 - 0xFF7F<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Memory Configuration<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3.2.5 Internal (Flash) Memory Operation for DSP56F803 and<br />

DSP56F805<br />

Section 6.3, Memory Configuration, in the Programmer’s Guide explains and shows an<br />

example of memory configuration using the Linker Command File for internal memory operation<br />

for the DSP56F803 and DSP56F805 platforms.<br />

3.2.6 Internal (Flash) Memory Operation for DSP56F807<br />

Section 6.3 in the Programmer’s Guide gives an explanation and an example of memory<br />

configuration using the Linker Command File. The current chapter documents only the<br />

differences that are specific to the DSP56F807 platform.<br />

3.2.6.1 Linker Command File<br />

# Linker.cmd file for DSP56F807EVM<br />

# using internal data memory only ( EX = 0, Boot Mode 0A )<br />

#*******************************************************************************<br />

MEMORY {<br />

.pInterruptVector (RX) : ORIGIN = 0x0000, LENGTH = 0x0086<br />

.pFlash (RX) : ORIGIN = 0x0086, LENGTH = 0xEF7A<br />

.pIntRAM (RWX) : ORIGIN = 0xF000, LENGTH = 0x0800<br />

.pIntRAM_Mirror (RWX) : ORIGIN = 0xF000, LENGTH = 0x0800<br />

.pBootFlash (RX) : ORIGIN = 0xF800, LENGTH = 0x0800<br />

.xAvailable (RW) : ORIGIN = 0x0000, LENGTH = 0x0030<br />

.xCWRegisters (RW) : ORIGIN = 0x0030, LENGTH = 0x0010<br />

.xIntRAM (RW) : ORIGIN = 0x0040, LENGTH = 0x0E60<br />

.xIntRAM_Mirror (RWX) : ORIGIN = 0x0040, LENGTH = 0x0E60<br />

.xStack (RW) : ORIGIN = 0x0EA0, LENGTH = 0x0160<br />

.xPeripherals (RW) : ORIGIN = 0x1000, LENGTH = 0x0800<br />

.xReserved (R) : ORIGIN = 0x1800, LENGTH = 0x0800<br />

.xFlash (R) : ORIGIN = 0x2000, LENGTH = 0x2000<br />

.xExtRAM (R) : ORIGIN = 0x4000, LENGTH = 0xBF80<br />

.xCoreRegisters (RW) : ORIGIN = 0xFF80, LENGTH = 0x0080<br />

}<br />

#*******************************************************************************<br />

FORCE_ACTIVE {FconfigInterruptVector}<br />

SECTIONS {<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

#*******************************************************************************<br />

.ApplicationInterruptVector :<br />

{<br />

vector.c (.text)<br />

} > .pInterruptVector<br />

#*******************************************************************************<br />

.ApplicationCode :<br />

{<br />

# Place all code into Program Flash<br />

* (.text)<br />

MOTOROLA Target Configuration for DSP56F80x<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

3-37<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Target Configuration for DSP56F80x<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

* (rtlib.text)<br />

* (fp_engine.text)<br />

* (user.text)<br />

} > .pFlash<br />

#*******************************************************************************<br />

.InitializedDataForProgramRAM : AT (ADDR(.pFlash)+1+SIZEOF(.pFlash) / 2)<br />

{<br />

# Define variables for C initialization code of Program RAM data<br />

F_Pdata_start_addr_in_ROM = ADDR(.pFlash)+1 + SIZEOF(.pFlash) / 2;<br />

F_Pdata_start_addr_in_RAM = .;<br />

_P_DATA_ADDR = .;<br />

# <strong>SDK</strong> initialized data to be placed into Program RAM<br />

pramdata.c (.data)<br />

F_Pdata_ROMtoRAM_length = . - _P_DATA_ADDR;<br />

} > .pIntRAM_Mirror<br />

#*******************************************************************************<br />

.InitializedConstData :<br />

{<br />

const.c (.data)<br />

appconst.c (.data)<br />

} > .xFlash<br />

#*******************************************************************************<br />

.ApplicationInitialzedData : AT (ADDR(.pFlash) + 1 + SIZEOF(.pFlash) / 2 +<br />

SIZEOF(.pIntRAM_Mirror) / 2 + 1 )<br />

{<br />

# Define variables for C initialization code<br />

F_Xdata_start_addr_in_ROM = ADDR(.pFlash) + 1 + SIZEOF(.pFlash) /<br />

2 + SIZEOF(.pIntRAM_Mirror) / 2 + 1;<br />

F_StackAddr = ADDR(.xStack);<br />

F_StackEndAddr = ADDR(.xStack)+SIZEOF(.xStack) / 2 - 1;<br />

F_Xdata_start_addr_in_RAM = .;<br />

_X_DATA_ADDR = .;<br />

# Place rest of the data into Internal Data RAM<br />

* (.data)<br />

* (fp_state.data)<br />

* (rtlib.data)<br />

F_Xdata_ROMtoRAM_length = . - _X_DATA_ADDR;<br />

} > .xIntRAM_Mirror<br />

#*******************************************************************************<br />

.DataForProgramRAM :<br />

{<br />

# allocates space for .InitializedDataForProgramRAM section<br />

. = (ADDR(.pIntRAM_Mirror) + SIZEOF(.pIntRAM_Mirror) / 2) + 1;<br />

# Define variables for C initialization code of Program RAM bss<br />

F_Pbss_start_addr = .;<br />

3-38 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Memory Configuration<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

_P_BSS_ADDR = .;<br />

# <strong>SDK</strong> uninitialized data to be placed into Program RAM<br />

pramdata.c (.bss)<br />

F_Pbss_length = . - _P_BSS_ADDR;<br />

} > .pIntRAM<br />

#*******************************************************************************<br />

.DataForDataRAM :<br />

{<br />

# allocates space for .ApplicationInitializedData section<br />

. = (ADDR(.xIntRAM_Mirror) + SIZEOF(.xIntRAM_Mirror) / 2);<br />

# Define variables for C initialization code<br />

F_Xbss_start_addr = .;<br />

_X_BSS_ADDR = .;<br />

# .bss sections<br />

* (rtlib.bss.lo)<br />

* (.bss)<br />

F_Xbss_length = . - _X_BSS_ADDR;<br />

} > .xIntRAM<br />

#*******************************************************************************<br />

FArchIO = ADDR(.xPeripherals);<br />

FArchCore = ADDR(.xCoreRegisters);<br />

}<br />

MOTOROLA Target Configuration for DSP56F80x<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

3-39<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Target Configuration for DSP56F80x<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3.2.6.2 Linking: Set Up Memory Partitions<br />

Using memory directives in the Linker Command File, the DSP56F807 is set up to use Internal<br />

Program RAM and Program Flash for code and for any data that must be put into Program<br />

memory, as well as to use a combination of Data Flash and Internal Data RAM for initialized and<br />

uninitialized data. See Figure 3-8.<br />

application.o Program Flash<br />

data<br />

bss<br />

text<br />

appconfig.o<br />

data<br />

bss<br />

text<br />

appconst.o<br />

data<br />

bss<br />

text<br />

config.o<br />

data<br />

bss<br />

text<br />

const.o<br />

data<br />

bss<br />

text<br />

pramdata.o<br />

data<br />

bss<br />

text<br />

vector.o<br />

data<br />

bss<br />

text<br />

<strong>SDK</strong> Libraries<br />

data<br />

bss<br />

text<br />

CW Run-Time Libs<br />

data<br />

bss<br />

text<br />

Program Int. RAM<br />

Data Int. RAM<br />

Used by<br />

CodeWarrior<br />

Data Flash<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

.pInterruptVector<br />

.pFlash<br />

.pIntRAM<br />

.pIntRAM_Mirror<br />

.xAvailable<br />

Software Stack .xStack<br />

.xCWRegisters<br />

.xIntRAM<br />

.xIntRAM_Mirror<br />

.xFlash<br />

Linker<br />

Command<br />

File<br />

Step 1<br />

MEMORY {<br />

.pInterruptVector (RX) : ORIGIN = 0x0000, LENGTH = 0x0086<br />

.pFlash (RX) : ORIGIN = 0x0086, LENGTH = 0xEF7A<br />

.pIntRAM (RWX): ORIGIN = 0xF000, LENGTH = 0x0800<br />

{ .pIntRAM_Mirror (RWX): ORIGIN = 0xF000, LENGTH = 0x0800<br />

.pBootFlash (RX) : ORIGIN = 0xF800, LENGTH = 0x0800<br />

.xAvailable (RW) : ORIGIN = 0x0000, LENGTH = 0x0030<br />

.xCWRegisters (RW) : ORIGIN = 0x0030, LENGTH = 0x0010<br />

.xIntRAM (RW) : ORIGIN = 0x0040, LENGTH = 0x0E60<br />

{ .xIntRAM_Mirror (RWX): ORIGIN = 0x0040, LENGTH = 0x0E60<br />

.xStack (RW) : ORIGIN = 0x0EA0, LENGTH = 0x0160<br />

.xPeripherals (RW) : ORIGIN = 0x1000, LENGTH = 0x0800<br />

.xReserved (R) : ORIGIN = 0x1800, LENGTH = 0x0800<br />

.xFlash (R) : ORIGIN = 0X2000, LENGTH = 0X2000<br />

.xExtRAM (R) : ORIGIN = 0x4000, LENGTH = 0xBF80<br />

.xCoreRegisters (RW) : ORIGIN = 0xFF80, LENGTH = 0x0080<br />

}<br />

Figure 3-8. Set Up DSP56F807 Memory Partitions<br />

3-40 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Memory Configuration<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3.2.6.3 Programming Target Memory<br />

Figure 3-9 demonstrates how an executable file (configured for internal memory operation) will<br />

be mapped into physical memory on the DSP56F807 target.<br />

Program Flash<br />

Interrupt Vector<br />

Code<br />

Program Data<br />

Values<br />

Data Values<br />

Program Int. RAM<br />

Program Data<br />

Symbols<br />

Program<br />

Unitialized Data<br />

Data Int. RAM<br />

Used by<br />

CodeWarrior<br />

Data Symbols<br />

Uninitialized Data<br />

Software Stack<br />

Data Flash<br />

Const Data<br />

Application.elf (Application.elf.S)<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Load<br />

DSP56F807<br />

Memory<br />

(Using<br />

CodeWarrior<br />

Tools or Serial<br />

Bootloader)<br />

Program Memory<br />

Boot Flash<br />

Data Memory<br />

Peripherals<br />

Reserved<br />

External RAM<br />

Figure 3-9. Programming Target Memory<br />

Core Registers 0xFF80 - 0xFFFF<br />

MOTOROLA Target Configuration for DSP56F80x<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

3-41<br />

Flash<br />

RAM<br />

Boot Flash<br />

RAM<br />

Flash<br />

DSP56F807 Memory Map<br />

0x0000 - 0x0003<br />

0x0004 - 0xEFFF<br />

0xF000 - 0xF7FF<br />

0xF800 - 0xFFFF<br />

0x0000 - 0x0FFF<br />

0x1000 - 0x17FF<br />

0x1800 - 0x1FFF<br />

0x2000 - 0x3FFF<br />

0x4000 - 0xFF7F<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Target Configuration for DSP56F80x<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3.3 DSP56F80x Boot Sequence Configuration<br />

As explained in the Programmer’s Guide, the <strong>SDK</strong> supports initialization and load of executable<br />

applications by providing a portion of code located at a specific location in memory to which the<br />

processor will always jump on reset or power-up. This code sets the processor in a specific state,<br />

initializes memory, enables and configures user-specified device drivers, and then passes control<br />

to the user’s application code. For the DSP56F80x platform, the <strong>SDK</strong> has two different Boot<br />

sequence configurations: Start-up Sequence Without Bootloader and Start-up Sequence with<br />

Bootloader.<br />

3.3.1 Start-up Sequence Without Bootloader<br />

Power-up/Reset<br />

0x0000<br />

0x0001<br />

0x0002<br />

0x0003<br />

0x0080<br />

0x0081<br />

0x0082<br />

0x0083<br />

0x0084<br />

0x0085<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Program Memory<br />

JSR<br />

ArchStart( )<br />

JSR<br />

Interrupt1( )<br />

JSR<br />

Interrupt2( )<br />

.<br />

.<br />

.<br />

.<br />

.<br />

.<br />

JSR<br />

Interrupt63( )<br />

R e s e r v e d<br />

.<br />

.<br />

.<br />

.pInterruptVector<br />

ArchStart( )<br />

{<br />

. . .<br />

}<br />

Figure 3-10. DSP56F80x Boot Sequence without Bootloader<br />

3-42 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

1<br />

arch.c<br />

2<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F80x Boot Sequence Configuration<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3.3.1.1 Step 1: Power-up/Reset<br />

The DSP56800 core specifies two reset vectors: Hardware Reset and COP Reset (normally<br />

located at addresses 0x0 and 0x2, respectively). The Hardware Reset vector identifies the address<br />

that the processor accesses once it recognizes a power-up or power reset. All applications<br />

developed with the <strong>SDK</strong> will have a default entry point, archStart() (see system file<br />

\<strong>SDK</strong>\src\dsp568xx\nos\sys\arch.c). The address of this routine is placed into the Hardware<br />

Reset vector location via the Interrupt Vector table located in the vector.c configuration file.<br />

3.3.1.2 Step 2: Start-up Code<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Once execution of archStart() begins, the boot-up process is the same as the process described in<br />

Section 6.4, Boot Sequence Configuration, in the Programmer’s Guide.<br />

NOTE: Program memory locations from 0x0080 through 0x0085 are reserved for Bootloader<br />

compatibility. This means that any application that uses the configuration for <strong>SDK</strong><br />

Internal (Flash) Memory Operation will be compatible with a boot-up process which<br />

may or may not contain the DSP56F80x bootloader.<br />

3.3.2 Start-up Sequence with Bootloader<br />

For a detailed description of the DSP56F80x bootloader, see Chapter 9, Chapter 10, Chapter 11<br />

and Chapter 12 of this manual.<br />

MOTOROLA Target Configuration for DSP56F80x<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

3-43<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Target Configuration for DSP56F80x<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Power-up/Reset<br />

0x0000<br />

0x0001<br />

0x0002<br />

0x0003<br />

0x0080<br />

0x0081<br />

0x0082<br />

0x0083<br />

0x0084<br />

0x0085<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Program Memory<br />

JSR<br />

bootArchStart( )<br />

JSR<br />

bootCOPInterrupt( )<br />

JSR<br />

Interrupt2( )<br />

.<br />

.<br />

.<br />

.<br />

.<br />

.<br />

JSR<br />

Interrupt63( )<br />

JSR<br />

archStart( )<br />

JSR<br />

Interrupt1( )<br />

Reserved by<br />

Bootloader<br />

.<br />

.<br />

.<br />

.pInterruptVector<br />

bootArchStart( )<br />

{<br />

. . .<br />

/*Start User Application*/<br />

. . .<br />

}<br />

Figure 3-11. DSP56F80x Boot Sequence with Bootloader<br />

3-44 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

1<br />

2<br />

archStart( )<br />

{<br />

. . .<br />

}<br />

arch.c<br />

Bootloader<br />

3<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F80x Boot Sequence Configuration<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3.3.2.1 Step 1: Power-up/Reset<br />

The DSP56800 core specifies two reset vectors: Hardware Reset and COP Reset (normally<br />

located at addresses 0x0 and 0x2, respectively). The Hardware Reset vector identifies the address<br />

that the processor accesses once it recognizes a power-up or power reset. When the DSP56F80x<br />

bootloader is present, it controls this address by placing a bootloader entry point into the<br />

Hardware Reset vector location.<br />

3.3.2.2 Step 2: Transition to Application’s Entry Point<br />

When the DSP56F80x bootloader completes its execution (see Section 9.5, Section 10.16,<br />

Section 11.16, and Section 12.16 for more information about bootloader execution), it transfers<br />

control to the user’s application by performing a JSR instruction to an address specified in<br />

memory location 0x0081. All applications developed with the <strong>SDK</strong> will have a default entry<br />

point, archStart() (see system file \<strong>SDK</strong>\src\dsp568xx\nos\sys\arch.c). The address of this<br />

routine is placed into the 0x0081 location via the Interrupt Vector table located in the vector.c<br />

configuration file.<br />

3.3.2.3 Step 3: Start-up Code<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Once the execution of archStart() begins, the boot-up process is the same as the process described<br />

in Section 6.4, Boot Sequence Configuration, in the Programmer’s Guide.<br />

MOTOROLA Target Configuration for DSP56F80x<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

3-45<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Target Configuration for DSP56F80x<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3.4 Clock (PLL) Configuration<br />

<strong>SDK</strong> provides a fast and easy way to configure DSP56F80x clocks. By modifying <strong>SDK</strong> default<br />

configuration parameters, a user can change the clock frequency for the DSP56F80x core and<br />

peripherals.<br />

Figure 3-12 shows the <strong>SDK</strong> configuration parameters available to a user.<br />

OSC_CLOCK<br />

8MHz Typ.<br />

EXTAL<br />

Crystal<br />

Osc.<br />

XTAL<br />

Relaxation<br />

Osc. (801)<br />

*Divided by (PLLDB + 1)<br />

VCO<br />

PH<br />

COMP<br />

Figure 3-12. <strong>SDK</strong> Clock Configuration for DSP56F80x<br />

BSP_OSCILLATOR_FREQ defines the frequency of the external oscillator and is located in the<br />

config.h configuration file.<br />

PLL_CLOCK_IN_DIVIDE_BY_X defines a value of the PLL prescaler, and can be set to:<br />

• PLL_CLOCK_IN_DIVIDE_BY_1<br />

• PLL_CLOCK_IN_DIVIDE_BY_2<br />

• PLL_CLOCK_IN_DIVIDE_BY_4<br />

• PLL_CLOCK_IN_DIVIDE_BY_8<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

(PLLCID bits)<br />

Prescaler<br />

div. by 1,2,4,8<br />

EXTAL_CLK<br />

PLL<br />

Div.<br />

by<br />

*<br />

FOUT<br />

Div.<br />

by<br />

2<br />

FOUT/2<br />

(PLLCOD bits)<br />

Postscaler<br />

div. by 1,2,4,8<br />

3-46 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Loss of<br />

Lock<br />

Loss of<br />

Clock<br />

Sync<br />

MUX<br />

Typ.<br />

IRQ<br />

80MHz<br />

IRQ ZCLK,<br />

COP<br />

SIM<br />

56800<br />

DSP<br />

Core<br />

en<br />

COP<br />

IRQ<br />

IP_Bus<br />

Bridge<br />

div. by 2<br />

CPU_FREQ = (BSP_OSCILLATOR_FREQ * PLL_MUL) / (2 * PLL_CLOCK_OUT_DIVIDE_X)<br />

PERIPHERALS_FREQ =<br />

<strong>SDK</strong><br />

Configures<br />

These<br />

CPU_FREQ<br />

2<br />

40MHz Typ. IP_BUS CLOCK<br />

Peripheral<br />

Peripheral<br />

Peripheral<br />

CAN<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Clock (PLL) Configuration<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

PLL_CLOCK_OUT_DIVIDE_BY_X defines a value of the PLL postscaler, and can be set to:<br />

• PLL_CLOCK_OUT_DIVIDE_BY_1<br />

• PLL_CLOCK_OUT_DIVIDE_BY_2<br />

• PLL_CLOCK_OUT_DIVIDE_BY_4<br />

• PLL_CLOCK_OUT_DIVIDE_BY_8<br />

PLL_MUL can be any number in the range from 0 to 127.<br />

Application developers can use these configuration parameters to select desired CPU speeds. For<br />

example, to set CPU speed to 18Mhz, use the equation from Figure 3-12, and redefine default<br />

configuration parameters (from config.h) in the appconfig.h as follows:<br />

Code Example 3-45. appconfig.h file<br />

#define PLL_MUL 18<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

#define PLL_DIVIDE_BY_REG (( PLL_MUL - 1 ) \<br />

| PLL_CLOCK_IN_DIVIDE_BY_1)<br />

| PLL_CLOCK_OUT_DIVIDE_BY_4)<br />

In this example, BSP_OSCILLATOR_FREQ (with default value set to 8000000 in the config.h),<br />

PLL_MUL (with user set value of 18 in the appconfig.h), PLL_CLOCK_IN_DIVIDE_BY_1, and<br />

PLL_CLOCK_OUT_DIVIDE_BY_4 are used to define the CPU clock to 8000000 / 1 * 18 / 2 / 4<br />

= 18000000Hz.<br />

NOTE: The default <strong>SDK</strong> setting for the CPU clock is 72MHz (BSP_OSCILLATOR_FREQ =<br />

8000000, PLL_MUL = 18, PLL_CLOCK_IN_DIVIDE_BY_1,<br />

PLL_CLOCK_OUT_DIVIDE_BY_1)<br />

MOTOROLA Target Configuration for DSP56F80x<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

3-47<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Target Configuration for DSP56F80x<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3-48 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Chapter 4<br />

Interrupt Processing for the<br />

DSP56F80x<br />

This section describes specifically how to use the <strong>SDK</strong> toimplement interrupts on the<br />

DSP56F80x. Please refer to the Programmer’s Guide for a high-level description of interrupts<br />

for the DSP568xx family.<br />

4.1 Interrupt Dispatcher<br />

The <strong>SDK</strong> for DSP56F80x platforms comes with interrupt dispatchers that provide normal and fast<br />

context saves.<br />

4.1.1 Super Fast Interrupt Dispatcher<br />

A super fast interrupt dispatcher is not required, since the interrupt dispatcher is bypassed<br />

altogether when using a super fast ISR.<br />

4.1.2 Fast Interrupt Dispatcher<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The fast interrupt dispatcher provides limited context saving, therefore decreasing the ISR<br />

overhead (interrupt latency). The registers saved are: n, a0, a1, a2, b0, b1, b2, x0, y0, y1, r0, r1, r2,<br />

r3, la, lc. The temporary register file used by the compiler (x:0x30 to x:0x3f) and the hardware<br />

stack are not saved, nor is the state of the various registers (OMR and m01) set, as in the Normal<br />

Interrupt Dispatcher. After saving the registers, the fast interrupt dispatcher jumps to the fast ISR.<br />

The amount of overhead when using the <strong>SDK</strong> fast interrupt dispatcher for the DSP56F80x is<br />

shown in Table 4-1.<br />

4.1.3 Normal Interrupt Dispatcher<br />

The normal interrupt dispatcher saves all registers (n, a0, a1, a2, b0, b1, b2, x0, y0, y1, r0, r1, r2,<br />

r3, omr, la, m01, lc); saves the hardware stack; saves the temporary register file used by the<br />

compiler (x:0x30 to x:0x3f); sets the modifier register (m01) to -1 (linear arithmetic); sets<br />

convergent rounding, no saturation mode, and 32-bit compares in the OMR; and then jumps to the<br />

installed ISR.<br />

MOTOROLA Interrupt Processing for the DSP56F80x<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

4-1<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Interrupt Processing for the DSP56F80x<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The amount of overhead when using the <strong>SDK</strong> normal interrupt dispatcher for the DSP56F80x is<br />

shown in Table 4-1.<br />

4.1.4 <strong>SDK</strong> ISR Overhead<br />

Table 4-1 and Table 4-2 provide the number of instructions and clock cycles that the super fast,<br />

fast, and normal interrupt dispatchers require when they are executing from internal and external<br />

program memory. For the values below, the clock cycles for the initial JSR instruction to the ISR<br />

and the RTI instruction are not included, because they are the same for each type of ISR and are<br />

not actually part of the <strong>SDK</strong> ISR overhead. They are due to the hardware overhead in dealing with<br />

interrupts. The initial JSR instruction takes 12 clock cycles and the RTI takes 10 clock cycles.<br />

Table 4-1. <strong>SDK</strong> ISR Overhead for DSP56F80x (running from internal memory)<br />

Program Code - Internal Memory<br />

<strong>SDK</strong> ISR Overhead from the point when the<br />

DSP allows the interrupt to the point where<br />

interrupts of higher priority are unmasked<br />

<strong>SDK</strong> ISR Overhead from the point when the<br />

DSP allows the interrupt to the start of User ISR<br />

<strong>SDK</strong> ISR Overhead from the end of User ISR to<br />

the point where the Interrupt Dispatcher returns<br />

to the User Code<br />

Super<br />

Fast<br />

Interrupt Dispatcher<br />

Instructions<br />

Fast Normal<br />

Interrupt Dispatcher Clock<br />

Cycles<br />

Super<br />

Fast<br />

Fast Normal<br />

N/A 21 21 N/A 68 66<br />

0 41 66 0 128 178<br />

0 19 41 0 40 84<br />

Table 4-2. <strong>SDK</strong> ISR Overhead for DSP56F80x (running from external memory)<br />

Program Code - External Memory<br />

<strong>SDK</strong> ISR Overhead from the point when the<br />

DSP allows the interrupt to the point where<br />

interrupts of higher priority are unmasked<br />

<strong>SDK</strong> ISR Overhead from the point when the<br />

DSP allows the interrupt to the start of User ISR<br />

<strong>SDK</strong> ISR Overhead from the end of User ISR to<br />

the point where the Interrupt Dispatcher returns<br />

to the User Code<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Super<br />

Fast<br />

Interrupt Dispatcher<br />

Instructions<br />

Fast Normal<br />

Interrupt Dispatcher Clock<br />

Cycles<br />

Super<br />

Fast<br />

Fast Normal<br />

N/A 21 21 N/A 80 82<br />

0 41 66 0 168 250<br />

0 19 41 0 74 142<br />

4-2 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Nested Interrupts<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

4.1.5 <strong>SDK</strong> ISR Stack Requirements<br />

Table 4-3 provides the stack size requirements for the super fast, fast, and normal interrupt<br />

dispatchers. Note that these numbers include the two words required for the initial ISR from the<br />

interrupt vector table.<br />

Calculating the overall amount of software stack consumed by ISRs depends on the number of<br />

nested ISRs, the type of ISR (normal, fast, or super fast), and the size of the ISRs. Once you have<br />

this number, you must account for the maximum software stack consumed by your application,<br />

which can be very complicated. To simplify calculating the software stack, the <strong>SDK</strong> offers a<br />

“stackcheck” capability to allow you to determine how much stack your application (including<br />

ISRs) uses. See Section 5.2.2 of the Programmer’s Guide for more information.<br />

4.2 Nested Interrupts<br />

Nested interrupts are supported by the <strong>SDK</strong> for the DSP56F80x since it has an IP Bus Interrupt<br />

Controller (ITCN). The interrupt priority (GPR_INT_PRIORITY_XX) for each interrupt must be<br />

defined to be between 0 and 7, with 7 the highest priority. If any interrupt is defined to have a<br />

priority greater than 1, then the configuration data used by the <strong>SDK</strong> Interrupt Dispatcher will be<br />

conditionally compiled to enable nested interrupts. Code Example 4-1 shows how nesting might<br />

be turned on and off.<br />

Code Example 4-1. Example appconfig.h<br />

/*****************************************************************************<br />

/* Make ButtonB_ISRs visible */<br />

extern void ButtonB_NormalISR(void);<br />

extern void ButtonB_FastISR(void);<br />

extern void ButtonB_SuperFastISR(void);<br />

extern void ButtonB_NestedSuperFastISR(void);<br />

#define NO 1<br />

#define YES 2<br />

//#define USE_NESTED_INTERRUPTS NO<br />

#define USE_NESTED_INTERRUPTS YES<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Table 4-3. <strong>SDK</strong> ISR Stack Requirements for DSP56F80x<br />

Interrupt Dispatcher<br />

Software Stack Size Consumed<br />

by <strong>SDK</strong> (words)<br />

Super Fast 2<br />

Fast 24<br />

Normal 38<br />

#if USE_NESTED_INTERRUPTS == YES /* Placeholder only, IRQA,B bypasses ICTN */<br />

MOTOROLA Interrupt Processing for the DSP56F80x<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

4-3<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Interrupt Processing for the DSP56F80x<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

#define GPR_INT_PRIORITY_8 1 /* Setup IRQA button ISR priority */<br />

#define GPR_INT_PRIORITY_9 2 /* Setup IRQB button ISR priority */<br />

#elif USE_NESTED_INTERRUPTS == NO<br />

#define GPR_INT_PRIORITY_8 1 /* Setup IRQA button ISR priority */<br />

#define GPR_INT_PRIORITY_9 1 /* Setup IRQB button ISR priority */<br />

#endif<br />

#define NORMAL 1<br />

#define FAST 2<br />

#define SFAST 3<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

//#define BUTTONB_ISR_TYPE NORMAL /* Normal ISR - full context saving */<br />

//#define BUTTONB_ISR_TYPE FAST /* Fast ISR - Some context saving */<br />

#define BUTTONB_ISR_TYPE SFAST /* Super Fast ISR - no context savings */<br />

#if BUTTONB_ISR_TYPE == NORMAL<br />

#define NORMAL_ISR_9 ButtonB_NormalISR<br />

#elif BUTTONB_ISR_TYPE == FAST<br />

#define FAST_ISR_9 ButtonB_FastISR<br />

#elif BUTTONB_ISR_TYPE == SFAST<br />

#if USE_NESTED_INTERRUPTS == YES<br />

#define INTERRUPT_VECTOR_ADDR_9 ButtonB_NestedSuperFastISR<br />

#else<br />

#define INTERRUPT_VECTOR_ADDR_9 ButtonB_SuperFastISR<br />

#endif<br />

#endif<br />

******************************************************************************/<br />

Because Super Fast interrupts bypass the interrupt dispatcher, there is an additional step required<br />

to implement interrupt nesting for Super Fast interrupts. Explicit calls to<br />

archEnterNestedInterruptCommon and archExitNestedInterruptCommon must be added to the<br />

code of the Super Fast interrupt, as shown in Code Example 4-2.<br />

Code Example 4-2. Additions to Code for Super Fast Interrupt<br />

/*****************************************************************************/<br />

This example provides a template for implementing nested superfast ISRs.<br />

The code is split into two parts (ISR and core) to minimize the delay in<br />

re-enabling ISRs and to allow use of C code (with pragma interrupt) for<br />

the core (or body) of the ISR.<br />

*/<br />

EXPORT void ButtonB_NestedSuperFastISR(void);<br />

EXPORT void ButtonB_NSFISR_Core(void);<br />

asm void ButtonB_NestedSuperFastISR(void)<br />

{<br />

lea (SP)+ ; Push registers used<br />

move N,x:(SP) ; to save context.<br />

4-4 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

}<br />

Interrupt Priorities<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

move #9,N ; store IrqB index as argument<br />

jsr archEnterNestedInterruptCommon ; Implement nesting<br />

;Put your assembly code here, OR jump to core coded in C.<br />

jsr ButtonB_NSFISR_Core ; Jump to interrupt core<br />

jsr archExitNestedInterruptCommon ; restore IPR flag et al<br />

pop N ; Pop registers used to restore context.<br />

rti<br />

EXPORT void ButtonB_NSFISR_Core(void) /* Core for Nested Super Fast interrupt */<br />

{|<br />

#pragma interrupt<br />

/* Pragma used to insure context saving done by routine instead of the<br />

dispatcher since super fast interrupts bypass the dispatcher.<br />

With pragma an RTI is used instead of RTS.*/<br />

/* Turn Off the Green LED */<br />

ioctl(LedFD, LED_OFF, LED_GREEN);<br />

}<br />

/*****************************************************************************/<br />

4.3 Interrupt Priorities<br />

By default, as defined in config.h, the GPR_INT_PRIORITY_XX for each interrupt is set to 0,<br />

which disables the interrupt. The GPR_INT_PRIORITY_XX for each interrupt used should be set<br />

between 1 and 7 in appconfig.h, with 7 the highest priority. If the GPR_INT_PRIORITY_XX is<br />

not set between 1 and 7, then the vector in the interrupt vector table for the specific interrupt will<br />

contain the address of configUnhandledInterruptISR.<br />

Note that the GPR_INT_PRIORITY_XX is defined automatically to be 1 for interrupts used by<br />

device drivers that are included in appconfig.h. If you want the interrupts used to implement the<br />

device drivers to be nested, this definition can be changed in the appconfig.h.<br />

4.4 Device Drivers<br />

The following <strong>SDK</strong> device drivers used by the DSP56F80x automatically set the<br />

GPR_INT_PRIORITY_xx to 1 for the interrupts required by the drivers.<br />

4.4.1 ADC Driver<br />

The ADC driver, when enabled, uses interrupt numbers 54, 55, 56, and 57, so the following<br />

interrupt priorities are automatically set to 1:<br />

• GPR_INT_PRIORITY_54<br />

• GPR_INT_PRIORITY_55<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

MOTOROLA Interrupt Processing for the DSP56F80x<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

4-5<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Interrupt Processing for the DSP56F80x<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

• GPR_INT_PRIORITY_56<br />

• GPR_INT_PRIORITY_57<br />

4.4.2 Button Driver<br />

The button driver, when enabled, uses interrupt numbers 8 and 9, so the following interrupt<br />

priorities are automatically set to 1:<br />

• GPR_INT_PRIORITY_8 - note that this interrupt is not controlled by the ITCN<br />

• GPR_INT_PRIORITY_9 - note that this interrupt is not controlled by the ITCN<br />

These interrupts are core interrupts (IRQA and IRQB) and are not controlled by the ITCN. Thus,<br />

when enabled, they will always interrupt the other maskable interrupts (interrupt numbers 11 to<br />

64) and the ISR associated with the interrupt cannot be interrupted by the other maskable<br />

interrupts.<br />

4.4.3 CAN Driver<br />

The CAN driver, when enabled, uses interrupt numbers 14, 15, 16, and 17, so the following<br />

interrupt priorities are automatically set to 1:<br />

• GPR_INT_PRIORITY_14<br />

• GPR_INT_PRIORITY_15<br />

• GPR_INT_PRIORITY_16<br />

• GPR_INT_PRIORITY_17<br />

4.4.4 DAC Driver<br />

The DAC driver is implemented using the SPI driver; see Section 4.4.14.<br />

4.4.5 Decoder Driver<br />

The decoder driver, when enabled, uses interrupt numbers 26, 27, 28, and 29, so the following<br />

interrupt priorities are automatically set to 1:<br />

• GPR_INT_PRIORITY_26<br />

• GPR_INT_PRIORITY_27<br />

• GPR_INT_PRIORITY_28<br />

• GPR_INT_PRIORITY_29<br />

4.4.6 File I/O Driver<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The file I/O driver is implemented using the SCI driver; see Section 4.4.13.<br />

4-6 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

4.4.7 Flash Driver<br />

Device Drivers<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The flash driver, when enabled, uses interrupt numbers 11, 12 and 13, so the following interrupt<br />

priorities are automatically set to 1:<br />

• GPR_INT_PRIORITY_11<br />

• GPR_INT_PRIORITY_12<br />

• GPR_INT_PRIORITY_13<br />

4.4.8 GPIO Driver<br />

The GPIO driver, when enabled, uses interrupt numbers 19, 20, 22, and 23, so the following<br />

interrupt priorities are automatically set to 1:<br />

• GPR_INT_PRIORITY_19<br />

• GPR_INT_PRIORITY_20<br />

• GPR_INT_PRIORITY_22<br />

• GPR_INT_PRIORITY_23<br />

4.4.9 LED Driver<br />

The LED driver is implemented using the GPIO driver; see Section 4.4.8.<br />

4.4.10 PC Master Driver<br />

The PC master driver is implemented using the SCI driver; see Section 4.4.13.<br />

4.4.11 PWM Driver<br />

The PWM driver, when enabled, uses interrupt numbers 58, 59, 60, and 61, so the following<br />

interrupt priorities are automatically set to 1:<br />

• GPR_INT_PRIORITY_58<br />

• GPR_INT_PRIORITY_59<br />

• GPR_INT_PRIORITY_60<br />

• GPR_INT_PRIORITY_61<br />

4.4.12 Quad Timer Driver<br />

The quad timer driver, when enabled, uses interrupt numbers 30 to 45, so the following interrupt<br />

priorities are automatically set to 1:<br />

• GPR_INT_PRIORITY_30<br />

• GPR_INT_PRIORITY_31<br />

• GPR_INT_PRIORITY_32<br />

• GPR_INT_PRIORITY_33<br />

• GPR_INT_PRIORITY_34<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

MOTOROLA Interrupt Processing for the DSP56F80x<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

4-7<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Interrupt Processing for the DSP56F80x<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

• GPR_INT_PRIORITY_35<br />

• GPR_INT_PRIORITY_36<br />

• GPR_INT_PRIORITY_37<br />

• GPR_INT_PRIORITY_38<br />

• GPR_INT_PRIORITY_39<br />

• GPR_INT_PRIORITY_40<br />

• GPR_INT_PRIORITY_41<br />

• GPR_INT_PRIORITY_42<br />

• GPR_INT_PRIORITY_43<br />

• GPR_INT_PRIORITY_44<br />

• GPR_INT_PRIORITY_45<br />

4.4.13 SCI Driver<br />

The SCI driver, when enabled, uses interrupt numbers 46 to 53, so the following interrupt<br />

priorities are automatically set to 1:<br />

• GPR_INT_PRIORITY_46<br />

• GPR_INT_PRIORITY_47<br />

• GPR_INT_PRIORITY_48<br />

• GPR_INT_PRIORITY_49<br />

• GPR_INT_PRIORITY_50<br />

• GPR_INT_PRIORITY_51<br />

• GPR_INT_PRIORITY_52<br />

• GPR_INT_PRIORITY_53<br />

4.4.14 SPI Driver<br />

The SPI driver uses interrupt numbers 24 and 25, so the following interrupt priorities are<br />

automatically set to 1:<br />

• GPR_INT_PRIORITY_24<br />

• GPR_INT_PRIORITY_25<br />

4.4.15 Switch Driver<br />

The switch driver is implemented using the GPIO driver, see Section 4.4.8.<br />

4.4.16 Timer Driver<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The timer driver is implemented using the quad timer driver, see Section 4.4.12.<br />

4-8 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Chapter 5<br />

On-Chip Drivers<br />

One strength of the <strong>SDK</strong> is that it provides a high degree of architectural and hardware<br />

independence for application code. This portability is due to the <strong>SDK</strong>’s modular design, which, in<br />

this case, isolates all chip-specific functionality into a set of libraries that are part of a Board<br />

Support Package (BSP). This BSP can be found at \src\dsp5680xevm\nos\bsp of the <strong>SDK</strong>.<br />

This chapter is composed of two major components: Interfaces and Drivers. It defines the<br />

Application Programming Interface (API) by identifying all public interface functions and data<br />

structures. The <strong>SDK</strong> On Chip API Interface can be used at two levels: Device-Independent I/O<br />

API interface and a Low-Level device driver interface. The Device-Independent I/O layer<br />

interface provide a standard I/O interface and invokes the lower layer device driver interface.<br />

Your application may use either the Device-Independent layer interface or, the low-level device<br />

driver interface, depending on your specific goals for efficiency and portability. The Device-<br />

Independent I/O layer is portable and the Low-Level device drivers are not portable, but<br />

potentially more efficient than the Device-Independent I/O layer.<br />

This document focuses on the DSP56F80x “On Chip” device drivers only. Specific EVM<br />

hardware peripheral drivers will be addressed in Chapter 6, Off Chip Drivers.<br />

5.1 SPI Driver<br />

5.1.1 Introduction<br />

The DSP56F80x processors have an SPI device which allows full duplex, synchronous, serial<br />

communication between the DSP and peripheral devices. This section describes the Serial<br />

Peripheral Interface driver software, which provides the lowest-level software layer interfacing<br />

hardware to software.<br />

5.1.2 Initialization<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The SPI device driver currently has no default configurations that can be overwritten through a<br />

project’s appconfig.h file.<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-1<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

5.1.3 API Definition<br />

This section defines the Application Programming Interface (API) by identifying all public<br />

interface functions and data structures.<br />

Code to create and initialize the SPI driver is automatically included into an <strong>SDK</strong> <strong>Embedded</strong><br />

Project by inserting the following line in the appconfig.h file:<br />

#define INCLUDE_SPI<br />

The following information may be found in the public header file spi.h:<br />

Public Interface Function(s):<br />

/*****************************************************************************<br />

* int open(const char *pName, int OFlags, &SpiParams);<br />

* ssize_t write(int FileDesc, const void * pBuffer, size_t Size);<br />

* ssize_t read(int FileDesc, void * pBuffer, size_t Size);<br />

* int close(int FileDesc);<br />

* UWord16 ioctl(int FileDesc, UWord16 Cmd, void * pParams);<br />

*****************************************************************************/<br />

Public Data Structure(s):<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

typedef struct<br />

{<br />

bool bSetAsMaster;<br />

UWord16 TransmissionSize;<br />

void (* pSlaveSelect)(void);<br />

void (* pSlaveDeselect)(void);<br />

} spi_sParams;<br />

Table 5-1. SPI Data Structure Members<br />

bSetAsMaster bool A bool that sets the SPI device to a Master when set to True and to a<br />

Slave when set to False<br />

TransmissionSize UWord16 Sets the Size of Transmission from 2 to 16 bits<br />

(* pSlaveSelect)(void) void A function pointer to a function that enables the SS. If set to NULL,<br />

will use the default (Port B pin 5) to assert the SS.<br />

(* pSlaveDeselect)(void) void A function pointer to a function that disables the SS. If set to NULL,<br />

will use the default (Port B pin 5) to de-assert the SS<br />

5-2 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.1.4 SPI Device Independent I/O API Specifications<br />

SPI Driver<br />

The following pages specify the device independent Application Programming Interface (API).<br />

Function arguments for each routine are described as in, out, or inout. An in argument means that<br />

the parameter value is an input only to the function. An out argument means that the parameter<br />

value is an output only from the function. An inout argument means that a parameter value is an<br />

input to the function, but the same parameter is also an output from the function.<br />

Typically, inout parameters are input pointer variables in which the caller passes the address of a<br />

preallocated data structure to a function. The function stores its results within that data structure.<br />

The actual value of the inout pointer parameter is not changed.<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-3<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

5.1.4.1 open<br />

Call(s):<br />

int open(const char *pName, int OFlags, &SpiParams);<br />

Description: The open call opens the SPI peripheral for operations and returns a file descriptor<br />

used by the SPI driver’s read, write, close, and ioctl function calls. The SPI device needs to be<br />

opened for read/write calls.<br />

Returns: The open call returns a type int. When the open call is successful, this int is a file<br />

descriptor for the SPI device. This file descriptor is used by the SPI driver’s read, write, close, and<br />

ioctl functions. A "-1" is returned when the open call is not successful.<br />

Code Example: See Code Example 5-1.<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 5-2. SPI Driver open Arguments - open<br />

pName in The SPI device name. Use BSP_DEVICE_NAME_SPI_0.<br />

OFlag in Open Mode Flags which are ignored.<br />

SpiParams in A public data structure described above that needs to filled before passing in<br />

as an open argument.<br />

FileDesc out SPI device descriptor returned by open call and used in read/write/ioctl function<br />

calls.<br />

5-4 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.1.4.2 write<br />

Call(s):<br />

ssize_t write(int FileDesc, const void * pBuffer, size_t Size);<br />

Description: The write call writes the user buffer out of SPI device.<br />

SPI Driver<br />

Returns: The write call returns a type ssize_t. This ssize_t is the number of transferred words,<br />

which are defined as the transmission size of the input data.<br />

Code Example: See Code Example 5-1.<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 5-3. SPI Driver Arguments - write<br />

FileDesc in SPI device descriptor returned by open call and used in<br />

read/write/ioctl function calls<br />

pBuffer in Pointer to user buffer<br />

Size in Size of data to read/write<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-5<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

5.1.4.3 read<br />

Call(s):<br />

ssize_t read(int FileDesc, void * pBuffer, size_t Size);<br />

Description: The read call reads data from SPI device into the user buffer.<br />

Returns: The read call returns a type ssize_t. When the SPI device is in “Master” mode, the<br />

function will return only one word. This word is the last word read from the SPI device due to the<br />

last write to the SPI device. When the SPI device is in “Slave” mode, the function will return Size<br />

words.<br />

NOTE: Since the SPI peripheral is full duplex device, a write must be performed before each<br />

read while using the SPI device in “Master” mode.<br />

Code Example: None<br />

Table 5-4. SPI Driver Arguments - read<br />

FileDesc in SPI device descriptor returned by open call and used in read/write/ioctl function calls<br />

pBuffer in Pointer to user buffer<br />

Size in Size of data to read/write<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5-6 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.1.4.4 close<br />

Call(s):<br />

int close (int FileDesc);<br />

Description: The close call closes the SPI peripheral and releases the file descriptor handle.<br />

Returns: The close call returns a type int; this int is always zero.<br />

SPI Driver<br />

Code Example: Code Example 5-1 sets up the SPI as a master device and writes “Data” out of the<br />

SPI peripheral.<br />

Code Example 5-1. SPI Driver Usage with ioctl call<br />

/****************************************************************************/<br />

#include "port.h"<br />

#include "io.h"<br />

#include "fcntl.h"<br />

#include "bsp.h"<br />

#include "spi.h"<br />

void main(void)<br />

{<br />

spi_sParams SpiParams;<br />

int SerialMaster;<br />

UWord16 Data = 0x1234;<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 5-5. SPI Driver Arguments - close<br />

FileDesc in SPI device descriptor returned by open call and used in read/write/ioctl function calls<br />

SpiParams.pSlaveSelect = NULL; /* Use default PortB GPIO Pin 5 to toggle SS */<br />

SpiParams.pSlaveDeselect = NULL;/* Use default PortB GPIO Pin 5 to toggle SS */<br />

SpiParams.bSetAsMaster = 1;/* Put SPI device in master mode */<br />

SpiParams.TransmissionSize = 0x000F; /* Set Transmission size to 16 bits */<br />

/* Open the spi driver */<br />

SerialMaster = open(BSP_DEVICE_NAME_SPI_0, 0, &SpiParams);<br />

/* Write “Data” out of the spi device */<br />

write(SerialMaster, (UWord16 *)(&Data), sizeof(UWord16));<br />

/* Close spi driver */<br />

close(SerialMaster);<br />

}<br />

/****************************************************************************/<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-7<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

5.1.4.5 ioctl<br />

Call(s):<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

UWord16 ioctl(int FileDesc, UWord16 Cmd, void * pParams);<br />

Table 5-6. SPI Driver Arguments<br />

FileDesc in SPI device descriptor returned by open call<br />

Cmd in Commands found in spidrv.h which are used to modify the SPI status and control<br />

registers<br />

pParams in Used to pass in data transmission size with SPI_TRANSMISSION_DATA_SIZE ioctl<br />

function call<br />

Table 5-7. SPI ioctl Commands<br />

Cmd pParams Return Result<br />

SPI_DATA_SHIFT_MSB_FIRST None None MSB transmitted first<br />

SPI_DATA_SHIFT_LSB_FIRST None None LSB transmitted first<br />

SPI_ERROR_INTERRUPT_ENABLE None None MODF and OVRF can generate DSP<br />

interrupt requests<br />

SPI_ERROR_INTERRUPT_DISABLE None None MODF and OVRF cannot generate DSP<br />

interrupt requests<br />

SPI_MODE_FAULT_ENABLE None None Allows MODF to be set<br />

SPI_MODE_FAULT_DISABLE None None The level of the SS pin does not affect the<br />

operation of an enabled SPI configured as<br />

a Master<br />

SPI_CLEAR_MODE_FAULT None None Clears Mode Fault Bit after it has been set<br />

SPI_BAUDRATE_DIVIDER_2 None None Divides clock by 2<br />

SPI_BAUDRATE_DIVIDER_8 None None Divides clock by 8<br />

SPI_BAUDRATE_DIVIDER_16 None None Divides clock by 16<br />

SPI_BAUDRATE_DIVIDER_32 None None Divides clock by 32<br />

SPI_RX_INTERRUPT_ENABLE None None SPRF DSP interrupt requests enabled<br />

SPI_RX_INTERRUPT_DISABLE None None SPRF DSP interrupt requests disabled<br />

SPI_MODE_MASTER None None Puts SPI in Master mode<br />

SPI_MODE_SLAVE None None Puts SPI in Slave mode<br />

SPI_CLK_POL_RISING_EDGE None None Rising edge of SCLK starts transmission<br />

SPI_CLK_POL_FALLING_EDGE None None Falling edge of SCLK starts transmission<br />

5-8 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 5-7. SPI ioctl Commands (Continued)<br />

Description: The ioctl call changes SPI device modes.<br />

Returns: The ioctl call returns a type UWord16; this UWord16 is always zero.<br />

SPI Driver<br />

SPI_CLOCK_PHASE_SET None None SS pin of the slave SPI module does not<br />

have to be set to a logic one between full<br />

length data transmissions<br />

SPI_CLOCK_PHASE_NOTSET None None SS pin of the slave device module does<br />

have to be set to a logic one between full<br />

length data transmissions<br />

SPI_ENABLE None None SPI module enabled<br />

SPI_DISABLE None None SPI module disabled<br />

SPI_TX_INTERRUPT_ENABLE None None SPTE interrupt requests enabled<br />

SPI_TX_INTERRUPT_DISABLED None None SPTE interrupt requests disabled<br />

SPI_TRANSMISSION_DATA_SIZE 2 - 16 None The data transmission size in bits<br />

Code Example: Code Example 5-2 sets up the SPI as a master device and makes the LSB transmit<br />

first.<br />

Code Example 5-2. SPI Driver Usage<br />

/****************************************************************************/<br />

#include "io.h"<br />

#include "fcntl.h"<br />

#include "bsp.h"<br />

#include "spi.h"<br />

void main(void)<br />

{<br />

spi_sParams SpiParams;<br />

int SerialMaster;<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

SpiParams.pSlaveSelect=NULL; /* Use default PortB GPIO Pin 5 to toggle SS */<br />

SpiParams.pSlaveDeselect =NULL; /* Use default PortB GPIO Pin 5 to toggle SS */<br />

SpiParams.bSetAsMaster=1; /* Put SPI device in master mode */<br />

SpiParams.TransmissionSize = 0x000F;/* Set Transmission size to 16 bits */<br />

/* Open spi driver */<br />

SerialMaster = open(BSP_DEVICE_NAME_SPI_0, 0, &SpiParams);<br />

/* This will make the LSB tx first */<br />

ioctl(SerialMaster, SPI_DATA_SHIFT_LSB_FIRST, NULL);<br />

/* Close spi driver */<br />

close(SerialMaster);<br />

}<br />

/****************************************************************************/<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-9<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

5.1.5 SPI Low-Level I/O API Specification<br />

None<br />

5.1.6 SPI Driver Application<br />

This application for the SPI driver is currently only for the DSP56F805/807 chip, because the<br />

DSP56F805EVM and DSP56F807EVM have an on-board DAC.<br />

The SPI driver application will generate a 1kHz sine-wave and output it via an onboard DAC. The<br />

SPI driver application can be found at \src\dsp56805evm\nos\applications\spi for the<br />

DSP56F805 or at \src\dsp56807evm\nos\applications\spi for the DSP56F807 and consists of the<br />

application spi.mcp and the source code for the application, spi.c. To view the signal, apply a<br />

scope probe to pin 7 on connector J20 of the DSP56F805 or to connector J26 of the DSP56F807<br />

and ground on pins 2, 4, 6, or 8.<br />

Jumper Settings:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Use the default jumper settings for the DSP56F805EVM or DSP56F807EVM board. See the<br />

appropriate Hardware User’s Manual for more information on jumper settings.<br />

Trim Pot Settings: R107 on the DSP56F805EVM board or R97 on the DSP56F807EVM board<br />

must have a reference voltage of 2.5V between pins 2 and 1. This is the maximum reference<br />

voltage before clipping of the sine signal ensues.<br />

GND - pin TP1<br />

Figure 5-1. Trim Pots Pins (Top View)<br />

5-10 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

2<br />

POT<br />

1 3<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 5-2. DSP56F805EVM Board Overview<br />

Figure 5-3. DSP56F805EVM Board: Connector J20<br />

SPI Driver<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-11<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

5.2 Flash Driver<br />

5.2.1 Introduction<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 5-4. 1kHz Sine Wave Output of Digital to Analog Converter<br />

The DSP56F801 and DSP56802 processors have three Flash Memory blocks:<br />

• 2K words of Data Flash are located in X memory space from address 0x1000 to 0x17FF<br />

• 8K words of Program Flash are located in P memory space from address 0x0004 to 0x1FFF<br />

• 2K words of Boot Flash are located in P memory from address 0x8000 to 0x87FF<br />

The DSP56F803 processor has three Flash Memory blocks:<br />

• 4K words of Data Flash are located in X memory space from address 0x1000 to 0x1FFF<br />

• 32K words of Program Flash are located in P memory space from address 0x0004 to<br />

0x7DFF<br />

• 2K words of Boot Flash are located in P memory from address 0x8000 to 0x87FF<br />

The DSP56F805 processor has three Flash Memory blocks:<br />

• 4K words of Data Flash are located in X memory space from address 0x1000 to 0x1FFF<br />

• 32K words of Program Flash are located in P memory space from address 0x0004 to<br />

0x7DFF<br />

• 2K words of Boot Flash are located in P memory from address 0x8000 to 0x87FF<br />

5-12 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The DSP56F807 processor has three Flash Memory blocks:<br />

Flash Driver<br />

• 8K words of Data Flash are located in X memory space from address 0x2000 to 0x3FFF<br />

• 60K words of Program Flash are located in P memory space from address 0x0004 to<br />

0xEFFF<br />

• 2K words of Boot Flash are located in P memory from address 0xF800 to 0xFFFF<br />

NOTE: See Section 3.2 in the DSP56F80x User’s Manual for more details on the memory<br />

map of specific chips within the DSP56F80x chip set.<br />

The Flash Driver uses an internal start address for read and write calls. This address saves the<br />

position within the Flash address space for read and write operations. The address is incremented<br />

by the size value after read and write calls. The user can change the current address value via an<br />

ioctl call. Applications cannot read or write more then MAX_VECTOR_LEN (8192) data words<br />

in one API call.<br />

5.2.2 Initialization<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The Flash device driver allows the ability to modify the Data Flash Interface Unit (DFIU),<br />

Program Flash Interface Unit (PFIU), and Boot Flash Interface Unit (BFIU) registers in a<br />

project’s appconfig.h. To accomplish this, the relative symbol<br />

FLASH_DFIU_PROGRAM_TIME, FLASH_PFIU_PROGRAM_TIME, or<br />

FLASH_BFIU_PROGRAM_TIME must first be defined in a project’s appconfig.h. If these<br />

symbols are not defined, the driver will leave these registers in their default state, specified in<br />

Chapter 5 of the DSP56F80x User’s Manual. The Data Flash Interface Unit registers are listed<br />

in Table 5-8.<br />

Table 5-8. Flash Driver appconfig.h Settings<br />

Parameter Description<br />

Default<br />

Setting<br />

FLASH_DFIU_CKDIVISOR_VALUE Value to put into DFIU_CKDIVISOR register 0x000F<br />

FLASH_DFIU_TERASEL_VALUE Value to put into DFIU_TERASEL register 0x000F<br />

FLASH_DFIU_TMEL_VALUE Value to put into DFIU_TMEL register 0x000F<br />

FLASH_DFIU_TNVSL_VALUE Value to put into DFIU_TNVSL register 0x00FF<br />

FLASH_DFIU_TPGSL_VALUE Value to put into DFIU_TPGSL register 0x01FF<br />

FLASH_DFIU_TPROGL_VALUE Value to put into DFIU_TPROGL register 0x03FF<br />

FLASH_DFIU_TNVHL_VALUE Value to put into DFIU_TNVHL register 0x00FF<br />

FLASH_DFIU_TNVH1L_VALUE Value to put into DFIU_TNVH1L register 0x0FFF<br />

FLASH_DFIU_TRCVL_VALUE Value to put into DFIU_TRCVL register 0x003F<br />

FLASH_PFIU_PROGRAM_TIME Define this symbol to program PFIU timer registers. If this<br />

symbol is undefined, driver does not change PFIU timer<br />

registers.<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-13<br />

None<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

FLASH_PFIU_CKDIVISOR_VALUE Value to put into PFIU_CKDIVISOR register 0x000F<br />

FLASH_PFIU_TERASEL_VALUE Value to put into PFIU_TERASEL register 0x000F<br />

FLASH_PFIU_TMEL_VALUE Value to put into PFIU_TMEL register 0x000F<br />

FLASH_PFIU_TNVSL_VALUE Value to put into PFIU_TNVSL register 0x00FF<br />

FLASH_PFIU_TPGSL_VALUE Value to put into PFIU_TPGSL register 0x01FF<br />

FLASH_PFIU_TPROGL_VALUE Value to put into PFIU_TPROGL register 0x03FF<br />

FLASH_PFIU_TNVHL_VALUE Value to put into PFIU_TNVHL register 0x00FF<br />

FLASH_PFIU_TNVH1L_VALUE Value to put into PFIU_TNVH1L register 0x0FFF<br />

FLASH_PFIU_TRCVL_VALUE Value to put into PFIU_TRCVL register 0x003F<br />

FLASH_BFIU_PROGRAM_TIME Define this symbol to program BFIU timer registers. If this<br />

symbol is undefined, driver does not change BFIU timer<br />

registers.<br />

5.2.3 API Definition<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 5-8. Flash Driver appconfig.h Settings (Continued)<br />

FLASH_BFIU_CKDIVISOR_VALUE Value to put into BFIU_CKDIVISOR register 0x000F<br />

FLASH_BFIU_TERASEL_VALUE Value to put into BFIU_TERASEL register 0x000F<br />

FLASH_BFIU_TMEL_VALUE Value to put into BFIU_TMEL register 0x000F<br />

FLASH_BFIU_TNVSL_VALUE Value to put into BFIU_TNVSL register 0x00FF<br />

FLASH_BFIU_TPGSL_VALUE Value to put into BFIU_TPGSL register 0x01FF<br />

FLASH_BFIU_TPROGL_VALUE Value to put into BFIU_TPROGL register 0x03FF<br />

FLASH_BFIU_TNVHL_VALUE Value to put into BFIU_TNVHL register 0x00FF<br />

FLASH_BFIU_TNVH1L_VALUE Value to put into BFIU_TNVH1L register 0x0FFF<br />

FLASH_BFIU_TRCVL_VALUE Value to put into BFIU_TRCVL register 0x003F<br />

This section defines the Application Programming Interface (API) by identifying all public<br />

interface functions and data structures.<br />

Code to create and initialize the Flash driver is automatically included into an <strong>SDK</strong> <strong>Embedded</strong><br />

Project by inserting the following line in the appconfig.h file:<br />

#define INCLUDE_FLASH<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The following information may be found in the public header file flash.h:<br />

5-14 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

None<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Public Interface Function(s):<br />

Flash Driver<br />

/*****************************************************************************<br />

* int open(const char *pName, int OFlags,...);<br />

* ssize_t write(int FileDesc, const void * pBuffer, size_t Size);<br />

* ssize_t read(int FileDesc, void * pBuffer, size_t Size);<br />

* int close(int FileDesc);<br />

* UWord16 ioctl(int FileDesc, UWord16 Cmd, void * pParams);<br />

*****************************************************************************/<br />

Public Data Structure(s): None<br />

Members: None<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-15<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.2.4 FLASH Device-Independent I/O API Specifications<br />

The following pages specify the device-independent Application Programming Interface (API).<br />

Function arguments for each routine are described as in, out, or inout. An in argument means that<br />

the parameter value is an input only to the function. An out argument means that the parameter<br />

value is an output only from the function. An inout argument means that a parameter value is an<br />

input to the function, but the same parameter is also an output from the function.<br />

Typically, inout parameters are input pointer variables in which the caller passes the address of a<br />

preallocated data structure to a function. The function stores its results within that data structure.<br />

The actual value of the inout pointer parameter is not changed.<br />

5-16 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.2.4.1 open<br />

Call(s):<br />

int open(const char *pName, int OFlags,...);<br />

Flash Driver<br />

Description: The open call opens the Flash device for operations and returns a file descriptor<br />

used by the Flash driver’s read, write, close, and ioctl function calls. The Flash device needs to be<br />

opened for read/write calls.<br />

Returns: The open call returns a type int. When the open call is successful, this int is a file<br />

descriptor for the Flash device. This file descriptor is used by the Flash’s read, write, ioctl, and<br />

close functions. A "-1" is returned when the open call is not successful.<br />

Code Example: See Code Example 5-3.<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 5-9. Flash Driver open Arguments - open<br />

pName in The Flash device name; use BSP_DEVICE_NAME_FLASH_X<br />

for X data flash, BSP_DEVICE_NAME_FLASH_P<br />

for Program flash and BSP_DEVICE_NAME_FLASH_B for Boot flash<br />

OFlag in Open Mode Flags; Ignored<br />

FileDesc out Flash device descriptor returned by open call and used in read/write function calls<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-17<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

5.2.4.2 write<br />

Call(s):<br />

ssize_t write(int FileDesc, const void * pBuffer, size_t Size);<br />

Description: The write call writes the user buffer into flash.<br />

Returns: The write call returns a type ssize_t, which is the number of transferred words, or zero if<br />

verification mode is on and verification failed.<br />

Code Example: See Code Example 5-3.<br />

Table 5-10. Flash Driver Arguments - write<br />

FileDesc in Flash device descriptor returned by open call and used in read/write function calls<br />

pBuffer in Pointer to user buffer<br />

Size in Size of data to read/write<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5-18 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.2.4.3 read<br />

Call(s):<br />

ssize_t read(int FileDesc, void * pBuffer, size_t Size);<br />

Description: The read call reads data from flash into the user buffer.<br />

Flash Driver<br />

Returns: The read call returns a type ssize_t, which is the number of received words, or zero if<br />

verification mode is on and verification failed.<br />

Code Example: None<br />

Table 5-11. Flash Driver Arguments - read<br />

FileDesc in Flash device descriptor returned by open call and used in read/write function calls<br />

pBuffer in Pointer to user buffer<br />

Size in Size of data to read/write<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-19<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

5.2.4.4 close<br />

Call(s):<br />

int close (int FileDesc);<br />

Description: The close call closes the Flash device.<br />

Returns: The close call returns a type int; this int is always zero.<br />

Code Example: Code Example 5-3 sets up the Flash to write the array Data into Flash.<br />

Code Example 5-3. Flash Driver Usage<br />

/****************************************************************************/<br />

#include "port.h"<br />

#include "io.h"<br />

#include "fcntl.h"<br />

#include "bsp.h"<br />

#include "flash.h"<br />

#define DATA_LENGTH 100<br />

void main(void)<br />

{<br />

int FlashDevice;<br />

int I;<br />

UWord16 Data[DATA_LENGTH];<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

/* fill array up with data */<br />

for(I = 0; I < DATA_LENGTH; I++)<br />

{<br />

Data[I] = I;<br />

}<br />

Table 5-12. Flash Driver Arguments - close<br />

FileDesc in Flash device descriptor returned by open call and used in read/write function calls<br />

/* open flash driver */<br />

FlashDevice = open(BSP_DEVICE_NAME_FLASH_X, 0, NULL);<br />

/* write array “Data” into flash */<br />

write(FlashDevice, Data, DATA_LENGTH);<br />

/* close flash driver */<br />

close(FlashDevice);<br />

}<br />

/****************************************************************************/<br />

5-20 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.2.4.5 ioctl<br />

Call(s):<br />

UWord16 ioctl(int FileDesc, UWord16 Cmd, void * pParams);<br />

Description: The ioctl call changes Flash device parameters.<br />

Returns: The ioctl call returns a type UWord16. This UWord16 is always zero.<br />

Flash Driver<br />

Code Example: Code Example 5-4 sets the user’s buffer location to Program memory space.<br />

Code Example 5-4. Flash Driver Usage with IOCTL<br />

/****************************************************************************/<br />

#include "io.h"<br />

#include "fcntl.h"<br />

#include "bsp.h"<br />

#include "flash.h"<br />

void main(void)<br />

{<br />

int FlashDevice;<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 5-13. Flash Driver Arguments<br />

FileDesc in Flash device descriptor returned by open call and used in read/write function calls<br />

Cmd in Commands found in flash.h which are used to manage the Flash driver<br />

pParams in Pointer to ioctl command parameter<br />

Table 5-14. Flash ioctl Commands<br />

Cmd pParams Return Result<br />

FLASH_CMD_SEEK Word16 * None Changes internal address; Internal Address is<br />

offset in 16-bit words from the beginning of flash<br />

address space<br />

FLASH_SET_USER_X_DATA NULL None Sets user’s data buffer location in X data space<br />

FLASH_SET_USER_P_DATA NULL None Sets user’s data buffer location in Program memory<br />

space<br />

FLASH_CMD_ERASE_ALL NULL None Erases all data in flash<br />

FLASH_RESET NULL None Reset internal flash address to initial state<br />

FLASH_SET_VERIFY_ON NULL None Set verification mode on<br />

FLASH_SET_VERIFY_OFF NULL None Set verification mode off<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-21<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

}<br />

/* opens flash driver */<br />

FlashDevice = open(BSP_DEVICE_NAME_FLASH_X, 0, NULL);<br />

/* sets the user’s data buffer location to “Program” memory space */<br />

ioctl(FlashDevice, FLASH_SET_USER_P_DATA, NULL);<br />

/* close flash driver */<br />

close(FlashDevice);<br />

/****************************************************************************/<br />

5.2.5 Flash Low-Level I/O Specification<br />

None<br />

5.2.6 Flash Driver Application<br />

The Flash application writes data from a data memory buffer to data flash. It then reads the data<br />

from data flash to another buffer, at which point the two buffers are compared. If the data is the<br />

same in both buffers, a successful message is printed on the screen. The Flash driver application<br />

can be found at \src\dsp5680xevm\nos\applications\flash and consists of the application<br />

flash.mcp and the source code for the application, flash.c.<br />

Jumper Settings:<br />

Use the default jumper settings for the DSP56F80xEVM board. See the Evaluation Module<br />

Hardware User’s Manual for a specific target, (i.e., DSP56F805 Evaluation Module Hardware<br />

User’s Manual) for more information on jumper settings.<br />

5.3 SCI Driver<br />

5.3.1 Introduction<br />

The DSP56F801, DSP56F802, and DSP56F803 processors have one SCI device, SCI0. The<br />

DSP56F805 and DSP56F807 processors have two SCI devices, SCI0 and SCI1. These SCI<br />

devices allow full duplex, asynchronous, serial communication between the DSP, a host<br />

computer, or other devices.<br />

5.3.2 Initialization<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The SCI driver has default configurations that can be overwritten via the appconfig.h for a<br />

specific project. Driver communication configuration is done at run time by the driver’s open<br />

function but some static initialization is done prior to this. Parameters that may be redefined in the<br />

appconfig.h file are defined in Table 5-15.<br />

5-22 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

SCI Driver<br />

The lengths of the SCI transmit and receive buffers, in non-blocking mode, may be redefined in<br />

the appconfig.h file to accomodate buffer sizes required by a particular application. For example,<br />

if an application requires an SCI0 receive buffer size of 1024 words and transmit buffer size of<br />

500, it may be defined by placing the following line in the appconfig.h file:<br />

#define SCI0_RECEIVE_BUFFER_LENGTH 1024<br />

#define SCI0_SEND_BUFFER_LENGTH 500<br />

NOTE: The constraints on these buffer length defined constants are as follows:<br />

• They must be defined to be greater than or equal to one<br />

• The maximum size of the defines is based on the available memory size<br />

The SCI driver uses these defined constants to statically allocate memory for SCI Transmit and<br />

Receive buffers based on the equations below:<br />

For DSP56F801/802/803:<br />

SCI0_SEND_BUFFER_LENGTH + SCI0_RECEIVE_BUFFER_LENGTH + 4<br />

For DSP56F805/807:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 5-15. SCI Configuration Items for appconfig.h<br />

Defined constants Explanation<br />

SCI0_SEND_BUFFER_LENGTH Fifo buffer size for write operation in Non-Blocking<br />

mode for SCI0. Default value is 8.<br />

SCI0_RECEIVE_BUFFER_LENGTH Fifo buffer size for read operation in Non-Blocking<br />

mode for SCI0. Default value is 8.<br />

SCI1_SEND_BUFFER_LENGTH Fifo buffer size for write operation in Non-Blocking<br />

mode for SCI1. Default value is 8. (805, 807 only)<br />

SCI1_RECEIVE_BUFFER_LENGTH Fifo buffer size for read operation in Non-Blocking<br />

mode for SCI1. Default value is 8. (805, 807 only)<br />

SCI_USER_BAUD_RATE_1 Default value of 9600<br />

SCI_USER_BAUD_RATE_2 Default value of 9600<br />

SCI0_SEND_BUFFER_LENGTH + SCI0_RECEIVE_BUFFER_LENGTH + 4<br />

SCI1_SEND_BUFFER_LENGTH + SCI1_RECEIVE_BUFFER_LENGTH + 4<br />

The SCI driver has a set of defined constants for standard baud rates located in the sci.h file. The<br />

user may also define a custom rate in the appconfig.h file if the desired rate is not already defined.<br />

For example if the user wants to run at a rate of 9800 baud he would have to define this rate in the<br />

appconfig.h file since this rate is not one of the standard rates. Specifically, the SCI driver has two<br />

defined constants to accomplish this:<br />

#define SCI_USER_BAUD_RATE_1<br />

#define SCI_USER_BAUD_RATE_2<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-23<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

These defined constants can be specified in two ways:<br />

• Example 1: #define SCI_USER_BAUD_RATE_1 1250<br />

Determine the value to be stored into the SCI Baud Rate (SBR) register based on the<br />

equation:<br />

SBR = IP Bus Freq/(16 * BaudRate)<br />

If the IP bus frequency equals 36Mhz, 1250 will set the SCI Baud Rate Register to a baud<br />

rate of 1800. To configure the IP bus frequency to 36 MHz, set PLL_MUL equal to 18 and<br />

BSP_OSCILLATOR_FREQ equal to 8000000 Hz.<br />

• Example 2: #define SCI_USER_BAUD_RATE_1 SCI_GET_SBR(1800u)<br />

Specify the baud rate required and allow the <strong>SDK</strong> SCI_GET_SBR macro calculate the<br />

required SBR register value base on the equation:<br />

SBR = ([(PLL_MUL * BSP_OSCILLATOR_FREQ) + (BaudRate * 32)]<br />

/ (BaudRate *64)) & 0x1FFF<br />

The output of the macro in this example would be 1250, which is the value in the first<br />

example with PLL_MUL equal to 18 and BSP_OSCILLATOR_FREQ equal to 8000000<br />

Hz. The advantage to using the macro is that the baud rate will automatically be<br />

recalculated if the PLL multiplier or External Oscillator freqency values changed.<br />

5.3.3 API Definition<br />

This section defines the Application Programming Interface (API) by identifying all public<br />

interface functions and data structures.<br />

Code to create and initialize the SCI driver is automatically included into an <strong>SDK</strong> <strong>Embedded</strong><br />

Project by inserting the following line in the appconfig.h file:<br />

#define INCLUDE_SCI<br />

The following information may be found in the public header file sci.h:<br />

Public Interface Function(s):<br />

/*****************************************************************************<br />

* int open(const char *pName, int OFlags, &SciConfig);<br />

* ssize_t write(int FileDesc, const void * pBuffer, size_t Size);<br />

* ssize_t read(int FileDesc, void * pBuffer, size_t Size);<br />

* int close(int FileDesc);<br />

* UWord16 ioctl(int FileDesc, UWord16 Cmd, void * pParams);<br />

*****************************************************************************/<br />

Public Data Structure(s):<br />

typedef struct<br />

{<br />

UWord16 SciCntl;<br />

UWord16 SciHiBit;<br />

UWord16 BaudRate;<br />

} sSciConfig;<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

5-24 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 5-16. SCI Data Structure Members<br />

* - Denotes default driver setting by open function call<br />

NOTE: If the application does not use Non-Blocking mode, the SCI driver size can be<br />

decreased by the undefine SCI_NONBLOCK_MODE symbol in file scidrv.h.<br />

SCI Driver<br />

SciCntl UWord16 Data to write into SCI control register. Generated by ORing bit masks defined<br />

in Table 5-17<br />

SciHiBit UWord16 Value for Most Significant Bit transmitted (bit8-MSB bit0-LSB); this field is used<br />

only if SciCntl is configured with SCI_CNTL_PARITY_NONE and<br />

SCI_CNTL_WORD_9BIT bits set and the device mode is<br />

SCI_DATAFORMAT_RAW. If device mode is<br />

SCI_DATAFORMAT_EIGHTBITCHARS then this bit has no meaning. Use the<br />

following defined constants:<br />

SCI_HIBIT_0 - transmit zero<br />

SCI_HIBIT_1 - transmit one<br />

BaudRate UWord16 Data to write into SCI Baud Rate register<br />

Table 5-17. SCI Control Register bit masks, SciCntl<br />

Defined Constant Description<br />

SCI_CNTL_RECEIVER_ENABLE* Enable receiver<br />

SCI_CNTL_TRANSMITTER_ENABLE* Enable transmitter<br />

SCI_CNTL_PARITY_NONE*<br />

SCI_CNTL_PARITY_ODD<br />

SCI_CNTL_PARITY_EVEN<br />

SCI_CNTL_TX_NOT_INVERTED*<br />

SCI_CNTL_TX_INVERTED<br />

SCI_CNTL_WAKE_BY_IDLE*<br />

SCI_CNTL_WAKE_BY_ADDRESS<br />

SCI_CNTL_WORD_8BIT*<br />

SCI_CNTL_WORD_9BIT<br />

SCI_CNTL_LOOP_NO*<br />

SCI_CNTL_LOOP<br />

SCI_CNTL_LOOP_SINGLE_WIRE<br />

SCI_CNTL_ENABLE_IN_WAIT*<br />

SCI_CNTL_DISABLE_IN_WAIT<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

No Parity<br />

Odd Parity<br />

Even Parity<br />

Do not invert transmit and receive data bits (normal mode)<br />

Invert transmit and receive data bits (invert mode)<br />

Idle line Wake-up<br />

Address mark Wake-up<br />

8 bits per character, one start bit, one stop bit<br />

9 bits per character, one start bit, one stop bit<br />

Loop mode disabled (normal mode)<br />

Loop mode with internal TXD fed back to RXD<br />

Single-wire loop mode with internal TXD Output fed back to RXD<br />

Enable SCI in wait mode<br />

Disable SCI in wait mode<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-25<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.3.4 SCI Device Independent I/O API Specifications<br />

The following pages specify the device-independent Application Programming Interface (API).<br />

Function arguments for each routine are described as in, out, or inout. An in argument means that<br />

the parameter value is an input only to the function. An out argument means that the parameter<br />

value is an output only from the function. An inout argument means that a parameter value is an<br />

input to the function, but the same parameter is also an output from the function.<br />

Typically, inout parameters are input pointer variables in which the caller passes the address of a<br />

preallocated data structure to a function. The function stores its results within that data structure.<br />

The actual value of the inout pointer parameter is not changed.<br />

5-26 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.3.4.1 open<br />

Call(s):<br />

int open(const char *pName, int OFlags, sSciConfig * pSciConfig);<br />

SCI Driver<br />

Description: The open call opens the SCI peripheral for operations and returns a file descriptor<br />

used by the SCI driver’s read, write, close, and ioctl function calls. This function will<br />

automatically enable the SCI transmitter and receiver. If O_NONBLOCK mode is specified in the<br />

OFlags, the driver will automatically install default Transmit and Receive interrupt service<br />

routines and enable the Receive interrupt.<br />

Special Considerations: Installation of callback functions must be done through ioctl function<br />

calls (see Section 5.3.4.5).<br />

Returns: The open call returns a type int. When the open call is successful, this int is a file<br />

descriptor for the SCI device and is used by the SCI read, write, and ioctl functions. A "-1" is<br />

returned when the open call is not successful.<br />

Code Example: See Code Example 5-5.<br />

Table 5-18. SCI Driver open Arguments - open<br />

pName in The SCI device name; see Table 5-19<br />

OFlags in Open Mode Flags; specify O_RDWR<br />

Use O_NONBLOCK flags for Non-Blocking mode<br />

pSciConfig in Pointer to SCI mode description<br />

FileDesc out SCI device descriptor returned by open call and used in read/write function calls<br />

Table 5-19. SCI Devices for Specific DSP56F80x Chips<br />

Chip Can Use<br />

DSP56F801/802<br />

DSP56F803<br />

DSP56F805<br />

DSP56F807<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

BSP_DEVICE_NAME_SCI_0<br />

BSP_DEVICE_NAME_SCI_0<br />

BSP_DEVICE_NAME_SCI_0; BSP_DEVICE_NAME_SCI_1<br />

SP_DEVICE_NAME_SCI_0; BSP_DEVICE_NAME_SCI_1<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-27<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

5.3.4.2 write<br />

Call(s):<br />

ssize_t write(int FileDesc, const void * pBuffer, size_t Size);<br />

Description: The write call writes the user buffer out of the SCI device.<br />

Returns: The write call returns a type ssize_t. This ssize_t is the number of transferred words.<br />

Code Example: See Code Example 5-5.<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 5-20. SCI Driver Arguments - write<br />

FileDesc in SCI device descriptor returned by open call<br />

pBuffer in Pointer to user buffer<br />

Size in Number of data words to write<br />

5-28 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.3.4.3 read<br />

Call(s):<br />

ssize_t read(int FileDesc, void * pBuffer, size_t Size);<br />

Description: The read call reads data from the SCI device into the user buffer.<br />

Returns: The read call returns a type ssize_t. This ssize_t is the number of received words.<br />

Code Example: See Code Example 5-5.<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 5-21. SCI Driver Arguments - read<br />

FileDesc in SCI device descriptor returned by open call<br />

pBuffer in Pointer to user buffer<br />

Size in Number of data words to read<br />

SCI Driver<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-29<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

5.3.4.4 close<br />

Call(s):<br />

int close (int FileDesc);<br />

Description: The close call closes the SCI peripheral.<br />

Returns: The close call returns a type int. This int is always zero.<br />

Code Example: See Code Example 5-5.<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 5-22. SCI Driver Arguments - close<br />

FileDesc in SCI device descriptor returned by open call<br />

5-30 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.3.4.5 ioctl<br />

Call(s):<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

UWord16 ioctl(int FileDesc, UWord16 Cmd, void * pParams);<br />

Table 5-23. SCI Driver Arguments<br />

FileDesc in SCI device descriptor returned by open call<br />

Cmd in Commands found in sci.h which are used to manage the SCI driver<br />

pParams in Pointer to ioctl command parameter<br />

Table 5-24. SCI ioctl Commands<br />

Cmd pParams Return Result<br />

SCI_DATAFORMAT_EIGHTBITCHARS NULL None Set data format as 8-bit<br />

SCI_DATAFORMAT_RAW NULL None Set data format as 16-bit<br />

SCI Driver<br />

SCI_DEVICE_RESET sSciConfig * None Set SCI new configuration and reset<br />

device; cancel all Non-Blocking<br />

operations<br />

SCI_DEVICE_OFF NULL None Disable device<br />

SCI_DEVICE_ON NULL None Enable device<br />

SCI_CALLBACK_RX void<br />

(*sciDataCallback)<br />

(void)<br />

SCI_CALLBACK_TX void<br />

(*sciDataCallback)<br />

(void)<br />

SCI_CALLBACK_EXCEPTION void<br />

(*sciErrorCallback)<br />

(UWord16<br />

Exception)<br />

None Install Read-completed callback<br />

function<br />

None Install Transfer completed callback<br />

None Install Error callback<br />

SCI_SET_READ_LENGTH UWord16 * length None Set number of words/bytes for Read<br />

callback; after this number of<br />

words/bytes is received, the RX<br />

callback function will be called<br />

SCI_GET_STATUS NULL Status Get device status<br />

If a length larger than the<br />

previously-configured<br />

SCIx_RECEIVE_BUFFER_LENGTH<br />

is specified, this command will set the<br />

length to the<br />

SCIx_RECEIVE_BUFFER_LENGTH<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-31<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

SCI_GET_EXCEPTION NULL Exception Get device exception status<br />

SCI_CMD_SEND_BREAK NULL None Send break symbol via SCI<br />

SCI_CMD_WAIT NULL None Put SCI device in wait state<br />

SCI_CMD_WAKEUP NULL None Wake up device from wait mode<br />

SCI_CMD_READ_CLEAR NULL None Clear Read buffer in Non-Blocking<br />

mode<br />

SCI_CMD_WRITE_CANCEL NULL None Cancel data transmission after Write<br />

operation in Non-Blocking mode<br />

SCI_GET_READ_SIZE NULL Read Size Return number of data reciver fifo,<br />

that can be read via read call<br />

Description: The ioctl call changes SCI device modes or gives SCI driver status.<br />

Returns: The ioctl call returns a type UWord16. This UWord16 is dependent on the command<br />

passed in as an input parameter. Table 5-24 lists these returns based on the specific command.<br />

Code Example: Code Example 5-5 sets up the SCI to communicate with HyperTerminal using<br />

CallBacks.<br />

Code Example 5-5. SCI Driver Usage<br />

#include "port.h"<br />

#include "sci.h"<br />

#include "io.h"<br />

#include "bsp.h"<br />

#include "assert.h"<br />

// CallBack function prototypes<br />

void sciRxCallBack(void);<br />

void sciTxCallBack(void);<br />

void sciExceptionCallBack(void);<br />

int SCI0, count;<br />

UWord16 DataR;<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 5-24. SCI ioctl Commands (Continued)<br />

/**********************************************************************<br />

* SCI Receive CallBack Routine<br />

*<br />

* Description: This function is called when the SCI driver has received<br />

* the number of characters specified by the read length.<br />

***********************************************************************/<br />

void sciRxCallBack(void)<br />

{<br />

read( SCI0, &DataR, sizeof(DataR) ); // Read a character<br />

write(SCI0, &DataR, sizeof(DataR) ); // Send it back to the pc (echo)<br />

}<br />

5-32 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

/**********************************************************************<br />

* SCI Transmit CallBack Routine<br />

*<br />

* Description: This function is called when the SCI driver has sent all<br />

* data in its transmit buffer.<br />

***********************************************************************/<br />

void sciTxCallBack(void)<br />

{<br />

/* Add code for Transmit handling */<br />

asm(nop);<br />

}<br />

/**********************************************************************<br />

* SCI Exception CallBack Routine<br />

*<br />

* Description: This function is called when the SCI driver has detected<br />

* an exception.<br />

***********************************************************************/<br />

void sciExceptionCallBack(void)<br />

{<br />

/* Add code for exception handling */<br />

asm(debug);<br />

}<br />

void main (void)<br />

{<br />

UWord16 SciReadLength;<br />

sci_sConfig SciConfig;<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

SciConfig.SciCntl = SCI_CNTL_WORD_8BIT | SCI_CNTL_PARITY_NONE;<br />

SciConfig.SciHiBit = SCI_HIBIT_0;<br />

SciConfig.BaudRate = SCI_BAUD_9600;<br />

SCI0 = open(BSP_DEVICE_NAME_SCI_0, O_RDWR | O_NONBLOCK, &SciConfig);<br />

if (SCI0 == -1)<br />

{<br />

assert(!" Open /sci0 device failed.");<br />

}<br />

/* Set the data format for 8-bit characters<br />

and Clear the Read and Write buffers */<br />

ioctl(SCI0, SCI_DATAFORMAT_EIGHTBITCHARS, NULL);<br />

/* Set the Receive, Transmit, and Exception Callback functions */<br />

ioctl(SCI0, SCI_CALLBACK_RX, sciRxCallBack);<br />

ioctl(SCI0, SCI_CALLBACK_TX, sciTxCallBack);<br />

ioctl(SCI0, SCI_CALLBACK_EXCEPTION, sciExceptionCallBack);<br />

/* The SCI Rx CallBack function will be called by the SCI driver after<br />

one character is received by setting the read length to 1. */<br />

SciReadLength = 1;<br />

ioctl(SCI0, SCI_SET_READ_LENGTH, &SciReadLength);<br />

SCI Driver<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-33<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

/* Wait for data to be received */<br />

/* Use HyperTerminal to send characters that will be echoed back<br />

by the Receive CallBack function */<br />

while (1)<br />

{<br />

count++;<br />

}<br />

}<br />

return;<br />

5.3.5 SCI Low-Level I/O Specifications<br />

None<br />

5.3.6 SCI Driver Application<br />

The SCI application interacts with a PC via a serial connection. The SCI driver application can be<br />

found at \src\dsp5680xevm\nos\applications\sci and consists of the application sci.mcp and the<br />

source code for the application, sci.c. Once this application is running, the user can execute the<br />

serial.exe program on the PC to launch a serial GUI interface. This file can be found at<br />

..\x86\win32\applications\serial\. Using this GUI, the user can display any memory location on<br />

the DSP56F80xEVM board by selecting the data space, address range, and READ. When READ<br />

is selected, a command is sent to the DSP56F80x processor via the serial interface. After the<br />

application, running on the DSP56F80x, processes this command, a response message with the<br />

requested data is returned to the PC. As soon as the GUI application running on the PC receives<br />

the response, the data for the requested memory location is displayed.<br />

NOTE: The serial.exe program allows for the selection of COM Port 1 or COM Port 2 for serial<br />

communication via the GUI interface. Should the request for data go unanswered, the<br />

data can be requested again by using the button on the GUI interface to toggle to the<br />

other COM Port setting.<br />

Baud Rate:<br />

The SCI driver for this application is configured to run at a baud rate of 28800.<br />

Jumper Settings:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Use the default jumper settings for the specific DSP56F80xEVM board. See the Evaluation<br />

Module Hardware User’s Manual for a specific target (i.e., the DSP56F805 Evaluation Module<br />

Hardware User’s Manual), for more information on jumper settings.<br />

5-34 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.4 ADC Driver<br />

5.4.1 Introduction<br />

ADC Driver<br />

The DSP56F801/802/803/805 processors have one 8-channel, 12-bit resolution ADC device. The<br />

DSP56F807 has two dual 8-channel, 12-bit resolution ADC devices. The ADC driver provides a<br />

standard <strong>SDK</strong> interface for this device.<br />

The 8-channel device is distinguished between analog channel (chip pin) and conversion sample<br />

(CPU register) by the driver. Each analog channel can be opened for reading. The user must<br />

assign a sample mask for each channel to be opened. The number of samples can not exceed eight<br />

for an ADC device. The driver is scalable, so due to reduction of consumed resources, the user<br />

must allocate samples statically by corresponding macro definitions. The driver provides a<br />

statically configured callback service.<br />

5.4.2 Initialization<br />

The ADC has default configurations defined in config.h. These default configuration settings, and<br />

other ADC settings that can be utilized to customize the ADC, can be redefined in the appconfig.h<br />

for that project and are explained in Table 5-25.<br />

ADC_QUEUE_DEPTH<br />

ADCA_QUEUE_DEPTH<br />

ADCB_QUEUE_DEPTH<br />

ADC_INITIATE_SCAN<br />

ADCA_INITIATE_SCAN<br />

ADCB_INITIATE_SCAN<br />

ADC_SCANMODE<br />

ADCA_SCANMODE<br />

ADCB_SCANMODE<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 5-25. ADC appconfig.h Settings<br />

ADC #define Type Explanation<br />

int •ADC channel queue (FIFO) size in bits<br />

•Unless this value is redefined in<br />

appconfig.h, it will default to 16 bits.<br />

adc_eInitiateScan •ADC_INITIATE_SCAN_ON_START -<br />

conversion process is initiated by write<br />

to START bit<br />

•ADC_INITIATE_SCAN_ON_SYNC -<br />

conversion process is initiated by SYNC<br />

input.; unless this value is redefined in<br />

appconfig.h, it will default to:<br />

ADC_INITIATE_SCAN_ON_START<br />

adc_eScanMode •ADC_SEQUENTIAL_ONCE,<br />

•ADC_SEQUENTIAL_LOOP,<br />

•ADC_SEQUENTIAL_TRIGGERED,<br />

•ADC_SIMULTANEOUS_ONCE,<br />

•ADC_SIMULTANEOUS_LOOP,<br />

•ADC_SIMULTANEOUS_TRIGGERED<br />

•Unless this value is redefined in<br />

appconfig.h, it will default to<br />

ADC_SEQUENTIAL_ONCE;<br />

•See Section 9.6.1.10 of the<br />

DSP56F80x User’s Manual for details<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-35<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

ADC_CLOCK_DIVISOR<br />

ADCA_CLOCK_DIVISOR<br />

ADCB_CLOCK_DIVISOR<br />

ADC_DIFFERENTIAL_01<br />

ADCA_DIFFERENTIAL_01<br />

ADCB_DIFFERENTIAL_01<br />

ADC_DIFFERENTIAL_23<br />

ADCA_DIFFERENTIAL_23<br />

ADCB_DIFFERENTIAL_23<br />

ADC_DIFFERENTIAL_45<br />

ADCA_DIFFERENTIAL_45<br />

ADCB_DIFFERENTIAL_45<br />

ADC_DIFFERENTIAL_67<br />

ADCA_DIFFERENTIAL_67<br />

ADCB_DIFFERENTIAL_67<br />

INCLUDE_ADCA_SAMPLE_0<br />

INCLUDE_ADCB_SAMPLE_0<br />

INCLUDE_ADCA_SAMPLE_1<br />

INCLUDE_ADCB_SAMPLE_1<br />

INCLUDE_ADCA_SAMPLE_2<br />

INCLUDE_ADCB_SAMPLE_2<br />

INCLUDE_ADCA_SAMPLE_3<br />

INCLUDE_ADCB_SAMPLE_3<br />

INCLUDE_ADCA_SAMPLE_4<br />

INCLUDE_ADCB_SAMPLE_4<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 5-25. ADC appconfig.h Settings (Continued)<br />

int •ADC clock divisor value; unless this<br />

value is redefined in appconfig.h, it will<br />

default to 1<br />

•See Section 9.6.2.2 of the<br />

DSP56F80x User’s Manual for details<br />

bool •ADC channel AN0 and AN1 are used<br />

together to measure differential voltage<br />

(true)<br />

•Unless this value is redefined in<br />

appconfig.h, it will default to 0 (false).<br />

bool •ADC channel AN2 and AN3 are used<br />

together to measure differential voltage<br />

(true)<br />

•Unless this value is redefined in<br />

appconfig.h, it will default to 0 (false)<br />

bool •ADC channel AN4 and AN5 are used<br />

together to measure differential voltage<br />

(true)<br />

•Unless this value is redefined in<br />

appconfig.h, it will default to 0 (false)<br />

bool •ADC channel AN6 and AN7 are used<br />

together to measure differential voltage<br />

(true)<br />

•Unless this value is redefined in<br />

appconfig.h, it will default to 0 (false)<br />

bool •Sample 0 (0x01 mask) is allocated and<br />

accessible by the driver (true); this is<br />

defined as a default<br />

bool •Sample 1 (0x02 mask) is allocated and<br />

accessible by the driver (true)<br />

•This is not defined as a default and<br />

would need to be defined in appconfig.h<br />

to use (false).<br />

bool •Sample 2 (0x04 mask) is allocated and<br />

accessible by the driver (true)<br />

•This is not defined as a default and<br />

would need to be defined in appconfig.h<br />

to use (false)<br />

bool •Sample 3 (0x08 mask) is allocated and<br />

accessible by the driver (true)<br />

•This is not defined as a default and<br />

would need to be defined in appconfig.h<br />

to use (false)<br />

bool •Sample 4 (0x10 mask) is allocated and<br />

accessible by the driver (true)<br />

•This is defined as a default<br />

5-36 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

INCLUDE_ADCA_SAMPLE_5<br />

INCLUDE_ADCB_SAMPLE_5<br />

INCLUDE_ADCA_SAMPLE_6<br />

INCLUDE_ADCB_SAMPLE_6<br />

INCLUDE_ADCA_SAMPLE_7<br />

INCLUDE_ADCB_SAMPLE_7<br />

ADC_RAW_ZERO_CROSSING_CALLBACK<br />

ADCA_RAW_ZERO_CROSSING_CALLBACK<br />

ADCB_RAW_ZERO_CROSSING_CALLBACK<br />

ADC_RAW_LOW_LIMIT_CALLBACK<br />

ADCA_RAW_LOW_LIMIT_CALLBACK<br />

ADCB_RAW_LOW_LIMIT_CALLBACK<br />

ADC_RAW_HIGH_LIMIT_CALLBACK<br />

ADCA_RAW_HIGH_LIMIT_CALLBACK<br />

ADCB_RAW_HIGH_LIMIT_CALLBACK<br />

ADC_RAW_CONVERSION_COMPLETE_CALLBACK<br />

ADCA_RAW_CONVERSION_COMPLETE_CALLBACK<br />

ADCB_RAW_CONVERSION_COMPLETE_CALLBACK<br />

ADC Driver<br />

NOTE: See the DSP56F80x User’s Manual for more information on ADC configuration.<br />

The ADC callback functions allow functions created by the user in the application to be called as<br />

a result of ADC specific interrupts.<br />

Callback Prototype:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 5-25. ADC appconfig.h Settings (Continued)<br />

All callback functions should be declared according to the following prototype:<br />

void LocalCallBackFunction(adc_eCallbackType callbackType, adc_tSampleMask causedMask);<br />

where callbackType is a type of callback, and causedMask is a mask for the samples which were<br />

the reason for the callback. See an example of this callback in:<br />

...\src\dsp5680x\nos\applications\adc\adcapp.mcp<br />

bool •Sample 5 (0x20 mask) is allocated and<br />

accessible by the driver (true)<br />

•This is not defined as a default and<br />

would need to be defined in appconfig.h<br />

to use (false)<br />

bool •Sample 6 (0x40 mask) is allocated and<br />

accessible by the driver (true)<br />

•This is not defined as a default and<br />

would need to be defined in appconfig.h<br />

to use (false)<br />

bool •Sample 7 (0x80 mask) is allocated and<br />

accessible by the driver (true)<br />

•This is not defined as a default and<br />

would need to be defined in appconfig.h<br />

to use (false)<br />

/* callback<br />

prototype */<br />

/* callback<br />

prototype */<br />

/* callback<br />

prototype */<br />

/* callback<br />

prototype */<br />

•Zero crossing callback function; see<br />

explanation below<br />

•Low Limit callback function; see<br />

explanation below<br />

•High Limit callback function; see<br />

explanation below<br />

•Conversion complete callback function;<br />

see explanation below<br />

To utilize the callback functions, they must be defined in the appconfig.h of a specific project as<br />

follows:<br />

#define ADC_RAW_ZERO_CROSSING_CALLBACK LocalCallBackFunction1<br />

The function LocalCallBackFunction1 is created by the user in the application and will be called<br />

when the ADC A Zero Crossing interrupt occurs. The type of zero crossing is dependent on the<br />

value set in the structure adc_State, which is discussed in Section 5.4.3.<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-37<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

#define ADC_RAW_LOW_LIMIT_CALLBACK LocalCallBackFunction2<br />

The function LocalCallBackFunction2 is created by the user in the application. This function will<br />

be called when the ADC A Limit Error interrupt occurs as a result of being below the “low limit”.<br />

This limit is based on a threshold defined in the structure adc_State, which is discussed in<br />

Section 5.4.3.<br />

#define ADC_RAW_HIGH_LIMIT_CALLBACK LocalCallBackFunction3<br />

The function LocalCallBackFunction3 is created by the user in the application. This function will<br />

be called when the ADC A Limit Error interrupt occurs as a result of exceeding the “high limit”.<br />

This limit is based on a threshold defined in the structure adc_State, which is discussed in<br />

Section 5.4.3.<br />

#define ADC_RAW_CONVERSION_COMPLETE_CALLBACK LocalCallBackFunction4<br />

The function LocalCallBackFunction4 is created by the user in the application. This function will<br />

be called when the ADC A Conversion Complete interrupt occurs.<br />

The ADC A Zero Crossing, ADC A Limit Error, and ADC A Conversion Complete interrupts are<br />

enabled when INCLUDE_ADC is #defined in the appconfig.h of a project. The interrupts are<br />

enabled within the Group Priority Register (GPR) with a default priority of 1. This priority can be<br />

redefined within the appconfig.h from 1 to 7, with 7 the highest priority and 1 the lowest priority.<br />

The interrupts should not be redefined to 0, as this will cause the interrupt to be disabled and the<br />

ADC driver will not function properly. An example is shown below:<br />

#define GPR_INT_PRIORITY_55 2<br />

This will redefine the ADC A Conversion Complete interrupt priority from 1 to 2 within the Group<br />

Priority Register. See Section 7.1.7.2.1, Interrupts, in the Programmer’s Guide for more details.<br />

5.4.3 API Definition<br />

This section defines the Application Programming Interface (API) by identifying all public<br />

interface functions and data structures.<br />

Code to create and initialize the ADC driver is automatically included in an <strong>SDK</strong> <strong>Embedded</strong><br />

Project by inserting the following line in the appconfig.h file:<br />

#define INCLUDE_ADC<br />

The following information may be found in the public header file adc.h:<br />

Public Interface Function(s):<br />

/*****************************************************************************<br />

* int open(const char *pName, int OFlags, &AdcConfig);<br />

* ssize_t read(int FileDesc, void * pBuffer, size_t Size);<br />

* int close(int FileDesc);<br />

* UWord16 ioctl(int FileDesc, UWord16 Cmd, void * pParams);<br />

*****************************************************************************/<br />

Public Data Structure(s):<br />

typedef struct<br />

{<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

5-38 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

adc_eAnalogChannel AnalogChannel;<br />

adc_tSampleMask openSampleMask;<br />

Frac16 OffsetRegister;<br />

Frac16 LowLimitRegister;<br />

Frac16 HighLimitRegister;<br />

adc_eZeroCrossing ZeroCrossing;<br />

} adc_sState;<br />

Table 5-26. ADC Data Structure Members<br />

AnalogChannel adc_eAnalogChannel •Analog channel number; possible value is:<br />

•ADC_CHANNEL_0, ADC_CHANNEL_1,<br />

•ADC_CHANNEL_2, ADC_CHANNEL_3,<br />

•ADC_CHANNEL_4, ADC_CHANNEL_5,<br />

•ADC_CHANNEL_6, ADC_CHANNEL_7<br />

ADC Driver<br />

openSampleMask adc_tSampleMask •The mask of samples per scan. Each channel can allocate<br />

any number of samples 1 .<br />

•For scaleability reason each sample are configured<br />

statically by “include sample” like statement (see<br />

Table 5-25 )<br />

OffsetRegister Frac16 •Offset register value<br />

LowLimitRegister Frac16 •Low limit register value<br />

HighLimitRegister Frac16 •High limit register value<br />

ZeroCrossing adc_eZeroCrossing •ADC_ZC_DISABLE<br />

•ADC_ZC_POSITIVE_NEGATIVE<br />

•ADC_ZC_NEGATIVE_POSITIVE<br />

•ADC_ZC_ANY<br />

1.Some ADC hardware algorithms depend on index sample number. So sample 1 (0x01 openSampleMask) is<br />

more preferable to used than sample 8 (0x80 openSampleMask) due to performance reasons.<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-39<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.4.4 ADC Device-Independent I/O API Specifications<br />

The following pages specify the device-independent Application Programming Interface (API).<br />

Function arguments for each routine are described as in, out, or inout. An in argument means that<br />

the parameter value is an input only to the function. An out argument means that the parameter<br />

value is an output only from the function. An inout argument means that a parameter value is an<br />

input to the function, but the same parameter is also an output from the function.<br />

Typically, inout parameters are input pointer variables in which the caller passes the address of a<br />

preallocated data structure to a function. The function stores its results within that data structure.<br />

The actual value of the inout pointer parameter is not changed.<br />

5-40 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.4.4.1 open<br />

Call(s):<br />

int open(const char *pName, int OFlags, adc_sState * pState);<br />

ADC Driver<br />

Description: The open call opens the ADC channel for operations and returns a file descriptor<br />

used by read function calls. The ADC channel device needs to be opened for read/write calls.<br />

Returns: The open call returns a type int. When the open call is successful, this int is a file<br />

descriptor for the ADC device. This file descriptor is used by the ADC driver’s read, close, and<br />

ioctl functions. A “-1” is returned when the open call is not successful.<br />

Code Example: See Code Example 5-6.<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 5-27. ADC Driver Arguments - open<br />

pName in The ADC device name; the open statement is applied for the ADC analog<br />

channel (AN0-AN7)<br />

The device names are:<br />

BSP_DEVICE_NAME_ADC_0<br />

BSP_DEVICE_NAME_ADC_1<br />

OFlag in Open Mode Flags; use O_RDONLY only<br />

pState in Pointer to channel parameters<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-41<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

5.4.4.2 read<br />

Call(s):<br />

ssize_t read(int FileDesc, void * pBuffer, size_t Size);<br />

Description: The read call reads data from ADC channel into the user buffer.<br />

Returns: The read call returns a type ssize_t. This ssize_t is the number of read values.<br />

Code Example: See Code Example 5-6.<br />

Table 5-28. ADC Driver Arguments - read<br />

FileDesc in ADC device descriptor returned by open call and used in read function calls<br />

pBuffer in Pointer to user buffer<br />

Size in Size of data to read/write<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5-42 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.4.4.3 close<br />

Call(s):<br />

int close (int FileDesc);<br />

Description: The close call closes the ADC channel.<br />

Returns: The close call returns a type int. This int is always zero.<br />

Code Example: See Code Example 5-6.<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 5-29. ADC Driver Arguments - close<br />

FileDesc in ADC device descriptor returned by open call and used in read function calls<br />

ADC Driver<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-43<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

5.4.4.4 ioctl<br />

Call(s):<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Word16 ioctl(int FileDesc, UWord16 Cmd, void * pParams,);<br />

Table 5-30. ADC Driver Arguments<br />

FileDesc in ADC device descriptor returned by open call and used in read function calls<br />

Cmd in Commands found in adc.h which are used to manage the ADC driver<br />

pParams in Pointer to ioctl command parameter<br />

Table 5-31. ADC ioctl Commands<br />

Cmd pParams Return Result<br />

ADC_START NULL None Starts ADC device<br />

ADC_STOP NULL None Stops ADC device<br />

ADC_TEST_MODE NULL None ADC in test mode<br />

ADC_SYNC_ON NULL None Synchronizes ADC<br />

ADC_SYNC_OFF NULL None Disables ADC synchronization<br />

ADC_DISABLE_CALLBACKS adc_eCallbackType None Disables user callbacks (no<br />

impact on conversion complete<br />

callback)<br />

ADC_ENABLE_CALLBACKS adc_eCallbackType None Enables user callback (no impact<br />

on conversion complete<br />

callback)<br />

ADC_SET_DIVISOR UWord16:4 None Sets ADC devisor in run-time<br />

ADC_SET_LOW_LIMIT_REGISTER Frac16 None Assigns low limit register<br />

ADC_SET_HIGH_LIMIT_REGISTER Frac16 None Assigns high limit register<br />

ADC_SET_OFFSET_REGISTER Frac16 None Assigns offset register<br />

ADC_STATE_READ Frac16* int Reads static data and returns<br />

size of read data<br />

ADC_SET_ZERO_CROSSING_MODE adc_eZeroCrossing none Sets ADC zero crossing mode<br />

ADC_GET_NUM_SAMPLES_PER_SCAN int int The routine return mask of<br />

reasonable samples for next<br />

open; added for compatibility<br />

with previous version<br />

Description: The ioctl call changes ADC channel modes.<br />

5-44 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

ADC Driver<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Returns: The ioctl call returns a type UWord16. This UWord16 is dependent on the command<br />

passed in as an input parameter.Table 5-31 lists these returns based on the specific command.<br />

Code Example: Code Example 5-6 sets up the ADC to read data into ReadValue from ADC<br />

channel 6. ADC channel 6 is found on connector J9, pin 7, of the DSP56F803EVM; connector J9,<br />

pin 6, of the DSP56F805EVM; and connector J9, pin 6, of the DSP56F807EVM.<br />

Code Example 5-6. ADC Driver Usage<br />

/****************************************************************************/<br />

#include "port.h"<br />

#include "io.h"<br />

#include "fcntl.h"<br />

#include "bsp.h"<br />

#include "adc.h"<br />

#define ONE_VOLT 0x26C9 /* (32768 * (1/3.3 Volts)) */<br />

static const adc_sState sAdc1 = {<br />

/* AnalogChannel = */ADC_CHANNEL_6,<br />

/* NumSamplesPerScan = */ 1,<br />

/* OffsetRegister = */ 0,<br />

/* LowLimitRegister = */ 0,<br />

/* HighLimitRegister = */ 0,<br />

/* ZeroCrossing = */ 0,<br />

};<br />

void main(void)<br />

{<br />

int NumberRead;<br />

int Handle;<br />

Frac16 ReadValue;<br />

/* open ADC A device for reads */<br />

Handle = open(BSP_DEVICE_NAME_ADC_0, 0, &sAdc1);<br />

/* starts conversion process of adc */<br />

ioctl(Handle, ADC_START, 0);<br />

/* sit in loop and read adc until read a value greater than 1 volt */<br />

while(1)<br />

{<br />

NumberRead = read(Handle, &ReadValue, sizeof(ReadValue));<br />

}<br />

if(ReadValue > ONE_VOLT)<br />

{<br />

break;<br />

}<br />

close(Handle);<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

}<br />

/****************************************************************************/<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-45<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.4.5 ADC Low-Level I/O API Specifications<br />

The following pages specify the Low-Level Application Programming Interface (API).<br />

Function arguments for each routine are described as in, out, or inout. An in argument means that<br />

the parameter value is an input only to the function. An out argument means that the parameter<br />

value is an output only from the function. An inout argument means that a parameter value is an<br />

input to the function, but the same parameter is also an output from the function.<br />

Typically, inout parameters are input pointer variables in which the caller passes the address of a<br />

preallocated data structure to a function. The function stores its results within that data structure.<br />

The actual value of the inout pointer parameter is not changed.<br />

5-46 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.4.5.1 adcOpen<br />

Call(s):<br />

int adcOpen(const char *pName, int OFlags, adc_sState * pState);<br />

Description: The adcOpen opens the ADC device and configures initial parameters.<br />

Returns: The adcOpen returns the ADC device handle or “-1” if it fails.<br />

Code Example: See Code Example 5-7.<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 5-32. ADC Driver Arguments - open<br />

pName in The ADC device name; the adcOpen statement is applied for the ADC analog<br />

channel (AN0-AN7)<br />

The device names are:<br />

BSP_DEVICE_NAME_ADC_0<br />

BSP_DEVICE_NAME_ADC_1<br />

OFlag in adcOpen Mode Flags; use O_RDONLY only<br />

pState in Pointer to channel parameters<br />

ADC Driver<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-47<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

5.4.5.2 adcRead<br />

Call(s):<br />

ssize_t adcRead(int FileDesc, void * pBuffer, size_t);<br />

Description: The read call reads data from ADC channel into the user buffer.<br />

Returns: The read call returns a type ssize_t. This ssize_t is the number of read values.<br />

Code Example: See Code Example 5-7.<br />

Table 5-33. adcRead driver Arguments - read<br />

FileDesc in ADC device descriptor returned by adcOpen call and used in read function calls<br />

pBuffer in Pointer to user buffer<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Size_t in Size (unsigned int) of data to read / write<br />

5-48 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.4.5.3 adcClose<br />

Call(s):<br />

int adcClose (int FileDesc);<br />

Description: The close call closes the ADC channel.<br />

Returns: The close call returns a type int. This int is always zero.<br />

Code Example: See Code Example 5-7.<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 5-34. ADC Driver Arguments - close<br />

FileDesc in ADC device descriptor returned by open call and used in read function calls<br />

ADC Driver<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-49<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

5.4.5.4 adcIoctl<br />

Call(s):<br />

UWord16 adcIoctl(int FileDesc, UWord16 Cmd, void * pParams, char * adcDevice);<br />

Description: The adcIoctl call changes ADC device modes.<br />

Returns: The adcIoctl call returns a type UWord16. This UWord16 is dependent on the command<br />

passed in as an input parameter. Table 5-31 lists these returns based on the specific command.<br />

Code Example 5-7. ADC Low-Level Driver Usage<br />

/****************************************************************************/<br />

#include "port.h"<br />

#include "bsp.h"<br />

#include "adc.h"<br />

#define ONE_VOLT 0x26C9 /* (32768 * (1/3.3 Volts)) */<br />

static const adc_sState sadc = {<br />

/* AnalogChannel = */ADC_CHANNEL_6,<br />

/* NumSamplesPerScan = */ 1,<br />

/* OffsetRegister = */ 0,<br />

/* LowLimitRegister = */ 0,<br />

/* HighLimitRegister = */ 0,<br />

/* ZeroCrossing = */ 0,<br />

};<br />

void main(void)<br />

{<br />

int NumberRead;<br />

int AdcFD;<br />

Frac16 ReadValue;<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 5-35. GPIO Driver Arguments<br />

FileDesc in GPIO device descriptor returned by open call and used in ioctl function calls<br />

Cmd in Commands found in adc.h which are used to manage the adc device; see Table 5-31<br />

pParams in Pointer to ioctl command parameter<br />

adcDevice in The adc device name; see Table 5-32<br />

/* ADC initialization */<br />

AdcFD = adcOpen( BSP_DEVICE_NAME_ADC_0, 0, (adc_sState *)&sadc );<br />

adcIoctl(AdcFD, ADC_START, 0, BSP_DEVICE_NAME_ADC_0);<br />

/* sit in loop and read adc until read a value greater than 1 volt */<br />

while(1)<br />

{<br />

5-50 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

NumberRead = adcRead(AdcFD, &ReadValue, sizeof(ReadValue));<br />

if(ReadValue > ONE_VOLT)<br />

{<br />

break;<br />

}<br />

}<br />

adcClose(AdcFD);<br />

}<br />

/****************************************************************************/<br />

ADC Driver<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-51<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

5.4.6 ADC Driver Application<br />

For the DSP56F801 and DSP56F802:<br />

The RUN/STOP toggle switch is connected to the ADCA analog channel, by design, on the<br />

DSP56F801EVM target board. The ADC Driver application uses the Green LED to indicate the<br />

state of the RUN/STOP toggle switch. When the switch is in the RUN state, the application<br />

detects a Logic One voltage level on the ADC channel and turns the Green LED On. When the<br />

switch is in the STOP state, the Green LED is Off.<br />

For the DSP56F803:<br />

The RUN/STOP toggle switch is connected to the ADCA analog channel, by design, on the<br />

DSP56F803EVM target board. The ADC Driver application uses the Green LEDto indicate the<br />

state of the RUN/STOP toggle switch. When the switch is in the RUN state, the application<br />

detects a Logic One voltage level on the ADC channel and turns the Green LED On. When the<br />

switch is in the STOP state, the Green LED is Off.<br />

For the DSP56F805:<br />

The RUN/STOP toggle switch must be connected to the ADCA analog channel by connecting a<br />

jumper wire from the GPIO Port D PD5(J4-6) output pin to the ADCA Channel 7<br />

ADCA-AN7(J9-8) input pin on the DSP56F805EVM target board. The ADC Driver application<br />

uses the Green LED to indicate the state of the RUN/STOP toggle switch. When the switch is in<br />

the RUN state, the application detects a Logic One voltage level on the ADC channel and turns<br />

the Green LED On. When the switch is in the STOP state, the Green LED is Off. The application<br />

also senses the voltages on the ADCA Channel 0 and Channel 1 inputs. A Logic One voltage on<br />

Channel 0 turns the Red LED On and a Logic One voltage on Channel 1 turns the Yellow LED<br />

On. Additional LEDs indicate the status of the AN0 and AN1 analog channels. The user can<br />

connect AN0 (J9-1) and AN1 (J9-3) pins to 3.3V on the EVM board to indicate a Logic One<br />

voltage level.<br />

For the DSP56F807:<br />

The RUN/STOP toggle switch must be connected to the ADCA analog channel by connecting a<br />

jumper wire from the GPIO Port D PD5(J23-6) output pin to the ADCA Channel 7<br />

ADCA-AN7(J9-8) input pin on the DSP56F807EVM target board. The ADC Driver application<br />

uses the Green LED to indicate the state of the RUN/STOP toggle switch. When the switch is in<br />

the RUN state, the application detects a Logic One voltage level on the ADC channel and turns<br />

the Green LED On. When the switch is in the STOP state, the Green LED is Off. The application<br />

senses the voltages on the ADCA Channel 1 input pin (J9-3) and also senses the voltages on the<br />

ADCB Channel 0 input pin (J12-1). A Logic One voltage on Channel 0 turns the Red LED On<br />

and a Logic One voltage on Channel 1 turns the Yellow LED On.<br />

Jumper Settings:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Use the default jumper settings for the specific DSP56F80xEVM board. For more information on<br />

jumper settings, see the Evaluation Module Hardware User’s Manual for a specific target (i.e., the<br />

DSP56F805 Evaluation Module Hardware User’s Manual).<br />

5-52 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Quad Timer Driver<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.5 Quad Timer Driver<br />

5.5.1 Introduction<br />

The DSP56F80x processor has four Quad Timers with four channels. Pin availability for the quad<br />

timers is different for each chip. (Please refer to Chapter 14 in the DSP56F80x User’s Manual<br />

for more information on these configuration settings.)<br />

In Table 5-36, a channel listed for a particular chip signifies a pin is available for that channel on<br />

that chip:<br />

The Quad Timer driver provides a standard <strong>SDK</strong> interface for each device.<br />

5.5.2 Initialization<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Table 5-36. Pin Availability of Quad Timers for Specific Chips<br />

DSP56F801/802 DSP56F803 DSP56F805 DSP56F807<br />

•Timer D Channels 0 - 2 •Timer A channels 0 - 3<br />

•Timer D channels 1 - 2<br />

•Timer A Channels 0 - 3<br />

•Timer B Channels 0 - 3<br />

•Timer C Channels 0 - 1<br />

•Timer D Channels 0 - 3<br />

The Quad Timer driver has a default configuration that is defined in config.h. These default<br />

configuration settings can be redefined in the appconfig.h for a specific project.<br />

To operate with a particular quad timer, the user application must #define that quad timer in<br />

appconfig.h. If definitions are declared as a “1”, this timer will be used by the POSIX timer driver<br />

(See Section 5.1.5 for the user interface definition and specification). If definitions are declared as<br />

a “0”, this timer will be used only by the quad timer. An example is shown below:<br />

#define INCLUDE_USER_TIMER_A_0 0 /* only quad timer */<br />

#define INCLUDE_USER_TIMER_D_0 1 /* used for POSIX timer */<br />

•Timer A Channels 0 - 3<br />

•Timer B Channels 0 - 3<br />

•Timer C Channels 0 - 1<br />

•Timer D Channels 0 - 3<br />

The complete list of quad timers that can be #defined in the appconfig.h are listed in Table 5-37.<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-53<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

For DSP56F801 and DSP56F802:<br />

The DSP56F801 and DSP56F802 chips have two dedicated Quad Timers: D and C. Timer D has<br />

three input pins for external interface. Timer C can be used for applications internal to the chip;<br />

this timer has no external pins.<br />

For DSP56F803:<br />

The DSP56F803 chip has a dedicated Quad Timer D and an optional Quad Timer A. Timer B and<br />

Timer C can be used for applications internal to the chip; these timers have no pins available for<br />

them.<br />

For DSP56F805:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 5-37. Quad Timers<br />

Timer State<br />

INCLUDE_USER_TIMER_A_0 Defaults as a quad timer if not overwritten in appconfig.h when<br />

INCLUDE_QUAD_TIMER is defined<br />

INCLUDE_USER_TIMER_A_1 Defaults as a quad timer if not overwritten in appconfig.h when<br />

INCLUDE_QUAD_TIMER is defined<br />

INCLUDE_USER_TIMER_A_2 Default as a quad timer if not overwritten in appconfig.h when<br />

INCLUDE_QUAD_TIMER is defined<br />

INCLUDE_USER_TIMER_A_3 Default as a quad timer if not overwritten in appconfig.h when<br />

INCLUDE_QUAD_TIMER is defined<br />

INCLUDE_USER_TIMER_B_0 Not a default, must be defined in appconfig.h of project to use<br />

INCLUDE_USER_TIMER_B_1 Not a default, must be defined in appconfig.h of project to use<br />

INCLUDE_USER_TIMER_B_2 Not a default, must be defined in appconfig.h of project to use<br />

INCLUDE_USER_TIMER_B_3 Not a default, must be defined in appconfig.h of project to use<br />

INCLUDE_USER_TIMER_C_0 Not a default, must be defined in appconfig.h of project to use<br />

INCLUDE_USER_TIMER_C_1 Not a default, must be defined in appconfig.h of project to use<br />

INCLUDE_USER_TIMER_C_2 Not a default, must be defined in appconfig.h of project to use<br />

INCLUDE_USER_TIMER_C_3 Not a default, must be defined in appconfig.h of project to use<br />

INCLUDE_USER_TIMER_D_0 Not a default, must be defined in appconfig.h of project to use<br />

INCLUDE_USER_TIMER_D_1 Not a default, must be defined in appconfig.h of project to use<br />

INCLUDE_USER_TIMER_D_2 Not a default, must be defined in appconfig.h of project to use<br />

INCLUDE_USER_TIMER_D_3 Not a default, must be defined in appconfig.h of project to use<br />

The DSP56F805 chip has two dedicated Quad Timers C and D. The DSP56F805 chip also has<br />

two optional Quad Timers: A and B.<br />

5-54 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

For DSP56F807:<br />

Quad Timer Driver<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The DSP56F807 chip has two dedicated Quad Timers: C and D. The DSP56F807 chip also has<br />

two optional Quad Timers: A and B.<br />

All of the timers which can be used are defined in the device list of bsp.h header. These quad<br />

timers are opened through the open function call explained in the following section.<br />

5.5.3 API Definition<br />

This section defines the Application Programming Interface (API) by identifying all public<br />

interface functions and data structures.<br />

Code to create and initialize the Quad Timer driver may automatically be included in an <strong>SDK</strong><br />

<strong>Embedded</strong> Project by inserting the following line in the appconfig.h file:<br />

#define INCLUDE_QUAD_TIMER<br />

The following information may be found in the public header file quadraturetimer.h:<br />

Public Interface Function(s):<br />

/*****************************************************************************<br />

* int open(const char *pName, int OFlags,...);<br />

* int close(int FileDesc);<br />

* UWord16 ioctl(int FileDesc, UWord16 Cmd, void * pParams);<br />

* UWord16 qtIoctl(int FileDesc, UWord16 Cmd, void * pParams, void *<br />

bspDeviceName);<br />

*****************************************************************************/<br />

Public Data Structure(s):<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

typedef struct<br />

{<br />

qt_eMode Mode;<br />

qt_eInputSource InputSource;<br />

qt_ePolarity InputPolarity;<br />

qt_eSecondaryInputSource SecondaryInputSource;<br />

qt_eCountFrequency CountFrequency;<br />

qt_eCountLength CountLength;<br />

qt_eCountDirection CountDirection;<br />

qt_eOutputMode OutputMode;<br />

qt_ePolarity OutputPolarity;<br />

bool OutputDisabled;<br />

bool Master;<br />

bool OutputOnMaster;<br />

bool CoChannelInitialize;<br />

bool AssertWhenForced;<br />

qt_eCaptureMode CaptureMode;<br />

UInt16 CompareValue1;<br />

UInt16 CompareValue2;<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-55<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

UInt16 InitialLoadValue;<br />

}qt_sState;<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

qt_sCallback CallbackOnCompare;<br />

qt_sCallback CallbackOnOverflow;<br />

qt_sCallback CallbackOnInputEdge;<br />

Table 5-38. Quad Timer Data Structure Members<br />

Parameter Type Description<br />

Mode qt_eMode Quad timer count mode Possible<br />

values are:<br />

•qtCount<br />

•qtCountBothEdges<br />

•qtGatedCount<br />

•qtQuadratureCount<br />

•qtSignedCount<br />

•qtTriggeredCount<br />

•qtCascadeCount<br />

•qtOneShot<br />

•qtPulseOutput<br />

•qtFixedFreqPWM<br />

•qtVariableFreqPWM<br />

InputSource qt_eInputSource •Primary count source type<br />

Possible values are:<br />

•qtCounter0Input<br />

•qtCounter1Input<br />

•qtCounter2Input,<br />

•qtCounter3Input<br />

•qtCounter0Output<br />

•qtCounter1Output<br />

•qtCounter2Output<br />

•qtCounter3Output<br />

•qtPrescalerDiv1<br />

•qtPrescalerDiv2<br />

•qtPrescalerDiv4<br />

•qtPrescalerDiv8<br />

•qtPrescalerDiv16<br />

•qtPrescalerDiv32<br />

•qtPrescalerDiv64<br />

•qtPrescalerDiv128<br />

InputPolarity qt_ePolarity Input polarity<br />

Possible values are:<br />

•qtNormal<br />

•qtInverted<br />

SecondaryInputSource qt_eSecondaryInputSource Secondary count source type<br />

Possible value are:<br />

•qtSISCounter0Input<br />

•qtSISCounter1Input<br />

•qtSISCounter2Input<br />

•qtSISCounter3Input<br />

Quad Timer<br />

Register Reference<br />

Counting options;<br />

count code of control<br />

register<br />

Primary count<br />

source of control<br />

register<br />

Input polarity select<br />

of status and control<br />

register<br />

Secondary input<br />

source of control<br />

register<br />

5-56 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Quad Timer Driver<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 5-38. Quad Timer Data Structure Members (Continued)<br />

CountFrequency qt_eCountFrequency To select continuous or one shot<br />

counting mode<br />

Possible values are:<br />

•qtRepeatedly<br />

•qtOnce<br />

CountLength qt_eCountLength Re-initialize after a compare or<br />

do not re-initialize after a<br />

compare.<br />

Possible values are:<br />

•qtPastCompare<br />

•qtUntilCompare<br />

CountDirection qt_eCountDirection Normal or reverse direction<br />

Possible value are:<br />

•qtUp<br />

•qtDown<br />

OutputMode qt_eOutputMode Output mode possible values<br />

are:<br />

•qtAssertWhileActive<br />

•qtAssertOnCompare<br />

•qtDeassertOnCompare<br />

•qtToggleOnCompare<br />

•qtToggleUsingAlternateCompar<br />

e<br />

•qtDeassertOnSecondary<br />

•qtDeassertOnCounterRollover<br />

•qtAssertOnGatedClock<br />

OutputPolarity qt_ePolarity Output polarity<br />

Possible values are:<br />

•qtNormal<br />

•qtInverted<br />

OutputDisabled bool Enable (true) / disable (false)<br />

output<br />

Count once of<br />

control register<br />

Count length of<br />

control register<br />

Count direction of<br />

control register<br />

Output mode of<br />

control register<br />

Output polarity<br />

select of status and<br />

control register<br />

Output enable of<br />

status and control<br />

register<br />

Master bool Master mode (true) Master mode of<br />

status and control<br />

register<br />

OutputOnMaster bool Enable as a master to force the<br />

state of counter by OFLAG (true)<br />

CoChannelInitialize bool Enable another counter force the<br />

initialization (true)<br />

CaptureMode qt_eCaptureMode Counter capture mode:<br />

•qtDisabled<br />

•qtRisingEdge<br />

•qtFallingEdge<br />

•qtBothEdges<br />

Enable external<br />

OFLAG force<br />

Co-channel<br />

initialization of status<br />

register<br />

Input capture mode<br />

of status and control<br />

register<br />

CompareValue1 UInt16 Compare value 1 Compare register 1<br />

CompareValue2 UInt16 Compare value 2 Compare register 2<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-57<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

InitialLoadValue UInt16 Initial load value Counter register<br />

CallbackOnCompare qt_sCallback User callback on compare See explanation<br />

below<br />

CallbackOnOverflow qt_sCallback User callback on overflow See explanation<br />

below<br />

CallbackOnInputEdge qt_sCallback User callback on input edge See explanation<br />

below<br />

The Quad driver callback functions allow functions created by the user in the application to be<br />

called as a result of Quad Timer-specific interrupts. These Quad Timer-specific interrupts can be<br />

seen by referring to Table 4-1 of the DSP56F80x User’s Manual.<br />

The three types of callback functions that the Quad Timer driver allows are:<br />

• callback on compare<br />

• callback on overflow<br />

• callback on an input edge<br />

To utilize the callback functions, they must be passed into the open function via the qt_sState<br />

data structure. As shown in Code Example 5-8, where the user has defined a callback function,<br />

CallbackOnCompare0, with input argument 0. This data structure would then be passed into<br />

specific ioctl/qtioctl functions.<br />

Code Example 5-8. qt_sState<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 5-38. Quad Timer Data Structure Members (Continued)<br />

const qt_sState quadParam0 = {<br />

/* Mode = */ qtCount,<br />

/* InputSource = */ qtPrescalerDiv128,<br />

/* InputPolarity = */ qtNormal,<br />

/* SecondaryInputSource = */ 0,<br />

/* CountFrequency = */ qtOnce,<br />

/* CountLength = */ qtUntilCompare,<br />

/* CountDirection = */ qtDown,<br />

/* OutputMode = */ qtAssertWhileActive,<br />

/* OutputPolarity = */ qtNormal,<br />

/* OutputDisabled = */ 1,<br />

/* Master = */ 0,<br />

/* OutputOnMaster = */ 0,<br />

/* CoChannelInitialize = */ 0,<br />

/* AssertWhenForced = */ 0,<br />

/* CaptureMode = */ qtDisabled,<br />

/* CompareValue1 = */ 0x8000,<br />

/* CompareValue2 = */ 0,<br />

/* InitialLoadValue = */ 0xFFFF,<br />

/* CallbackOnCompare = */ {CallbackOnCompare0, 0},<br />

/* CallbackOnOverflow = */ {0, 0},<br />

/* CallbackOnInputEdge = */ {0, 0}<br />

};<br />

5-58 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Quad Timer Driver<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.5.4 Quad Device-Independent I/O API Specifications<br />

The following pages specify the device independent Application Programming Interface (API).<br />

Function arguments for each routine are described as in, out, or inout. An in argument means that<br />

the parameter value is an input only to the function. An out argument means that the parameter<br />

value is an output only from the function. An inout argument means that a parameter value is an<br />

input to the function, but the same parameter is also an output from the function.<br />

Typically, inout parameters are input pointer variables in which the caller passes the address of a<br />

preallocated data structure to a function. The function stores its results within that data structure.<br />

The actual value of the inout pointer parameter is not changed.<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-59<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

5.5.4.1 open<br />

Call(s):<br />

int open(const char *pName, int OFlags,...);<br />

Description: The open call opens the Quad Timer peripheral for operations and returns a file<br />

descriptor used by ioctl function calls.<br />

Returns: The open call returns a type int. When the open call is successful, this int is a file<br />

descriptor for the Quad Timer driver. This file descriptor is used by the Quad Timer driver’s close<br />

and ioctl functions. A “-1” is returned when the open call is not successful.<br />

Code Example: See Code Example 5-9.<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 5-39. Quad Driver Arguments - open<br />

pName in The Quad Timer device name:<br />

BSP_DEVICE_NAME_QUAD_TIMER_A_0<br />

BSP_DEVICE_NAME_QUAD_TIMER_A_1<br />

BSP_DEVICE_NAME_QUAD_TIMER_A_2<br />

BSP_DEVICE_NAME_QUAD_TIMER_A_3<br />

BSP_DEVICE_NAME_QUAD_TIMER_B_0<br />

BSP_DEVICE_NAME_QUAD_TIMER_B_1<br />

BSP_DEVICE_NAME_QUAD_TIMER_B_2<br />

BSP_DEVICE_NAME_QUAD_TIMER_B_3<br />

BSP_DEVICE_NAME_QUAD_TIMER_C_0<br />

BSP_DEVICE_NAME_QUAD_TIMER_C_1<br />

BSP_DEVICE_NAME_QUAD_TIMER_C_2<br />

BSP_DEVICE_NAME_QUAD_TIMER_C_3<br />

BSP_DEVICE_NAME_QUAD_TIMER_D_0<br />

BSP_DEVICE_NAME_QUAD_TIMER_D_1<br />

BSP_DEVICE_NAME_QUAD_TIMER_D_2<br />

BSP_DEVICE_NAME_QUAD_TIMER_D_3<br />

OFlag in Open Mode Flags; use 0 because read and write are not supported<br />

FileDesc out Quad Timer device descriptor returned by open call and used in ioctl function calls<br />

5-60 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.5.4.2 close<br />

Call(s):<br />

Quad Timer Driver<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

int close (int FileDesc);<br />

Description: The close call closes the Quad Timer peripheral.<br />

Returns: The close call returns a type int. This int is always zero.<br />

Code Example: See Code Example 5-9.<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Table 5-40. Quad Timer Driver Arguments - close<br />

FileDesc in Quad Timer device descriptor returned by open call and used in ioctl function calls<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-61<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

5.5.4.3 ioctl and qtIoctl<br />

The timer supports both ioctl and qtIoctl statements; generally, qtIoctl provides more optimal<br />

code.<br />

Call(s):<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

UWord16 ioctl(int FileDesc, UWord16 Cmd, void * pParams);<br />

UWord16 qtIoctl(int FileDesc, UWord16 Cmd, void * pParams, void *<br />

bspDeviceName);<br />

Table 5-41. Quad Timer Driver Arguments<br />

FileDesc in Quad Timer device descriptor returned by open call and used in ioctl<br />

function calls<br />

Cmd in Commands found in quadtimer.h which are used to manage the Quad<br />

Timer driver<br />

pParams in Pointer to ioctl command parameter; see Table 5-42<br />

bspDeviceName void* BSP device name which was used in open statement<br />

Table 5-42. Quad Timer ioctl/qIoctl Commands<br />

Cmd pParams Return Result<br />

QT_ENABLE qt_sState None Enable (Start) timer<br />

QT_FAST_RESTART qt_eMode None Fast timer restart if condition is not<br />

changed<br />

QT_DISABLE NULL Nine Disable (Stop) timer<br />

QT_DISABLE_CALLBACK qt_eCallback None Disable user Callback<br />

QT_ENABLE_CALLBACK qt_eCallback None Enable user Callback<br />

QT_ENABLE_OUTPUT NULL None Connect timer Output signal to the<br />

external pin<br />

QT_DISABLE_OUTPUT NULL None Disable timer Output<br />

QT_FORCE_OUTPUT bool None Force Output timer signal to the input<br />

value<br />

QT_ENABLE_CAPTURE_REG NULL None Enable Capture Register<br />

QT_GET_STATUS NULL UWord16 Get Status register value<br />

QT_WRITE_COMPARE_VALUE1 UWord16 None Write Compare register 1<br />

QT_WRITE_COMPARE_VALUE2 UWord16 None Write Compare register 2<br />

QT_WRITE_INITIAL_LOAD_VALUE UWord16 None Write Initial Load Value register<br />

QT_READ_CAPTURE_REG NULL UWord16 Get Capture Register value<br />

5-62 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Quad Timer Driver<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 5-42. Quad Timer ioctl/qIoctl Commands (Continued)<br />

QT_READ_HOLD_REG NULL UWord16 Get Hold Register value<br />

QT_READ_COUNTER_REG NULL UWord16 Get Counter Register value<br />

QT_WRITE_COUNTER_REG UWord16 NULL Set Counter Register<br />

QT_GET_INPUT_CLK_FREQ UWord32 * (addr<br />

of output value<br />

Description: The ioctl call changes device modes.<br />

Returns: The ioctl call returns a type UWord16. This UWord16 is dependent on the command<br />

passed in as an input parameter. Table 5-42 lists these returns based on the specific command.<br />

Code Example: Code Example 5-9 sets up Quad Timer 1, Channel Zero, to turn the Green LED<br />

On and Off.<br />

Code Example 5-9. Quad Timer Driver Usage<br />

/****************************************************************************/<br />

#include "port.h"<br />

#include "io.h"<br />

#include "fcntl.h"<br />

#include "bsp.h"<br />

#include "quadraturetimer.h"<br />

#include "led.h"<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

None Get Input Clock Frequency<br />

QT_SET_INPUT_CAPTURE_MODE qt_eCaptureMode None Set Input Capture Mode<br />

QT_FAST_RESTART qt_eMode None Fast Restart (Counter mode)<br />

static void CallbackOnCompare0(qt_eCallbackType CallbackType, void* pParam);<br />

const qt_sState quadParam0 = {<br />

/* Mode = */ qtCount,<br />

/* InputSource = */ qtPrescalerDiv128,<br />

/* InputPolarity = */ qtNormal,<br />

/* SecondaryInputSource = */ 0,<br />

/* CountFrequency = */ qtOnce,<br />

/* CountLength = */ qtUntilCompare,<br />

/* CountDirection = */ qtDown,<br />

/* OutputMode = */ qtAssertWhileActive,<br />

/* OutputPolarity = */ qtNormal,<br />

/* OutputDisabled = */ 1,<br />

/* Master = */ 0,<br />

/* OutputOnMaster = */ 0,<br />

/* CoChannelInitialize = */ 0,<br />

/* AssertWhenForced = */ 0,<br />

/* CaptureMode = */ qtDisabled,<br />

/* CompareValue1 = */ 0x8000,<br />

/* CompareValue2 = */ 0,<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-63<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

};<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

/* InitialLoadValue = */ 0xFFFF,<br />

/* CallbackOnCompare = */ {CallbackOnCompare0, 0},<br />

/* CallbackOnOverflow = */ {0, 0},<br />

/* CallbackOnInputEdge = */ {0, 0}<br />

Word16 Counter;<br />

bool ServicedInterrupt = true;<br />

/*****************************************************************************/<br />

main()<br />

{<br />

int LedFD;<br />

int TimerCompare0;<br />

/* open LED driver */<br />

LedFD = open(BSP_DEVICE_NAME_LED_0, 0);<br />

/* turn on “Green” LED */<br />

ioctl(LedFD, LED_OFF, LED_GREEN);<br />

/* initialize global counter variable */<br />

Counter = 0;<br />

/* open timer */<br />

TimerCompare0 = open(BSP_DEVICE_NAME_QUAD_TIMER_A_0, 0, NULL);<br />

/* disable timer */<br />

ioctl(TimerCompare0, QT_DISABLE, (void*)&quadParam0);<br />

/* initialize flag to true */<br />

ServicedInterrupt = true;<br />

/* infinite loop */<br />

while(1)<br />

{<br />

if(ServicedInterrupt == true)<br />

{<br />

switch(Counter % 2)<br />

{<br />

case 0:<br />

ioctl(TimerCompare0, QT_ENABLE, (void*)&quadParam0);<br />

ioctl(LedFD, LED_ON, LED_GREEN);<br />

break;<br />

}<br />

}<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

case 1:<br />

ioctl(TimerCompare0, QT_ENABLE, (void*)&quadParam0);<br />

ioctl(LedFD, LED_OFF, LED_GREEN);<br />

break;<br />

}<br />

ServicedInterrupt = false;<br />

5-64 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

}<br />

Quad Timer Driver<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

/* close LED driver */<br />

close(LedFD);<br />

/* close timer */<br />

close(TimerCompare0);<br />

void CallbackOnCompare0(qt_eCallbackType CallbackType, void* pParam)<br />

{<br />

/* increment count */<br />

Counter += 1;<br />

}<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

/* set flag to true */<br />

ServicedInterrupt = true;<br />

/****************************************************************************/<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-65<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.5.5 Quad Timer Low-Level I/O API Specifications<br />

The following pages specify the Low Level Application Programming Interface (API).<br />

Function arguments for each routine are described as in, out, or inout. An in argument means that<br />

the parameter value is an input only to the function. An out argument means that the parameter<br />

value is an output only from the function. An inout argument means that a parameter value is an<br />

input to the function, but the same parameter is also an output from the function.<br />

Typically, inout parameters are input pointer variables in which the caller passes the address of a<br />

preallocated data structure to a function. The function stores its results within that data structure.<br />

The actual value of the inout pointer parameter is not changed.<br />

5-66 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.5.5.1 qtOpen<br />

Call(s):<br />

Quad Timer Driver<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

int qtOpen(const char *pName, int OFlags, qt_sState * pParams););<br />

Description: Opens a particular Quad Timer device. Argument pName is the name of the<br />

particular device.<br />

Returns: If qtOpen is successful, a file descriptor is returned. This file descriptor must be<br />

passed to other QT driver functions. if qtOpen failed, a “-1” value is returned.<br />

Code Example: See Code Example 5-10.<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Table 5-43. Quad Timer Driver Arguments - open<br />

pName in The Quad Timer device name; see Table 5-39<br />

OFlag in General parameter to configure the QT driver; however, this parameter is not used at<br />

this time<br />

pParams int A pointer to the data structure used to configure the quad timer, or NULL if a subsequent<br />

qtIoctl call is made to QT_ENABLE the quad timer<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-67<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

5.5.5.2 qtClose<br />

Call(s):<br />

int qtClose (int FileDesc);<br />

Description: The qtClose call closes the Quad Timer device.<br />

Returns: The qtClose call returns a type int. This int is always zero.<br />

Code Example: See Code Example 5-10.<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 5-44. Quad Timer Driver Arguments - close<br />

FileDesc in Quad Timer device descriptor returned by qtOpen call and used in qtIoctl function calls<br />

5-68 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.5.5.3 qtIoctl<br />

See Section 5.5.4.3.<br />

Quad Timer Driver<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Code Example: See Code Example 5-10.<br />

Code Example 5-10. Low-Level Quad Timer Driver Usage (See also: Code Example 5-9)<br />

/****************************************************************************/<br />

#include "bsp.h" /* Board support package driver */<br />

#include "quadraturetimer.h" /* Quadrature timer support */<br />

void main(void)<br />

{<br />

int qtFD;<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

/* Open the QT driver */<br />

qtFD = qtOpen(BSP_DEVICE_NAME_QUAD_TIMER_D_0, 0, NULL);<br />

/* Disable the QT */<br />

qtIoctl(qtFD, QT_DISABLE, NULL, BSP_DEVICE_NAME_QUAD_TIMER_D_0);<br />

/* Close the QT driver */<br />

qtClose(qtFD);<br />

}<br />

/****************************************************************************/<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-69<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

5.5.6 Quad Timer Driver Application<br />

For DSP56F801 and DSP56F802:<br />

The Quad Timer driver application uses the three timers of timer D to count incrementally. One<br />

counter runs in overflow mode and the other two run in timer compare mode. The<br />

DSP56F801EVM has only one general purpose Green LED and this is used to indicate the status<br />

of the timer overflow.<br />

For DSP56F803:<br />

The Quad Timer driver application uses three timers to count incrementally. One counter runs in<br />

overflow mode and the other two run in timer compare mode. Normally, the application lights a<br />

different LED to display the count status of the each counter, but since the DSP56F803EVM only<br />

has one general purpose LED, only the status of the timer running in overflow mode is shown.<br />

For DSP56F805:<br />

The Quad Timer driver’s application uses three channels which count continuously. Each LED<br />

indicator reflects the status of the corresponding counter. As a result, the LEDs on the running<br />

application are also lighting continuously.<br />

For DSP56F807:<br />

The Quad Timer driver’s application uses three channels which count continuously. Each LED<br />

indicator reflects the status of the corresponding counter. As a result, the LEDs on the running<br />

application are also lighting continuously.<br />

Jumper Settings:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Use the default jumper settings for the specific DSP56F80xEVM board. For more information on<br />

jumper settings, see the Evaluation Module Hardware User’s Manual for a specific target (i.e., the<br />

DSP56F805 Evaluation Module Hardware User’s Manual).<br />

5-70 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.6 GPIO Driver<br />

5.6.1 Introduction<br />

GPIO Driver<br />

The General Purpose I/O interface manipulates external signals routed through general purpose<br />

pins. Typically, each pin may be may be programmed as an input, output, or level sensitive<br />

interrupt input. However, peripherals may share control of these general purpose I/O pins; you<br />

may not use a pin for both a peripheral and as a general purpose I/O pin. Therefore, please consult<br />

the DSP56F80x User’s Manual to determine which pins are assigned to peripherals that you will<br />

use, and which pins may be available for general purpose use. Specific chips within the<br />

DSP56F80x chip set have the following GPIO:<br />

For DSP56F801 and DSP56F802:<br />

The DSP56F801 and DSP56802 have 11 shared GPIOs (A and B). The GPIO A and B are<br />

multiplexed with other on-chip peripherals. GPIO A0-A2 are shared with Quad Timer D. GPIO<br />

B0-B7 are shared with SCI0, PLL and Clock, and SPI peripherals. For more detailed information<br />

see the DSP56F80x User’s Manual.<br />

For DSP56F803:<br />

The DSP56F803 has no dedicated GPIO and 16 multiplexed GPIOs on Ports A and E.<br />

For DSP56F805:<br />

On the DSP56F805, eight pins on Port B and the lower six pins of Port D are dedicated GPIOs.<br />

There are also 18 multiplexed GPIOs available on Ports A and E.<br />

For DSP56F807:<br />

On the DSP56F807, 14 pins on Port B and D are dedicated GPIOs. There are also 18 multiplexed<br />

GPIOs available on Ports A, D, and E.<br />

5.6.2 Initialization<br />

The GPIO driver currently has no default configurations that can be overwritten through a<br />

project’s appconfig.h file.<br />

5.6.3 API Definition<br />

Code to create and initialize the GPIO driver is automatically included in an <strong>SDK</strong> <strong>Embedded</strong><br />

Project by inserting the following line in the appconfig.h file:<br />

#define INCLUDE_GPIO<br />

The following information may be found in the public header file gpio.h:<br />

Public Interface Function(s):<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

/*****************************************************************************<br />

* int open(const char *pName, int OFlags,...);<br />

* int close(int FileDesc);<br />

* UWord16 ioctl(int FileDesc, UWord16 Cmd, void * pParams);<br />

*****************************************************************************/<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-71<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Public Data Structure(s): None<br />

Members: None<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

5-72 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.6.4 GPIO Device-Independent I/O API Specifications<br />

GPIO Driver<br />

The following pages specify the device-independent Application Programming Interface (API).<br />

Function arguments for each routine are described as in, out, or inout. An in argument means that<br />

the parameter value is an input only to the function. An out argument means that the parameter<br />

value is an output only from the function. An inout argument means that a parameter value is an<br />

input to the function, but the same parameter is also an output from the function.<br />

Typically, inout parameters are input pointer variables in which the caller passes the address of a<br />

preallocated data structure to a function. The function stores its results within that data structure.<br />

The actual value of the inout pointer parameter is not changed.<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-73<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

5.6.4.1 open<br />

Call(s):<br />

int open(const char *pName, int OFlags, ...);<br />

Description: The open call opens the GPIO driver for operations and returns a file descriptor<br />

used by ioctl function calls. The GPIO driver needs to be opened for ioctl calls.<br />

Returns: The open call returns a type int. When the open call is successful, this int is a file<br />

descriptor for the GPIO driver. This file descriptor is used by the GPIO driver’s close and ioctl<br />

functions. When the open call is not successful, a "-1" is returned.<br />

Code Example: See Code Example 5-11.<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 5-45. GPIO Driver open Arguments - open<br />

pName in The GPIO device name; see Table 5-46<br />

OFlag in Open Mode Flags which are ignored<br />

Table 5-46. GPIO Ports Available for Specific DSP56F80x Chips<br />

Chip Can Use<br />

DSP56F801/802 BSP_DEVICE_NAME_GPIO_A<br />

BSP_DEVICE_NAME_GPIO_B<br />

DSP56F803 BSP_DEVICE_NAME_GPIO_A<br />

BSP_DEVICE_NAME_GPIO_E<br />

DSP56F805 BSP_DEVICE_NAME_GPIO_A<br />

BSP_DEVICE_NAME_GPIO_B<br />

BSP_DEVICE_NAME_GPIO_D<br />

BSP_DEVICE_NAME_GPIO_E<br />

DSP56F807 BSP_DEVICE_NAME_GPIO_A<br />

BSP_DEVICE_NAME_GPIO_B<br />

BSP_DEVICE_NAME_GPIO_D<br />

BSP_DEVICE_NAME_GPIO_E<br />

5-74 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.6.4.2 close<br />

Call(s):<br />

int close (int FileDesc);<br />

Description: The close call closes the GPIO driver.<br />

Returns: The close call returns a type int. This int is always zero.<br />

Code Example: See Code Example 5-11.<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 5-47. GPIO Driver Arguments - close<br />

GPIO Driver<br />

FileDesc in GPIO device descriptor returned by open call and used in ioctl function calls<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-75<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

5.6.4.3 ioctl<br />

Call(s):<br />

UWord16 ioctl(int FileDesc, UWord16 Cmd, void * pParams);<br />

Table 5-48. GPIO Driver Arguments<br />

FileDesc in GPIO device descriptor returned by open call and used in ioctl function calls<br />

Cmd in Commands found in gpio.h which are used to modify GPIO pins<br />

pParams in gpioPin (Port,Pin) macro<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 5-49. GPIO ioctl Commands<br />

Cmd pParams Return Result<br />

GPIO_SETAS_GPIO gpioPin (Port,Pin)<br />

macro<br />

GPIO_SETAS_PERIPHERAL gpioPin (Port,Pin)<br />

macro<br />

GPIO_SETAS_INPUT gpioPin (Port,Pin)<br />

macro<br />

GPIO_SETAS_OUTPUT gpioPin (Port,Pin)<br />

macro<br />

GPIO_INTERRUPT_DISABLE gpioPin (Port,Pin)<br />

macro<br />

GPIO_INTERRUPT_ENABLE gpioPin (Port,Pin)<br />

macro<br />

GPIO_DISABLE_PULLUP gpioPin (Port,Pin)<br />

macro<br />

GPIO_ENABLE_PULLUP gpioPin (Port,Pin)<br />

macro<br />

GPIO_INTERRUPT_ASSERT_DISABLE gpioPin (Port,Pin)<br />

macro<br />

GPIO_INTERRUPT_ASSERT_ENABLE gpioPin (Port,Pin)<br />

macro<br />

GPIO_INTERRUPT_DETECTION_ACTIVE_HIGH gpioPin (Port,Pin)<br />

macro<br />

GPIO_INTERRUPT_DETECTION_ACTIVE_LOW gpioPin (Port,Pin)<br />

macro<br />

None When peripheral disabled,<br />

DDR determines direction<br />

of data flow in PER register<br />

None A peripheral masters the<br />

gpio pin in PER register<br />

None Sets a gpio pin as an input<br />

in DDR register<br />

None Sets a gpio pin as an output<br />

in DDR register<br />

None Disables edge detection for<br />

any incoming interrupt in<br />

IENR register<br />

None Enables edge detection for<br />

any incoming interrupt in<br />

IENR register<br />

None Disable pull-up in PUR<br />

register<br />

None Enable pull-up in PUR<br />

register<br />

None Disables an interrupt assert<br />

in IAR register<br />

None Enables an interrupt assert,<br />

used only in software<br />

testing, in IAR register<br />

None The interrupt seen at the<br />

PAD is active high<br />

None The interrupt seen at the<br />

PAD is active low<br />

5-76 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Description: The ioctl call changes the state of GPIO pins.<br />

Returns: The ioctl call returns a type UWord16. This UWord16 is always zero.<br />

Code Example: See Code Example 5-11.<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 5-49. GPIO ioctl Commands (Continued)<br />

GPIO_CLEAR_INTERRUPT_PEND_REGISTER gpioPin (Port,Pin)<br />

macro<br />

GPIO_SET gpioPin (Port,Pin)<br />

macro<br />

GPIO_CLEAR gpioPin (Port,Pin)<br />

macro<br />

GPIO_TOGGLE gpioPin (Port,Pin)<br />

macro<br />

GPIO Driver<br />

None By writing zeros to this<br />

register, the IPR is cleared<br />

None Sets a GPIO signal<br />

None Clears a GPIO signal<br />

None Toggles a GPIO signal<br />

GPIO_READ gpioPin (Port,Pin) None Reads the value of an input<br />

pin; 0 or 1 value<br />

For DSP56F801/802: Code Example 5-11 toggles Port A, pin 1 (J5, pin 1), between a logic high<br />

and logic low.<br />

For DSP56F803: Code Example 5-11 toggles Port A, pin 5 (J7, pin 13), between a logic high and<br />

logic low.<br />

For DSP56F805: Code Example 5-11 toggles Port A, pin 5 (J1, pin 13), between a logic high and<br />

logic low.<br />

For DSP56F807: Code Example 5-11 toggles Port A, pin 5 (J6, pin 13), between a logic high and<br />

logic low.<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-77<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Code Example 5-11. GPIO Driver Usage<br />

/****************************************************************************/<br />

#include "io.h"<br />

#include "fcntl.h"<br />

#include "bsp.h"<br />

#include "gpio.h"<br />

void main(void)<br />

{<br />

int PortA;<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

/* For DSP56F801/802 */<br />

PortA = open(BSP_DEVICE_NAME_GPIO_A, NULL);<br />

/* For DSP56F803/805/807*/<br />

PortA = open(BSP_DEVICE_NAME_GPIO_A, NULL);<br />

/* For DSP56F801/802 */<br />

/* disable peripheral as the master of pin 1 on port A */<br />

ioctl(PortA, GPIO_SETAS_GPIO, gpioPin(A,0));<br />

/* For DSP56F803/805/807*/<br />

/* disable peripheral as the master of pin 5 on port A */<br />

ioctl(PortA, GPIO_SETAS_GPIO, gpioPin(A,4));<br />

/* For DSP56F801/802 */<br />

/* set pin 1 on port A as an output pin, note bit 0 in gpioPin() corresponds to<br />

pin 1<br />

*/<br />

ioctl(PortA, GPIO_SETAS_OUTPUT, gpioPin(A,0));<br />

/* For DSP56F803/805/807*/<br />

/* set pin 5 on port A as an output pin, note bit 4 in gpioPin() corresponds to<br />

pin 5 */<br />

ioctl(PortA, GPIO_SETAS_OUTPUT, gpioPin(A,4));<br />

/* For DSP56F803/805/807*/<br />

/* toggle pin 5 on port A, note bit 4 in gpioPin() corresponds to pin 5<br />

*/<br />

ioctl(PortA, GPIO_TOGGLE, gpioPin(A,4));<br />

close(PortA);<br />

}<br />

/****************************************************************************/<br />

5-78 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.6.5 GPIO Low-Level I/O API Specifications<br />

The following pages specify the Low-Level Application Programming Interface (API).<br />

GPIO Driver<br />

Function arguments for each routine are described as in, out, or inout. An in argument means that<br />

the parameter value is an input only to the function. An out argument means that the parameter<br />

value is an output only from the function. An inout argument means that a parameter value is an<br />

input to the function, but the same parameter is also an output from the function.<br />

Typically, inout parameters are input pointer variables in which the caller passes the address of a<br />

preallocated data structure to a function. The function stores its results within that data structure.<br />

The actual value of the inout pointer parameter is not changed.<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-79<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

5.6.5.1 gpioOpen<br />

Call(s):<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

int gpioOpen(const char *pName, int OFlags, ...);<br />

Table 5-50. GPIO Driver Arguments - gpioOpen<br />

pName in The GPIO device name; see Table 5-46<br />

OFlag in Open Mode Flags which are ignored<br />

Description: Opens a particular port for operations; argument pName is the particular port’s<br />

name. A particular port must be opened before configuring the port with gpioIoctl calls.<br />

Returns: If gpioOpen is successful, a port file descriptor is returned. If gpioOpen failed, a “-1” is<br />

returned.<br />

5-80 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.6.5.2 gpioClose<br />

Call(s):<br />

int gpioClose (int FileDesc);<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 5-51. GPIO Driver Arguments - close<br />

Description: The close call closes the GPIO device.<br />

Returns: The close call returns a type int. This int is always zero.<br />

GPIO Driver<br />

FileDesc in GPIO device descriptor returned by gpioOpen call and used in gpioIoctl function calls<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-81<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

5.6.5.3 gpioIoctl<br />

Call(s):<br />

UWord16 gpioIoctl(int FileDesc, UWord16 Cmd, UWord16 Parms, const char*<br />

gpioDevice);<br />

Description: The gpioIoctl modifies a GPIO port configuration or sets a GPIO pin.<br />

Returns: The gpioIoctl call returns an int value.<br />

Code Example 5-12. GPIO Driver Usage<br />

/****************************************************************************/<br />

#include "bsp.h"<br />

#include "gpio.h"<br />

void main(void)<br />

{<br />

int PortA;<br />

int state;<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 5-52. GPIO Driver Arguments<br />

FileDesc in GPIO device descriptor returned by open call and used in ioctl function calls<br />

Cmd in Commands found in gpio.h which are used to modify GPIO pins; see Table 5-49<br />

Parms in Used to pass on a particular pin on a port in which to perform<br />

one of the above commands; the gpioPin macro defined in Code Example 5-12 is<br />

used to obtain a mask for that particular pin and port<br />

gpioDevice in The GPIO device name; see Table 5-46<br />

// open a gpio port A<br />

PortA = gpioOpen(BSP_DEVICE_NAME_GPIO_A,0);<br />

// disable peripheral as the master of bit 0 on port A */<br />

gpioIoctl (PortA, GPIO_SETAS_GPIO, 0, BSP_DEVICE_NAME_GPIO_A);<br />

// set bit 3 on port B as an output pin<br />

gpioIoctl (PortB, GPIO_SETAS_OUTPUT, 3, BSP_DEVICE_NAME_GPIO_B);<br />

// read the state of port D pin 5<br />

state = gpioIoctl (PortD, GPIO_READ, 5, BSP_DEVICE_NAME_GPIO_D);<br />

gpioClose(PortA);<br />

}<br />

/****************************************************************************/<br />

5-82 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Quadrature Decoder Driver<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.6.6 GPIO Driver Application<br />

None<br />

5.7 Quadrature Decoder Driver<br />

5.7.1 Introduction<br />

This section describes the API for the DSP56F80x Quadrature Decoder device.<br />

The DSP56F801 and DSP56F802 do not have a Quadrature Decoder. The DSP56F803 has one<br />

Quadrature Decoder, Quadrature Decoder #0. The DSP56F805 and the DSP56F807 have two<br />

Quadrature Decoders, Quadrature Decoder #0 and #1. For more detailed information on the<br />

Quadrature Decoder, please refer to the DSP56F80x User's Manual.<br />

This section describes the Quadrature Decoder driver software providing the lowest-level<br />

software layer interfacing hardware to software.<br />

5.7.2 Initialization<br />

The Quadrature Decoder driver currently has no default configurations that can be overwritten<br />

through a project’s appconfig.h file.<br />

5.7.3 API Definition<br />

This section defines the Application Programming Interface (API) by identifying all public<br />

interface functions and data structures.<br />

Code to create and initialize the Quadrature Decoder driver is automatically included in an <strong>SDK</strong><br />

<strong>Embedded</strong> Project by inserting the following line in the appconfig.h file:<br />

#define INCLUDE_DECODER<br />

The following information may be found in the public header file decoder.h:<br />

Public Interface Function(s):<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

/*****************************************************************************<br />

* int open(const char *pName, int OFlags,...);<br />

* int close(int FileDesc);<br />

* UWord16 decIoctl(int FileDesc, UWord16 Cmd, void * pParams, const char<br />

*pName);<br />

*****************************************************************************/<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-83<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Public Data Structure(s):<br />

typedef struct<br />

{<br />

fn_tCallbackpCallback;<br />

UWord16* pCallbackArg;<br />

}decoder_sCallback;<br />

typedef struct<br />

{<br />

Word16 PositionDifferenceHoldReg;<br />

Word16 RevolutionHoldReg;<br />

uReg32bit PositionHoldReg;<br />

}decoder_sState;<br />

typedef struct<br />

{<br />

UWord16 EncPulses;<br />

UWord16 RevolutionScale;<br />

}decoder_sEncScale;<br />

typedef struct<br />

{<br />

UWord16 Index : 1;<br />

UWord16 PhaseB : 1;<br />

UWord16PhaseA : 1;<br />

UWord16 Reserved : 13;<br />

}decoder_sEncSignals;<br />

typedef union<br />

{<br />

decoder_sEncSignals EncSignals;<br />

UWord16 Value;<br />

}decoder_uEncSignals;<br />

Table 5-53. decoder_sCallback Data Structure Members<br />

pCallback (*fn_tCallback)(void *) A pointer on the user interrupt service routine<br />

* pCallbackArg UWord16 An argument of the user interrupt service routine<br />

Table 5-54. decoder_sState Data Structure Members<br />

PositionDifferenceHoldReg Word16 A data value representing the content of the Position Difference Hold<br />

Register<br />

RevolutionHoldReg Word16 A data value representing the content of the Revolution Hold Register<br />

PositionHoldReg uReg32bit A data value representing the content of the Lower and Upper<br />

Position Hold Register<br />

Table 5-55. decoder_sEncScale Data Structure Members<br />

EncPulses UWord16 A data value representing the number of pulses per revolution of the<br />

Encoder device<br />

5-84 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Quadrature Decoder Driver<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 5-55. decoder_sEncScale Data Structure Members (Continued)<br />

RevolutionScale UWord16 A data value representing the number of revolutions to be reflected by<br />

the 16 bit register full range<br />

RevolutionScale = 0 represents a range +/- PI<br />

RevolutionScale =1 represents a range +/- 2PI<br />

RevolutionScale =2 represents a range +/- 4PI<br />

...<br />

Note: The maximum RevolutionScale value is determined by the<br />

following expression:<br />

32767 > ((EncPulses * 4) * RevolutionScale)<br />

When RevolutionScale is equal to 0, then the following expression<br />

must be valid:<br />

32767 > (EncPulses * 2)<br />

The RevolutionScale has meaning only for the<br />

DEC_GET_SCALED_POSITION_DIFFERENCE command<br />

Table 5-56. decoder_sEncSignals Data Structure Members<br />

Index UWord16 : 1 A bit reflecting the state of the Encoder Index Signal<br />

PhaseB UWord16 : 1 A bit reflecting the state of the Encoder PhaseB Signal<br />

PhaseA UWord16 : 1 A bit reflecting the state of the Encoder PhaseA Signal<br />

Reserved UWord16 : 13 Unused<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-85<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.7.4 Quadrature Decoder Device-Independent<br />

I/O API Specification<br />

This section specifies the exact usage for each API function.<br />

Function arguments for each routine are described as in, out, or inout. An in argument means that<br />

the parameter value is an input only to the function. An out argument means that the parameter<br />

value is an output only from the function. An inout argument means that a parameter value is an<br />

input to the function, but the same parameter is also an output from the function.<br />

Typically, inout parameters are input pointer variables in which the caller passes the address of a<br />

preallocated data structure to a function. The function stores its results within that data structure.<br />

The actual value of the inout pointer parameter is not changed.<br />

5-86 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.7.4.1 open<br />

Call(s):<br />

Quadrature Decoder Driver<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

int open(const char *pName, int OFlags,...);<br />

Table 5-57. Quadrature Decoder Driver open Arguments - open<br />

pName in The Quadrature Decoder device name; use<br />

BSP_DEVICE_NAME_DECODER_0<br />

BSP_DEVICE_NAME_DECODER_1<br />

OFlag in Open Mode Flags which are ignored<br />

FileDesc out Quadrature decoder driver device descriptor returned by the<br />

open call and used in write/read/decIoctl function calls<br />

Description: The open call opens the Quadrature Decoder peripheral for operations and returns a<br />

file descriptor used by all function calls. The Quadrature Decoder device needs to be opened for<br />

all accesses.<br />

Returns: The open call returns a type int. When the open call is successful, this int is a file<br />

descriptor for the Quadrature Decoder driver. This file descriptor is used by the Quadrature<br />

Decoder driver’s close and ioctl functions. A "-1" is returned when the open call is not successful.<br />

Code Example: See Code Example 5-13.<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-87<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

5.7.4.2 close<br />

Call(s):<br />

int close (int FileDesc);<br />

Table 5-58. Quadrature Decoder Driver Arguments - close<br />

FileDesc in Quadrature Decoder device descriptor returned by open call<br />

Description: The close call closes the Quadrature Decoder peripheral and releases the file<br />

descriptor handle.<br />

Returns: The close call returns a type int. This int is always zero.<br />

Code Example: See Code Example 5-13.<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5-88 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.7.4.3 decIoctl<br />

Call(s):<br />

Quadrature Decoder Driver<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

UWord16 decIoctl(int FileDesc, UWord16 Cmd, void * pParams, const char *pName);<br />

Description: The decIoctl call changes Quadrature Decoder device modes or accesses the<br />

Quadrature Decoder registers.<br />

Returns: The ioctl call returns a type UWord16. This UWord16 is dependent on the command<br />

passed in as an input parameter. A list of these returns based on the specific command follows.<br />

Command: DEC_HOME_INTERRUPT_REQUEST_CLEAR<br />

pParams: NULL<br />

Return: None<br />

Description: Clears the HOME signal interrupt request flag<br />

Command: DEC_HOME_INTERRUPT<br />

pParams: DEC_ENABLE / DEC_DISABLE<br />

Return: None<br />

Description: HOME signal interrupt enable or disable<br />

Command: DEC_HOME_INIT<br />

pParams: DEC_ENABLE / DEC_DISABLE<br />

Return: None<br />

Table 5-59. Quadrature Decoder Driver Arguments - decIoctl<br />

FileDesc in Quadrature Decoder device descriptor returned by open call<br />

Cmd in Commands found in decoder.h which are used to modify the Quadrature Decoder<br />

module status and control registers; see below for a description of specific commands<br />

pParams in,<br />

inout<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Used to pass the relevant data to decIoctl function call<br />

pName in The Quadrature Decoder device name. Use<br />

BSP_DEVICE_NAME_DECODER_0<br />

BSP_DEVICE_NAME_DECODER_1<br />

Description: Enables or disables the position counter to be initialized by the HOME<br />

signal<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-89<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Command: DEC_HOME_EDGE<br />

pParams: DEC_NEGATIVE / DEC_POSITIVE<br />

Return: None<br />

Description: Sets the negative or positive edge of the HOME signal to initialize the<br />

position counter<br />

Command: DEC_SOFTWARE_TRIGGERED_INIT<br />

pParams: NULL<br />

Return: None<br />

Description: Initializes the position counter by value from the initialization register<br />

Command: DEC_DIRECTION_COUNTING_ENABLE<br />

pParams: DEC_REVERSE / DEC_NORMAL<br />

Return: None<br />

Description: Reverses the interpretation of the quadrature signal to change the direction<br />

of count<br />

Command: DEC_SINGLE_PHASE_COUNT<br />

pParams: DEC_ENABLE / DEC_DISABLE<br />

Return: None<br />

Description: If DEC_ENABLE, then the quadrature decoder logic is bypassed (PHASEA<br />

is used a single phase pulse stream, PHASEB is ignored)<br />

Command: DEC_INDEX_PULSE_INTERRUPT_REQUEST_CLEAR<br />

pParams: NULL<br />

Return: None<br />

Description:Clears the INDEX pulse interrupt request flag<br />

Command: DEC_INDEX_PULSE_INTERRUPT<br />

pParams: DEC_ENABLE / DEC_DISABLE<br />

Return: None<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Description: INDEX pulse interrupt enable or disable<br />

5-90 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Quadrature Decoder Driver<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Command: DEC_INDEX_TRIGGERED_INIT<br />

pParams: DEC_ENABLE / DEC_DISABLE<br />

Return: None<br />

Description: Enables or disables the position counter to be initialized by the INDEX<br />

pulse<br />

Command: DEC_INDEX_EDGE<br />

pParams: DEC_NEGATIVE / DEC_POSITIVE<br />

Return: None<br />

Description: Sets the negative or positive edge of the INDEX pulse to initialize the<br />

position counter<br />

Command: DEC_WATCHDOG_INTERRUPT_REQUEST_CLEAR<br />

pParams: NULL<br />

Return: None<br />

Description:Clears the watchdog time-out interrupt request flag<br />

Command: DEC_WATCHDOG_INTERRUPT<br />

pParams: DEC_ENABLE / DEC_DISABLE<br />

Return: None<br />

Description: Watchdog timer interrupt enable or disable<br />

Command: DEC_WATCHDOG<br />

pParams: DEC_ENABLE / DEC_DISABLE<br />

Return: None<br />

Description: Watchdog timer enable or disable<br />

Command: DEC_SWITCH_MATRIX<br />

pParams: DEC_MODE_1<br />

Return: None<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

DEC_MODE_2<br />

DEC_MODE_3<br />

Description: Selects the switch matrix mode that connects the input to the Timer module<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-91<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Command: DEC_SET_CALLBACK_HOME_WATCHDOG<br />

pParams: decoder_sCallback*<br />

Return: None<br />

Description: Installs the user- defined Watchdog timer and HOME signal interrupt<br />

service routine<br />

Command: DEC_SET_CALLBACK_INDEX<br />

pParams: decoder_sCallback*<br />

Return: None<br />

Description: Installs the user- defined INDEX pulse interrupt service routine<br />

Command: DEC_WRITE_FILTER<br />

pParams: UWord16<br />

Return: None<br />

Description: Sets the Filter Interval Register with the desired value<br />

Command: DEC_WRITE_WATCHDOG_TIMEOUT<br />

pParams: UWord16<br />

Return: None<br />

Description: Sets the Watchdog Time-out Register with the desired value<br />

Command: DEC_READ_POSITION_DIFFERENCE<br />

pParams: NULL<br />

Return: Word16<br />

Description: Returns the content of the Position Difference Counter Register +<br />

Command: DEC_READ_REVOLUTION<br />

pParams: NULL<br />

Return: Word16<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Description: Returns the content of the Revolution Counter Register +<br />

5-92 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Quadrature Decoder Driver<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Command: DEC_WRITE_REVOLUTION<br />

pParams: Word16<br />

Return: None<br />

Description: Sets the Revolution Counter by the desired value<br />

Command: DEC_READ_POSITION<br />

pParams: uReg32bit*<br />

Return: None<br />

Description: Returns the content of the Upper and Lower Position Counter Register +<br />

Command: DEC_WRITE_POSITION<br />

pParams: value - 32bit<br />

Return: None<br />

Description: Sets the Position Counter Register to the desired starting value<br />

Command: DEC_WRITE_INIT_STATE<br />

pParams: value - 32bit<br />

Return: vNone<br />

Description: Sets the Initialization Position Counter Register (Upper and Lower) with the<br />

desired value<br />

Command: DEC_READ_MONITOR_REG<br />

pParams: NULL<br />

Return: UWord16<br />

Description: Returns the content of the Input Monitor Register<br />

Command: DEC_GET_RAW_ENCSIGNALS<br />

pParams: NULL<br />

Return: decoder_uEncSignals.Value<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Description: Returns the raw version of INDEX, PHASEB and PHASEA encoder signals<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-93<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Command: DEC_GET_FILTERED_ENCSIGNALS<br />

pParams: NULL<br />

Return: decoder_uEncSignals.Value<br />

Description: Returns the filtered version of INDEX, PHASEB and PHASEA encoder<br />

signals<br />

Command: DEC_READ_HOLD_DATA_REGS<br />

pParams: decoder_sState*<br />

Return: None<br />

Description: Holds the Position, Position Difference and the Revolution counters and<br />

copies such state to the structure members +<br />

Command: DEC_READ_CONTROL_REG<br />

pParams: NULL<br />

Return: UWord16<br />

Description: Returns the content of the Control Register<br />

Command: DEC_CALCULATE_SCALE_COEF<br />

pParams: decoder_sEncScale*<br />

Return: None<br />

Description: Calculates the scaling coefficients needed for the correct functionality of<br />

DEC_GET_SCALED_POSITION and<br />

DEC_GET_SCALED_POSITION_DIFFERENCE commands (i.e. this command must be<br />

executed before the execution of the above mentioned commands)<br />

Command: DEC_GET_SCALED_POSITION<br />

pParams: Word32*<br />

Return: None<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Description: Calculates an absolute position. It returns a 32bit value where the MSB<br />

part represents the number of revolutions (equals to the content of the Revolution<br />

Register) while the LSB part represents the portion of the current revolution scaled<br />

into the 16bit unsigned data range. The DEC_CALCULATE_SCALE_COEF<br />

command must be executed prior this command. Note: the correct functionality requires to<br />

fill the Initialization Register by value 0x00000000 and to enable initialization of the<br />

Position Counter by the INDEX signal (DEC_WRITE_INIT_STATE and<br />

DEC_INDEX_TRIGGERED_INIT commands) during the Quadrature Decoder init<br />

phase. +<br />

5-94 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Quadrature Decoder Driver<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Command: DEC_GET_SCALED_POSITION_DIFFERENCE<br />

pParams: Word16*<br />

Return: None<br />

Description: Returns the scaled relative position (difference). The 16bit signed value<br />

represents a range specified by RevolutionScale. The<br />

DEC_CALCULATE_SCALE_COEF command must be executed prior to this command.<br />

This command recalculates (scales) the content of the Position Difference Counter<br />

Register which is automatically cleared when Position Register is read. (see note)<br />

NOTE: “+” These commands will cause contents of the counter register to be written to its<br />

corresponding hold register.<br />

Code Example 5-13. decIoctl<br />

decIoctl(decFD, DEC_SET_CALLBACK_INDEX, &cb, BSP_DEVICE_NAME_DECODER_0);<br />

decIoctl(decFD, DEC_WATCHDOG, DEC_ENABLE, BSP_DEVICE_NAME_DECODER_0);<br />

decIoctl(decFD, DEC_WRITE_POSITION, 0x12344321, BSP_DEVICE_NAME_DECODER_0);<br />

monitor = decIoctl(decFD, DEC_READ_MONITOR_REG, NULL, BSP_DEVICE_NAME_DECODER_0);<br />

Code Example 5-14 illustrates deIoctl function calls for the Quadrature Decoder driver.<br />

Code Example 5-14. Quadrature Decoder Driver Usage<br />

Step 1: Edit the appconfig.h file in your project config directory to include the Quadrature<br />

Decoder peripheral module by adding the line:<br />

#define INCLUDE_DECODER<br />

Step 2: Create an application code<br />

/*****************************************************************************/<br />

#include "io.h"<br />

#include "fcntl.h"<br />

#include "bsp.h"<br />

#include "decoder.h"<br />

void main(void)<br />

{<br />

int decFD;<br />

decoder_uEncSignals signal;<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

/* Open decoder */<br />

decFD = open(BSP_DEVICE_NAME_DECODER_0, 0);<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-95<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

/* Get the raw version of INDEX, PHASE A, and PHASE B encoder signals */<br />

signal.Value = decIoctl(decFD, DEC_GET_RAW_ENCSIGNALS, NULL,<br />

BSP_DEVICE_NAME_DECODER_0);<br />

/* Set the filter interval register with the value 0x0003 */<br />

decIoctl(decFD, DEC_WRITE_FILTER, 0x0003, BSP_DEVICE_NAME_DECODER_0);<br />

/* close decoder */<br />

close(decFD);<br />

}<br />

/****************************************************************************/<br />

5-96 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Quadrature Decoder Driver<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.7.5 Low-Level Device Driver I/O API Specification<br />

This section specifies the Low-Level API interface.<br />

Function arguments for each routine are described as in, out, or inout. An in argument means that<br />

the parameter value is an input only to the function. An out argument means that the parameter<br />

value is an output only from the function. An inout argument means that a parameter value is an<br />

input to the function, but the same parameter is also an output from the function.<br />

Typically, inout parameters are input pointer variables in which the caller passes the address of a<br />

preallocated data structure to a function. The function stores its results within that data structure.<br />

The actual value of the inout pointer parameter is not changed.<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-97<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

5.7.5.1 decoderOpen<br />

Call(s):<br />

int decoderOpen(const char *pName, int OFlags);<br />

Table 5-60. Low-Level Quadrature Decoder Driver open Arguments - open<br />

pName in The Quadrature Decoder device name; see Table 5-57<br />

OFlag in Open Mode Flag which is ignored<br />

Description: The decoderOpen call opens the Quadrature Decoder device for operations.<br />

Returns: File descriptor if decoderOpen is successful. This file descriptor must be<br />

passed to other Quadrature Decoder driver functions. Returns a “-1” value if open failed.<br />

Code Example: See Code Example 5-15.<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5-98 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.7.5.2 decoderClose<br />

Call(s):<br />

Quadrature Decoder Driver<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

int decoderClose (int FileDesc);<br />

Table 5-61. Low-Level Quadrature Decoder Driver Arguments - decoderClose<br />

FileDesc in Quadrature Decoder device descriptor returned by decoderOpen call<br />

Code Example: See Code Example 5-15.<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-99<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

5.7.5.3 decoderIoctl<br />

Call(s):<br />

UWord16 decoderIoctl(int FileDesc,UWord16 Cmd,void * pParams, const<br />

char*pName);<br />

Code Example: See Code Example 5-15.<br />

Code Example 5-15. Low-Level Quadrature Decoder Driver Usage (See also Code Example 5-14)<br />

/****************************************************************************/<br />

#include "bsp.h"<br />

#include "decoder.h"<br />

void main(void)<br />

{<br />

int decoderFD;<br />

/* Open the Quadrature Decoder driver */<br />

decoderFD = decoderOpen(BSP_DEVICE_NAME_DECODER_0, 0);<br />

decoderIoctl(FDdec,DEC_HOME_INTERRUPT,DEC_ENABLE,BSP_DEVICE_NAME_DECODER_0);<br />

/* Close the Quadrature Decoder driver */<br />

decoderClose(decoderFD);<br />

}<br />

/****************************************************************************/<br />

5.7.6 Quadrature Decoder Driver Application<br />

None<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 5-62. Low-Level Quadrature Decoder Driver Arguments - decoderIoctl<br />

FileDesc in Quadrature Decoder device descriptor returned by decoderOpen call<br />

Cmd in Commands found in decoder.h which are used to modify the Quadrature Decoder<br />

module status and control registers; see Table 5-60<br />

pParams in, inout Used to pass the relevant data to decoderIoctl function call<br />

pName in The Quadrature Decoder device name; use:<br />

BSP_DEVICE_NAME_DECODER_0<br />

BSP_DEVICE_NAME_DECODER_1<br />

5-100 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.8 PWM Driver<br />

5.8.1 Introduction<br />

This section describes the API for the DSP56F80x PWM device.<br />

PWM Driver<br />

The DSP56F801, DSP56F802, and DSP56F803 have one Pulse Width Modulator, named<br />

PWMA. The DSP56F805 and the DSP56F807 have two PWM modules, named PWMA and<br />

PWMB. The PWM driver provides a standard <strong>SDK</strong> interface for this device. For additional<br />

information about PWM, refer to Chapter 11 of the DSP56F80x User’s Manual.<br />

5.8.2 Initialization<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The PWM driver’s default configurations are defined in config.h and can be redefined in the<br />

appconfig.h for a specific project. The complete list of PWM parameters that can be #defined in<br />

the appconfig.h are listed in Table 5-63 and correspond to PWM registers.<br />

NOTE: For information on these default register bit settings, see Chapter 11 of the<br />

DSP56F80x User’s Manual; specific section are detailed in the Description column of<br />

Table 5-63.<br />

Table 5-63. PWM appconfig.h Configuration Settings<br />

Parameter Description Default<br />

#define PWM_EXCLUDE_PWM_A Will exclude PWM A Not defined<br />

#define PWM_EXCLUDE_PWM_B Will exclude PWM B Not defined<br />

#define PWM_A_CONTROL_REG PMCTL register; *see Section 11.7 for<br />

information on specific bits<br />

#define PWM_A_FAULT_CONTROL_REG PMFCTL register; *see Section 11.7 for<br />

information on specific bits<br />

#define PWM_A_FAULT_STATUS_REG PMFSA register; *see Section 11.7 for<br />

information on specific bits<br />

#define PWM_A_OUTPUT_CONTROL_REG PMOUT register; *see Section 11.7 for<br />

information on specific bits<br />

#define PWM_A_COUNTER_MODULO_REG PWMCM register; *see Section 11.7 for<br />

information on specific bits<br />

#define PWM_A_DEAD_TIME_REG PMDEADTM register; *see Section 11.7<br />

for information on specific bits<br />

#define PWM_A_DISABLE_MAPPING_1_REG PMDISMAP1 register; *see Section 11.7<br />

for information on specific bits<br />

#define PWM_A_DISABLE_MAPPING_2_REG PMDISMAP2 register; *see Section 11.7<br />

for information on specific bits<br />

0x00C0<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-101<br />

0<br />

0<br />

0<br />

0x07FF<br />

0x001F<br />

0x0000<br />

0x0000<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

#define PWM_A_CONFIG_REG PMCFG register; *see Section 11.7<br />

for information on specific bits<br />

#define PWM_A_CHANNEL_CONTROL_REG PMCCR register; *see Section 11.7<br />

for information on specific bits<br />

#define PWM_B_CONTROL_REG PMCTL register; *see Section 11.7 for<br />

information on specific bits<br />

#defined PWM_B_FAULT_CONTROL_REG PMFCTL register; *see Section 11.7 for<br />

information on specific bits<br />

#define PWM_B_FAULT_STATUS_REG PMFSA register; *see Section 11.7 for<br />

information on specific bits<br />

* DSP56F80x User’s Manual<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

On-Chip Drivers<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 5-63. PWM appconfig.h Configuration Settings (Continued)<br />

#define PWM_B_OUTPUT_CONTROL_REG PMOUT register; *see Section 11.7 for<br />

information on specific bits<br />

#define PWM_B_COUNTER_MODULO_REG PWMCM register; *see Section 11.7 for<br />

information on specific bits<br />

#define PWM_B_DEAD_TIME_REG PMDEADTM register; *see Section 11.7<br />

for information on specific bits<br />

#define PWM_B_DISABLE_MAPPING_1_REG PMDISMAP1 register; *see Section 11.7<br />

for information on specific bits<br />

#define PWM_B_DISABLE_MAPPING_2_REG PMDISMAP2 register, *see Section 11.7<br />

for information on specific bits<br />

#define PWM_B_CONFIG_REG PMCFG register; *see Section 11.7<br />

for information on specific bits<br />

#define PWM_B_CHANNEL_CONTROL_REG PMCCR register, *see Section 11.7<br />

for information on specific bits<br />

0x1000<br />

5-102 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

0<br />

0x00C0<br />

0<br />

0<br />

0<br />

0x07FF<br />

0x001F<br />

0x0000<br />

0x0000<br />

0x1000<br />

0<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.8.3 API Definition<br />

This section defines the Application Programming Interface (API) by identifying all public<br />

interface functions and data structures.<br />

PWM Driver<br />

Code to create and initialize the PWM driver is automatically included in an <strong>SDK</strong> <strong>Embedded</strong><br />

Project by inserting the following line in the appconfig.h file:<br />

#define INCLUDE_PWM<br />

The following information may be found in the public header file pwm.h:<br />

Public Interface Function(s):<br />

*****************************************************************************<br />

* int open(const char *pName, int OFlags,...);<br />

* int close(int FileDesc);<br />

* UWord16 pwmIoctl(int FileDesc, UWord16 Cmd, void * pParams, const<br />

char *pName);<br />

*****************************************************************************/<br />

Public Data Structure(s):<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

typedef struct<br />

{<br />

fn_tCallback pCallback;<br />

UWord16 * pCallbackArg;<br />

}pwm_sCallback;<br />

typedef struct<br />

{<br />

Word16 pwmChannel_0_Value;<br />

Word16 pwmChannel_2_Value;<br />

Word16 pwmChannel_4_Value;<br />

}pwm_sComplementaryValues;<br />

typedef struct<br />

{<br />

Word16 pwmChannel_0_Value;<br />

Word16 pwmChannel_1_Value;<br />

Word16 pwmChannel_2_Value;<br />

Word16 pwmChannel_3_Value;<br />

Word16 pwmChannel_4_Value;<br />

Word16 pwmChannel_5_Value;<br />

}pwm_sIndependentValues;<br />

typedef struct<br />

{<br />

mc_tPWMSignalMask SoftwareControlled;<br />

mc_tPWMSignalMask OutputControl;<br />

}pwm_sOutputControl;<br />

typedef struct<br />

{<br />

Word16 DutyCycle;<br />

UWord16 Vlmode;<br />

}pwm_sUpdateValueSetVlmode;<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-103<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

typedef struct<br />

{<br />

mc_tPWMSignalMask Mask;<br />

pwm_tPWMChannelSwap Swap;<br />

}pwm_sChannelControl;<br />

Table 5-64. pwm_sCallback Data Structure Members<br />

pCallback (*fn_tCallback)(void *) A pointer on the user interrupt service routine;<br />

see explanation at end of this section<br />

* pCallbackArg UWord16 An argument of the user interrupt service routine;<br />

see explanation at end of this section<br />

Table 5-65. pwm_sComplementaryValues Data Structure Members<br />

pwmChannel_0_Value Word16 A data value representing a duty cycle or<br />

the desired value of the corresponding<br />

PWM Value register<br />

pwmChannel_2_Value Word16 A data value representing a duty cycle or<br />

the desired value of the corresponding<br />

PWM Value register<br />

pwmChannel_4_Value Word16 A data value representing a duty cycle or<br />

the desired value of the corresponding<br />

PWM Value register<br />

Table 5-66. pwm_sIndependentValues Data Structure Members<br />

pwmChannel_0_Value Word16 A data value representing a duty cycle or the desired value of the<br />

corresponding PWM Value register<br />

pwmChannel_1_Value Word16 A data value representing a duty cycle or the desired value of the<br />

corresponding PWM Value register<br />

pwmChannel_2_Value Word16 A data value representing a duty cycle or the desired value of the<br />

corresponding PWM Value register<br />

pwmChannel_3_Value Word16 A data value representing a duty cycle or the desired value of the<br />

corresponding PWM Value register<br />

pwmChannel_4_Value Word16 A data value representing a duty cycle or the desired value of the<br />

corresponding PWM Value register<br />

pwmChannel_5_Value Word16 A data value representing a duty cycle or the desired value of the<br />

corresponding PWM Value register<br />

Table 5-67. pwm_sOutputControl Data Structure Members<br />

SoftwareControlled mc_tPWMSignalMask A mask to enable software control of the<br />

corresponding PWM pins<br />

OutputControl mc_tPWMSignalMask A mask to control the PWM output pins<br />

5-104 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 5-68. pwm_sUpdateValueSetVlmode Data Structure Members<br />

PWM Driver<br />

DutyCycle Word16 A data value representing a duty cycle corresponding to the PWM Value 0 register<br />

Vlmode UWord16 A value representing the Value Register Load Mode<br />

Table 5-69. pwm_sChannelControl Data Structure Members<br />

Mask mc_tPWMSignalMask A mask of the PWM logical channels<br />

Swap pwm_tPWMChannelSwap A mask to determine channel swapping operation<br />

The PWM driver callback functions allow functions created by the user in his application to be<br />

called as a result of PWM specific interrupts. These PWM-specific interrupts can be seen in Table<br />

4-1 of the DSP56F80x User’s Manual.<br />

The types of callback functions that the PWM driver allows are:<br />

• Callback on Reload PWM A or Reload PWM B<br />

• Callback on PWM A Fault or PWM B Fault<br />

To utilize the callback functions, the functions must be passed into the ioctl/pwmioctl function via<br />

the pwm_sCallback data structure. In Code Example 5-16, the user has defined a callback<br />

function, pwm_Reload_A_Callback, with input argument NULL. This data structure would then<br />

be passed into the ioctl/pwmioctl function.<br />

Code Example 5-16. Data Structure for Callback Functions<br />

/* define pwmCallBack as a pwm_sCallback type */<br />

pwm_sCallback pwmCallBack;<br />

/* set structure element to function pointer of callback function */<br />

pwmCallBack.pCallback = pwm_Reload_A_Callback;<br />

/* set structure element of call back function args to NULL */<br />

pwmCallBack.pCallbackArg = NULL;<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-105<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.8.4 PWM Device-Independent I/O API Specification<br />

This section specifies the exact usage for each API function.<br />

Function arguments for each routine are described as in, out, or inout. An in argument means that<br />

the parameter value is an input only to the function. An out argument means that the parameter<br />

value is an output only from the function. An inout argument means that a parameter value is an<br />

input to the function, but the same parameter is also an output from the function.<br />

Typically, inout parameters are input pointer variables in which the caller passes the address of a<br />

preallocated data structure to a function. The function stores its results within that data structure.<br />

The actual value of the inout pointer parameter is not changed.<br />

5-106 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.8.4.1 open<br />

Call(s):<br />

int open(const char *pName, int OFlags,...);<br />

PWM Driver<br />

Description: The open call opens the PWM peripheral for operations and returns a file descriptor<br />

used by all function calls. The PWM device needs to be opened for all accesses.<br />

Returns: The open call returns a type int. When the open call is successful, this int is a file<br />

descriptor for the PWM driver. This file descriptor is used by the PWM driver’s close and ioctl<br />

functions. A "-1" is returned when the open call is not successful.<br />

Code Example: See Code Example 5-18.<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 5-70. PWM Driver Arguments - open<br />

pName in The PWM device name; see Table 5-71<br />

OFlag in Open Mode Flags which are ignored<br />

FileDesc out PWM driver device descriptor returned by open call and used in<br />

write/read/pwmIoctl function call.<br />

Table 5-71. PWM Devices for Specific DSP56F80x Chips<br />

Chip Can Use<br />

DSP56F801/802 BSP_DEVICE_NAME_PWM_A<br />

DSP56F803 BSP_DEVICE_NAME_PWM_A<br />

DSP56F805 BSP_DEVICE_NAME_PWM_A<br />

BSP_DEVICE_NAME_PWM_B<br />

DSP56F807 BSP_DEVICE_NAME_PWM_A<br />

BSP_DEVICE_NAME_PWM_B<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-107<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

5.8.4.2 close<br />

Call(s):<br />

int close (int FileDesc);<br />

Description: The close call closes the PWM peripheral and releases the file descriptor handle.<br />

Returns: The close call returns a type int. This int is always zero.<br />

Code Example: See Code Example 5-18.<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 5-72. PWM Driver Arguments - close<br />

FileDesc in PWM device descriptor returned by open call<br />

5-108 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.8.4.3 pwmIoctl<br />

Call(s):<br />

PWM Driver<br />

UWord16 pwmIoctl(int FileDesc, UWord16 Cmd, void * pParams, const char *pName);<br />

Description: The pwmIoctl call changes PWM device modes or accesses the PWM registers.<br />

Note, the data values representing the duty cycles in percentage are scaled into the effective data<br />

range where 0x0000 corresponds to 0% and 0x7fff corresponds to 100%.<br />

Returns: The ioctl call returns a type UWord16. This UWord16 is dependent on the command<br />

passed in as an input parameter. A list of these returns based on the specific command follows.<br />

Commands:<br />

Command: PWM_SET_RELOAD_FREQUENCY<br />

pParams: PWM_RELOAD_OPPORTUNITY_X (where X can be from 1 to 16)<br />

Return: None<br />

Description: Sets the PWM Reload Frequency by selecting a certain order of opportunity;<br />

see Table 11-6 in the DSP56F80x User’s Manual for more information<br />

Command: PWM_HALF_CYCLE_RELOAD<br />

pParams: PWM_ENABLE/PWM_DISABLE<br />

Return: None<br />

Description: Half Cycle Reload enable or disable<br />

Command: PWM_SET_CURRENT_POLARITY<br />

pParams: (PWM_IPOL0 | PWM_IPOL1 | PWM_IPOL2) / PWM_ZERO_MASK<br />

Return: None<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 5-73. PWM Driver Arguments - pwmIoctl<br />

FileDesc in PWM device descriptor returned by open call<br />

Cmd in Commands found in pwm.h which are used to modify the PWM module status and<br />

control registers; see list of Commands below<br />

pParams in Used to pass the relevant data to pwmIoctl function call<br />

pName in The PWM device name. Use BSP_DEVICE_NAME_PWM_A or<br />

BSP_DEVICE_NAME_PWM_B<br />

Description: Sets the selected Current Polarity Bits<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-109<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Command: PWM_SET_PRESCALER<br />

pParams: PWM_PRESCALER_DIV_1<br />

Return: None<br />

PWM_PRESCALER_DIV_2<br />

PWM_PRESCALER_DIV_4<br />

PWM_PRESCALER_DIV_8<br />

Description: Sets the PWM clock frequency as a fraction of operational frequency; see<br />

Table 11-7 in the DSP56F80x User’s Manual for more information<br />

Command: PWM_RELOAD_INTERRUPT<br />

pParams: PWM_ENABLE/PWM_DISABLE<br />

Return: None<br />

Description: PWM Reload Interrupt enable or disable<br />

Command: PWM_SET_CURRENT_SENSING<br />

pParams: PWM_CORRECTION_NO<br />

Return: None<br />

PWM_CORRECTION_SOFTWARE<br />

PWM_CORRECTION_DURING_DEADTIME<br />

PWM_CORRECTION_DURING_CYCLE<br />

Description: Selects the top/bottom correction scheme<br />

Command: PWM_DEVICE<br />

pParams: PWM_ENABLE/PWM_DISABLE<br />

Return: None<br />

Description: Enables or disables PWM generator and enables PWM pins<br />

Command: PWM_CLEAR_RELOAD_FLAG<br />

pParams: NULL<br />

Return: None<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Description: Clears the PWM Reload Interrupt Flag<br />

5-110 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Command: PWM_LOAD_OK<br />

pParams: NULL<br />

Return: None<br />

PWM Driver<br />

Description: Causes loading of the PWM registers into a set of buffers to take effect at the<br />

next PWM reload<br />

Command: PWM_FAULT_INTERRUPT_ENABLE<br />

pParams: PWM_FAULTx<br />

Return: None<br />

Description: Enables corresponding FAULTx CPU interrupt request<br />

Command: PWM_FAULT_INTERRUPT_DISABLE<br />

pParams: PWM_FAULTx<br />

Return: None<br />

Description: Disables corresponding FAULTx CPU interrupt request<br />

Command: PWM_SET_AUTOMATIC_FAULT_CLEAR<br />

pParams: PWM_FAULTx<br />

Return: None<br />

Description: Sets the automatic fault clearing of FAULTx pin fault<br />

Command: PWM_SET_MANUAL_FAULT_CLEAR<br />

pParams: PWM_FAULTx<br />

Return: None<br />

Description: Sets the manual fault clearing of FAULTx pin fault<br />

Command: PWM_CLEAR_FAULT_FLAG<br />

pParams: PWM_FAULTx<br />

Return: None<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Description: Clears corresponding FAULTx Pin Flag<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-111<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Command: PWM_OUTPUT_PAD<br />

pParams: PWM_ENABLE/PWM_DISABLE<br />

Return: None<br />

Description: Output Pad enable or disable<br />

Command: PWM_OUTPUT_SOFTWARE_CONTROL<br />

pParams: mc_tPWMSignalMask<br />

Return: None<br />

Description: Enables software control of the selected PWM pins +<br />

Command: PWM_OUTPUT_CONTROL<br />

pParams: mc_tPWMSignalMask<br />

Return: None<br />

Description: Controls the state of the corresponding PWM pins +<br />

Command: PWM_SET_MODULO<br />

pParams: UWord16<br />

Return: None<br />

Description: Sets the PWM period in PWM clock periods<br />

Command: PWM_SET_DEADTIME<br />

pParams: UWord16<br />

Return: None<br />

Description: Sets the number of CPU clock cycles of deadtime in complementary channel<br />

operation mode<br />

Command: PWM_SET_DISABLE_MAPPING_REG1<br />

pParams: UWord16<br />

Return: None<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Description: Determines which PWM pins are disabled by the fault detection decoder<br />

(INDISMAP1 register)<br />

5-112 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Command: PWM_SET_DISABLE_MAPPING_REG2<br />

pParams: UWord16<br />

Return: None<br />

PWM Driver<br />

Description: Determines which PWM pins are disabled by the fault detection decoder<br />

(INDISMAP2 register)<br />

Command: PWM_SET_ALIGNMENT<br />

pParams: PWM_EDGE<br />

Return: None<br />

PWM_CENTER<br />

Description: Determines whether all PWM channels will use edge- or center-aligned<br />

waveforms<br />

Command: PWM_SET_NEG_TOP_SIDE_POLARITY<br />

pParams: (PWM_CHANNEL_45 | PWM_CHANNEL_23 | PWM_CHANNEL_01) /<br />

PWM_ZERO_MASK<br />

Return: None<br />

Description: Determines the polarity for the top-side PWMs; the negative top-side<br />

polarity is set for the selected channels (the rest of channels use the positive top-side<br />

polarity)<br />

Command: PWM_SET_NEG_BOTTOM_SIDE_POLARITY<br />

pParams: (PWM_CHANNEL_45 | PWM_CHANNEL_23 | PWM_CHANNEL_01) /<br />

PWM_ZERO_MASK<br />

Return: None<br />

Description: Determines the polarity for the bottom-side PWMs; the negative<br />

bottom-side polarity is set for the selected channels (the rest of channels use the positive<br />

bottom-side polarity)<br />

Command: PWM_SET_INDEPENDENT_OPERATION<br />

pParams: (PWM_CHANNEL_45 | PWM_CHANNEL_23 | PWM_CHANNEL_01) /<br />

PWM_ZERO_MASK<br />

Return: None<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Description: Determines whether the PWM pins will be independent PWMs or<br />

complementary PWM pairs; the independent operation is set for the selected channels (the<br />

rest of channels are configured as complementary pairs) +<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-113<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Command: PWM_SET_WRITE_PROTECT<br />

pParams: NULL<br />

Return: None<br />

Description: Write-protects the write-protected registers<br />

Command: PWM_HARDWARE_ACCELERATION<br />

pParams: PWM_ENABLE/PWM_DISABLE<br />

Return: None<br />

Description: Enables or disables the hardware accelerator feature<br />

Command: PWM_SET_CHANNEL_MASK<br />

pParams: mc_tPWMSignalMask<br />

Return: None<br />

Description: Masks the selected PWM logical channels (the rest of channels are<br />

unmasked). This command should be used in the independent mode. In complementary<br />

mode, the masked channels are set to 0% duty cycle and the corresponding<br />

complementary channels are therefore set to 100% duty cycle. +<br />

Command: PWM_SET_LOAD_MODE<br />

pParams: PWM_LOAD_INDEP or<br />

Return: None<br />

PWM_LOAD_FROM_0_TO_5 or<br />

PWM_LOAD_FROM_0_TO_3<br />

Description: Sets how the PWM Value Registers are loaded<br />

Command: PWM_SET_SWAP<br />

pParams: (PWM_SWAP0 | PWM_SWAP1 | PWM_SWAP2) / PWM_ZERO_MASK<br />

Return: None<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Description: Swaps the selected channels. +<br />

5-114 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Command: PWM_SET_RELOAD_CALLBACK<br />

pParams: pwm_sCallback*<br />

Return: None<br />

Description: Installs the user-defined Reload interrupt service routine<br />

Command: PWM_SET_FAULT_CALLBACK<br />

pParams: pwm_sCallback*<br />

Return: None<br />

Description: Installs the user-defined Fault interrupt service routine<br />

Command: PWM_WRITE_VALUE_REG_0<br />

pParams: Word16<br />

Return: None<br />

Description: Writes the new value to the PWM Value Register 0<br />

Command: PWM_WRITE_VALUE_REGS_COMPL<br />

pParams: pwm_sComplementaryValues*<br />

Return: None<br />

Description: Writes the new value to the PWM Value Register 0, 2 & 4<br />

Command: PWM_WRITE_VALUE_REGS_INDEP<br />

pParams: pwm_sIndependentValues*<br />

Return: None<br />

Description: Writes the new value to the PWM Value Register 0, 1, 2, 3, 4 & 5<br />

Command: PWM_READ_FAULT_STATUS_REG<br />

pParams: NULL<br />

Return: UWord16<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Description: Returns the content of PWM Fault Status & Acknowledge Register<br />

PWM Driver<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-115<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Command: PWM_READ_COUNTER_REG<br />

pParams: NULL<br />

Return: UWord16<br />

Description: Returns the content of PWM Counter Register<br />

Command: PWM_READ_CONTROL_REG<br />

pParams: NULL<br />

Return: UWord16<br />

Description: Returns the content of PWM Control Register<br />

Command: PWM_READ_PORT_REG<br />

pParams: NULL<br />

Return: UWord16<br />

Description: Returns the content of PWM Port Register<br />

Command: PWM_SOFTWARE_OUTPUTS_CONTROL<br />

pParams: pwm_sOutputControl*<br />

Return: None<br />

Description: Sets the desired PWM output pins to be controlled by software and<br />

activates/deactivates the PWM outputs +<br />

Command: PWM_UPDATE_VALUE_REG_0<br />

pParams: Word16<br />

Return: None<br />

Description: Recalculates the input value of duty cycle (in percentage) with respect to the<br />

PWM modulus and writes the resulting value to the PWM Value Register 0; the LDOK bit<br />

is set afterwards.<br />

Command: PWM_UPDATE_VALUE_REGS_COMPL<br />

pParams: pwm_sComplementaryValues*<br />

Return: None<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Description: Recalculates the input value of duty cycles (in percentage) with respect to<br />

the PWM modulus and writes the resulting values to the three corresponding PWM Value<br />

Registers; the LDOK bit is set afterwards.<br />

5-116 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Command: PWM_UPDATE_VALUE_REGS_INDEP<br />

pParams: pwm_sIndependentValues*<br />

Return: None<br />

PWM Driver<br />

Description: Recalculates the input value of duty cycles (in percentage) with respect to<br />

the PWM modulus and writes the resulting values to the six corresponding PWM Value<br />

Registers; the LDOK bit is set afterwards.<br />

Command: PWM_UPDATE_VALUE_SET_VLMODE<br />

pParams: pwm_sUpdateValueSetVlmode*<br />

Return: None<br />

Description: Recalculates the input value of duty cycle (in percentage) with respect to the<br />

PWM modulus and writes the resulting value to the PWM Value Register 0 and sets the<br />

desired Value Register Load Mode; the LDOK bit is set afterwards. +<br />

Command: PWM_CORRECT_DEAD_TIME_COMPL<br />

pParams: pwm_sComplementaryValues*<br />

Return: None<br />

Description: Recalculates the input value of duty cycles (in percentage) with respect to<br />

the PWM modulus and writes the resulting values to the six corresponding PWM Value<br />

Registers; the actual values reflect the deadtime correction. The LDOK bit is set<br />

afterwards.<br />

Command: PWM_SET_MASK_SWAP<br />

pParams: pwm_sChannelControl*<br />

Return: None<br />

Description: Masks the selected PWM logical channels and sets the desired swapping<br />

channel operation. This command should be used in the independent mode. In<br />

complementary mode, the masked channels are set to 0% duty cycle and the<br />

corresponding complementary channels are therefore set to 100% duty cycle.<br />

NOTE: “+” Ensure that these pwmIoctl calls cannot be interrupted.<br />

Code Example 5-17. PWMioctl<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

pwmIoctl(FDPwm,PWM_SET_RELOAD_CALLBACK,&cb,BSP_DEVICE_NAME_PWM_A);<br />

pwmIoctl(FDPwm, PWM_DEVICE, PWM_DISABLE, BSP_DEVICE_NAME_PWM_A);<br />

pwmIoctl(FDPwm,PWM_RELOAD_INTERRUPT,PWM_ENABLE,BSP_DEVICE_NAME_PWM_A);<br />

port = pwmIoctl(FDPwm, PWM_READ_PORT_REG, NULL,BSP_DEVICE_NAME_PWM_A);<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-117<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Code Example 5-18 illustrates the functionality of the PWM driver by blinking PWM associated<br />

LEDs.<br />

Code Example 5-18. PWM Driver Usage<br />

Step 1: Edit appconfig.h file in your project config directory:<br />

LEDS */<br />

1a) include the PWM peripheral module by<br />

#define INCLUDE_PWM<br />

#define INCLUDE_LED<br />

#define INCLUDE_IO<br />

1b) disable certain PWM module if necessary, e.g.<br />

#define PWM_EXCLUDE_PWM_B /* PWM B is not used */<br />

1c) define your own PWM module operation mode, e.g.<br />

#define PWM_A_CONTROL_REG 0x50cl<br />

#define PWM_A_FAULT_CONTROL_REG0<br />

#define PWM_A_FAULT_STATUS_REG0<br />

#define PWM_A_OUTPUT_CONTROL_REG0<br />

#define PWM_A_COUNTER_MODULO_REG0x7fff<br />

#define PWM_A_DEAD_TIME_REG0x002f<br />

#define PWM_A_DISABLE_MAPPING_1_REG0xffff<br />

#define PWM_A_DISABLE_MAPPING_2_REG0x00ff<br />

#define PWM_A_CONFIG_REG0x0000<br />

#define PWM_A_CHANNEL_CONTROL_REG0x8000<br />

1d) redefine PLL_MUL (only if needed in specific application)<br />

#define PLL_MUL 4 /* for this application, it allows user to see blinking<br />

Step 2: Create an application code<br />

/****************************************************************************/<br />

#include <br />

#include <br />

#include "pwmdrv.h"<br />

#include "pwm.h"<br />

#include "periph.h"<br />

#include "bsp.h"<br />

#include "led.h"<br />

void pwm_Reload_A_Callback(void);<br />

pwm_sCallback pwm_CB;<br />

int pwm0FD;<br />

int LedFD;<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

/* a reload interrupt service routine */<br />

void pwm_Reload_A_Callback(void)<br />

{<br />

ioctl (ledFD, LED_TOGGLE, LED_GREEN);<br />

5-118 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

}<br />

/* clears Reload interrupt flag */<br />

pwmIoctl(pwm0FD, PWM_CLEAR_RELOAD_FLAG, NULL, BSP_DEVICE_NAME_PWM_A);<br />

void main(void)<br />

{<br />

pwm_sComplementaryValues Comp;<br />

/* open calls of drivers */<br />

LedFD = open(BSP_DEVICE_NAME_LED_0, 0);<br />

pwm0FD = open(BSP_DEVICE_NAME_PWM_A, 0);<br />

/* WARNING: to disable all FAULT signals!!!! */<br />

pwmIoctl(pwm0FD, PWM_SET_DISABLE_MAPPING_REG1, PWM_ZERO_MASK,<br />

BSP_DEVICE_NAME_PWM_A);<br />

pwmIoctl(pwm0FD, PWM_SET_DISABLE_MAPPING_REG2, PWM_ZERO_MASK,<br />

BSP_DEVICE_NAME_PWM_A);<br />

pwm_CB.pCallback = pwm_Reload_A_Callback;<br />

pwm_CB.pCallbackArg = NULL;<br />

PWM Driver<br />

/* installs the user Reload interrupt service routine */<br />

pwmIoctl(pwm0FD, PWM_SET_RELOAD_CALLBACK, &pwm_CB, BSP_DEVICE_NAME_PWM_A);<br />

/* enables PWM output pad */<br />

pwmIoctl (pwm0FD, PWM_OUTPUT_PAD, PWM_ENABLE, BSP_DEVICE_NAME_PWM_A);<br />

/* sets 50% duty cycle for channels */<br />

Comp.pwmChannel_0_Value = 0x4000;<br />

Comp.pwmChannel_2_Value = 0x4000;<br />

Comp.pwmChannel_4_Value = 0x4000;<br />

/* calculates the actual contents of the value registers, fills these<br />

registers,<br />

sets Load OK bit */<br />

pwmIoctl(pwm0FD, PWM_UPDATE_VALUE_REGS_COMPL, &Comp, BSP_DEVICE_NAME_PWM_A);<br />

/* enables reload interrupt */<br />

pwmIoctl(pwm0FD, PWM_RELOAD_INTERRUPT, PWM_ENABLE, BSP_DEVICE_NAME_PWM_A);<br />

while(1)<br />

{<br />

}<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

return;<br />

}<br />

/***********************************************************************************/<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-119<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.8.5 Low-Level Device Driver I/O API Specification<br />

This section specifies the Low-Level API Interface.<br />

Function arguments for each routine are described as in, out, or inout. An in argument means that<br />

the parameter value is an input only to the function. An out argument means that the parameter<br />

value is an output only from the function. An inout argument means that a parameter value is an<br />

input to the function, but the same parameter is also an output from the function.<br />

Typically, inout parameters are input pointer variables in which the caller passes the address of a<br />

preallocated data structure to a function. The function stores its results within that data structure.<br />

The actual value of the inout pointer parameter is not changed.<br />

5-120 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.8.5.1 pwmOpen<br />

Call(s):<br />

int pwmOpen(const char *pName, int OFlags);<br />

Table 5-74. Low-Level PWM Driver Arguments - pwmOpen<br />

pName in The PWM device name; see Table 5-71<br />

PWM Driver<br />

OFlag in General parameter to configure the PWM driver; however,this parameter is not used at<br />

this time<br />

Description: Opens a particular PWM device; the argument pName is the name of the particular<br />

device.<br />

Returns: If open is successful, returns a file descriptor which must be passed to other PWM<br />

driver functions. If open failed, returns a “-1” value.<br />

Code Example: See Code Example 5-19.<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-121<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

5.8.5.2 pwmClose<br />

Call(s):<br />

int pwmClose (int FileDesc);<br />

Description: The pwmClose call closes the PWM device and releases the file descriptor handle.<br />

Returns: The pwmClose call returns a type int. This int is always zero.<br />

Code Example: See Code Example 5-19.<br />

Code Example 5-19. Low-Level PWM Driver Usage (See also Code Example 5-18)<br />

/****************************************************************************/<br />

#include "bsp.h"<br />

#include "pwm.h"<br />

void main(void)<br />

{<br />

int pwmFD;<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 5-75. Low-Level PWM Driver Arguments - pwmClose<br />

FileDesc in PWM device descriptor returned by pwmOpen call<br />

/* Open the PWM driver */<br />

pwmFD = pwmOpen(BSP_DEVICE_NAME_PWM_A, 0);<br />

/* Disable the PWM */<br />

pwmIoctl(pwmFD, PWM_DEVICE, PWM_DISABLE, BSP_DEVICE_NAME_PWM_A);<br />

/* Close the PWM driver */<br />

pwmClose(pwmFD);<br />

}<br />

/****************************************************************************/<br />

5-122 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.8.6 PWM Driver Application<br />

For DSP56F801 and DSP56F802:<br />

PWM Driver<br />

The PWM driver application is intended to illustrate the usage of this driver by a real example and<br />

also to verify the functionality by blinking LEDs associated to the PWM. LED 7 is associated<br />

with the PWM Reload Interrupt and changes its state inside the interrupt service routine. The<br />

PWM driver application can be found in:<br />

src\dsp56801evm\nos\applications\pwm<br />

The application includes a CodeWarrior project file, pwm.mcp, and the PWM application source<br />

file, pwm.c. To view the PWM signal, apply a scope probe to pin 3 on connector J1 with ground<br />

on pin 9.<br />

For DSP56F803:<br />

The PWM driver application is intended to illustrate the usage of this driver by a real example and<br />

also to verify the functionality by blinking LEDs associated to the PWM. LED 8 is associated<br />

with the PWM Reload Interrupt and changes its state inside the interrupt service routine. The<br />

PWM driver application can be found in:<br />

\src\dsp56803evm\nos\applications\pwm<br />

The PWM driver application consists of the application pwm.mcp and the source code for the<br />

application, pwm.c. To view the signal, apply a scope probe to pin 10 on connector J4 with ground<br />

on pin 13.<br />

For DSP56F805:<br />

The PWM driver application is intended to illustrate the usage of this driver by a real example and<br />

also to verify the functionality by blinking LEDs associated to the PWM. LED 3 is associated<br />

with the PWM Reload Interrupt and changes its state inside the interrupt service routine. The<br />

PWM driver application can be found in:<br />

\src\dsp56805evm\nos\applications\pwm<br />

The PWM driver application consists of the application pwm.mcp and the source code for the<br />

application pwm.c. To view the signal, apply a scope probe to pin 11 on connector J21 with<br />

ground on pin 14.<br />

For DSP56F807:<br />

The PWM driver application is intended to illustrate the usage of this driver by a real example and<br />

also to verify the functionality by blinking LEDs associated to the PWM. LED 3 is associated<br />

with the PWM Reload Interrupt and changes its state inside the interrupt service routine. The<br />

PWM driver application can be found in:<br />

\src\dsp56807evm\nos\applications\pwm<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The PWM driver application consists of the application pwm.mcp and the source code for the<br />

application, pwm.c. To view the signal, apply a scope probe to pin 4 on connector J10 with ground<br />

on pin 14.<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-123<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

Jumper Settings:<br />

Use the default jumper settings for the DSP56F80xEVM board. See the Evaluation Module<br />

Hardware User’s Manual for a specific target; (i.e., the DSP56F805 Evaluation Module<br />

Hardware User’s Manual) for more information on jumper settings.<br />

5.9 PLL Driver<br />

The Motorola DSP56F803/805/807 chips allow the user to interface an external crystal oscillator<br />

or an external clock source. The DSP56F801/802 have the same features as the<br />

DSP56F803/805/807 as well as an internal relaxation oscillator. This section describes the<br />

software driver support for configuring the Phase Locked Loop in the On-Chip Clock Synthesis<br />

(OCCS) peripheral. For more OCCS information , consult the Motorola DSP56F80x User’s<br />

Manual. A block diagram of OCCS is shown in Figure 5-5.<br />

EXTAL<br />

XTAL<br />

Relaxation<br />

OSC<br />

Crystal<br />

OSC<br />

Lock<br />

Detector<br />

Loss of<br />

Clock<br />

PLL<br />

Figure 5-5. OCCS Block Diagram<br />

The <strong>SDK</strong> allows the user to configure all modes of operation of the PLL by defining the<br />

appropriate constants in appconfig.h to override the default settings. The default configuration is<br />

defined in config.h; PLL initialization is done in config.c, located in:<br />

\<strong>SDK</strong>\src\DSP568xx\nos\config<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

LCK<br />

FEEDBACK<br />

FREF<br />

FOUT/2<br />

Bus Interface<br />

and<br />

Control<br />

DSP56F801/802 Only<br />

Prescaler<br />

Postscaler<br />

Divide By [6:0]<br />

PRECS<br />

Prescaler Clk<br />

Clock<br />

MUX<br />

Postscaler Clk<br />

Bus<br />

Interface<br />

ZCLK<br />

operating<br />

clock<br />

5-124 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

PLL Driver<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The following sections detail the definitions available for use in configuring the PLL. For more<br />

PLL information, consult the Motorola DSP56F80x User’s Manual.<br />

5.9.1 API Definition<br />

This section defines the Application Programming Interface (API) by identifying all public<br />

interface functions and data structures.<br />

Code to create and initialize the PLL driver is automatically included in an <strong>SDK</strong> <strong>Embedded</strong><br />

Project by inserting the following line in the appconfig.h file:<br />

#define INCLUDE_BSP<br />

The following information may be found in the public header file plldrv.h:<br />

Public Interface Function(s):<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

EXPORT void plldrvInitialize (UWord16 ControlReg,<br />

UWord16 DivideReg,<br />

UWord16 TestReg,<br />

UWord16 SelectReg);<br />

EXPORT UWord16 plldrvCalibrate(void); /* DSP56F801 and DSP56F802 only */<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-125<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

5.9.2 API Specification<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

This section specifies the exact usage for each API function.<br />

Function arguments for each routine are described as in, out, or inout. An in argument means that<br />

the parameter value is an input only to the function. An out argument means that the parameter<br />

value is an output only from the function. An inout argument means that a parameter value is an<br />

input to the function, but the same parameter is also an output from the function.<br />

Typically, inout parameters are input pointer variables in which the caller passes the address of a<br />

preallocated data structure to a function. The function stores its results within that data structure.<br />

The actual value of the inout pointer parameter is not changed.<br />

5-126 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.9.2.1 plldrvInitialize<br />

Call(s):<br />

void plldrvInitialize (UWord16 ControlReg,<br />

UWord16 DivideReg,<br />

UWord16 TestReg,<br />

UWord16 SelectReg)<br />

Table 5-76. PLL Driver Arguments - plldrvInitialize<br />

ControlReg in OCCS Control Register<br />

DivideReg in OCCS Divide-By Register<br />

TestReg in OCCS Test Register.<br />

SelectReg in OCCS Select Register<br />

Table 5-77. PLL Control Register Definitions - ControlReg<br />

Defined Constant<br />

PLL_INT1_ENABLE_ANY_EDGE<br />

PLL_INT1_ENABLE_FALLING_EDGE<br />

PLL_INT1_ENABLE_RISING_EDGE<br />

PLL_INT0_ENABLE_ANY_EDGE<br />

PLL_INT0_ENABLE_FALLING_EDGE<br />

PLL_INT0_ENABLE_RISING_EDGE<br />

Description<br />

Used to enable interrupts on changes of PLL LCK1 status<br />

Used to enable interrupts on changes of PLL LCK0 status<br />

PLL Driver<br />

PLL_LOSS_OF_CLOCK_INT Enables an interrupt if the oscillator circuit output clock is lost<br />

PLL_LOCK_DETECTOR Enables the lock detector 80x Default<br />

PLL_FORCE_LOCK Force lock is enabled<br />

PLL_PRESCALER_EXTERNAL_CLK_SELECT<br />

PLL_PRESCALER_INTERNAL_CLK_SELECT<br />

PLL_ZCLOCK_PRESCALER<br />

PLL_ZCLOCK_POSTSCALER *<br />

External Crystal Oscillator selected 803/805/807 Default<br />

Internal Relaxation Oscillator selected 801/802 Default<br />

Determines the clock source to the DSP core<br />

Prescaler selected<br />

Postscaler selected 80x Default<br />

Table 5-78. PLL Divide-By Register - DivideReg<br />

Defined Constant Description<br />

PLL_CLOCK_OUT_DIVIDE_BY_1 *<br />

PLL_CLOCK_OUT_DIVIDE_BY_2<br />

PLL_CLOCK_OUT_DIVIDE_BY_4<br />

PLL_CLOCK_OUT_DIVIDE_BY_8<br />

* Selected as default in the <strong>SDK</strong><br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Directly configures the PLL Clock Out Divide (PLLCOD) bits<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-127<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

PLL_CLOCK_IN_DIVIDE_BY_1 *<br />

PLL_CLOCK_IN_DIVIDE_BY_2<br />

PLL_CLOCK_IN_DIVIDE_BY_4<br />

PLL_CLOCK_IN_DIVIDE_BY_8<br />

Directly configures the PLL Clock In Divide (PLLCID) bits<br />

PLL_MUL Directly configures the PLL Divide By (PLLDB) bits with<br />

(PLL_MUL-1). PLL_MUL is set to 18 by default, which generates<br />

144MHz ZCLK and 72 MHz IP Bus Frequency for an 8MHz input<br />

clock using the PLL_CLOCK_OUT_DIVIDE_BY_1 and<br />

PLL_CLOCK_IN_DIVIDE_BY_1 defaults.<br />

Table 5-79. PLL Test Register - TestReg<br />

Defined Constant Description<br />

PLL_TEST_FEEDBACK_CLOCK Tests Feedback clock for lock detector<br />

PLL_TEST_REF_FREQ_CLOCK Tests Reference frequency clock<br />

PLL_TEST_FORCE_LOSS_OF_CLOCK Simulates a loss of clock if Test Mode is enabled (TM=1)<br />

PLL_TEST_FORCE_LOSS_OF_CLOCK1 Simulates a loss of lock if Test Mode is enabled (TM=1)<br />

PLL_TEST_FORCE_LOSS_OF_CLOCK2 Simulates a loss of lock if Test Mode is enabled (TM=1)<br />

PLL_TEST_MODE Enables Test Mode (TM=1)<br />

This register is set to zero by default to disable Test Mode.<br />

Table 5-80. PLL Select Register - SelectReg<br />

Defined Constant Description<br />

PLL_CLKO_SELECT_ZCLK* Selects the Processor Clock output from the clock generation module<br />

PLL_CLKO_SELECT_NO_CLK Selects No Clock output from the clock generation module<br />

* Selected as default in the <strong>SDK</strong><br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 5-78. PLL Divide-By Register - DivideReg<br />

Defined Constant Description<br />

* Selected as default in the <strong>SDK</strong><br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Description: The plldrvInitialize call initializes the On Chip Clock Synthesis (OCCS) module.<br />

When the system is powered up, the <strong>SDK</strong> initializes and configures the OCCS module. During<br />

this initialization, if the PLL Lock Detect is enabled, the <strong>SDK</strong> monitors the Lock Detect bit,<br />

allowing the PLL to lock for a maximum of 10ms before proceeding. In the current <strong>SDK</strong><br />

implementation, PLL Lock Detection is performed once during power-up. Code Example 5-21<br />

shows the <strong>SDK</strong> PLL Lock Detect implementation.<br />

NOTE: Notice that this detection scheme will continue even if the lock is NOT detected. If<br />

initial lock detection is critical to the execution of the application, the user should either<br />

modify this code or provide an additional lock detection function to ensure PLL lock is<br />

achieved.<br />

5-128 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Returns: None<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

PLL Driver<br />

Code Examples: Code Example 5-20 illustrates how to use defined constants to configure the<br />

PLL Control Register through the <strong>SDK</strong>. To reconfigure the PLL Control Register, the constants in<br />

Table 5-77can be ORed together, except those with a single block, which are mutually exclusive,<br />

Code Example 5-20. Reconfigure the PLL_CONTROL_REG<br />

#define PLL_CONTROL_REG ( PLL_LOCK_DETECTOR | PLL_ZCLOCK_POSTSCALER )<br />

Code Example 5-21 Illustrates the PLL lock detection code executed in the plldrvInitialize<br />

function when the Control Register is configured with the PLL_LOCK_DETECTOR set.<br />

Code Example 5-21. PLL Lock Detect, plldrv.c<br />

if ((ControlReg & PLL_LOCK_DETECTOR) == PLL_LOCK_DETECTOR)<br />

{<br />

/* Wait for PLL to lock */<br />

for (i=0; i


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

On-Chip Drivers<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Code Example 5-22. Reconfiguring the PLL Divide-By Register<br />

#define PLL_MUL 18 // For 8 MHz input clock,<br />

// generate 144 MHz PLL output clock<br />

// which runs the part at 72 MHz<br />

#define PLL_DIVIDE_BY_REG ( PLL_CLOCK_OUT_DIVIDE_BY_1 \<br />

| PLL_CLOCK_IN_DIVIDE_BY_1 \<br />

| ( PLL_MUL -1 ) )<br />

The CLKO Select Register, (CLKOSR), can be set either to ZCLK or to “no clock”; all other<br />

settings are reserved. The <strong>SDK</strong> uses ZCLK by default. To use the “no clock” setting, place the<br />

definition shown in Code Example 5-23 in your appconfig.h file.<br />

Code Example 5-23. Reconfiguring the PLL Select Register<br />

#define PLL_SELECT_REG PLL_CLKO_SELECT_NO_CLK<br />

5-130 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.9.2.2 plldrvCalibrate - (DSP56F801 and DSP56F802 only)<br />

Call(s):<br />

UWord16 plldrvCalibrate(void)<br />

PLL Driver<br />

Description: The plldrvCalibrate call sets the internal oscillator control register (IOSCTL) to the<br />

factory calibration value. This value is calibrated at the factory to 8MHz at room temperature. If<br />

the value is invalid (0xFFFF), the IOSCTL will not be changed.<br />

Returns: Factory Calibration value.<br />

Special Issues: The calibration value is stored at the end of the Data Flash information block<br />

(0x103F). This address is reserved but may be overwritten by the user to force a different<br />

calibration value.<br />

Code Example: See Example 5-26<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-131<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

5.9.3 PLL Test Register<br />

The PLL test register (TESTR) can be configured by defining PLL_TEST_REG in the appconfig.h file and<br />

ORing any of the constants defined in the list below as part of its definition. By default, <strong>SDK</strong> sets this<br />

register to zero.<br />

• PLL_TEST_FEEDBACK_CLOCK<br />

• PLL_TEST_REF_FREQ_CLOCK<br />

• PLL_TEST_FORCE_LOSS_OF_CLOCK<br />

• PLL_TEST_FORCE_LOSS_OF_CLOCK1<br />

• PLL_TEST_FORCE_LOSS_OF_CLOCK2<br />

• PLL_TEST_MODE<br />

Using the PLL test register requires active code to update the register as needed for test<br />

implementation. This is handled in the <strong>SDK</strong> by the code found in Code Example 5-24.<br />

Code Example 5-24. Dynamically setting the PLL Test Register (TESTR)<br />

UWord16 TestReg;<br />

TestReg = ...; // Define the new contents of the TESTR<br />

periphMemWrite( TestReg, &ArchIO.Pll.TestReg ); // Set the register<br />

5.9.4 PLL Status Register<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The PLL status register can be read with this code:<br />

UWord16 PLLStatus;<br />

PLLStatus = periphMemRead( &ArchIO.Pll.StatusReg );<br />

The status bits can then be checked by ANDing PLLStatus with the following definitions:<br />

• PLL_STATUS_LOCK_LOST_INT1<br />

• PLL_STATUS_LOCK_LOST_INT0<br />

• PLL_STATUS_CLOCK_LOST<br />

• PLL_STATUS_LOCK_1<br />

• PLL_STATUS_LOCK_0<br />

• PLL_STATUS_POWERED_DOWN<br />

• PLL_STATUS_ZCLOCK_PRESCALER<br />

• PLL_STATUS_ZCLOCK_POSTSCALER<br />

5.9.5 DSP56F801 and DSP56802 Clock Operation<br />

The DSP56F801 and DSP56F802 contain an internal relaxation oscillator that is selected at power<br />

up as the default system clock. The relaxation oscillator’s frequency can vary by manufacturing<br />

5-132 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

PLL Driver<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

process to produce a clock frequency anywhere between 7MHz and 9 MHz. For applications that<br />

require a more exact frequency, the chip provides a mechanism to trim the internal oscillator to<br />

the desired frequency (see the DSP5680x User’s Manual for detailed information). Every<br />

DSP56F801* and DSP56F802 internal oscillator has been calibrated to run at 8MHz. This<br />

calibration value is stored in the information block of the Data Flash at address $103F and may be<br />

used to dynamically calibrate the internal oscillator at system power up. The DSP56F801 and<br />

DSP56F802 <strong>Embedded</strong> <strong>SDK</strong> Stationery defaults to use the internal relaxation oscillator and<br />

provides startup code that automatically performs this calibration. This code can be found in the<br />

plldrv.c file in the plldrvCalibrate function; see Section 5.9.2.2.<br />

NOTE:* For the DSP56F801, only processors with a date code greater than 0152 marked in the<br />

lower right corner of the part contain the internal oscillator calibration value. For parts<br />

built prior to this date, see Code Example 5-25 for an example of the text that must be<br />

added to the appconfig.h file to select external clock operation.<br />

The DSP56F802 must use the internal relaxation oscillator, since it does not have an external<br />

clock option. The DSP56F801 processor defaults to use the internal relaxation oscillator at<br />

power-up, at which time the software may reconfigure the chip to run using the external oscillator.<br />

When making this switch, a strict sequence must be followed to guarantee a successful switch<br />

(see Section 5.9.5.1). The default DSP56F801 <strong>Embedded</strong> <strong>SDK</strong> Stationery configuration settings<br />

can be redefined by the user in the appconfig.h for a specific project. See Code Example 5-25 for<br />

an example of the text that must be added to the appconfig.h file to select external clock<br />

operation.<br />

Code Example 5-25. Selecting External Clock in appconfig.h File<br />

#define PLL_CONTROL_REG ( PLL_LOCK_DETECTOR \<br />

| PLL_ZCLOCK_POSTSCALER \<br />

| PLL_PRESCALER_EXTERNAL_CLK_SELECT)<br />

5.9.5.1 DSP56F801 Clock Switch-Over Procedure<br />

Reset or power-up configures the DSP56F801 to use the internal relaxation oscillator. To switch the clock<br />

from internal relaxation oscillator to external crystal oscillator, the DSP56F801 clock switch-over<br />

procedure is strongly recommended:<br />

• Disable the pull-up resistors for the EXTAL pin and XTAL pin<br />

• Wait for the external crystal oscillator to stabilize<br />

• Switch over to external crystal oscillator<br />

• Enable PLL lock detect circuit and enable PLL<br />

• Wait for PLL to lock<br />

• Switch from the PLL prescaler to postscaler clock<br />

By selecting the <strong>Embedded</strong> <strong>SDK</strong> DSP56F801 stationery, the <strong>SDK</strong> automatically performs this<br />

switch-over procedure in the start-up code, which is shown in Code Example 5-26. The relative<br />

delay required for the stabilization of the external oscillator may be configured by changing the<br />

defined constant, EXT_OSC_STABILIZATION_DELAY.<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-133<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Code Example 5-26. DSP56F801 Clock switch-over procedure, plldrv.c<br />

/* (100 * 16430 Machine cycles )/40MHz = 41ms */<br />

#define EXT_OSC_STABILIZATION_DELAY 100<br />

/****************************************************************************/<br />

void plldrvInitialize ( UWord16 ControlReg,<br />

UWord16 DivideReg,<br />

UWord16 TestReg,<br />

UWord16 SelectReg)<br />

{<br />

UWord16 PLLStatus;<br />

UInt16 i;<br />

/* If External Oscillator selected */<br />

if((ControlReg & PLL_PRESCALER_EXTERNAL_CLK_SELECT) \<br />

== PLL_PRESCALER_EXTERNAL_CLK_SELECT)<br />

{<br />

/* Disable Extal, Xtal pull up resistors */<br />

periphMemWrite(PLL_DISABLE_PULLUP_EXTAL_XTAL,&ArchIO.PortB.PullUpReg);<br />

}<br />

else<br />

{<br />

}<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

/* Delay long enough to allow external oscillator to stabilize */<br />

/* One pass through for loop = 16430 Machine cycles */<br />

for (i=0;i


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

/* Program PLL to user defined value */<br />

periphMemWrite(ControlReg, &ArchIO.Pll.ControlReg);<br />

}<br />

5.9.5.1.1 Disabling EXTAL and XTAL Pull Up Resistors<br />

The EXTAL and XTAL pull-up resistors are controlled by GPIO B Pull-Up Enable Register<br />

(PUR) bits two and three. The GPIO B pull-up resistors are enabled by default after reset or<br />

power-up.<br />

PLL Driver<br />

NOTE: Do not enable GPIO B pull-up resistors for bits two and three (EXTAL and XTAL pins).<br />

The user should ensure that these bits are not configured or changed when the external<br />

crystal oscillator is being used as a clock source for the DSP56F801.<br />

5.9.5.1.2 External Crystal Oscillator Stabilization Delay<br />

The correct operation of the DSP56F801 chip initialization depends on the reset input signal and<br />

the stability of the external clock oscillator. Generally, upon power-up, crystal oscillators may<br />

take 20ms or more before they reach a stable operating frequency. For the DSP56F801EVM, a<br />

delay of 40 to 50ms is recommended after the pull-up resistors of the EXTAL and XTAL pins are<br />

disabled to ensure the external crystal oscillator’s stabilization. Different crystal oscillators have<br />

different stabilization requirements, so the user should consult the manufacturer’s recommended<br />

specifications. The user can also hold the DSP56F801 reset signal while the external crystal<br />

oscillator is stabilizing and before gating it to the DSP56F801. For more DSP56F801 reset<br />

requirements and default PLL Registers, refer to the DSP56F80x User's Manual.<br />

Code Example 5-26 shows <strong>SDK</strong> implementation of a 41ms delay. This delay may vary, depending<br />

on the DSP56F801 internal oscillator frequency at power-up. In this example, an IPBus clock of<br />

40MHz clock is assumed (Maximum IPBus clock). The user can verify this delay by toggling a<br />

port pin and measuring it.<br />

NOTE: The internal relaxation oscillator clock frequency varies as a function of the wafer<br />

fabrication process. It varies little with temperature and voltage. The calculated delay<br />

in Code Example 5-26 is an estimation. The machine cycles number was measured using<br />

CodeWarrior’s (Simulator) instruction cycle count mechanism.<br />

5.9.5.1.3 External Crystal Oscillator Select<br />

The clock switch-over mechanism is available only for the DSP56F801 chip. The clock source to<br />

the prescaler circuit can be selected to be either the external crystal oscillator or the internal<br />

relaxation oscillator. Code Example 5-26 shows implementation of the <strong>SDK</strong> clock switch-over.<br />

NOTE: Clock switch-over from the external crystal oscillator to the internal crystal oscillator<br />

is not supported.<br />

5.9.5.2 Internal Oscillator Control Register (IOSCTL)<br />

Figure 5-6 shows the revised Internal Oscillator Control Register (IOSCTL). The Relaxation<br />

Oscillator Power-Down bit (ROPD) is no longer supported and is currently reserved for future<br />

use. For more information on the Internal Oscillator Control Register, refer to the DSP56F80x<br />

User's Manual.<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-135<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

DSP56F801 Internal<br />

Oscillator Control<br />

Register (IOSCTL)<br />

CLKGEN_BASE+$5<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Bits 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0<br />

R 0 0 0 0 0 0 0 0<br />

W<br />

Figure 5-6. Internal Oscillator Control Register (IOSCTL)<br />

TRIM[7:0]<br />

reset 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0<br />

NOTE: The Internal Oscillator Control Register (IOSCTL) in Figure 5-6 is an updated version<br />

from the OCCS shown in Figure 15-13 in the DSP56F80x User’s Manual Rev. 2.<br />

5-136 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Computer Operating Properly (COP) Driver<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.10 Computer Operating Properly (COP) Driver<br />

The COP Driver supports a mechanism for initializing COP registers, the services to reset the<br />

COP timer and to check system status. Current restrictions of the COP Driver functionality are<br />

related to the hardware implementation, which disables the COP module when the OnCE debug<br />

interface is active. Due to this hardware limitation, the COP module does not generate reset in the<br />

debug mode, even though the COP timeout has expired.<br />

5.10.1 Initialization<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The COP driver’s default configuration is defined in config.h and is shown in Table 5-81 and<br />

Table 5-82. Please refer to the DSP56F80x User’s Manual for a detailed description of these bits.<br />

Table 5-81. COP Control Register (COPCTL) Default Configuration<br />

COPCTL Bits Explanation and Default Value<br />

Stop Enable (CSEN) If 0, COP counter stops in Stop mode<br />

if 1, COP counter runs in Stop mode<br />

<strong>SDK</strong> Default = 0; COP Driver does not provide modification of this<br />

bit<br />

COP Wait Enable (CWEN) If 0, COP counter stops in Wait mode<br />

If 1, COP counter runs in Wait mode<br />

<strong>SDK</strong> Default = 0; COP Driver does not provide modification of this<br />

bit<br />

COP Enable (CEN) If 0, COP is disabled<br />

If 1, COP is enabled<br />

<strong>SDK</strong> Default = 0<br />

COP Write Protect (CWP) If 0, COPCTL, COPTO registers are readable and writable<br />

If 1, COPCTL, COPTO registers are read-only<br />

<strong>SDK</strong> Default = 0; COP Driver does not provide modification of this<br />

bit<br />

Table 5-82. COP Timeout Register (COPTO) Default Configuration<br />

COPTO Bits Explanation and Default Value<br />

COP Timeout (CT[11:0]) COP Timeout Period = 16384 x (CT[11:0] + 1) clock cycles<br />

Write the CT[11:0] value before the COP is enabled<br />

Valid values for CT[11:0] are 0-4095<br />

<strong>SDK</strong> Default = 4095<br />

Overwrite the COP driver’s default configuration for a specific project via the appconfig.h by<br />

redefining the COP_TIMEOUT definitions (See Code Example 5-28). This value defines COP<br />

timeout length in microseconds. The actual value that will be written to the COP Timeout<br />

Register depends on which DSP bus frequency is used. For a 40MHz frequency of the DSP bus,<br />

the maximum available timeout is 819100 µs (about 0.8 sec). Insert the following line of code into<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-137<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

the appconfig.h file to configure the COP timeout to be 1000 µs and the COP will be enabled<br />

automatically):<br />

#define COP_TIMEOUT 1000<br />

If the user redefines the COP_TIMEOUT value, the COP driver will be initialized and enabled<br />

during <strong>SDK</strong>’s initialization.<br />

By default, the COP reset interrupt vector is assigned with archStart() in <strong>SDK</strong>’s regular startup<br />

code. It can be reassigned in the appconfig.h, as shown in the following example:<br />

extern void copResetInterruptVector(void);<br />

#define INTERRUPT_VECTOR_ADDR_1 copResetInterruptVector<br />

NOTE: The processor has been reset due to the COP timeout and therefore the C environment<br />

has not been set up. It is recommende dthat an assemply routine be written for the COP<br />

ISR.<br />

To automatically include the code to initialize the COP driver in an <strong>SDK</strong> <strong>Embedded</strong> Project,<br />

insert the following line in the appconfig.h file:<br />

#define INCLUDE_COP<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

5-138 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.10.2 API Definition<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Computer Operating Properly (COP) Driver<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The following pages specify the Application Programming Interface (API).<br />

Function arguments for each routine are described as in, out, or inout. An in argument means that<br />

the parameter value is an input only to the function. An out argument means that the parameter<br />

value is an output only from the function. An inout argument means that a parameter value is an<br />

input to the function, but the same parameter is also an output from the function.<br />

Typically, inout parameters are input pointer variables in which the caller passes the address of a<br />

preallocated data structure to a function. The function stores its results within that data structure.<br />

The actual value of the inout pointer parameter is not changed.<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-139<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

5.10.2.1 copInitialize()<br />

Call(s):<br />

Arguments:<br />

void copInitialize(UWord16 ControlReg, UWord16 TimeoutReg);<br />

Description: The copInitialize() call restarts COP timer and writes two values to the COP<br />

appropriated registers.<br />

Returns: None<br />

Code Example 5-27. copInitialize()<br />

#include "cop.h"<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 5-83. COP Driver Arguments - copInitialize()<br />

ControlReg in This argument will be written directly to the COP Control Register. The following<br />

macro or its combinations can be used:<br />

COP_RUN_IN_STOP - COP module will be active in the STOP mode.<br />

COP_RUN_IN_WAIT - COP module will be active in the WAIT mode.<br />

COP_ENABLE - Enable COP timeout processing.<br />

COP_WRITE_PROTECT - Prohibit any following writing to the COP Control<br />

Register.<br />

TimeoutReg in This argument will be written directly to the COP Timeout Register. The<br />

maximum allowed value is 0x0FFF and minimum value is 0.<br />

/* Initialize COP module with the maximum allowed timeout value */<br />

copInitialize(COP_ENABLE|COP_WRITE_PROTECT,0x0FFF);<br />

5-140 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.10.2.2 copReload()<br />

Call(s):<br />

Arguments: None<br />

Computer Operating Properly (COP) Driver<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

void copReload(void);<br />

Description: The copReload() call restarts the COP timer. Place a copReload() call into the<br />

critical part of code that is executed periodically. If the code is not executed during the time<br />

specified by the COP_TIMEOUT value, the DSP chip will be restarted. Avoid placing the<br />

copReload() call into the interrupt service routine, because the interrupt can be going well, but the<br />

main code can be looping at the same time.<br />

Returns: None<br />

Code Example: See Code Example 5-29.<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-141<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

5.10.2.3 copForceReset()<br />

Call(s):<br />

Arguments: None<br />

void copForceReset(void);<br />

Description: The copForceReset() call forces COP timeout and causes the procesor to reset. This<br />

function may be used to debug the COP exception handling of the application.<br />

Returns: None<br />

Code Example: See Code Example 5-29.<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5-142 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Computer Operating Properly (COP) Driver<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.10.2.4 copGetSysStatus() and copClrSysStatus()<br />

Call(s):<br />

Arguments:<br />

UWord16 copGetSysStatus(UWord16 mask);<br />

void copClrSysStatus(UWord16 mask);<br />

Table 5-84. COP Driver Arguments - copGetSysStatus() and copClrSysStatus()<br />

mask in The DSP chip has three reset sources:<br />

COP_RESET - COP timeout expired Reset<br />

PWR_RESET - Power-On Reset<br />

EXT_RESET - External Reset<br />

Description: The copGetSysStatus() call checks corresponded bits in the System Status Register.<br />

It makes it possible to determine the last reset source. The copClrSysStatus() call clears<br />

corresponding bits in the System Status Register.<br />

Returns: The copGetSysStatus() returns zero value if the event specified by the mask argument<br />

did not occur or if the event was cleared by copClrSysStatus() service. In other cases, the return<br />

word contains non-zero value. The copClrSysStatus() has no return value.<br />

Code Example: See Code Example 5-29, which shows how to overwrite the default COP driver<br />

configuration in the appconfig.h file. This example configures COP timeout by 0.8 second value<br />

and redirects the default COP reset interrupt vector to the user-defined interrupt service routine.<br />

Code Example 5-28. Owerwriting Default COP Driver Settings in appconfig.h<br />

#define INCLUDE_COP<br />

EXPORT void copTimeoutISR(void);<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

#define INTERRUPT_VECTOR_ADDR_1 copTimeoutISR<br />

#define COP_TIMEOUT 800000L<br />

Code Example 5-29 shows how to use the COP Driver API, causing the Green LED on the EVM<br />

board to blink at a rate equal to the COP timeout value.<br />

Caution! This sample will not work when the OnCE debug interface is active. Please refer the<br />

appropriate EVM board manual to learn how to disable the OnCE port.<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-143<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Code Example 5-29. COP Driver API usage<br />

void main(void )<br />

{<br />

static int LedFD; /* File descriptor for LED driver */<br />

}<br />

/* Open LED's driver */<br />

LedFD = open(BSP_DEVICE_NAME_LED_0, 0);<br />

/* Check COP TIMEOUT status */<br />

if ( copGetSysStatus(COP_RESET) )<br />

{<br />

/* Clear each second event to provide GREEN LED blinking */<br />

if (COP_RESET_COUNTER & 0x0001)<br />

{<br />

copClrSysStatus(COP_RESET);<br />

}<br />

}<br />

do<br />

{<br />

/*<br />

To avoid COP reset uncomment the following function call:<br />

copReload();<br />

*/<br />

/* Indicate RESET SOURCE (from System Status register) */<br />

if ( copGetSysStatus(COP_RESET) != 0)<br />

ioctl(LedFD, LED_ON, LED_GREEN);<br />

} while (1);<br />

asm void copTimeoutISR(void )<br />

{<br />

move #-1,x0<br />

move x0,m01 /* ; Set the m register to linear addressing */<br />

}<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

move X:0x0000,X0 /* ; Increment COP_COUNTER_RESET */<br />

incw X0<br />

move X0,X:0x0000<br />

jsr archStart /* ; The STARTUP procedure of the <strong>SDK</strong> */<br />

5-144 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Computer Operating Properly (COP) Driver<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.10.3 COP Driver Application<br />

The COP application demonstrates how to set up and use the COP module in an application. By<br />

lighting LEDs, the application indicates why the chip was reset. The RED LED indicates that a<br />

Power-On Reset occurred. The YELLOW LED indicates an External Reset occurred. The<br />

GREEN LED toggles its state on each occurrence of a COP Reset, causing it to blink at the COP<br />

timeout frequency.<br />

The application is written for the "Flash" target only, because the COP module is inactive when<br />

the OnCE debug port is enabled. This means CodeWarrior debug features are unavailable during<br />

execution time and the application must be run in stand-alone mode.<br />

For DSP56F801 and DSP56F802:<br />

The COP application consists of the application cop.mcp and the source code for the application,<br />

cop.c, and can be found at:<br />

\src\dsp56801evm\nos\applications\cop<br />

Jumper Settings:<br />

Use the default jumper settings for the DSP56F801EVM board. See the DSP56F801 Evaluation<br />

Module Hardware Reference Manual for more information on jumper settings.<br />

Execution:<br />

• Ensure that jumper JG5 "CC Disable" is removed and download the code via Metrowerks<br />

CodeWarrior through the parallel cable OnCE port interface<br />

• Place the EVM board in stand-alone mode by connecting jumper JG5 "CC Disable" to<br />

disable the OnCE port and enable all COP module features on the EVM board<br />

• Switch off, then switch on the board’s power to provide the DSP chip Power-On reset<br />

• The COP application will automatically begin execution and the GREEN LED will blink<br />

at the COP timeout frequency<br />

For DSP56F803:<br />

The COP application consists of the application cop.mcp and the source code for the application,<br />

cop.c, and can be found at:<br />

\src\dsp56803evm\nos\applications\cop<br />

Jumper Settings:<br />

Use the default jumper settings for the DSP56F803EVM board. See the DSP56F803 Evaluation<br />

Module Hardware Reference Manual for more information on jumper settings.<br />

Execution:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

• Ensure that jumper JG2 "CC Disable" is removed and download the code via Metrowerks<br />

CodeWarrior through the parallel cable OnCE port interface<br />

• Place the EVM board in stand-alone mode by connecting jumpers JG4 "INT Boot" and JG2<br />

"CC Disable" to disable the OnCE port and enable all COP module features on the EVM<br />

board<br />

• Switch off, then switch on the board’s power to provide the DSP chip Power-On reset<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-145<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

• The COP application will automatically begin execution and the GREEN LED will blink<br />

at the COP timeout frequency<br />

For DSP56F805:<br />

The COP application consists of the application cop.mcp and the source code for the application,<br />

cop.c, and can be found at:<br />

\src\dsp56805evm\nos\applications\cop<br />

Jumper Settings:<br />

Use the default jumper settings for the DSP56F805EVM board. See the DSP56F805 Evaluation<br />

Module Hardware Reference Manual for more information on jumper settings.<br />

Execution:<br />

• Ensure that jumper JG5 "CC Disable" is removed and download the code via Metrowerks<br />

CodeWarrior through the parallel cable OnCE port interface<br />

• Place the EVM board in stand-alone mode by connecting jumpers JG7 "INT Boot" and JG5<br />

"CC Disable" to disable the OnCE port and enable all COP module features on the EVM<br />

board<br />

• Switch off, then switch on the board’s power to provide the DSP chip Power-On reset<br />

• The COP application will automatically begin execution and the RED LED will indicate<br />

that the Power-On reset occurred. The GREEN LED will blink at the COP timeout<br />

frequency. Press the reset button to switch on the YELLOW LED.<br />

For DSP56F807:<br />

The COP application consists of the application cop.mcp and the source code for the application,<br />

cop.c, and can be found at:<br />

\src\dsp56807evm\nos\applications\cop<br />

Jumper Settings:<br />

Use the default jumper settings for the DSP56F807EVM board. See the DSP56F807 Evaluation<br />

Module Hardware Reference Manual for more information on jumper settings.<br />

Execution:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

• Ensure that jumper JG4 "CC Disable" is removed and download the code via Metrowerks<br />

CodeWarrior through the parallel cable OnCE port interface<br />

• Place the EVM board in stand-alone mode by connecting jumpers JG7 "INT Boot" and JG4<br />

"CC Disable" to disable the OnCE port and enable all COP module features on the EVM<br />

board<br />

• Switch off, then switch on the board’s power to provide the DSP chip Power-On reset<br />

• The COP application will automatically begin execution and the RED LED will indicate<br />

that the Power-On reset occurred. The GREEN LED will blink at the COP timeout<br />

frequency. Press the reset button to switch on the YELLOW LED.<br />

5-146 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Core Configuration Registers (CORE) Driver<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5.11 Core Configuration Registers (CORE) Driver<br />

CORE services include on-chip core configuration registers, such as Bus Control and Interrupt<br />

Priority Register. The Bus Control Register’s fields include wait state generation for External<br />

Data (X) Memory, and External Program (P) Memory. These bits allow for programming up to 15<br />

wait states for both External Data and External Program Memory, depending on the DSP Core<br />

used. For example, the DSP56F807/805/803 chips can generate up to 12 wait states, while the<br />

DSP56824 chip can generate 15 wait states. The DSP56F801 and DSP56F802 processors do not<br />

support external Data or Program Memory. For specific peripherals, refer to the DSP56F80x<br />

User’s Manuals. Table 5-85 shows a list of variables needed for CORE configuration.<br />

Table 5-85. CORE Configuration<br />

CORE Configuration Definition<br />

BUS_CONTROL_EXT_X_MEM_WAIT_STATES •Bus Control External Data Memory Wait state<br />

•0,4,8,12 Wait State (DSP56F807/805/803/826/827)<br />

•0 - 15 Wait State (DSP56824)<br />

BUS_CONTROL_EXT_P_MEM_WAIT_STATES •Bus Control External Program Memory Wait State<br />

•0,4,8,12 Wait State (DSP56F807/805/803/826/827)<br />

•0 - 15 Wait State (DSP56824)<br />

INTERRUPT_PRIORITY REGISTER •0 - Level 1(Non-Maskable) and Level 0 (Maskable)<br />

Interrupts are Disabled<br />

•1 - Level 1 and Level 0 Interrupts are Enabled<br />

The following are configured when<br />

INTERRUPT_PRIORITY_REGISTER is defined:<br />

IPR_ENABLE_CHANNEL_0<br />

IPR_ENABLE_CHANNEL_1<br />

IPR_ENABLE_CHANNEL_2<br />

IPR_ENABLE_CHANNEL_3<br />

IPR_ENABLE_CHANNEL_4<br />

IPR_ENABLE_CHANNEL_5<br />

IPR_ENABLE_CHANNEL_6<br />

IPR_ENABLE_IRQA<br />

IPR_ENABLE_IRQB<br />

IPR_IRQA_TRIGGER_RISING_EDGE<br />

IPR_IRQB_TRIGGER_RISING_EDGE<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Channel 0 Peripheral Interrupt<br />

Channel 1 Peripheral Interrupt<br />

Channel 2 Peripheral Interrupt<br />

Channel 3 Peripheral Interrupt<br />

Channel 4 Peripheral Interrupt<br />

Channel 5 Peripheral Interrupt<br />

Channel 6 Peripheral Interrupt<br />

IRQA (External Interrupt)<br />

IRQB(External Interrupt)<br />

IRQA Trigger Rising Edge (select)<br />

IRQB Trigger Rising Edge (select)<br />

5.12 Interrupt Controller (ITCN) Driver<br />

Table 5-86 lists the ITCN variables’ configuration. The table also shows the default configuration<br />

set-up value for Global Priority Registers 0-15 (GPR_REG_0 to GPR_REG_15); Global Interrupt<br />

Priority (GPR_INT_PRIORITY_0 to GPR_INT_PRIORITY_63); and Board Support Peripherals<br />

(BSP_ENABLE_INTERRUPTS). Before making changes, the user should consult the<br />

DSP56F80x User’s Manual for correct ITCN operation .<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-147<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

ITCN Configuration Value Definition<br />

GPR_REG_0 0<br />

1<br />

GPR_REG_1 0<br />

1<br />

GPR_REG_2 0<br />

1<br />

GPR_REG_3 0<br />

1<br />

GPR_REG_4 0<br />

1<br />

GPR_REG_5 0<br />

1<br />

GPR_REG_6 0<br />

1<br />

GPR_REG_7 0<br />

1<br />

GPR_REG_8 0<br />

1<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 5-86. ITCN Default Configuration<br />

Default Value set by config.h; user defines the following interrupts:<br />

GPR_INT_PRIORITY_0<br />

GPR_INT_PRIORITY_1<br />

GPR_INT_PRIORITY_2<br />

GPR_INT_PRIORITY_3<br />

Default Value set by config.h; user defines the following interrupts:<br />

GPR_INT_PRIORITY_4<br />

GPR_INT_PRIORITY_5<br />

GPR_INT_PRIORITY_6<br />

GPR_INT_PRIORITY_7<br />

Default Value set by config.h; user defines the following interrupts:<br />

GPR_INT_PRIORITY_8<br />

GPR_INT_PRIORITY_9<br />

GPR_INT_PRIORITY_10<br />

GPR_INT_PRIORITY_11<br />

Default Value set by config.h; user defines the following interrupts:<br />

GPR_INT_PRIORITY_12<br />

GPR_INT_PRIORITY_13<br />

GPR_INT_PRIORITY_14<br />

GPR_INT_PRIORITY_15<br />

Default Value set by config.h; user defines the following interrupts:<br />

GPR_INT_PRIORITY_16<br />

GPR_INT_PRIORITY_17<br />

GPR_INT_PRIORITY_18<br />

GPR_INT_PRIORITY_19<br />

Default Value set by config.h; user defines the following interrupts:<br />

GPR_INT_PRIORITY_20<br />

GPR_INT_PRIORITY_21<br />

GPR_INT_PRIORITY_22<br />

GPR_INT_PRIORITY_23<br />

Default Value set by config.h; user defines the following interrupts:<br />

GPR_INT_PRIORITY_24<br />

GPR_INT_PRIORITY_25<br />

GPR_INT_PRIORITY_26<br />

GPR_INT_PRIORITY_27<br />

Default Value set by config.h; user defines the following interrupts:<br />

GPR_INT_PRIORITY_28<br />

GPR_INT_PRIORITY_28<br />

GPR_INT_PRIORITY_30<br />

GPR_INT_PRIORITY_31<br />

Default Value set by config.h; user defines the following interrupts:<br />

GPR_INT_PRIORITY_32<br />

GPR_INT_PRIORITY_33<br />

GPR_INT_PRIORITY_34<br />

GPR_INT_PRIORITY_35<br />

5-148 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

GPR_REG_9 0<br />

1<br />

GPR_REG_10 0<br />

1<br />

GPR_REG_11 0<br />

1<br />

GPR_REG_12 0<br />

1<br />

GPR_REG_13 0<br />

1<br />

GPR_REG_14 0<br />

1<br />

GPR_REG_15 0<br />

1<br />

BSP_ENABLE_INTERRUPTS 0<br />

1<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

System Integration Module (SIM) Driver<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 5-86. ITCN Default Configuration (Continued)<br />

Default Value set by config.h; user defines the following interrupts:<br />

GPR_INT_PRIORITY_36<br />

GPR_INT_PRIORITY_37<br />

GPR_INT_PRIORITY_38<br />

GPR_INT_PRIORITY_39<br />

Default Value set by config.h; user defines the following interrupts:<br />

GPR_INT_PRIORITY_40<br />

GPR_INT_PRIORITY_41<br />

GPR_INT_PRIORITY_42<br />

GPR_INT_PRIORITY_43<br />

Default Value set by config.h; user defines the following interrupts:<br />

GPR_INT_PRIORITY_44<br />

GPR_INT_PRIORITY_45<br />

GPR_INT_PRIORITY_46<br />

GPR_INT_PRIORITY_47<br />

Default Value set by config.h; user defines the following interrupts:<br />

GPR_INT_PRIORITY_48<br />

GPR_INT_PRIORITY_49<br />

GPR_INT_PRIORITY_50<br />

GPR_INT_PRIORITY_51<br />

Default Value set by config.h; user defines the following interrupts:<br />

GPR_INT_PRIORITY_52<br />

GPR_INT_PRIORITY_53<br />

GPR_INT_PRIORITY_54<br />

GPR_INT_PRIORITY_55<br />

Default Value set by config.h; user defines the following interrupts:<br />

GPR_INT_PRIORITY_56<br />

GPR_INT_PRIORITY_57<br />

GPR_INT_PRIORITY_58<br />

GPR_INT_PRIORITY_59<br />

Default Value set by config.h; user defines the following interrupts:<br />

GPR_INT_PRIORITY_60<br />

GPR_INT_PRIORITY_61<br />

GPR_INT_PRIORITY_62<br />

GPR_INT_PRIORITY_63<br />

•Disable Board Support Interrupts<br />

•Enable Board Support Interrupts<br />

•Board Support Interrupts includes on-chip Non-Maskable and<br />

Maskable interrupts<br />

5.13 System Integration Module (SIM) Driver<br />

The <strong>SDK</strong> provides a driver for the SIM with limited functionality. Presently, the SIM Driver only<br />

supports a mechanism for initializing the SIM’s SYS_CNTL register.<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-149<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

5.13.1 Initialization<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The SIM driver’s default configuration is defined in config.h and is shown in Table 5-87. Please<br />

refer to the DSP56F80x User’s Manual for a detailed description of these bits.<br />

Table 5-87. SYS_CNTL Default Configuration<br />

SYS_CNTL Bits Explanation and Default Value<br />

Timer I/O Pull-up Disable (TIM PD) •If 0, pull-ups for the timer I/O pins are enabled<br />

•If 1, pull-ups for the timer I/O pins are disabled<br />

•<strong>SDK</strong> Default = 0<br />

Control Signal Pull-Up Disable (CTRL PD) •If 0, pull-ups for the DS, PS, RD, and the WR I/O pins are<br />

enabled<br />

•If 1, pull-ups for the DS, PS, RD, and the WR I/O pins are<br />

disabled<br />

•<strong>SDK</strong> Default = 0<br />

Address Bus [5:0] Pull-up Disable (ADR PD) •If 0, pull-ups for the lower address I/O pins are enabled<br />

•If 1, pull-ups for the lower address I/O pins are disabled<br />

•<strong>SDK</strong> Default = 0<br />

Data Bus I/O Pull-up Disable (DATA PD) •If 0, pull-ups for the data bus I/O pins are enabled<br />

•If 1, pull-ups for the data bus I/O pins are disabled<br />

•<strong>SDK</strong> Default = 0<br />

Bootmap (BOOTMAP_B) •The Bootmap bit and the MA and MB bits in the OMR register<br />

determine memory mapping for program memory<br />

•If the Bootmap bit is 0, and the MA and MB bits are 0, the Boot<br />

Mode is selected (Mode 0A)<br />

•If the Bootmap bit is 1, and the MA and MB bits are 0, the first<br />

32K of program memory is internal and the second 32K of<br />

program memory is external (Mode 0B)<br />

•If either MA or MB is 1, then the Bootmap bit is ignored<br />

•<strong>SDK</strong> Default = 0<br />

2.7 V Low Voltage Interrupt Enable (LVIE27) •If 0, 2.7V low-voltage interrupt is disabled<br />

•If 1, 2.7V low-voltage interrupt is enabled<br />

•<strong>SDK</strong> Default = 0<br />

2.2 V Low Voltage Interrupt Enable (LVIE22) •If 0, 2.2V low-voltage interrupt is disabled<br />

•If 1, 2.2V low-voltage interrupt is enabled<br />

•<strong>SDK</strong> Default = 0<br />

Permanent STOP/WAIT Disable (PD) •If 0, STOP and WAIT instructions are enabled<br />

•If 1, STOP and WAIT instructions act as NOPs<br />

•<strong>SDK</strong> Default = 0<br />

Note: The part must be reset to clear this bit<br />

Re-programmable STOP/WAIT (RPD) •If 0, STOP and WAIT instructions are enabled.<br />

•If 1,STOP and WAIT instructions act as NOPs.<br />

•<strong>SDK</strong> Default = 0<br />

Note: Software sets and clears this bit<br />

5-150 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

CAN Driver<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The SIM driver’s default configuration can be overwritten via the appconfig.h for a specific<br />

project by re-defining the SIM_CONTROL_REG definition. Each of the SIM #defines in<br />

Table 5-88 corresponds directly to a bit in the SYS_CNTL register.<br />

To disable the Timer I/O Pull-ups and select Mode 0B, insert the following line of code into the<br />

appconfig.h file :<br />

#define SIM_CONTROL_REG (SIM_TIMER_PULLUP_DISABLE | SIM_BOOT_MODE_B)<br />

Code to initialize the SIM driver may automatically be included in an <strong>SDK</strong> <strong>Embedded</strong> Project by<br />

inserting the following line in the appconfig.h file:<br />

#define INCLUDE_SIM<br />

5.14 CAN Driver<br />

The Motorola Scalable Controller Area Network (MSCAN) driver is described in more detail in<br />

the DSP56800/MSCAN Driver User’s Manual.<br />

5.15 Timer Driver<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Table 5-88. Configuration Items for appconfig.h<br />

SIM #define Explanation<br />

SIM_TIMER_PULLUP_DISABLE Use this label to disable the pull-ups for the Timer I/O pins<br />

SIM_CONTROL_PULLUP_DISABLE Use this label to disable the pull-ups for the Control Signal pins<br />

SIM_ADDRESS_PULLUP_DISABLE Use this label to disable the pull-ups for the lower address I/O pins<br />

SIM_DATA_BUS_PULLUP_DISABLE Use this label to disable the pull-ups for the data bus I/O pins<br />

SIM_BOOT_MODE_B Use this label to select Mode 0B<br />

SIM_27V_LOW_VOLTAGE_INT_ENABLE Use this label to enable the 2.7V low-voltage interrupt<br />

SIM_22V_LOW_VOLTAGE_INT_ENABLE Use this label to enable the 2.2V low-voltage interrupt<br />

SIM_PERM_STOP_WAIT_DISABLE Use this label to have the STOP and WAIT instructions act as<br />

NOPs<br />

SIM_PROG_STOP_WAIT_DISABLE Use this label to have the STOP and WAIT instructions act as<br />

NOPs<br />

The Timer Driver interface is implemented through <strong>SDK</strong> Timer services. The <strong>SDK</strong> includes a<br />

Timer service whose purpose is to furnish a device-independent, standard method both for<br />

integrating timer drivers into the system and for calling these timer drivers from the user’s<br />

application.<br />

MOTOROLA On-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

5-151<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

On-Chip Drivers<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

5-152 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Chapter 6<br />

Off-Chip Drivers<br />

One strength of the <strong>SDK</strong> is that it provides a high degree of architectural and hardware<br />

independence for application code. This portability is due to the <strong>SDK</strong>’s modular design, which, in<br />

this case, isolates all EVM board specific functionality into a set of libraries that are part of the<br />

Board Support Package (BSP). The BSP can be found at \src\dsp5680xevm\nos\bsp of the <strong>SDK</strong>.<br />

This chapter is composed of two major components: Drivers and Interfaces. It defines the<br />

Application Programming Interface (API) by identifying all public interface functions and data<br />

structures. The <strong>SDK</strong> Off Chip API Interface can be used at two levels: Device-Independent I/O<br />

API interface and a Low-Level device driver interface. The Device-Independent I/O layer<br />

interface provide a standard I/O interface and invokes the lower layer device driver interface.<br />

Your application may use either the Device-Independent layer interface or the low-level device<br />

driver interface, depending on your specific goals for efficiency and portability. The<br />

Device-Independent I/O layer is portable; while the Low-Level device drivers are not portable,<br />

they are potentially more efficient than the Device-Independent I/O layer.<br />

6.1 LED Driver<br />

6.1.1 Introduction<br />

The LED interface manipulates the light emitting diodes (LEDs).<br />

6.1.2 Initialization<br />

The LED driver currently has no default configurations that can be overwritten through a project’s<br />

appconfig.h file.<br />

6.1.3 API Definition<br />

This section defines the Application Programming Interface (API) by identifying all public<br />

interface functions and data structures.<br />

Code to create and initialize the LED driver is automatically included in an <strong>SDK</strong> <strong>Embedded</strong><br />

Project by inserting the following line in the appconfig.h file:<br />

#define INCLUDE_LED<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

MOTOROLA Off-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

6-1<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Off-Chip Drivers<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The following information may be found in the public header file led.h:<br />

Public Interface Function(s):<br />

/*****************************************************************************<br />

* int open(const char *pName, int OFlags,...);<br />

* int close(int FileDesc);<br />

* UWord16 ioctl(int FileDesc, UWord16 Cmd, void * pParams);<br />

*****************************************************************************/<br />

Public Data Structure(s):<br />

None<br />

Members:<br />

None<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

6.1.4 LED Device-Independent I/O API Specifications<br />

The following pages specify device independent Application Programming Interface (API).<br />

Function arguments for each routine are described as in, out, or inout. An in argument means that<br />

the parameter value is an input only to the function. An out argument means that the parameter<br />

value is an output only from the function. An inout argument means that a parameter value is an<br />

input to the function, but the same parameter is also an output from the function.<br />

Typically, inout parameters are input pointer variables in which the caller passes the address of a<br />

preallocated data structure to a function. The function stores its results within that data structure.<br />

The actual value of the inout pointer parameter is not changed.<br />

6-2 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

6.1.4.1 open<br />

Call(s):<br />

int open(const char *pName, int OFlags, ...);<br />

LED Driver<br />

Description: The open call opens the LED driver for operations and returns a file descriptor used<br />

by ioctl function calls. The LED driver needs to be opened for ioctl calls.<br />

Returns: The open call returns a type int. When the open call is successful, this int is a file<br />

descriptor for the LED driver. This file descriptor is used by the LED driver’s close and ioctl<br />

functions. When the open call is not successful, a “-1” is returned.<br />

Code Example: See Code Example 6-1.<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 6-1. LED Driver Arguments - open<br />

pName in The LED device name; use BSP_DEVICE_NAME_LED_0<br />

OFlag in Open Mode Flags which are ignored<br />

FileDesc out LED device descriptor returned by open call and used in ioctl function calls<br />

MOTOROLA Off-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

6-3<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Off-Chip Drivers<br />

6.1.4.2 close<br />

Call(s):<br />

int close (int FileDesc);<br />

Description: The close call closes the LED driver.<br />

Returns: The close call returns a type int. This int is always zero.<br />

Code Example: See Code Example 6-1.<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 6-2. LED Driver Arguments - close<br />

FileDesc in LED device descriptor returned by open call and used in ioctl function calls<br />

6-4 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

6.1.4.3 ioctl<br />

Call(s):<br />

UWord16 ioctl(int FileDesc, UWord16 Cmd, void * pParams);<br />

Table 6-3. LED Driver Arguments<br />

FileDesc in LED device descriptor returned by open call and used in ioctl function calls<br />

Cmd in Commands found in led.h which are used to modify specific LEDs on EVM board<br />

pParams in A specific LED; see Table 6-4<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 6-4. LEDs for Specific EVM Boards (pParams - input parameter)<br />

DSP56F801EVM DSP56F803EVM DSP56F805EVM DSP56F807EVM<br />

LED_GREEN LED_GREEN LED_RED<br />

LED_YELLOW<br />

LED_GREEN<br />

Table 6-5. LED ioctl Commands<br />

Cmd pParams Return Result<br />

Description: The ioctl call manipulates the LEDs on the EVM board.<br />

LED Driver<br />

Return: Although the ioctl function is specified to return a UWord16 value, this return value is<br />

not returned by this driver and should not be checked by the application.<br />

Code Example: Code Example 6-1 toggles a green LED.<br />

LED_RED<br />

LED_YELLOW<br />

LED_GREEN<br />

LED_OFF Specific LED; see Table 6-4 None Turns specific LED off<br />

LED_ON Specific LED; see Table 6-4 None Turns specific LED on<br />

LED_TOGGLE Specific LED; see Table 6-4 None Toggles specific LED<br />

MOTOROLA Off-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

6-5<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Off-Chip Drivers<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Code Example 6-1. LED Driver Usage<br />

/****************************************************************************/<br />

#include "io.h"<br />

#include "fcntl.h"<br />

#include "bsp.h"<br />

#include "led.h"<br />

void main(void)<br />

{<br />

int LedFD;<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

/* open LED driver */<br />

LedFD = open(BSP_DEVICE_NAME_LED_0, 0);<br />

/* toggle Green LED */<br />

ioctl(LedFD, LED_TOGGLE, LED_GREEN);<br />

/* close LED driver */<br />

close(LedFD);<br />

}<br />

/***************************************************************************/<br />

6-6 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

6.1.5 Low-Level Device Drivers I/O API Specifications<br />

The following pages specify the low level Application Programming Interface (API).<br />

LED Driver<br />

Function arguments for each routine are described as in, out, or inout. An in argument means that<br />

the parameter value is an input only to the function. An out argument means that the parameter<br />

value is an output only from the function. An inout argument means that a parameter value is an<br />

input to the function, but the same parameter is also an output from the function.<br />

Typically, inout parameters are input pointer variables in which the caller passes the address of a<br />

preallocated data structure to a function. The function stores its results within that data structure.<br />

The actual value of the inout pointer parameter is not changed.<br />

MOTOROLA Off-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

6-7<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Off-Chip Drivers<br />

6.1.5.1 ledOpen<br />

Call(s):<br />

int ledOpen(const char *pName, int OFlags);<br />

Description: The ledopen call opens the LED driver for operations and returns a file descriptor<br />

used by ledIoctl function calls. The LED driver needs to be opened for ledIoctl calls.<br />

Returns: The open call returns a type int. When the open call is successful, this int is a file<br />

descriptor for the LED driver. This file descriptor is used by the LED driver’s close and ioctl<br />

functions. If the open call is not successful, a“-1” is returned.<br />

Code Example: See Code Example 6-2.<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 6-6. Low-Level LED Driver Arguments - open<br />

pName in The LED device name; use BSP_DEVICE_NAME_LED_0<br />

OFlag in Open Mode Flags which are ignored<br />

6-8 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

6.1.5.2 ledClose<br />

Call(s):<br />

int ledClose (int FileDesc);<br />

Description: The ledClose call closes the LED driver.<br />

Returns: The ledClose call returns a type int. This int is always zero.<br />

Code Example: See Code Example 6-2.<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 6-7. LED Driver Arguments - ledClose<br />

FileDesc in LED device descriptor returned by ledOpen call and used in ioctl function calls<br />

LED Driver<br />

MOTOROLA Off-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

6-9<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Off-Chip Drivers<br />

6.1.5.3 ledIoctl<br />

Call(s):<br />

UWord16 ledIoctl(int FileDesc, UWord16 Cmd, UWord16 led, const char<br />

*ledDevice);<br />

Description: The ledIoctl call manipulates the LEDs on the EVM board.<br />

Return: Void<br />

Code Example: See Code Example 6-2.<br />

Code Example 6-2. Low-Level LED Driver Usage<br />

/****************************************************************************/<br />

#include "bsp.h"<br />

#include "led.h"<br />

void main(void)<br />

{<br />

int ledFD;<br />

/* Open LED driver */<br />

ledFD = ledOpen(BSP_DEVICE_NAME_LED_0,0);<br />

/* Toggle the Green LED */<br />

ledIoctl(ledFD, LED_TOGGLE, LED_GREEN, BSP_DEVICE_NAME_LED_0);<br />

/* Close the LED driver */<br />

ledClose(ledFD);<br />

}<br />

/****************************************************************************/<br />

6.1.6 LED Driver Application<br />

None<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 6-8. Low-Level LED Driver Arguments<br />

FileDesc in LED device descriptor returned by ledOpen call and used in ledIoctl function calls<br />

Cmd in Commands found in led.h which are used to modify specific LEDs on EVM board<br />

led in Pin on which to perform the command, denoted as LED_RED, LED_GREEN,<br />

LED_YELLOW<br />

ledDevice in The LED device name from bsp.h; typically, BSP_DEVICE_NAME_LED_0<br />

6-10 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

6.2 FILE I/O Driver<br />

6.2.1 Introduction<br />

FILE I/O Driver<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The File I/O driver allows a DSP application to send data from the target platform to a specified<br />

file located on a Personal Computer (PC). It also allows a DSP application to receive data from a<br />

specified file located on a PC into the target platform. This is accomplished by a Windows<br />

program on a PC running simultaneously with the File I/O driver application on the target<br />

platform. The Windows executable must be launched prior to the DSP File I/O driver application<br />

and can be found at:<br />

..\<strong>Embedded</strong> <strong>SDK</strong>\src\x86\win32\applications\fileio\fileio.exe<br />

Communication between the target platform and PC is done by RS-232 protocol through the serial<br />

port at 9600 baud on the respective platforms. As a result of this driver’s use of the SCI port, the<br />

File I/O driver prohibits the use of this port by a user’s application for any other use. Figure 6-1<br />

shows a block diagram with the set-up required to utilize the File I/O driver in an application.<br />

Personal<br />

Computer<br />

Figure 6-1. Basic Set-up for File I/O Utilization<br />

NOTE: A serial communication port must be set up on a personal computer with the following<br />

settings:<br />

– Baud Rate = 9600<br />

– Data Bits = 8<br />

– Parity = None<br />

– Stop Bit = 1<br />

– Flow Control = None<br />

6.2.2 Initialization<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Reading Data from file on PC into DSP<br />

via RS-232 Serial Port<br />

Writing Data to a file on PC from DSP<br />

via RS-232 Serial Port<br />

Target<br />

Platform<br />

The File I/O device driver currently has no default configurations that can be overwritten through<br />

a project’s appconfig.h file.<br />

MOTOROLA Off-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

6-11<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Off-Chip Drivers<br />

6.2.3 API Definition<br />

This section defines the Application Programming Interface (API) by identifying all public<br />

interface functions and data structures.<br />

Code to create and initialize the File I/O driver may be automatically included into an <strong>SDK</strong><br />

<strong>Embedded</strong> Project by inserting the following line in the appconfig.h file:<br />

#define INCLUDE_FILEIO<br />

The following information may be found in the public header file fileio.h:<br />

Public Interface Function(s):<br />

/*****************************************************************************<br />

* int open(const char *pName, int OFlags,...);<br />

* ssize_t write(int FileDesc, const void * pBuffer, size_t Size);<br />

* ssize_t read(int FileDesc, void * pBuffer, size_t Size);<br />

* int close(int FileDesc);<br />

* UWord16 ioctl(int FileDesc, UWord16 Cmd, void * pParams);<br />

*****************************************************************************/<br />

Public Data Structure(s):<br />

None<br />

Members:<br />

None<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

6-12 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

FILE I/O Driver<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

6.2.4 File I/O Device-Independent I/O API Specifications<br />

The following pages specify the device independent Application Programming Interface (API).<br />

Function arguments for each routine are described as in, out, or inout. An in argument means that<br />

the parameter value is an input only to the function. An out argument means that the parameter<br />

value is an output only from the function. An inout argument means that a parameter value is an<br />

input to the function, but the same parameter is also an output from the function.<br />

Typically, inout parameters are input pointer variables in which the caller passes the address of a<br />

preallocated data structure to a function. The function stores its results within that data structure.<br />

The actual value of the inout pointer parameter is not changed.<br />

MOTOROLA Off-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

6-13<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Off-Chip Drivers<br />

6.2.4.1 open<br />

Call(s):<br />

int open(const char *pName, int OFlags, ...);<br />

Description: The open call opens the File I/O for operations and returns a file descriptor used by<br />

read/write function calls. When \\\\PC\\<strong>Embedded</strong> <strong>SDK</strong>\\yourfile.txt is used as the pName<br />

parameter, it looks to the registry for a relative path into the <strong>SDK</strong>. The registry path is found in the<br />

registry at:<br />

HKEY_LOCAL_MACHINE\SOFTWARE\MOTOROLA\<strong>Embedded</strong> <strong>SDK</strong>\<br />

The File I/O driver needs to be opened for read/write calls. A windows executable must also be<br />

launched before any write/read operations take place. The windows application can be found at:<br />

<strong>Embedded</strong> <strong>SDK</strong>\src\x86\win32\applications\fileio\fileio.exe<br />

Returns: The open call returns a type int. When the open call is successful, this int is a file<br />

descriptor for the File I/O driver. This file descriptor is used by the File I/O driver’s read, write,<br />

close, and ioctl functions. If the open call is not successful, a “-1” is returned.<br />

Code Example: See Code Example 6-3.<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 6-9. File I/O Driver open Arguments - open<br />

pName in The File I/O driver name; use:<br />

\\\\PC\\specificdrive\\yourfile.txt<br />

or<br />

\\\\PC\\<strong>Embedded</strong> <strong>SDK</strong>\\yourfile.txt<br />

OFlag in Use O_RDONLY for a read operation<br />

Use O_WRONLY for a write operation<br />

FileDesc out File I/O device descriptor returned by open call and used in write/read function calls<br />

6-14 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

6.2.4.2 write<br />

Call(s):<br />

FILE I/O Driver<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

ssize_t write(int FileDesc, const void * pBuffer, size_t Size);<br />

Description: The write call writes the user buffer out of the SPI device to a user specified file.<br />

Returns: The write call returns a type ssize_t. This ssize_t is the number of transferred words.<br />

Code Example: See Code Example 6-3.<br />

Table 6-10. File I/O Driver Arguments - write<br />

FileDesc in File I/O device descriptor returned by open call and used in write/read function calls<br />

pBuffer in Pointer to user buffer<br />

Size in Size of data to read/write<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

MOTOROLA Off-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

6-15<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Off-Chip Drivers<br />

6.2.4.3 read<br />

Call(s):<br />

ssize_t read(int FileDesc, void * pBuffer, size_t Size);<br />

Description: The read call reads data from a specified file into a user buffer.<br />

Returns: The read call returns a type ssize_t. This ssize_t is the number of received words.<br />

Code Example: None<br />

Table 6-11. File I/O Driver Arguments - read<br />

FileDesc in File I/O device descriptor returned by open call and used in write/read function calls<br />

pBuffer in Pointer to user buffer<br />

Size in Size of data to read/write<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

6-16 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

6.2.4.4 close<br />

Call(s):<br />

FILE I/O Driver<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

int close (int FileDesc);<br />

Description: The close call closes the File I/O driver and releases the file descriptor handle.<br />

Returns: The close call returns a type int. This int is always zero.<br />

Code Example: See Code Example 6-3.<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Table 6-12. File I/O Driver Arguments - close<br />

FileDesc in File I/O device descriptor returned by open call and used in write/read function calls<br />

MOTOROLA Off-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

6-17<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Off-Chip Drivers<br />

6.2.4.5 ioctl<br />

Call(s):<br />

UWord16 ioctl(int FileDesc, UWord16 Cmd, void * pParams);<br />

Description: The ioctl call changes the File I/O device data mode; it defaults to 8 bits.<br />

Returns: The ioctl call returns a type UWord16. This UWord16 is always zero.<br />

Code Example 6-3. File I/O Driver Usage<br />

/***************************************************************************/<br />

#include "port.h"<br />

#include "io.h"<br />

#include "fcntl.h"<br />

#include "fileio.h"<br />

#include "mem.h"<br />

#define BUFFER_SIZE 10<br />

void main(void)<br />

{<br />

int Fd;<br />

int I;<br />

/* Dynamic memory allocation is only supported in External RAM configuration */<br />

UWord16 * pBuffer = malloc(BUFFER_SIZE * sizeof(UWord16));<br />

UWord16 * pTemp = pBuffer;<br />

for(I = 0; I < BUFFER_SIZE; I++)<br />

{<br />

*pTemp = 0xFF0F;<br />

pTemp += 1;<br />

}<br />

Table 6-13. File I/O Driver Arguments<br />

FileDesc in File I/O device descriptor returned by open call and used in read/write function calls<br />

Cmd in Commands found in fileio.h which are used to modify the data format<br />

pParams in NULL<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 6-14. File I/O ioctl Commands<br />

Cmd pParams Return Result<br />

FILE_IO_DATAFORMAT_RAW None None Data format will be set to 16 bits<br />

FILE_IO_DATAFORMAT_EIGHTBITCHARS None None Data format will be set to 8 bits<br />

6-18 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

FILE I/O Driver<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

/* opens file on a PC in which to write data buffer to, gets relative path from<br />

registry */<br />

Fd = open("\\\\PC\\<strong>Embedded</strong> <strong>SDK</strong>\\test.txt", O_WRONLY);<br />

/* set data mode for 16 bits */<br />

ioctl(Fd, FILE_IO_DATAFORMAT_RAW,NULL);<br />

/* write buffer to test.txt */<br />

write(Fd, pBuffer, 10 * sizeof(UWord16));<br />

close(Fd);<br />

}<br />

/***************************************************************************/<br />

6.2.5 Low-Level I/O Services API Specifications<br />

None<br />

6.2.6 FILE I/O Driver Application<br />

None<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

MOTOROLA Off-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

6-19<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Off-Chip Drivers<br />

6.3 PC Master SCI Communication Driver<br />

6.3.1 Introduction<br />

The PC Master SCI Communication driver communicates with the PC master softwareWindows<br />

application to develop and debug target applications. A description of the communication<br />

protocol can be found in the PC Master Software Communication Library Help files. The<br />

pcmasterdrvIsr function is the main function which is called from the SCI interrupt service<br />

routine. The pcmasterdrvInit initializes the SCI port to enable communication. The<br />

pcmasterdrvGetAppCmdSts and pcmasterdrvWriteAppCmdSts reads and writes the application<br />

command status for the user application. The pcmasterdrvRecorder samples data into an internal<br />

data buffer. This driver is automatically installed and initialized simply by defining<br />

INCLUDE_PCMASTER in the appconfig.h file. Keep in mind that this driver requires the use of<br />

the SCI port, thereby prohibiting the use of this port by the application for any other use. The PC<br />

Master SCI Communication driver utilizes the SCI driver, which is configured to run at a rate of<br />

9600 baud. For an overview of PC Master, please refer to the PC Master Software User’s<br />

Manual.<br />

6.3.2 Initialization<br />

The PC master driver has default configurations defined in config.h which can be redefined in the<br />

appconfig.h for that project. These settings are explained in Table 6-15.<br />

6.3.3 API Definitions<br />

Table 6-15. PC Master Driver appconfig.h Settings<br />

PC Master #defines Default Explanation<br />

PC_MASTER_REC_BUFF_LEN 40 Recorder buffer length<br />

PC_MASTER_APPCMD_BUFF_LEN 0 Application Command buffer length<br />

PC_MASTER_RECORDER_TIME_BASE 0x8030 Recorder timebase = 48us<br />

This section defines the Application Programming Interface (API) and public data structures. For<br />

a more detailed description of this interface, see Section 6.3.4.<br />

The header file pcmasterdrv.h includes all required prototypes and structure/type definitions.<br />

Public Interface Function(s):<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

/*****************************************************************************<br />

Initialization of SCI Communication Algorithm<br />

This function must be called first, before start of communication.<br />

Parameter passed to this function is a variable of the structure sPCMasterComm<br />

*****************************************************************************/<br />

Word16 pcmasterdrvInit(sPCMasterComm *p_sPCMasterComm);<br />

6-20 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

PC Master SCI Communication Driver<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

/*****************************************************************************<br />

Get Application Command Status<br />

This function is used to check whether an Application Command has been received<br />

*****************************************************************************/<br />

UWord16 pcmasterdrvGetAppCmdSts(void);<br />

******************************************************************************<br />

Write Application Command Status<br />

This function clears the flags in Application Command status word and responds to PC<br />

that a new Application Command from PC can be accepted<br />

*****************************************************************************/<br />

Word16 pcmasterdrvWriteAppCmdSts(UWord16 state);<br />

/*****************************************************************************<br />

Main SCI Communication routine which provides receiving, decoding of incoming message<br />

and sending a response to PC<br />

*****************************************************************************/<br />

void pcmasterdrvIsr(void);<br />

/*****************************************************************************<br />

Recorder Routine<br />

Performs sampling of data into a buffer which is located at the address p_recBuff is<br />

pointing at and its length is determined by recSize item in sPCMasterComm structure<br />

*****************************************************************************/<br />

void pcmasterdrvRecorder(void);<br />

Public Data Structure(s):<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The structure sPCMasterComm is defined as shown in Table 6-16.<br />

./* structure with SCI communication settings */<br />

typedef struct {<br />

UWord16 *p_dataBuff;/* pointer to input/output communication buffer */<br />

UWord16 dataBuffSize;/* size of input/output communication buffer */<br />

UWord16 *p_recBuff; /* pointer to recorder buffer */<br />

UWord16 recSize; /* recorder buffer size */<br />

UWord16 *p_recorder;/* structure with rec settings and temp variables */<br />

UWord16 *p_scope; /* structure with scope settings */<br />

UWord16 timeBase; /* period of Recorder Routine launch */<br />

UWord16 *p_appCmdBuff;/* pointer to application command buffer */<br />

UWord16 appCmdSize; /* application command buffer size */<br />

UWord16 globVerMajor;/* board firmware version major number */<br />

UWord16 globVerMinor;/* board firmware version minor number */<br />

UWord16 idtString[PCMDRV_IDT_STRING_LEN];/* device identification string<br />

*/<br />

} sPCMasterComm;<br />

MOTOROLA Off-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

6-21<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Off-Chip Drivers<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 6-16. sPCMasterComm structure<br />

variable type explanation<br />

p_recBuff UWord16 Pointer pointing to start of recorder buffer<br />

recSize UWord16 Size of recorder buffer<br />

timeBase UWord16 Period of Recorder Routine launch; see Table 6-17<br />

p_appCmdBuff UWord16 Pointer pointing to start of buffer for application command calls<br />

appCmdSize UWord16 Size of user functions buffer<br />

globVerMajor UWord16 Board firmware version major number<br />

globVerMinor UWord16 Board firmware version minor number<br />

idtString[25] UWord16 Identification string<br />

The timeBase variable in the sPCMasterComm structure is coded in the format shown in<br />

Table 6-17.<br />

Example of timeBase variable coding:<br />

1) Frequency of the pcmasterdrvRecorder routine call is 48us.<br />

timeBase = 0x8030<br />

2) Frequency of the pcmasterdrvRecorder routine call is 100ms.<br />

timeBase = 0x4064<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Table 6-17. timeBase format<br />

bits format explanation<br />

0-13 14-bits Mantissa of Recorder Routine launch period<br />

14-15 2-bits Exponent of Recorder Routine launch period<br />

0- 1 (10 0 )<br />

1 - m (10 -3 )<br />

2- u (10 -6 )<br />

3- n (10 -9 )<br />

6-22 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

PC Master SCI Communication Driver<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

6.3.4 PC Master Driver Low-Level I/O API Specification<br />

The following pages specify the device independent Application Programming Interface (API).<br />

Function arguments for each routine are described as in, out, or inout. An in argument means that<br />

the parameter value is an input only to the function. An out argument means that the parameter<br />

value is an output only from the function. An inout argument means that a parameter value is an<br />

input to the function, but the same parameter is also an output from the function.<br />

Typically, inout parameters are input pointer variables in which the caller passes the address of a<br />

preallocated data structure to a function. The function stores its results within that data structure.<br />

The actual value of the inout pointer parameter is not changed.<br />

MOTOROLA Off-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

6-23<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Off-Chip Drivers<br />

6.3.4.1 pcmasterdrvInit - Initialize PC Master Driver Communication<br />

Call(s):<br />

Arguments:<br />

Word16 pcmasterdrvInit(sPCMasterComm *p_sPCMasterComm);<br />

Table 6-18. pcmasterdrvInit parameters<br />

Description: Initializes receiver functions and internal variables. The pcmasterdrvInit function is<br />

called in the config.c file; therefore, the user need not call this function from an application.<br />

Returns: If initialization was successful, pcmasterdrvInit returns “0”. If the SCI device open<br />

failed, pcmasterdrvInit returns “-1”.<br />

Range Issues: None<br />

variable in/out explanation<br />

p_sPCMasterComm in Pointer to structure sPCMasterComm with initialization data<br />

Special Issues: None<br />

Code Example: None<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

6-24 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

PC Master SCI Communication Driver<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

6.3.4.2 pcmasterdrvGetAppCmdSts - Get Application Command<br />

Status<br />

Call(s):<br />

UWord16 pcmasterdrvGetAppCmdSts(void);<br />

Arguments: None<br />

Description: This function confirms whether or not a new application command call has been<br />

received. If a new application command has been received, data is in the<br />

PCMasterCommApplicationCommandBuffer and there is an application command code at the<br />

first position and the parameters of the application command in the buffer. The length of this<br />

buffer is defined by PC_MASTER_APPCMD_BUFF_LEN in the config.h file. The parameters are<br />

passed to the pcmasterdrvInit function during initialization; see Table 6-16 for details.<br />

To enable application command calls, set PC_MASTER_APPCMD_BUFF_LEN in the config.h<br />

file to define the length of the application command buffer. The application command buffer,<br />

PCMasterCommApplicationCommandBuffer, will be declared automatically.<br />

Returns: If no application command has been received, the pcmasterdrvGetAppCmdSts returns<br />

“0”; if the PCMasterCommApplicationCommandBuffer contains data (a new application<br />

command has been received ), the pcmasterdrvGetAppCmdSts returns “-1”.<br />

Range Issues: None<br />

Special Issues: The application command status returned by the pcmasterdrvGetAplCmdSts<br />

function must be rewritten with the pcmasterdrvWriteAppCmdSts function to enable receipt of the<br />

next application commands; see Section 6.3.4.3.<br />

Code Example: None<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

MOTOROLA Off-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

6-25<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Off-Chip Drivers<br />

6.3.4.3 pcmasterWriteAppCmdSts - Write Application Command<br />

Status<br />

Call(s):<br />

Word16 pcmasterdrvWriteAppCmdSts(UWord16 state);<br />

Description: The pcmasterdrvWriteAppCmdSts function stores a state value to be sent to the PC<br />

as an application command return code. If the status of the application command call is not<br />

changed to the range below after its execution, no new application command can be called.<br />

To enable application command calls, set the PC_MASTER_APPCMD_BUFF_LEN in the<br />

config.h file to define the length of the application command buffer. The application command<br />

buffer PCMasterCommApplicationCommandBuffer will be declared automatically.<br />

To service an application command call, follow these steps:<br />

• To check whether a new command has been received, call the pcmasterdrvGetAplCmdSts<br />

function<br />

• If a new command has been received, perform the action related to the application<br />

command received<br />

• Write back an application command return code using the pcmastercrvWriteAppCmdSts<br />

function<br />

Returns: The pcmastercrvWriteAppCmdSts function unconditionally returns “0”.<br />

Range Issues: Only the low byte of state is used. The value of the state must be within the range:<br />

0x0000


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

PC Master SCI Communication Driver<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

6.3.4.4 pcmasterdrvIsr - Main communication function<br />

Call(s):<br />

void pcmasterdrvIsr(void);<br />

Arguments: None<br />

Description: The function pcmasterdrvIsr is the main communication function and decodes<br />

received messages and executes proper commands. This function is called in SCI0 receiver and<br />

transmitter interrupts.<br />

Returns: void<br />

Range Issues: None<br />

Special Issues: The pcmasterdrvIsr function is installed to be called in receiver and transmitter<br />

interrupts of the SCI0 module.<br />

Code Example: None<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

MOTOROLA Off-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

6-27<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Off-Chip Drivers<br />

6.3.4.5 pcmasterdrvRecorder - Sample recorded variables<br />

Calls:<br />

void pcmasterdrvRecorder(void);<br />

Arguments: None<br />

Description: The function pcmasterdrvRecorder provides a sampling of required variables. The<br />

pcmasterdrvRecorder function should be called periodically (e.g., using timer interrupt) to<br />

provide a constant sampling period. The pcmasterdrvRecorder function uses the<br />

PCMasterCommRecorderBuffer defined in config.c file. The length of the buffer is defined by<br />

PC_MASTER_REC_BUFF_LEN and the time base of the pcmasterdrvRecorder routine is defined<br />

by PC_MASTER_RECORDER_TIME_BASE in the config.h file. The parameters are passed to the<br />

pcmasterdrvInit function during initialization; see Table 6-16 and Table 6-17 for details.<br />

To use the recorder follow these steps:<br />

• Set PC_MASTER_REC_BUFF_LEN to define the recorder buffer length<br />

• The recorder buffer PCMasterCommRecorderBuffer will be declared automatically<br />

• Call the pcmasterdrvRecorder function periodically<br />

Returns: Void<br />

Range Issues:None<br />

Special Issues: None<br />

Code Example: None<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

6-28 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

6.3.5 PC Master Driver Application<br />

Switch Driver<br />

Examples which demonstrate the use of the PC master driver can be found in such Motor Control<br />

applications as 3ph_srm_hall_sensor_type1, located in the ...\dsp5680xevm\nos\applications<br />

directory for the specific target.<br />

6.4 Switch Driver<br />

6.4.1 Introduction<br />

The Switch interface reads the state of the Run/Stop switch on the EVM board.<br />

6.4.2 Initialization<br />

The Switch driver currently has no default configurations that can be overwritten through a<br />

project’s appconfig.h file.<br />

6.4.3 API Definition<br />

This section defines the Application Programming Interface (API) by identifying all public<br />

interface functions and data structures.<br />

Code to create and initialize the Switch driver is automatically included in an <strong>SDK</strong> <strong>Embedded</strong><br />

Project by inserting the following line in the appconfig.h file:<br />

#define INCLUDE_SWITCH<br />

The following information may be found in the public header file switch.h:<br />

Public Interface Function(s):<br />

/*****************************************************************************<br />

* int open(const char *pName, int OFlags,...);<br />

* int close(int FileDesc);<br />

* UWord16 ioctl(int FileDesc, UWord16 Cmd, void * pParams);<br />

*****************************************************************************/<br />

Public Data Structure(s): None<br />

Members: None<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

MOTOROLA Off-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

6-29<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Off-Chip Drivers<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

6.4.4 Switch Device-Independent I/O API Specifications<br />

The following pages specify the device-independent Application Programming Interface (API).<br />

Function arguments for each routine are described as in, out, or inout. An in argument means that<br />

the parameter value is an input only to the function. An out argument means that the parameter<br />

value is an output only from the function. An inout argument means that a parameter value is an<br />

input to the function, but the same parameter is also an output from the function.<br />

Typically, inout parameters are input pointer variables in which the caller passes the address of a<br />

preallocated data structure to a function. The function stores its results within that data structure.<br />

The actual value of the inout pointer parameter is not changed.<br />

6-30 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

6.4.4.1 open<br />

Call(s):<br />

int open(const char *pName, int OFlags,...);<br />

Switch Driver<br />

Description: The open call opens the Switch driver for operations and returns a file descriptor<br />

used by ioctl function calls. The Switch driver needs to be opened for ioctl calls.<br />

Returns: The open call returns a type int. When the open call is successful, this int is a file<br />

descriptor for the Switch driver. This file descriptor is used by the Switch driver’s read, write,<br />

close, and ioctl functions. If the open call is not successful, “-1” is returned.<br />

Code Example: See Code Example 6-4.<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 6-20. Switch DriverArguments - open<br />

pName in The Switch device name; use BSP_DEVICE_NAME_SWITCH_0<br />

OFlag in Open Mode Flags which are ignored<br />

FileDesc out Switch device descriptor returned by open call and used in ioctl function calls<br />

MOTOROLA Off-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

6-31<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Off-Chip Drivers<br />

6.4.4.2 close<br />

Call(s):<br />

int close (int FileDesc);<br />

Description: The close call closes the Switch driver.<br />

Returns: The close call returns a type int. This int is always zero.<br />

Code Example: See Code Example 6-4.<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 6-21. Switch Driver Arguments - close<br />

FileDesc in Switch device descriptor returned by open call and used in ioctl function calls<br />

6-32 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

6.4.4.3 ioctl<br />

Call(s):<br />

UWord16 ioctl(int FileDesc, UWord16 Cmd, void * pParams);<br />

Description: The ioctl call finds the state of the Run/Stop switch on the EVM board.<br />

Switch Driver<br />

Returns: The ioctl call returns a type UWord16. This UWord16 is the state of the Run/Stop<br />

switch. A “1” signifies the switch is On; a “0” signifies the switch is Off.<br />

Code Example: Code Example 6-4 determines the state of the Run/Stop switch on the EVM board<br />

and returns the state in variable SwPos.<br />

Code Example 6-4. Switch Driver Usage<br />

/****************************************************************************/<br />

#include "io.h"<br />

#include "fcntl.h"<br />

#include "bsp.h"<br />

#include "switch.h"<br />

void main(void)<br />

{<br />

int SwitchFD;<br />

int SwPos;<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 6-22. Switch Driver Arguments<br />

FileDesc in Switch device descriptor returned by open call and used in ioctl function calls<br />

Cmd in Command found in switch.h which are used to read state of Run/Stop switch on EVM<br />

board<br />

pParams in pParams must be set to the switch device name: BSP_DEVICE_NAME_SWITCH_0<br />

Table 6-23. Switch ioctl Commands<br />

Cmd pParams Return Result<br />

SWITCH_GET_STATE pParams must be set to the switch<br />

device name:<br />

BSP_DEVICE_NAME_SWITCH_0<br />

/* open switch driver */<br />

SwitchFD = open(BSP_DEVICE_NAME_SWITCH_0, 0);<br />

The state of the<br />

Run/Stop switch on<br />

the EVM board<br />

/* get state of switch */<br />

SwPos = ioctl(SwitchFD, SWITCH_GET_STATE, BSP_DEVICE_NAME_SWITCH_0);<br />

A “1” signifies that the<br />

Run/Stop switch is On<br />

A “0” signifies that the<br />

Run/Stop switch is Off<br />

MOTOROLA Off-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

6-33<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Off-Chip Drivers<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

/* close switch driver */<br />

close(SwitchFD);<br />

}<br />

/***************************************************************************/<br />

6-34 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

6.4.5 Low-Level I/O Services API Specifications<br />

The following pages specify the Low-Level Application Programming Interface (API).<br />

Switch Driver<br />

Function arguments for each routine are described as in, out, or inout. An in argument means that<br />

the parameter value is an input only to the function. An out argument means that the parameter<br />

value is an output only from the function. An inout argument means that a parameter value is an<br />

input to the function, but the same parameter is also an output from the function.<br />

Typically, inout parameters are input pointer variables in which the caller passes the address of a<br />

preallocated data structure to a function. The function stores its results within that data structure.<br />

The actual value of the inout pointer parameter is not changed.<br />

MOTOROLA Off-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

6-35<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Off-Chip Drivers<br />

6.4.5.1 switchOpen<br />

Call(s):<br />

int switchOpen(const char *pName, int OFlags);<br />

Description: The switchOpen opens a particular SWITCH device. The argument pName is the<br />

particular device name. The SWITCH device needs to be opened before configuring the port with<br />

switchIoctl calls.<br />

Returns: If switchOpen is successful, the switchOpen Port file descriptor is returned. If<br />

switchOpen failed, “-1” value is returned.<br />

Code Example: See Code Example 6-5.<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 6-24. Low-Level Switch Driver Arguments - open<br />

pName in The Switch device name; use BSP_DEVICE_NAME_SWITCH_0<br />

OFlag in Open Mode Flags which are ignored<br />

6-36 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

6.4.5.2 switchClose<br />

Call(s):<br />

int switchClose (int FileDesc);<br />

Description: The switchClose call closes the Switch driver.<br />

Returns: The switchClose call returns a type int. This int is always zero.<br />

Code Example: See Code Example 6-5.<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 6-25. Low-Level Switch Driver Arguments - close<br />

Switch Driver<br />

FileDesc in Switch device descriptor returned by switchOpen call and used in switchIoctl function<br />

calls<br />

MOTOROLA Off-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

6-37<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Off-Chip Drivers<br />

6.4.5.3 switchIoctl<br />

Call(s):<br />

UWord16 switchIoctl(int FileDesc, UWord16 Cmd, void * pParams, const char*<br />

Device);<br />

Description: The switchIoctlr reads the state of the SWITCH.<br />

Returns: Void<br />

Table 6-26. Low-Level Switch Driver Arguments - switchIotcl<br />

FileDesc in Switch device descriptor returned by switchOpen call and used in ioctl function calls<br />

Cmd in Command found in switch.h which is used to read the state of the Run/Stop switch on<br />

the EVM board; see Table 6-23<br />

pParams in Not used<br />

Device in The SWITCH device name from bsp.h; typically, BSP_DEVICE_NAME_SWITCH_0<br />

Code Example: See Code Example 6-5.<br />

Code Example 6-5. Low-Level Switch Driver Usage<br />

/***************************************************************************/<br />

#include "bsp.h"<br />

#include "switch.h"<br />

void main(void)<br />

{<br />

int switchFD, SwitchState;<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

/* Open SWITCH driver */<br />

switchFD = switchOpen(BSP_DEVICE_NAME_SWITCH_0, 0);<br />

/* Read the state of the switch */<br />

SwitchState = switchIoctl(switchFD, SWITCH_GET_STATE, 0,<br />

BSP_DEVICE_NAME_SWITCH_0);<br />

/* Close the SWITCH driver */<br />

switchClose(switchFD);<br />

}<br />

/***************************************************************************/<br />

6-38 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

6.4.6 Low-Level I/O Services API Specification<br />

None<br />

6.4.7 Switch Driver Application<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Switch Driver<br />

Examples which demonstrate use of the switch driver can be found in such Motor Control<br />

applications as 3ph_srm_hall_sensor_type1, located in the ...\dsp5680xevm\nos\applications<br />

directory for the specific target.<br />

6.4.8 Switch Driver Considerations<br />

When utilizing the Switch Driver in an application on the DSP56F803EVM, there are several<br />

interdependencies to consider. The RUN/STOP switch on this EVM is connected to the ADC,<br />

used by the Switch Driver to capture a level which determines the state of the RUN/STOP switch.<br />

The Switch Driver configures the ADC, via the ADC Driver, to a Once Sequential Scan mode<br />

(See Chapter 9 of the DSP56F80x User’s Manual for more information on the ADC). Each time<br />

the state of the RUN/STOP switch is to be determined, the ADC is started in this mode. As a<br />

result, the user must take special care when using the Switch Driver concurrently with the ADC<br />

Driver.<br />

MOTOROLA Off-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

6-39<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Off-Chip Drivers<br />

6.5 Brake Driver<br />

This section discusses the use of the Brake Driver in Motor Control applications.<br />

6.5.1 Introduction<br />

The Brake interface controls the operation of a Motor Control brake used as a peripheral from the<br />

EVM board. The Motor Control brake is typically found in the suitcases used to demonstrate<br />

various motors.<br />

6.5.2 Initialization<br />

The Brake driver currently has no default configurations that can be overwritten through a<br />

project’s appconfig.h file.<br />

6.5.3 API Definition<br />

This section defines the Application Programming Interface (API) by identifying all public<br />

interface functions and data structures.<br />

Code to create and initialize the Brake driver is automatically included into an <strong>SDK</strong> <strong>Embedded</strong><br />

Project by inserting the following line in the appconfig.h file:<br />

#define INCLUDE_BRAKE<br />

The following information may be found in the public header file brake.h:<br />

Public Interface Function(s):<br />

/*****************************************************************************<br />

* int open (const char *pName, int OFlags,...);<br />

* int close (int FileDesc);<br />

* UWord16 ioctl (int FileDesc, UWord16 Cmd, void * pParams);<br />

* UWord16 brakeIoctl (int FileDesc, UWord16 Cmd, void * pParams, const char<br />

*pName);<br />

*****************************************************************************/<br />

Public Data Structure(s): None<br />

Members: None<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

6-40 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

6.5.4 Brake Device-Independent I/O API Specifications<br />

Brake Driver<br />

The following pages specify the device-independent Application Programming Interface (API).<br />

Function arguments for each routine are described as in, out, or inout. An in argument means that<br />

the parameter value is an input only to the function. An out argument means that the parameter<br />

value is an output only from the function. An inout argument means that a parameter value is an<br />

input to the function, but the same parameter is also an output from the function.<br />

Typically, inout parameters are input pointer variables in which the caller passes the address of a<br />

preallocated data structure to a function. The function stores its results within that data structure.<br />

The actual value of the inout pointer parameter is not changed.<br />

MOTOROLA Off-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

6-41<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Off-Chip Drivers<br />

6.5.4.1 open<br />

Call(s):<br />

int open(const char *pName, int OFlags,...);<br />

Description: The open call opens the Brake driver for operations and returns a file descriptor<br />

used by ioctl function calls. The Brake driver needs to be opened for ioctl calls.<br />

Returns: The open call returns a type int. When the open call is successful, this int is a file<br />

descriptor for the Brake driver. This file descriptor is used by the Brake driver’s close and ioctl<br />

functions. When the open call is not successful, “-1” is returned.<br />

Code Example: See Code Example 6-6.<br />

Table 6-27. Brake Driver open Arguments - open<br />

pName in The Brake device name; see Table 6-28<br />

OFlag in Open Mode Flags which are ignored<br />

FileDesc out Brake device descriptor returned by open call and used in ioctl function calls<br />

Table 6-28. Availability of Brake Devices for Specific Platforms<br />

DSP56F801EVM<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F803EVM BSP_DEVICE_NAME_BRAKE_A<br />

DSP56F805EVM BSP_DEVICE_NAME_BRAKE_A<br />

BSP_DEVICE_NAME_BRAKE_B<br />

DSP56F807EVM BSP_DEVICE_NAME_BRAKE_A<br />

BSP_DEVICE_NAME_BRAKE_B<br />

6-42 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

6.5.4.2 close<br />

Call(s):<br />

int close (int FileDesc);<br />

Description: The close call closes the Brake driver.<br />

Returns: The close call returns a type int. This int is always zero.<br />

Code Example: See Code Example 6-6.<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 6-29. Brake Driver Arguments - close<br />

FileDesc in Brake device descriptor returned by open call and used in ioctl function calls<br />

Brake Driver<br />

MOTOROLA Off-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

6-43<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Off-Chip Drivers<br />

6.5.4.3 ioctl<br />

Call(s):<br />

UWord16 ioctl(int FileDesc, UWord16 Cmd, void * pParams);<br />

UWord16 brakeIoctl(int FileDesc, UWord16 Cmd, void * pParams, const char *<br />

pName);<br />

Description: The ioctl call controls the Brake from the EVM board. The brakeIoctl call is<br />

functionally equivalent to ioctl, although perhaps more efficient in its operation, because it can<br />

use static information (from the pName parameter) about which Brake is being used.<br />

Returns: The ioctl call returns a type UWord16. This UWord16 is always zero.<br />

Code Example: Code Example 6-6 opens the Brake driver and turns the brake Off.<br />

Code Example 6-6. Brake Driver Example<br />

/****************************************************************************/<br />

#include "io.h"<br />

#include "fcntl.h"<br />

#include "bsp.h"<br />

#include "brake.h"<br />

void main(void)<br />

{<br />

int BrakeFD;<br />

/* open brake driver */<br />

BrakeFD = open(BSP_DEVICE_NAME_BRAKE_A, 0);<br />

/* turn brake off */<br />

Table 6-30. Brake ioctl Arguments<br />

FileDesc in Brake device descriptor returned by open call and used in Brake driver function calls<br />

Cmd in Command found in brake.h which are used to control the Brake<br />

pParams in pParams must be set to NULL<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

pName in The Brake device name; see Table 6-28<br />

Table 6-31. Brake ioctl Commands<br />

Cmd pParams Return Result<br />

BRAKE_ON NULL void Turns the brake on<br />

BRAKE_OFF NULL void Turns the brake off<br />

6-44 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

brakeIoctl(BrakeFD, BRAKE_OFF, NULL, BSP_DEVICE_NAME_BRAKE_A);<br />

/* close brake driver */<br />

close(BrakeFD);<br />

}<br />

/***************************************************************************/<br />

6.5.5 Brake Driver Application<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Brake Driver<br />

Examples which demonstrate the use of the brake driver can be found in such Motor Control<br />

applications as 3ph_srm_hall_sensor_type1, located in the ...\dsp5680xevm\nos\applications<br />

directory for the specific target.<br />

MOTOROLA Off-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

6-45<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Off-Chip Drivers<br />

6.6 Button Driver<br />

6.6.1 Introduction<br />

The Button driver provides a software interface to the push buttons on a specific EVM board.<br />

6.6.2 Initialization<br />

The Button driver currently has no default configurations that can be overwritten through a<br />

project’s appconfig.h file.<br />

6.6.3 API Definition<br />

This section defines the Application Programming Interface (API) by identifying all public<br />

interface functions and data structures.<br />

Code to create and initialize the Button driver is automatically included into an <strong>SDK</strong> <strong>Embedded</strong><br />

Project by inserting the following line in the appconfig.h file:<br />

#define INCLUDE_BUTTON<br />

The following information may be found in the public header file button.h:<br />

Public Interface Function(s):<br />

/*****************************************************************************<br />

* typedef void (*button_tCallback)(void *pCallbackArg);<br />

* typedef struct {<br />

* button_tCallback pCallback;<br />

* void *pCallbackArg;<br />

* }button_sCallback;<br />

* int open(const char *pName, int OFlags, button_sCallback * pCallbackSpec);<br />

* int close(int FileDesc);<br />

* *****************************************************************************/<br />

Public Data Structure(s): None<br />

Members: None<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

6-46 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

6.6.4 Button Device-Independent I/O API Specifications<br />

Button Driver<br />

The following pages specify the device-independent Application Programming Interface (API).<br />

Function arguments for each routine are described as in, out, or inout. An in argument means that<br />

the parameter value is an input only to the function. An out argument means that the parameter<br />

value is an output only from the function. An inout argument means that a parameter value is an<br />

input to the function, but the same parameter is also an output from the function.<br />

Typically, inout parameters are input pointer variables in which the caller passes the address of a<br />

preallocated data structure to a function. The function stores its results within that data structure.<br />

The actual value of the inout pointer parameter is not changed.<br />

MOTOROLA Off-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

6-47<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Off-Chip Drivers<br />

6.6.4.1 open<br />

Call(s):<br />

int open(const char *pName, int OFlags, button_sCallback * pCallbackSpec);<br />

Description: The open call opens the Button driver for operations and returns a file descriptor<br />

used by other Button driver function calls.<br />

The callback function, specified by pCallbackSpec, is called whenever the specified push button<br />

is pressed. The button is debounced to ensure that the callback function is only called once per<br />

button press.<br />

Returns: The open call returns a type int. When the open call is successful, this int is a file<br />

descriptor for the Button driver. This file descriptor is used by the Button driver’s close function.<br />

When the open call is not successful, a “-1” is returned.<br />

Code Example: See Code Example 6-7.<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 6-32. Button Driver Arguments - open<br />

pName in The Button device name; see Table 6-33<br />

OFlag in Open Mode Flags which are ignored<br />

pCallbackSpec in The function to be called when a button is pushed<br />

FileDesc out Button device descriptor returned by open call and used in ioctl function calls<br />

Table 6-33. Availability of Button Devices for Specific Platforms<br />

DSP56F801EVM BSP_DEVICE_NAME_BUTTON_A<br />

BSP_DEVICE_NAME_BUTTON_B<br />

DSP56F803EVM BSP_DEVICE_NAME_BUTTON_A<br />

BSP_DEVICE_NAME_BUTTON_B<br />

DSP56F805EVM BSP_DEVICE_NAME_BUTTON_A<br />

BSP_DEVICE_NAME_BUTTON_B<br />

DSP56F807EVM BSP_DEVICE_NAME_BUTTON_A<br />

BSP_DEVICE_NAME_BUTTON_B<br />

6-48 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

6.6.4.2 close<br />

Call(s):<br />

Arguments:<br />

int close (int FileDesc);<br />

Description: The close call closes the Button driver.<br />

Returns: The close call returns a type int. This int is always zero.<br />

Button Driver<br />

Code Example: Code Example 6-7 shows how a user function will be called when push button A<br />

is pressed on the EVM board.<br />

Code Example 6-7. Button Driver Example<br />

/****************************************************************************/<br />

#include "io.h"<br />

#include "fcntl.h"<br />

#include "bsp.h"<br />

#include "button.h"<br />

/* Function prototype */<br />

static void ButtonISR(void *pCallbackArg);<br />

/* File descriptor */<br />

static int ButtonAFD;<br />

/* Button ISR */<br />

void ButtonISR (void *pCallbackArg)<br />

{<br />

/* logic to execute when button is pushed */<br />

}<br />

void main(void)<br />

{<br />

button_sCallback ButtonSpec = {ButtonISR, NULL};<br />

/* open button driver */<br />

ButtonAFD = open(BSP_DEVICE_NAME_BUTTON_A, 0, &ButtonSpec);<br />

// .......<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 6-34. Button Driver Arguments - close<br />

FileDesc in Button device descriptor returned by open call and used in driver function calls<br />

/* close button driver */<br />

close(ButtonAFD);<br />

}<br />

/***************************************************************************/<br />

MOTOROLA Off-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

6-49<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Off-Chip Drivers<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

6.6.5 Low-Level I/O Services API Specifications<br />

The following pages specify the Low-Level Application Programming Interface (API).<br />

Function arguments for each routine are described as in, out, or inout. An in argument means that<br />

the parameter value is an input only to the function. An out argument means that the parameter<br />

value is an output only from the function. An inout argument means that a parameter value is an<br />

input to the function, but the same parameter is also an output from the function.<br />

Typically, inout parameters are input pointer variables in which the caller passes the address of a<br />

preallocated data structure to a function. The function stores its results within that data structure.<br />

The actual value of the inout pointer parameter is not changed.<br />

6-50 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

6.6.5.1 buttonOpen<br />

Call(s):<br />

int buttonOpen(const char *pName, int OFlags, button_sCallback *<br />

pCallbackParam);<br />

Button Driver<br />

Description: Opens a particular BUTTON device. The argument pName is the particular device<br />

name.<br />

The pCallbackParam is a pointer to a structure that specifies which user function to call when the<br />

button is pressed.<br />

Returns: If open is successful, a file descriptor is returned. This file descriptor must bepassed to<br />

other Button driver functions. If open failed, a “-1” value is returned.<br />

Code Example: See Code Example 6-8.<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 6-35. Button Driver Arguments - open<br />

pName in The name of the particular device; the pCallbackParam specifies which user function<br />

to call when the button is pressed<br />

OFlag in Open Mode Flags which are ignored<br />

pCallbackParam in A pointer to a structure which specifies a function to call when the button is pressed.<br />

This structure contains two values: the address of the function to be called and the<br />

value of the parameter to that function. The parameter value can be used in the<br />

function for such purposes as designating which button was pressed or to refer to an<br />

application-specific structure which must be modified by the callback function.<br />

MOTOROLA Off-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

6-51<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Off-Chip Drivers<br />

6.6.5.2 buttonClose<br />

Call(s):<br />

Arguments:<br />

int buttonClose (int FileDesc);<br />

Description: The close call closes the Button driver.<br />

Returns: The close call returns a type int. This int is always zero.<br />

Code Example: See Code Example 6-8.<br />

Code Example 6-8. Low-Level Button Driver Example<br />

/****************************************************************************/<br />

#include "bsp.h"<br />

#include "button.h"<br />

/* Function prototype */<br />

void ButtonFunc(void *pCallbackArg);<br />

volatile int buttonAcounter;<br />

/* ButtonFunc Function */<br />

void ButtonFunc (void *pCallbackArg)<br />

{<br />

volatile int * pCounter = (volatile int *)pCallbackArg;<br />

}<br />

(*pCounter)++;<br />

void main(void)<br />

{<br />

int buttonFD;<br />

button_sCallback ButtonACallbackSpec = {ButtonFunc, (void*) &buttonAcounter};<br />

/* Open button driver */<br />

buttonFD = buttonOpen(BSP_DEVICE_NAME_BUTTON_A, 0,(void*)<br />

&ButtonACallbackSpec);<br />

// .......<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 6-36. Button Driver Arguments - close<br />

FileDesc in Button device descriptor returned by buttonOpen call and used in driver function calls<br />

/* Close button driver */<br />

close(buttonFD);<br />

}<br />

/****************************************************************************/<br />

6-52 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Digital to Analog Converter (DAC) Driver<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

6.6.6 Button Driver Application<br />

Examples which demonstrate the use of the button driver can be found in such Motor Control<br />

applications as bldc_sensors, located in the ...dsp56824evm/nos/applications directory for the<br />

specific target.<br />

6.7 Digital to Analog Converter (DAC) Driver<br />

6.7.1 Introduction<br />

The DAC driver currently works only with the DSP56F805EVM and the DSP56F807EVM target<br />

boards. These target boards have one DAC device, a MAX5251 3V, four channel, 10-bit<br />

precision, Voltage-Output DAC with serial interface. This device is connected to the SPI bus of<br />

the DSP56F805 or the DSP56F807 processor. The DAC hardware is configured to run in<br />

Unipolar mode, meaning that its output voltages and reference inputs have the same polarity.<br />

These output voltages will range between 0V and +Vref(1023/1024). See the MAX5251 data<br />

sheet and the appropriate DSP56F805 or DSP56F807 Evaluation Module Hardware Reference<br />

Manual for hardware details.<br />

This section will define the API, specify its usage and provide example code and application code<br />

for the DAC driver.<br />

6.7.2 Initialization<br />

The DAC driver currently has no default configurations that can be overwritten through a<br />

project’s appconfig.h file.<br />

6.7.3 API Definition<br />

This section defines the Application Programming Interface (API) by identifying all public<br />

interface functions and data structures.<br />

Code to create and initialize the DAC driver is automatically included in an <strong>SDK</strong> <strong>Embedded</strong><br />

Project by inserting the following line in the appconfig.h file:<br />

#define INCLUDE_DAC<br />

The following information may be found in the header file dac.h:<br />

Public Interface Function(s):<br />

/*****************************************************************************<br />

* int open(const char *pName, int OFlags,...);<br />

* ssize_t write(int FileDesc, const void * pBuffer, size_t Size);<br />

* int close(int FileDesc);<br />

* UWord16 ioctl(int FileDesc, UWord16 Cmd, void * pParams);<br />

/*****************************************************************************<br />

Public Data Structure(s): None<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

MOTOROLA Off-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

6-53<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Off-Chip Drivers<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

6.7.4 DAC Device-Independent I/O API Specification<br />

This section species the device-independent Application Programming Interface (API).<br />

Function arguments for each routine are described as in, out, or inout. An in argument means that<br />

the parameter value is an input only to the function. An out argument means that the parameter<br />

value is an output only from the function. An inout argument means that a parameter value is an<br />

input to the function, but the same parameter is also an output from the function.<br />

Typically, inout parameters are input pointer variables in which the caller passes the address of a<br />

preallocated data structure to a function. The function stores its results within that data structure.<br />

The actual value of the inout pointer parameter is not changed.<br />

6-54 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

6.7.4.1 open<br />

Call(s):<br />

Digital to Analog Converter (DAC) Driver<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

int open(const char *pName, int OFlags);<br />

Description: Opens the DAC device and configures default parameters. The DAC device must be<br />

opened prior to all other API function calls.<br />

Returns: Upon successful completion, the function will return a valid handle to the DAC device<br />

requested. Otherwise, “IO_NULL_DEVICE_HANDLE” will be returned.<br />

Code Example 6-9. DAC open Usage<br />

// Open the DAC and get a handle to the device<br />

static int dacDevice;<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Table 6-37. DAC Driver Arguments - open<br />

pName in The DAC device name; values = BSP_DEVICE_NAME_DAC<br />

OFlag in Standard API argument, not used; values = NULL<br />

dacDevice = open(BSP_DEVICE_NAME_DAC, NULL);<br />

MOTOROLA Off-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

6-55<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Off-Chip Drivers<br />

6.7.4.2 write<br />

Call(s):<br />

ssize_t write(int FileDesc, const void * pBuffer, size_t Size);<br />

Description: This function writes one 16-bit word to the DAC specified in the file descriptor. If a<br />

buffer larger than one is passed, only the first element will be sent.<br />

Returns: Upon successful completion, the function will return the number of words written. If<br />

unsuccessful, it will return “-1.”<br />

Range Issues: The MAX5251 DAC has only 10 bits of precision, so only the 10 most significant<br />

data bits will be sent to the DAC.<br />

Example:<br />

Input data = MSB 0111 0110 0101 0100 LSB<br />

Data to DAC = MSB xxxx 0111 0110 01(00) LSB<br />

The driver automatically replaces 'x' with address and control bits and the two least significant<br />

bits are reserved and set to zero.<br />

Since the DAC hardware is configured for Unipolar output, the data written represents DAC<br />

voltage output between 0V and +Vref(1023/1024) as shown below:<br />

xxxx 1111 1111 11(00) - +Vref(1023/1024)<br />

xxxx 0000 0000 00(00) - 0V<br />

Special Issues: A valid writeMode must be set prior to calling this function via an ioctl command.<br />

Code Example 6-10. DAC write Usage<br />

// Generate max output on channel A<br />

static UWord16 * pChannelAValue;<br />

*(pChannelAValue) = (UWord16)0xFFFF;<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 6-38. DAC Driver Arguments - write<br />

FileDesc in DAC device handle returned by call<br />

pBuffer in Pointer to a single 16-bit data word<br />

Size in Number of words to write (must be one)<br />

ioctl(dacDevice, DAC_SET_CHANNEL_A, NULL);<br />

ioctl(dacDevice, DAC_WRITE_MODE_UPDATE, NULL);<br />

write(dacDevice, pChannelAValue, sizeof(UWord16));<br />

6-56 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

6.7.4.3 close<br />

Call(s):<br />

Digital to Analog Converter (DAC) Driver<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

int close (int FileDesc);<br />

Description: This function will close communication with the DAC device and free any allocated<br />

memory or resources used.<br />

Returns: Upon successful completion, the function will return “0”; if unsuccessful, it will return<br />

“-1.”<br />

Code Example 6-11. DAC close Usage<br />

// Close communication with DAC device<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Table 6-39. DAC Driver Arguments - close<br />

FileDesc in DAC device handle returned by open call<br />

close (dacDevice);UWord16 Data = 0x1234;<br />

MOTOROLA Off-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

6-57<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Off-Chip Drivers<br />

6.7.4.4 ioctl<br />

Call(s):<br />

UWord16 ioctl(int FileDesc, UWord16 Cmd, void * pParams);<br />

Description: This function handles all static control and configuration for the DAC device.<br />

Returns: If a valid command is requested, the function will return “PASS” (0). Otherwise, it will<br />

return “FAIL” (0xFFFF).<br />

Range Issues: A test for valid commands is made during debug mode.<br />

Code Example 6-12. DAC ioctl Usage<br />

// This will put the DAC in sleep mode<br />

ioctl(dacDevice, DAC_SLEEP, NULL);<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 6-40. DAC Driver Arguments - ioctl<br />

FileDesc in DAC device handle returned by open call<br />

Cmd in Commands found in dac.h which are used to modify the DAC address<br />

and control registers; see list of values in Table 6-41<br />

pParams in Standard API argument, not used; values = NULL<br />

Table 6-41. DAC ioctl Commands<br />

Cmd Result<br />

DAC_WRITE_MODE_WAKE_AND_UPDATE Exit shutdown mode and update all channel outputs<br />

from data written<br />

DAC_WRITE_MODE_NO_UPDATE Update input register but not channel output<br />

DAC_WRITE_MODE_UPDATE Update input register and channel output<br />

DAC_SLEEP Enter shutdown mode<br />

DAC_WAKE Exit shutdown mode and update all channel outputs<br />

from their respective input registers<br />

DAC_SET_CHANNEL_A Select channel A for update<br />

DAC_SET_CHANNEL_B Select channel B for update<br />

DAC_SET_CHANNEL_C Select channel C for update<br />

DAC_SET_CHANNEL_D Select channel D for update<br />

6-58 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Digital to Analog Converter (DAC) Driver<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

6.7.5 Low-Level I/O Services API Specification<br />

This section species the Low-Level Application Programming Interface (API).<br />

Function arguments for each routine are described as in, out, or inout. An in argument means that<br />

the parameter value is an input only to the function. An out argument means that the parameter<br />

value is an output only from the function. An inout argument means that a parameter value is an<br />

input to the function, but the same parameter is also an output from the function.<br />

Typically, inout parameters are input pointer variables in which the caller passes the address of a<br />

preallocated data structure to a function. The function stores its results within that data structure.<br />

The actual value of the inout pointer parameter is not changed.<br />

MOTOROLA Off-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

6-59<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Off-Chip Drivers<br />

6.7.5.1 dacOpen<br />

Call(s):<br />

int dacOpen(const char *pName, int OFlags);<br />

Description: This function opens communications with the DAC device. The DAC device must<br />

be opened prior to all other API function calls.<br />

Returns: Upon successful completion, the function will return a valid handle to the DAC device<br />

requested. Otherwise, “IO_NULL_DEVICE_HANDLE” will be returned.<br />

Code Example: See Code Example 6-13.<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 6-42. dacOpen Driver Arguments - dacOpen<br />

pName in The DAC device name; values = BSP_DEVICE_NAME_DAC<br />

OFlag in Standard API argument, not used; values = NULL<br />

6-60 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

6.7.5.2 dacWrite<br />

Call(s):<br />

Digital to Analog Converter (DAC) Driver<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

void dacWrite(int FileDesc, UWord16 dacData);<br />

Description: This function writes one 16-bit word to the DAC specified in the file descriptor.<br />

Returns: Void<br />

Table 6-43. Low Level dacWrite Driver Arguments - dacWrite<br />

FileDesc in DAC device handle returned by call<br />

dacData in The 16-bit data word to be written<br />

Code Example: See Code Example 6-13.<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

MOTOROLA Off-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

6-61<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Off-Chip Drivers<br />

6.7.5.3 dacClose<br />

Call(s):<br />

int dacClose (int FileDesc);<br />

Table 6-44. Low-Level dacClose Driver Arguments - dacClose<br />

FileDesc in DAC device handle returned by open call<br />

Description: This function closes communication with the DAC device.<br />

Returns: Upon successful completion, the function will return “0”. Otherwise, it will return “-1.”<br />

Code Example: See Code Example 6-13.<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

6-62 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

6.7.5.4 dacIoctl<br />

Call(s):<br />

Digital to Analog Converter (DAC) Driver<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

void dacIoctl((int FileDesc, UWord16 Cmd, void * pParams, const char*<br />

dacDeviceName);<br />

Description: This function handles all static control and configuration for the DAC device.<br />

Returns: Void<br />

Code Example: See Code Example 6-13.<br />

Code Example 6-13. Low-Level DAC dacIoctl Usage<br />

/****************************************************************************/<br />

#include "bsp.h"<br />

#include "dac.h"<br />

static int dacDevice;<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Table 6-45. DAC Driver Arguments - ioctl<br />

FileDesc in DAC device handle returned by open call<br />

Cmd in Commands found in dac.h which are used to modify the DAC address<br />

and control registers; see list of values in Table 6-41<br />

pParams in Standard API argument, not used; values = NULL<br />

dacDeviceName in The name of the DAC device from bsp.h; typically, this is<br />

BSP_DEVICE_NAME_DAC<br />

void main(void)<br />

{<br />

dacDevice = dacOpen(BSP_DEVICE_NAME_DAC, 0);<br />

// Generate max output on channel A<br />

dacIoctl(dacDevice, DAC_SET_CHANNEL_A, NULL, BSP_DEVICE_NAME_DAC);<br />

dacIoctl(dacDevice, DAC_WRITE_MODE_UPDATE, NULL, BSP_DEVICE_NAME_DAC);<br />

dacWrite(dacDevice, 0xFFFF);<br />

// Close communication with DAC device<br />

dacClose(dacDevice);<br />

}<br />

/****************************************************************************/<br />

MOTOROLA Off-Chip Drivers<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

6-63<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Off-Chip Drivers<br />

6.7.6 DAC Driver Application<br />

The DAC driver application is designed to test and demonstrate the usage of the DAC driver’s<br />

API to control and communicate with the DSP56F805EVM or the DSP56F807EVM target<br />

board’s hardware. This is accomplished by stepping through a series of generated output signals.<br />

The sequence follows:<br />

1. 500Hz sine wave on Channel A and 250Hz sine wave on Channel D<br />

2. 500Hz sine wave on Channel A and +Vref constant output voltage on Channel D<br />

3. Sleep the DAC causing 0V on both Channels<br />

4. Wake the DAC and resume series (2)<br />

5. Sleep the DAC causing 0V on both Channels<br />

6. Wake the DAC and generate a 500Hz sine wave on Channel A and +(Vref/2)<br />

constant output voltage on Channel D<br />

For the 56F805EVM:<br />

This application may be executed by opening the CodeWarrior project dac.mcp, located in the<br />

directory:<br />

...\src\dsp56805evm\nos\applications\dac<br />

To view the output signals, apply a scope probe to pin 1 (Channel A) and another to pin 7<br />

(Channel D) on connector J20, using ground pins 2, 4, 6, or 8.<br />

For the 56F807EVM:<br />

This application may be executed by opening the CodeWarrior project dac.mcp, located in the<br />

directory:<br />

...\src\dsp56807evm\nos\applications\dac<br />

To view the output signals, apply a scope probe to pin 1 (Channel A) and another to pin 7<br />

(Channel D) on connector J26, using ground pins 2, 4, 6, or 8.<br />

Trimpot Settings for 56F805EVM: R107 on the DSP56F805EVM board must have a reference<br />

voltage of 2.5V between pins 2 and 1. This is the maximum reference voltage before clipping of<br />

the sine signal ensues.<br />

Trimpot Settings for 56F807EVM: R97 on the DSP56F807EVM board must have a reference<br />

voltage of 2.5V between pins 2 and 1. This is the maximum reference voltage before clipping of<br />

the sine signal ensues.<br />

Jumper Settings:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Use the default jumper settings for the DSP56F805EVM and DSP56F807EVM boards. For more<br />

information on jumper settings, see the DSP56F805 or DSP56F807 Evaluation Module<br />

Hardware User’s Manual.<br />

6-64 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Chapter 7<br />

Libraries<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

This chapter describes all <strong>SDK</strong> libraries that are not part of the core libraries (see <strong>SDK</strong><br />

Programmer’s Guide), and are part of the <strong>SDK</strong> DSP56F80x release. The domain-specific<br />

libraries are:<br />

• DSP Functional Library<br />

• Motor Control Library<br />

• AC Induction Motor Library<br />

• Switched Reluctance Motor Library<br />

• Brushless DC Motor Library<br />

• V.8bis Library<br />

• V.21 Library<br />

• V.22bis Library<br />

• V.42bis Library<br />

• Data Encryption Standard (DES) Library<br />

• Triple Data Encryption Standard (3DES) Library<br />

• RSA Library<br />

• Acoustic Echo Canceller Library<br />

• Caller ID Library<br />

• CAS Detect Library<br />

• CPT Library<br />

• Common Tone Generation Library<br />

• DTMF Generation Library<br />

• DTMF Detection Library<br />

• G.165 Library<br />

• G.168 Library<br />

• G.711 Library<br />

• G.726 Library<br />

• MFCR2 Detection Library<br />

• VAD Library<br />

• Voice Recognition (VRLite-1) Library<br />

7.1 Signal Processing Libraries<br />

Signal processing libraries provide general-purpose DSP algorithms’ functionality.<br />

MOTOROLA Libraries<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

7-1<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Libraries<br />

7.1.1 DSP Functional Library<br />

The Digital Signal Processing Function Library provides mathematical algorithms for digital<br />

signal processing applications using fractional data types. The fractional data type is a fixed point<br />

representation encompassing the range -1


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

7.1.1.2.1 autoCorr<br />

Signal Processing Libraries<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 7-2 shows the approximate worst-case cycle counts and Memory details.<br />

Options Instruction Cycle Count<br />

nx = input vector length<br />

7.1.1.2.2 cbitrev<br />

Table 7-3 details the approximate worst-case instruction cycle count (= oscillator clocks/2) for<br />

Complex Bit-Reverse ASM Code.<br />

7.1.1.2.3 cfft<br />

Table 7-2. autoCorr Performance<br />

Program<br />

Memory<br />

(words)<br />

Data<br />

Memory<br />

(words)<br />

Data ROM<br />

(words)<br />

Stack Depth<br />

(words)<br />

CORR_RAW (nx) 2 + 33nx + 52 96 0 0 8<br />

CORR_BIAS (nx) 2 + 33nx + 75<br />

CORR_UNBIAS (nx) 2 + 62nx + 52<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Table 7-3. cbitrev Performance<br />

Size of Complex FFT, N Instruction Cycle Count<br />

8 271<br />

16 521<br />

32 1063<br />

64 2081<br />

128 4195<br />

256 8285<br />

512 16615<br />

1024 32993<br />

2048 66043<br />

Table 7-4 shows the approximate worst-case instruction cycle counts (= oscillator clocks/2) for the<br />

ASM code. For more details on options for FFT, see the DSP Function Library.<br />

MOTOROLA Libraries<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

7-3<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Libraries<br />

Size of<br />

Complex<br />

FFT, N<br />

7.1.1.2.4 cifft<br />

Table 7-4. cfft Performance<br />

Core Complex FFT Core Complex FFT + API<br />

AS BFP NS AS BFP NS<br />

8 438 736 438 833 1134 843<br />

16 1062 1635 1062 1707 2290 1717<br />

32 2454 3917 2454 3636 5109 3646<br />

64 5558 8231 5558 7763 10446 7773<br />

128 12438 18393 12438 16757 22722 16767<br />

256 27574 40843 27574 35983 49262 35993<br />

512 60630 90045 60630 77369 106794 77379<br />

1024 132342 197103 132342 165459 230230 165469<br />

2048 286998 428577 286998 353165 494754 353175<br />

Table 7-5 details the approximate worst-case instruction cycle counts (= oscillator clocks/2) for<br />

the ASM code. For information on options for IFFT, see the DSP Function Library.<br />

Size of<br />

Complex<br />

IFFT, N<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 7-5. cifft Performance<br />

Core Complex IFFT Core Complex IFFT + API<br />

AS BFP NS AS BFP NS<br />

8 455 723 455 836 1121 846<br />

16 1084 1626 1084 1722 2274 1732<br />

32 2500 3963 2500 3682 5155 3692<br />

64 5652 8342 5652 7850 10550 7860<br />

128 12628 18792 12628 16940 23114 16950<br />

256 27956 42010 27956 36358 50422 36368<br />

512 61396 93132 61396 78128 109874 78138<br />

1024 133876 204798 133876 166986 237918 166996<br />

2048 290068 447024 290068 356228 513194 356238<br />

7-4 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

7.1.1.2.5 corr<br />

Signal Processing Libraries<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 7-6 shows the approximate worst-case cycle counts and machine instructions.<br />

nx = length of the first input vector<br />

ny = length of the second input vector<br />

7.1.2 fir<br />

Performance of the fir functions vary, depending on whether firCreate was able to align the<br />

history buffer in memory to perform modulo addressing and to allocate the coefficient buffer<br />

within internal memory.<br />

For the performance formulas that follow:<br />

• n = the number of input samples to be processed by the filter<br />

• f = the number of filter coefficients<br />

Case 1: History buffer aligned for modulo addressing; coefficients in internal memory<br />

Number of machine instructions (uses REP): 29 + 13n<br />

Number of oscillator cycles: 132 + n(2f + 50)<br />

Number of oscillator cycles interrupts blocked: 2f (due to REP instruction)<br />

Case 2: History buffer aligned for modulo addressing; coefficients in external memory<br />

Number of machine instructions: 31 + n(2f + 11)<br />

Number of oscillator cycles: 140 + n(6f + 50)<br />

Number of oscillator cycles interrupts blocked: 0<br />

Case 3: History buffer not aligned for modulo addressing; coefficients in external memory<br />

Number of machine instructions: 29 + n(6f + 22)<br />

Number of oscillator cycles: 144 + n(22f + 86)<br />

Number of oscillator cycles interrupts blocked: 0<br />

7.1.2.1 iir<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Table 7-6. corr Performance<br />

Options Oscillator Cycles Machine Instructions<br />

CORR_RAW 140 + 144(nx - 1) + 132ny 38 + 36(nx - 1) + 38ny<br />

CORR_BIAS 196 + 144(nx - 1) + 132ny 45 + 36(nx - 1) + 38ny<br />

CORR_UNBIAS 140 + 208(nx - 1) + 196ny 38 + 46(nx - 1) + 48ny<br />

Performance of the iir functions vary, depending on whether iirCreate was able to align the<br />

history buffer in memory to perform modulo addressing and to allocate the coefficient buffer<br />

within internal memory.<br />

MOTOROLA Libraries<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

7-5<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Libraries<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

For the performance formulas in Table 7-7:<br />

• n = the number of input samples to be processed by the filter<br />

• nbiq = the number of filter biquads; each biquad uses 5 coefficients<br />

The following cases are defined:<br />

Case 1: History buffer aligned for modulo addressing; coefficients in internal memory<br />

Case 2: History buffer aligned for modulo addressing; coefficients in external memory<br />

Case 3: History buffer not aligned for modulo addressing; coefficients in external memory<br />

7.1.2.2 rfft<br />

Table 7-7. iir Performance<br />

Case Oscillator Cycles Machine Instructions<br />

Case 1 100 + n(80 + 32*nbiq) 26 + n(13 + 11*nbiq)<br />

Case 2 116 + n(68 + 28*nbiq) 29 + n(9 + 13*nbiq)<br />

Case 3 120 + n(56 + 32*nbiq) 28 + n(10 + 13*nbiq)<br />

Table 7-8 details the approximate worst-case instruction cycle counts (= oscillator clocks/2) for<br />

the ASM code. For more information on options for FFT, see the DSP Function Library.<br />

Size of<br />

Real FFT,<br />

N<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Table 7-8. rfft Performance<br />

Core Real FFT Core Real FFT + API<br />

AS BFP NS AS BFP NS<br />

8 485 729 490 567 806 569<br />

16 1007 1435 1017 1077 1512 1096<br />

32 2081 2914 2101 2147 2987 2185<br />

64 4415 6103 4449 4485 6180 4528<br />

128 9337 12931 9403 9407 13008 9482<br />

256 19931 27703 20061 20001 27780 20140<br />

512 42357 59235 42615 42427 59312 42694<br />

1024 90143 126751 90657 90213 126828 90736<br />

2048 191033 270155 192059 191103 270232 192138<br />

7-6 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

7.1.2.3 rifft<br />

Motor Control Library<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 7-9 shows the approximate worst-case instruction cycle counts (= oscillator clocks/2) for the<br />

ASM code. For details on options for FFT, see the DSP Function Library.<br />

Size of<br />

Real IFFT,<br />

N<br />

This library is described in more detail in the Digital Signal Processing Function Library.<br />

This library is described in more detail in the document Digital Signal Processing Function<br />

Library.<br />

7.2 Motor Control Library<br />

The Motor Control Library provides the application developer with a complete set of algorithms<br />

that target the development of motor control applications. This library includes:<br />

• Motor Control Function Library<br />

• AC Induction Motor Library<br />

• Switched Reluctance Motor Library<br />

• Brushless DC Motor Library<br />

7.2.1 Motor Control Function Library<br />

The Motor Control Function Library contains general-purpose algorithms that apply to motor<br />

control applications, independent of the specific motor type. Among these algorithms are such<br />

categories as:<br />

• PWM Waveform Generation<br />

• Field Oriented Control<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Table 7-9. rifft Performance<br />

Core Real IFFT Core Real IFFT + API<br />

AS BFP NS AS BFP NS<br />

8 447 638 452 519 714 529<br />

16 980 1317 985 1052 1393 1062<br />

32 2081 2791 2086 2144 2865 2154<br />

64 4448 5401 4453 4520 5977 4530<br />

128 9450 12681 9455 9522 12737 9532<br />

256 20204 27453 20209 20276 27529 20286<br />

512 42950 59177 42955 43022 59253 43032<br />

1024 91376 127461 91381 91448 127537 91458<br />

2048 193546 273169 193551 193618 273245 193628<br />

MOTOROLA Libraries<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

7-7<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Libraries<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

• Speed Control<br />

• Power Factor Correction<br />

This library is described in more detail in the document Motion Control Library.<br />

7.2.2 AC Induction Motor Library<br />

The AC Induction Motor Library contains algorithms that apply to AC Induction-type motors.<br />

Note: This library is not part of the current <strong>SDK</strong> release.<br />

7.2.3 Switched Reluctance Motor Library<br />

The Switched Reluctance Library contains algorithms that apply to Switched Reluctance-type<br />

motors. This library is described in more detail in the document Motion Control Library.<br />

7.2.4 Brushless DC Motor Library<br />

The Brushless DC Library contains algorithms that apply to Brushless DC-type motors. This<br />

library is described in more detail in the document Motion Control Library.<br />

7.3 Modem Libraries<br />

Modem libraries provide modem functionality.<br />

7.3.1 V.8bis Library<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The V.8bis allows DCEs and DTEs with multiple modes of operation over the PSTN and on<br />

leased telephone-type circuits, to perform these functions:<br />

• selection of the desired mode of operation at automatic call establishment on the PSTN,<br />

controlled by either the calling or answering station<br />

• selection of the desired mode of operation while in telephony mode on an<br />

already-established connection, controlled by either station<br />

• determination by either station of whether the remote station supports V.8bis, with<br />

minimum disturbance to a voice caller<br />

• exchange of available capabilities between stations on a connection, at call establishment<br />

or while in telephony mode<br />

• graceful recovery in the event of transmission of errors or selection of an unavailable mode<br />

of operation<br />

These functions are provided by defining a set of signals, messages and procedures. Signals are<br />

intended to be detected in the presence of an interfering voice or other audio; to turn around any<br />

echo suppressors in the network prior to the beginning of information transmission; and to<br />

7-8 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Modem Libraries<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

indicate the initiation of a V.8bis transaction to the receiving station, while not appearing to the<br />

user and receiver as an indication of a data or facsimile device.<br />

Messages convey significantly more information than signals, but may be used only when they<br />

will not cause disruption to a voice caller. They are intended to be used only in the absence of an<br />

interfering voice or other audio.<br />

This Recommendation provides for error detection and rejection of corrupted messages, and<br />

rejection of mode selections that are unavailable.<br />

7.3.1.1 Background<br />

Two stations, Initiating and Responding, can have different capabilities, some of which are<br />

common. A common mode of communication must be agreed upon by both sides, depending on<br />

the priorities on each side. This is facilitated by V.8bis recommendation.<br />

7.3.1.2 Features and Performance<br />

Table 7-10 details the memory and MIPS requirements for V.8bis.<br />

Table 7-10. V.8bis Memory and MIPS Requirements<br />

Program<br />

Memory<br />

(words)<br />

Data ROM<br />

(words)<br />

Data RAM -<br />

Algorithm<br />

(words)<br />

Data RAM<br />

Per Instance<br />

(words)<br />

Library allocates memory 6774 557 1298 Only one<br />

instance can<br />

exist<br />

User application allocates<br />

memory<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Data RAM per<br />

instance is<br />

1298 words<br />

6774 557 1298 Only one<br />

instance can<br />

exist<br />

Data RAM per<br />

instance is<br />

1298 words<br />

Notes:<br />

• Data RAM figures in Table 7-10 do not include the gaps (unused memory) that will be introduced<br />

due to circular buffers. These buffers take advantage of the modulo buffer indexing feature of the<br />

Motorola DSP architecture which has strict memory alignment requirements.<br />

• Table 7-10 does not include memory requirements for the input and output buffers and the<br />

structures which must be passed to the calling modules.<br />

The v.21 modem and the tone generator and detector algorithms are MIPS-intensive modules. The<br />

MIPS for these threads are shown in Table 7-11.<br />

MOTOROLA Libraries<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

7-9<br />

MIPS<br />

N/A<br />

N/A<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Libraries<br />

• In Table 7-11, MIPS specified for baud processing are the peak values.<br />

• In Table 7-11, MIPS specified are for the period while the complete program and data are kept in<br />

external memory with zero wait states.<br />

This library is described in more detail in the document V.8bis Library.<br />

7.3.2 V.21 Library<br />

V.21 is a 300 bits-per-second duplex modem for use in the general switched telephone network.<br />

The V.21 uses a binary modulation obtained by frequency shift, resulting in a modulation rate<br />

equal to the data signaling rate (i.e., baud rate = bit rate). Since V.21 is a duplex modem, each unit<br />

has two channels, one for transmission and one for reception. The frequencies at which the<br />

channels work are shown in the following table. The V.21 library works at 7200Hz sampling rate.<br />

Channel Number<br />

Even high-end modems like V.90 might require a fallback to lower data-rate modes (e.g., 300bps,<br />

75bps). V.21 provides a solution to this requirement by allowing a data rate of 300bps.<br />

7.3.2.1 Performance<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 7-11. MIPS<br />

Module Name MIPS<br />

V.21 modem Transmitter 0.1134<br />

V.21 modem Receiver 1.2516<br />

Single Tone Generation 0.0647<br />

Single Tone Detection 0.8656<br />

DTMF Generation 0.1655<br />

DTMF Detection 0.9992<br />

Table 7-12. Frequencies Used in V.21<br />

Nominal Mean<br />

Frequency<br />

Mark Frequency Zero Frequency<br />

1 1080Hz 980Hz 1180Hz<br />

2 1750Hz 1650Hz 1850Hz<br />

Table 7-13 shows V.21 Memory and MIPS figures for internal memory on the DSP56F80x.<br />

7-10 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

F<br />

Notes:<br />

Modem Libraries<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 7-13. V.21 Memory and MIPS Requirements for Internal Memory on the DSP5680x<br />

Library allocates<br />

memory [includes<br />

v21Create() and<br />

v21Destroy()]<br />

User application<br />

allocates memory<br />

[does not include<br />

v21Create() and<br />

v21Destroy()]<br />

Program<br />

Memory<br />

(words)<br />

• Memory resources in Table 7-13 do not include the gaps (unused<br />

memory) that are introduced due to circular buffers<br />

• Table 7-13 does not include memory requirements for the input and<br />

output buffers and the structures which must be passed to the calling<br />

modules<br />

This library is described in more detail in the document V.21 Library.<br />

7.3.3 V.22bis Library<br />

V.22bis conforms to the V.22bis Low-Speed Modem ITU-T Standard.<br />

Lower-end internet telephony and e-cash applications require a low-speed modem for exchanging<br />

data. ITU-T standard V.22 bis with 2400 bits per second is usually the preferred modem for these<br />

applications. Motorola has internally developed a single library module containing the V.22 bis<br />

modem. The modem was tested over all telephone networks available in continental North<br />

America using a network simulator and is available for the Motorola DSP568XX range of<br />

processors.<br />

7.3.3.1 Background<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Data ROM<br />

(words)<br />

Software<br />

Stack Per<br />

Channel<br />

(words)<br />

The ITU-T V.22bis recommendation describes a split-band modem for use on the General<br />

Switched Telephone Network and on Point-to-Point two wire leased telephone-type circuits. A<br />

split-band modem is characterized by transmission and reception on two spectral bands which do<br />

not overlap. The standard defines:<br />

• Calling modem to:<br />

— * transmit with a carrier frequency of 1200 Hz and<br />

— * receive with a carrier frequency of 2400 Hz<br />

• – Answering modem to:<br />

— * transmit with a carrier frequency of 2400 Hz and<br />

— * receive with a carrier frequency of 1200 Hz<br />

Data RAM<br />

Per Channel<br />

(words)<br />

MIPS at 7200Hz Sampling<br />

Rate<br />

Transmitter Receiver<br />

2325 535 24 248 0.14 1.0<br />

2081 535 24 248 0.14 1.0<br />

MOTOROLA Libraries<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

7-11<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Libraries<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Quadrature amplitude modulation technique is used for each channel with synchronous line<br />

transmission at 600 baud. The constellation could be either 16 point, 4 bits/baud supporting an<br />

input bit rate of 2400 bps, or 4 point, 2 bits/baud supporting 1200 bps. A scrambler is included in<br />

the input to the transmitter and a descrambler at the output of the receiver. The modem should<br />

have both an adaptive equalizer and a compromise equalizer. A guard tone of 1800 ±20 Hz or 550<br />

±20 Hz may be used while transmitting only in the high channel (transmitter of the answering<br />

modem).<br />

7.3.3.2 Features and Performance<br />

Table 7-14 shows the operating range of the V.22bis modem.<br />

Table 7-14. V.22bis Operating Range<br />

Data Rate 2400 / 1200 bits per second<br />

Line Bandwidth 300 - 3400 Hz<br />

Sampling Rate 7200 Hz<br />

Processing requirements for the V.22bis are shown in Table 7-15.<br />

Table 7-15. V.22bis Memory and MIPS Requirements<br />

Program<br />

Memory<br />

(words)<br />

Data ROM<br />

(words)<br />

Data RAM -<br />

Algorithm<br />

(words)<br />

Data RAM<br />

Per Instance<br />

(words)<br />

Library allocates memory 5646 1065 310 Only one<br />

instance<br />

exists<br />

User application allocates<br />

memory<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Data RAM per<br />

instance =<br />

310<br />

N/A N/A N/A N/A N/A<br />

Notes:<br />

• MIPS specified for baud processing are the peak values and are for the period while the complete<br />

program is kept in the external memory with zero wait states, the data tables in the internal<br />

memory and all other data variables in the external memory with zero wait states.<br />

• Data RAM figures in Table 7-15 do not include the gaps (unused memory) that will be introduced<br />

due to circular buffers. These buffers take advantage of the modulo buffer indexing feature of the<br />

Motorola DSP architecture which has strict memory alignment requirements. The table does not<br />

include memory requirement for the input and output buffers nor the structures which are to be<br />

passed to the calling modules.<br />

This library is described in more detail in the document V.22bis Library.<br />

7-12 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

MIPS<br />

Transmitter - 0.4<br />

Receiver - 3.6<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

7.3.4 V.42bis Library<br />

Modem Libraries<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The V.42bis recommendation describes a data compression procedure that can be used while<br />

transferring data to improve throughput. The DCE then uses the error-correcting procedures<br />

defined in the Recommendation.<br />

The standard also provides options for transferring data in un-compressed (transparent) mode,<br />

which is useful when the transferred data is already compressed. The compressibility of the data is<br />

tested periodically to choose the most efficient mode.<br />

The compression algorithm used is the LZW algorithm, a version of Lempel and Ziv’s LZ2,<br />

modified by Terry Welch. The algorithm makes use of the data’s repeating patterns. Every<br />

subsequent occurrence of a pattern can be encoded as an index to its previous occurrence, rather<br />

than encoding the entire pattern itself. These frequently-occurring strings are stored in a<br />

dictionary.<br />

For successful decoding operation, the decoder must construct a dictionary, which is identical to<br />

the dictionary used by the encoder. Since the dictionary is constructed dynamically, the encoder<br />

cannot use entries which were added before the decoder’s construction process. The standard<br />

specifies the dictionary construction procedure under normal operations and under such special<br />

modes of operation as transition from transparent to compressed modes, flush request, etc.<br />

7.3.4.1 Features and Performance<br />

Table 7-16 shows MIPS and memory requirements for the V.42bis library.<br />

Table 7-16. V.42bis Memory and MIPS Requirements<br />

Program<br />

Memory<br />

(words)<br />

Data ROM<br />

(words)<br />

Data RAM -<br />

Algorithm<br />

(words)<br />

Data RAM<br />

Per Instance<br />

(words)<br />

Library allocates memory 2331 0 16454 Only one<br />

instance<br />

exists.<br />

User application allocates<br />

memory<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Data RAM per<br />

instance =<br />

16454<br />

2331 0 16454 Only one<br />

instance<br />

exists.<br />

Data RAM per<br />

instance =<br />

16454<br />

MOTOROLA Libraries<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

7-13<br />

MIPS<br />

N/A<br />

N/A<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Libraries<br />

Notes:<br />

• P1 is the dictionary size and P2 is the string length.<br />

• The data memory in Table 7-16 includes the memory for both encoder and decoder dictionaries.<br />

Both share equal amounts of memory. The dictionary size for the memory requirement is 2048<br />

nodes, and each node requires four locations. The encoder’s dictionary requirement is 2048 * 4 =<br />

8192 words. The decoder takes another 8192 words. Table 7-17 includes cycle count for V.42bis<br />

encoder and decoder for different dictionary sizes. Cycle Count in Table 7-17 = Oscillator Cycle<br />

Count / 2.<br />

This library is described in more detail in the document V.42bis Library.<br />

7.4 Security Libraries<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 7-17. V.42bis Cycle Count<br />

Dictionary Parameters Encoder Cycle Count Decoder Cycle Count<br />

P1 = 512, P2 = 6 MAX count = 130046<br />

MIN count = 352<br />

P1 = 1024, P2 = 10 MAX count = 130046<br />

MIN count = 352<br />

MAX count = 1988<br />

MIN count = 288<br />

MAX count = 2490<br />

MIN count = 288<br />

Security libraries provide information and transmission security algorithms.<br />

7.4.1 Data Encryption Standard (DES) Library<br />

DES conforms to the Federal Information Processing Standards Publications 46-2 and 81 (FIPS<br />

PUB 46-2 and FIPS PUB 81).<br />

Any secure communication/storage requires converting data to be transmitted into an<br />

unintelligible form, called cipher, and reconverting data back to its original form, called plaintext.<br />

The FIPS PUB 46-2 standard describing DES is the most widely-used encryption standard for<br />

these applications. Motorola has internally developed a single library module containing the DES<br />

in Cipher Feedback Mode (CFB) and Cipher Block Chaining Mode (CBC).<br />

Table 7-18 details DES memory requirements for external memory on the DSP56F80x.<br />

7-14 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Security Libraries<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 7-18. DES Memory and MIPs Requirements for External Memory on the DSP56F80x<br />

Library allocates<br />

memory [includes<br />

desCreate() and<br />

desDestroy()]<br />

User application<br />

allocates memory<br />

[does not include<br />

desCreate() and<br />

desDestroy()]<br />

Program<br />

Memory<br />

(words)<br />

Data ROM<br />

(words)<br />

Note: Data RAM figures in Table 7-18 do not include the gaps (unused memory) that will be<br />

introduced due to circular buffers. These buffers take advantage of the modulo buffer indexing<br />

feature of the Motorola DSP architecture which has strict memory alignment requirements.<br />

Table 7-19 contains DES cycle count information for external memory on the DSP56F80x.<br />

Instruction Cycle Count = Oscillator Clock Cycles / 2<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Software Stack Per<br />

Channel (words)<br />

2711 231 Encrypt (CBC Mode)<br />

44<br />

Decrypt (CBC Mode)<br />

44<br />

Encrypt (CFB Mode)<br />

43<br />

Decrypt (CFB Mode)<br />

43<br />

2251 231 Encrypt (CBC Mode)<br />

44<br />

Decrypt (CBC Mode)<br />

44<br />

Encrypt (CFB Mode)<br />

43<br />

Decrypt (CFB Mode)<br />

43<br />

Note: The cycle counts in Table 7-19 are obtained for an input block (data to be encrypted or<br />

decrypted) of size 128 characters.<br />

This library is described in more detail in the document DES Library.<br />

Data RAM<br />

Per Channel<br />

(words)<br />

MOTOROLA Libraries<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

7-15<br />

MIPS<br />

890 N/A<br />

890 N/A<br />

Table 7-19. DES Cycle Counts for External Memory on the DSP56F80x<br />

Module Instruction Cycle Count for CFB Mode Instruction Cycle Count for CBC Mode<br />

Initialization 21042 21042<br />

Encryption 334092 163190<br />

Decryption 335484 164884<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Libraries<br />

7.4.2 Triple Data Encryption Standard (3DES) Library<br />

The DES core used in 3DES conforms to the Federal Information Processing Standards<br />

Publication 46-2, (FIPS PUB 46-2).<br />

A variant of the DES algorithm is 3DES, where DES is used three times, with different keys each<br />

time. Motorola has internally developed a single library module containing 3DES.<br />

Table 7-20 details the 3DES basic performance for external memory on the DSP56F80x.<br />

Table 7-20. 3DES Memory and MIPS Requirements for External Memory on the DSP56F80x<br />

Library allocates memory<br />

[includes triDesCreate() and<br />

triDesDestroy()]<br />

User application allocates<br />

memory [does not include<br />

triDesCreate() and<br />

triDesDestroy()]<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Program<br />

Memory<br />

(words)<br />

Data ROM<br />

(words)<br />

Note: Data RAM figures in Table 7-20 do not include the gaps (unused memory) that will be<br />

introduced due to circular buffers. These buffers take advantage of the modulo buffer<br />

indexing feature of the Motorola DSP architecture which has strict memory alignment<br />

requirements.<br />

Table 7-21 shows the 3DES cycle count for external memory on the DSP56F80x.<br />

Instruction Cycle Count = Oscillator Clock Cycles / 2.<br />

Software<br />

Stack Per<br />

Channel<br />

(words)<br />

1850 231 Encrypt<br />

53<br />

Decrypt<br />

43<br />

1389 231 Encrypt<br />

53<br />

Decrypt<br />

43<br />

Note: The cycle counts in Table 7-21 are obtained for an input block (data to be encrypted or<br />

decrypted) of size 128 characters.<br />

This library is described in more detail in the document 3DES Library.<br />

Data RAM<br />

Per Channel<br />

(words)<br />

7-16 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

MIPS<br />

1003 N/A<br />

1003 N/A<br />

Table 7-21. 3DES Cycle Count for External Memory on the DSP56F80x<br />

Module Instruction Cycle Count<br />

Initialization 50870<br />

Encryption 470662<br />

Decryption 470420<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

7.4.3 RSA Library<br />

Security Libraries<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Discrete exponentiation has been employed in a different way by Rivest, Shamir and Adleman<br />

(RSA) to produce a public key cryptosystem. They make use of the fact that finding large prime<br />

numbers is computationally easy, but that factoring the product of two such numbers appears to be<br />

computationally infeasible.<br />

User A selects two large prime numbers at random, p and q, and multiplies them together to<br />

obtain a number, n. The number n is made public, but the factors p and q are kept secret. Using p<br />

and q, User A can compute the Euler's Totient function:<br />

Φ( n)<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

(the number of integers less then n and relatively prime to n as)<br />

Φ( n)<br />

= (p-1)(q-1)<br />

User A then chooses another number, e, at random from the interval 2 through Φ( n)<br />

, such that e<br />

and Φ( n)<br />

are relatively prime. This number is also made public. Enciphering is carried out on each<br />

block as m, using the public information e and n as:<br />

c = m e (mod n)<br />

In this example, c represents the ciphertext. Using the secret number Φ( n)<br />

, User A can easily<br />

calculate a number, d, such that:<br />

(e.d) mod Φ( n)<br />

= 1<br />

If e has a common factor with then d does not exist. User B receives c and computes c d Φ( n)<br />

mod<br />

(n) which is equivalent to<br />

m.exp(k Φ( n)<br />

+1) (mod n)<br />

for some k. From Euler's theorem, x.exp( Φ( n)<br />

) (mod n) = 1, if x and n are relatively prime. Also,<br />

x.exp(k Φ( n)<br />

+1) (mod n) = x, for any integer x lying between 0 and n-1, where n=pq. Hence, User<br />

B gets the original message, m, by exponentiating c with d and finding modulo with respect to n.<br />

Similarly, we can explain the signaturing process with the following equations:<br />

m d (mod n) = s<br />

m = se (mod n)<br />

Table details the basic performance of RSA for external memory on the DSP56F80x.<br />

MOTOROLA Libraries<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

7-17<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Libraries<br />

Table 7-23 shows the cycle count for RSA on the DSP56F80x, when data memory is external.<br />

.<br />

Table 7-22. RSA Memory and MIPS Requirements for External Memory on the DSP56F80x<br />

Library allocates<br />

memory [includes<br />

rsaEncCreate()<br />

rsaEncDestroy()<br />

rsaDecCreate() and<br />

rsaDecDestroy()]<br />

User application<br />

allocates memory<br />

[does not include<br />

rsaEncCreate()<br />

rsaEncDestroy()<br />

rsaDecCreate() and<br />

rsaDecDestroy()]<br />

Program<br />

Memory<br />

(words)<br />

Data<br />

ROM<br />

(words)<br />

Instruction Cycle Count = Oscillator Clock Cycles / 2<br />

Note: The cycle counts in Table 7-23 are obtained for 512 bit modulo (or 32 words)<br />

This library is described in more detail in the document RSA Library.<br />

7.5 Telephony Libraries<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Software Stack Per<br />

Channel (words)<br />

2751 0 Encrypt<br />

22<br />

Decrypt<br />

21<br />

2600 0 Encrypt<br />

22<br />

Decrypt<br />

21<br />

Telephony libraries include algorithms that are used in telephone applications.<br />

7.5.1 Acoustic Echo Canceller Library<br />

Acoustic echo cancellers (AECs) are voice-operated devices which eliminate acoustic echoes and<br />

protect the communication from howling due to acoustic feedback from loudspeaker to<br />

microphone. AECs are placed in audio terminals on the customer’s premises.<br />

Table 7-24 shows Memory and MIPS figures on the DSP56F80x.<br />

Data RAM<br />

Per Instance<br />

(words)<br />

153 + n*26,<br />

where n = length<br />

of modulo buffer<br />

153 + n*26,<br />

where n = length<br />

of modulo buffer<br />

Table 7-23. RSA Cycle Count for External Memory on the DSP56F80x<br />

Module Instruction Clock Cycles<br />

Initialization 32782<br />

Encryption 18349054<br />

Decryption 18349054<br />

7-18 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

MIPS<br />

N/A<br />

N/A<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Notes:<br />

Telephony Libraries<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 7-24. AEC Memory and MIPS Requirements for External Memory on the DSP56F80x<br />

Library allocates<br />

memory<br />

[includes<br />

aecCreate() and<br />

aecDestroy()]<br />

User<br />

application<br />

allocates memory<br />

[does not include<br />

aecCreate() and<br />

aecDestroy()]<br />

Program<br />

Memory<br />

(words)<br />

• Memory resources in Table 7-24 include the gaps (unused memory) that<br />

are introduced due to circular buffers. These buffers take advantage of the<br />

modulo buffer indexing feature of Motorola’s DSP architecture, which has<br />

strict memory alignment requirements.<br />

• Table 7-24 does not include memory requirements for the input and output<br />

buffers and the structures which must be passed to the calling modules.<br />

For example, a 64ms tail length at an 8KHz sampling rate (512 taps), AEC library (on the<br />

DSP5680x) takes a peak MIPS of 23, 1024 internal memory words, and 1079 external<br />

memory words.<br />

This library is described in more detail in the document AEC Library.<br />

7.5.2 Caller ID Library<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Data ROM<br />

(words)<br />

Software<br />

Stack Per<br />

Channel<br />

(words)<br />

Data RAM<br />

Per Channel<br />

(words)<br />

1142 0 28 2N internal memory<br />

words<br />

55+2N external<br />

memory words<br />

N = Filter length<br />

(or echo tail length<br />

in taps)<br />

Multiple instances<br />

can exist<br />

869 0 28 2N internal memory<br />

words<br />

55+2N external<br />

memory words<br />

N = Filter length<br />

(or echo tail length<br />

in taps)<br />

Multiple instances<br />

can exist<br />

This algorithm implements GR-CORE-30 standard, a Bellcore standard for receiving<br />

on-hook/off-hook data transmission of Caller ID information.<br />

Table 7-25 details basic performance information for Caller ID on the DSP56F80x.<br />

MOTOROLA Libraries<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

7-19<br />

MIPS<br />

⎛1574 + 8N<br />

⎝<br />

--------------------------- ⎞Fs10 2 ⎠<br />

6 – ×<br />

N = Filter length (or echo<br />

tail length in taps)<br />

F s = Sampling Frequency<br />

in Hz<br />

⎛1574 + 8N<br />

⎝<br />

--------------------------- ⎞Fs10 2 ⎠<br />

6 – ×<br />

N = Filter length (or echo<br />

tail length in taps)<br />

F s = Sampling Frequency<br />

in Hz<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Libraries<br />

Table 7-25. Caller ID Memory and MIPS Requirements for External Memory on the DSP56F80x<br />

Library allocates memory<br />

(includes CallerIDCreate()<br />

and callerIDDestroy()]<br />

User application allocates<br />

memory [does not include<br />

CallerIDCreate() and<br />

callerIDDestroy()]<br />

Program<br />

Memory<br />

(words)<br />

Note: Data RAM figures in Table 7-25 do not include the gaps (unused memory) that will be<br />

introduced due to circular buffers. These buffers take advantage of the modulo buffer indexing<br />

feature of the Motorola DSP architecture which has strict memory alignment requirements.<br />

This library is described in more detail in the document Caller ID Library.<br />

7.5.3 CAS Detect Library<br />

Data ROM<br />

(words)<br />

Software<br />

Stack Per<br />

Channel<br />

(words)<br />

Data RAM<br />

Per Channel<br />

(words)<br />

MIPS at<br />

8000Hz<br />

Sampling Rate<br />

1365 28 16 393 2.584<br />

1089 28 16 393 2.584<br />

The CAS Detect library provides functionality for detecting the Customer Premises Equipment<br />

Alerting Signals.<br />

Table 7-26 shows CAS Detect performance information for external memory on the DSP56F80x.<br />

Table 7-26. CAS Detect Memory and MIPS for External Memory on the DSP56F80x<br />

Library allocates memory<br />

(includes casDetectCreate<br />

and casDetectDestroy)<br />

User application allocates<br />

memory (does not include<br />

casDetectCreate and<br />

casDetectDestroy)<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Program<br />

Memory<br />

(words)<br />

Data ROM<br />

(words)<br />

Software<br />

Stack Per<br />

Channel<br />

(words)<br />

Data RAM<br />

Per Channel<br />

(words)<br />

MIPS at<br />

8000Hz<br />

Sampling Rate<br />

1728 82 16 406 3.625<br />

1671 82 16 406 3.625<br />

Note: Table 7-26 does not include memory requirements for the input and output buffers or for<br />

the structures which are to be passed to the calling modules.<br />

For more details about CAS detection, refer to the document Customer Premises Equipment<br />

Alerting Signal (CAS) Library.<br />

7-20 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

7.5.4 CPT Library<br />

Telephony Libraries<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The detection of Call Progress Tones (CPT) is used in the telephone network to detect a signal<br />

comprised of two frequencies that represent a specific tone.<br />

Table 7-27 details CPT MIPS and memory for external memory on the DSP56F80x.<br />

Table 7-27. CPT Memory and MIPS Requirements for External Memory on the DSP56F80x<br />

Library allocates memory<br />

[includes CPTDetCreate()<br />

and CPTDetDestroy()]<br />

User application allocates<br />

memory [does not include<br />

CPTDetCreate() and<br />

CPTDetDestroy()]<br />

Program<br />

Memory<br />

(words)<br />

Data ROM<br />

(words)<br />

Software<br />

Stack Per<br />

Channel<br />

(words)<br />

Note: Figures in Table 7-27 do not include the gaps (unused memory) that will be introduced<br />

due to circular buffers.<br />

This library complies with North American Telecom standards and is described in more detail in<br />

the document CPT Library.<br />

7.5.5 Common Tone Generation Library<br />

Data RAM<br />

Per Channel<br />

(words)<br />

MIPS at<br />

8000Hz<br />

Sampling Rate<br />

1221 6 23 142 1.5828<br />

1085 6 23 142 1.5828<br />

The Common Tone Generation library is capable of generating any tone with any number of simultaneous<br />

frequencies.These frequencies can have different starting and ending times and they can be repeated for<br />

different number of cycles.<br />

Table 7-28 details basic performance information for Common Tone Generation on the<br />

DSP56F80x.<br />

Table 7-28. CTG MIPS and Memory Requirements for External Memory on the DSP56F80x<br />

Library allocates memory<br />

[includes ctgCreate() and<br />

ctgDestroy()]<br />

User application allocates memory<br />

[does not include ctgCreate()<br />

and ctgDestroy()]<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Program<br />

Memory<br />

(words)<br />

Data ROM<br />

(words)<br />

Software<br />

Stack Per<br />

Channel<br />

(words)<br />

Data RAM<br />

Per Channel<br />

(words)<br />

768 0 12 20 + 16 *<br />

(number of<br />

frequencies)<br />

568 0 12 20 + 16 *<br />

(number of<br />

frequencies)<br />

MIPS at<br />

8000Hz<br />

Sampling<br />

Rate<br />

MOTOROLA Libraries<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

7-21<br />

4.228<br />

4.228<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Libraries<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Note: Table 7-28 does not include memory requirements for the input and output buffers or for the<br />

structures which are to be passed to the calling modules.<br />

MIPS given in Table 7-28 is for a input buffer length of 16 samples. The MIPS are<br />

calculated for Call Progress Tones which involve 2 simultaneous frequencies.<br />

This library is described in more detail in the document Common Tone Generation Library.<br />

7.5.6 DTMF Generation Library<br />

The generation of Dual Tone Multiple Frequency (DTMF) signals (also known as Touch Tone<br />

signals) is used in the telephone network. A signal comprised of two frequencies that represent a<br />

digit on the telephone keyboard is generated.<br />

Table 7-29 details basic performance features of the DTMF Generation Library for external<br />

memory on the DSP56F80x.<br />

Table 7-29. MIPS and Memory Requirements for External Memory on the DSP56F80x<br />

Library allocates memory<br />

(includes dtmfCreate() and<br />

dtmfDestroy())<br />

User application allocates<br />

memory (doesn’t include<br />

dtmfCreate() and dtmfDestroy())<br />

Program<br />

Memory<br />

(words)<br />

This library is described in more detail in the document DTMF Generation Library.<br />

7.5.7 DTMF Detection Library<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Data ROM<br />

(words)<br />

Software<br />

Stack Per<br />

Channel<br />

(words)<br />

Data RAM<br />

Per<br />

Channel<br />

(words)<br />

MIPS at<br />

7200Hz<br />

Sampling<br />

Rate<br />

458 0 9 23 0.6642<br />

427 0 9 23 0.6642<br />

The detection of Dual Tone Multiple Frequency (DTMF) signals (also known as Touch Tone<br />

signals) is used in the telephone network. The aim is to detect a signal comprised of two<br />

frequencies that represent a digit on the telephone keyboard.<br />

The DTMF Detection MIPS and memory requirements for external memory on the DSP56F80x<br />

are shown in Table 7-30.<br />

7-22 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Telephony Libraries<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 7-30. MIPS and Memory Requirements for External Memory on the DSP56F80x<br />

Library allocates memory<br />

[includes DTMFDetCreate()<br />

and DTMFDetDestroy()]<br />

User application allocates<br />

memory [includes<br />

DTMFDetCreate() and<br />

DTMFDetDestroy()]<br />

Note: Data memory figures in Table 7-30 do not include the gaps (unused memory) that will<br />

be introduced due to circular buffers. These buffers take advantage of the modulo buffer<br />

indexing feature of the Motorola DSP architecture which has strict memory alignment<br />

requirements.<br />

This library is described in more detail in the document DTMF Detection Library.<br />

7.5.8 G.165 Library<br />

Program<br />

Memory<br />

(words)<br />

Data ROM<br />

(words)<br />

Software<br />

Stack Per<br />

Channel<br />

(words)<br />

Data RAM<br />

Per Channel<br />

(words)<br />

MIPS at<br />

8000Hz<br />

Sampling Rate<br />

1337 48 34 266 0.9644<br />

1186 48 34 266 0.9644<br />

G.165-based echo cancellers conform to the ITU-T Recommendation (Previously “CCITT<br />

Recommendation”) G.165.<br />

Echo cancellers are voice operated devices placed in the four-wire portion of the circuit. They are<br />

used for reducing the echo by subtracting the echo estimate from the circuit echo. In this<br />

recommendation, echo cancellers are assumed to be “half” echo cancellers; i.e., those in which<br />

cancellation takes place only in the send path, due to signals present in the receive path of the<br />

circuit.<br />

Table 7-31 details basic performance of the G.165 Echo Canceller for external memory on the<br />

DSP56F80x.<br />

Table 7-31. G.165 Memory and MIPs Requirements for External Memory on the DSP56F80x<br />

Library allocates memory<br />

[includes g165Create() and<br />

g165Destroy()]<br />

User application allocates<br />

memory [does not include<br />

g165Create() and<br />

g165Destroy()]<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Program<br />

Memory<br />

(words)<br />

Data ROM<br />

(words)<br />

Software<br />

Stack Per<br />

Channel<br />

(words)<br />

Data RAM<br />

Per Channel<br />

(words)<br />

2552 234 17 742+4 * EchoSpan<br />

(number of taps)<br />

1966 234 17 742+4 * EchoSpan<br />

(number of taps)<br />

MIPS at<br />

8000Hz<br />

Sampling<br />

Rate<br />

13.1 for Echo<br />

Canceller<br />

13.1 for Echo<br />

Canceller<br />

MOTOROLA Libraries<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

7-23<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Libraries<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Note: Data RAM figures in Table 7-31 do not include the gaps (unused memory) that will be<br />

introduced due to circular buffers.These buffers take advantage of the modulo buffer<br />

indexing feature of Motorola’s DSP architecture, which has strict memory alignment<br />

requirements. Data ROM has a circular buffer of length 4. Data RAM has circular<br />

buffers of length 3, 3, 3, 3, 6, 6, EchoSpan (number of filter taps at an 8KHz sampling<br />

rate).<br />

This library is described in more detail in the document G.165 Library.<br />

7.5.9 G.168 Library<br />

G.168-based echo cancellers conform to the ITU-T Recommendation (Previously “CCITT<br />

Recommendation”) G.168.<br />

Echo cancellers are voice-operated devices placed in the 4-wire portion of the circuit. They are<br />

used for reducing the echo by subtracting the echo estimate from the circuit echo. In this<br />

recommendation, the echo cancellers are assumed to be “half” echo cancellers, i.e., those in which<br />

cancellation takes place only in the send path, due to signals present in the receive path of the<br />

circuit.<br />

7.5.9.1 Performance<br />

Table 7-32 details basic performance of the G.168 Echo Canceller on the DSP56DF80x.<br />

Table 7-32. G.168 Memory and MIPS Requirements for Internal Memory on the DSP56F80x<br />

Library allocates memory<br />

[includes g168Create() and<br />

g168Destroy()]<br />

User application allocates<br />

memory [does not include<br />

g168Create() and<br />

g168Destroy()]<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Program<br />

Memory<br />

(words)<br />

Data ROM<br />

(words)<br />

Software<br />

Stack Per<br />

Channel<br />

(words)<br />

Data RAM<br />

Per Channel<br />

(words)<br />

2211 234 20 282 + 3 * Echo-<br />

Span<br />

(number of taps)<br />

1716 234 20 282 + 3 * Echo-<br />

Span<br />

(number of taps)<br />

MIPS at<br />

8000Hz<br />

Sampling<br />

Rate (echo<br />

tail (msec))<br />

5.2429 (8)<br />

6.0077(16)<br />

7.2685 (24)<br />

8.5613 (32)<br />

9.8541 (40)<br />

11.1469 (48)<br />

12.4397 (56)<br />

13.7325 (64)<br />

5.2429 (8)<br />

6.0077(16)<br />

7.2685 (24)<br />

8.5613 (32)<br />

9.8541 (40)<br />

11.1469 (48)<br />

12.4397 (56)<br />

13.7325 (64)<br />

7-24 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Notes:<br />

Telephony Libraries<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

• Data RAM figures in Table 7-32 do not include the gaps (unused<br />

memory) that will be introduced due to circular buffers. These<br />

buffers take advantage of the modulo buffer indexing feature of<br />

Motorola’s DSP architecture, which has strict memory alignment<br />

requirements. Data ROM has a circular buffer of length 4. Data<br />

RAM has circular buffers of length 3, 3, 3, 3, 6, 6, EchoSpan<br />

(number of filter taps at an 8KHz sampling rate).<br />

• MIPS in Table 7-32 are for 80 input samples per call.<br />

This library is described in more detail in the document G.168 Library.<br />

7.5.10 G.711 Library<br />

G.711-based log-PCM conforms to the ITU-T Recommendation (Previously “CCITT<br />

Recommendation”) G.711.<br />

The characteristics mentioned in the standard are recommended for encoding (A-law or µlaw)<br />

voice frequency signals to yield a bit rate of 64 kbits/s at an 8000Hz sampling rate. G.711 is a<br />

PCM Encoding and Decoding (log-PCM) Library.<br />

Table 7-33 outlines basic performance of the G.711 library for external memory on the<br />

DSP56F80x.<br />

Notes:<br />

Table 7-33. G.711 Memory and MIPS for External Memory on the DSP56F80x<br />

Library Functions<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Program<br />

Memory<br />

(words)<br />

Data ROM<br />

(words)<br />

Software<br />

Stack Per<br />

Channel<br />

(words)<br />

• Table 7-33 does not include memory requirements for the input and output<br />

buffers.<br />

• Data RAM figures in Table 7-33 do not include the gaps (unused memory)<br />

that will be introduced due to circular buffers. These buffers take<br />

advantage of the modulo buffer indexing feature of Motorola’s DSP<br />

architecture, which has strict memory alignment requirements.<br />

This library is described in more detail in the document G.711 Library.<br />

Data RAM<br />

Per<br />

Channel<br />

(words)<br />

MIPS at<br />

8000Hz<br />

Sampling Rate<br />

Linear2alaw 116 0 11 N/A 1.8<br />

Linear2ulaw 102 0 11 N/A 1.7<br />

alaw2linear 60 0 2 N/A 0.4<br />

ulaw2linear 42 0 2 N/A 0.37<br />

alaw2ulaw 44 256 2 N/A 0.4<br />

ulaw2alaw 46 256 2 N/A 0.41<br />

User application allocates memory N/A N/A N/A N/A N/A<br />

MOTOROLA Libraries<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

7-25<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Libraries<br />

7.5.11 G.726 Library<br />

The ITU-T Recommendation G.726 Adaptive Differential Pulse Code Modulation Speech Codec<br />

converts a 64 Kbits/s A-Law or µLaw pulse code modulation (PCM) channel to and from 40, 32,<br />

24, 16 Kbits/s PCM stream using an ADPCM transcoding technique.<br />

Memory requirements for the G.726 ADPCM Codec library for external memory on the<br />

DSP56F80x are shown in Table 7-34.<br />

Table 7-34. G726 Memory and MIPS Requirements for External Memory on the DSP56F80x<br />

Library<br />

allocates<br />

memory [includes<br />

G726EncCreate()<br />

G726EncDestroy()<br />

G726DecCreate()<br />

and<br />

G726DecDestroy()]<br />

User<br />

application<br />

allocates<br />

memory [does not<br />

include<br />

G726EncCreate()<br />

G726EncDestroy()<br />

G726DecCreate()<br />

and<br />

G726DecDestroy()]<br />

Program<br />

Memory<br />

(words)<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Program<br />

ROM<br />

(words)<br />

Data<br />

ROM<br />

(words)<br />

Note: Data RAM figures in Table 7-34 do not include the gaps (unused memory) that will be<br />

introduced due to circular buffers. These buffers take advantage of the modulo buffer<br />

indexing feature of Motorola’s DSP architecture which has strict memory alignment<br />

requirements.<br />

This library is described in more detail in the document G.726 Library.<br />

7.5.12 MFCR2 Detection Library<br />

Software<br />

Stack<br />

Per<br />

Channel<br />

(words)<br />

1349 417 305 Encoder<br />

14<br />

Decoder<br />

14<br />

1274 417 305 Encoder<br />

14<br />

Decoder<br />

14<br />

Data<br />

RAM<br />

Per<br />

Channel<br />

(words)<br />

133<br />

Only one<br />

instance<br />

exists<br />

133<br />

Only one<br />

instance<br />

exists<br />

MIPS at 8000Hz Sampling Rate<br />

Encoder Decoder<br />

8.088 @40kbps<br />

7.896 @32kbps<br />

7.800 @24kbps<br />

7.773 @16kbps<br />

8.088 @40kbps<br />

7.896 @32kbps<br />

7.800 @24kbps<br />

7.773 @16kbps<br />

8.992 @40kbps<br />

8.800 @32kbps<br />

8.704 @24kbps<br />

8.640 @16kbps<br />

8.992 @40kbps<br />

8.800 @32kbps<br />

8.704 @24kbps<br />

8.640 @16kbps<br />

The MFCR2 signal consists of two frequencies, taken from either the set of six forward<br />

frequencies or from the set of six backward frequencies. The MFCR2 receiver detects any valid<br />

MFCR2 signal and outputs the numerical value corresponding to that signal.<br />

7-26 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

7.5.12.1 Performance<br />

Telephony Libraries<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The MFCR2 Detection memory and MIPS requirements for internal memory on the DSP56F80x<br />

are shown in Table 7-35.<br />

Notes:<br />

Table 7-35. MFCR2 Detection Memory and MIPS for Internal Memory on the DSP56F80x<br />

Library allocates memory<br />

[includes<br />

MFCR2DetectCreate() and<br />

MFCR2DetectDestroy()]<br />

User application allocates<br />

memory [does not include<br />

MFCR2DetectCreate() and<br />

MFCR2DetectDestroy()]<br />

• Data memory figures in Table 7-35 do not include the gaps (unused<br />

memory) that will be introduced due to circular buffers. These<br />

buffers take advantage of the modulo buffer indexing feature of the<br />

Motorola DSP architecture, which has strict memory alignment<br />

requirements.<br />

• MIPS in Table 7-35 is for an input buffer length of 32 samples.<br />

A test that verifies the operation of the MFCR2 Detection library is described in Chapter 8.<br />

This library is described in more detail in the document MFCR2 Detection Library.<br />

7.5.13 VAD Library<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Program<br />

Memory<br />

(words)<br />

Data ROM<br />

(words)<br />

Software<br />

Stack Per<br />

Channel<br />

(words)<br />

Data RAM<br />

Per Channel<br />

(words)<br />

MIPS at<br />

8000Hz<br />

Sampling Rate<br />

986 250 5 216 4.1<br />

816 250 5 216 4.1<br />

The VAD library implements an algorithm to detect voice activity and activate or deactivate the<br />

transmission of packets to optimize bandwidth.<br />

Table 7-36 details the basic performace of VAD for external memory on the DSP56F80x.<br />

MOTOROLA Libraries<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

7-27<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Libraries<br />

Notes:<br />

Table 7-36. VAD Memory and MIPS Requirements for External Memory on the DSP56F80x<br />

Library allocates memory<br />

[includes vadCreate() and<br />

vadDestroy()]<br />

User application allocates<br />

memory [does not include<br />

vadCreate() and vadDestroy()]<br />

Program<br />

Memory<br />

(words)<br />

• Table 7-36 does not include memory requirement for the input and output<br />

buffers, nor for the structures which must be passed to the calling modules.<br />

• Data RAM figures in Table 7-36 do not include the gaps (unused memory)<br />

that will be introduced due to circular buffers. These buggers take<br />

advantage of the modulo buffer indexing feature of the Motorola DSP<br />

architecture which has strict memory alignment requirements.<br />

This library is described in more detail in the document Voice Activity Detector Library.<br />

7.6 Speech Libraries<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Data ROM<br />

(words)<br />

Software<br />

Stack Per<br />

Channel<br />

(words)<br />

7.6.1 Voice Recognition (VRLite-1) Library<br />

Data RAM<br />

Per Channel<br />

(words)<br />

MIPS at<br />

8000Hz<br />

Sampling Rate<br />

1299 0 27 84 1.833<br />

1214 0 27 84 1.833<br />

VRLite-1 is a memory-optimized, isolated-word, speaker-dependent speech recognition system.<br />

This means that the system must be trained to the voice of a particular user and that it can<br />

recognize only isolated words. For example, if the user trained the words “call” and “Bob”, the<br />

algorithm can recognize both “call” and “Bob”, but not the phrase “call Bob”.<br />

Many products, such as a mobile phone, require a voice recognition system to operate the phone<br />

through voice. VRLite-1 is a solution to this requirement.<br />

Figure 7-1 shows the entire system in the context of a product and emphasizes the scope of the<br />

VRLite-1 software algorithm.<br />

7-28 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Speech Libraries<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Microphone<br />

Display<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

BPF<br />

(0.25--3.8KHz)<br />

Host Software<br />

(Product Specific)<br />

Handset Controller Core Algorithm<br />

Figure 7-1. Typical Speaker-Dependent Speech Recognition Block Diagram<br />

Handset: The input is a signal (through a microphone) containing speech, and will output a<br />

symbol that represents the recognized utterance or perform some task associated with the<br />

recognized speech. The display might be used to prompt the user for different inputs or flag-out<br />

messages to the user.<br />

Controller 1 : This part consists of host processor, A/D, and D/A converters. The input speech is<br />

filtered and digitized. The host software supplies one frame at a time to the front end of the<br />

VRLite algorithm. Note that front end processing in VRLite is real time. After the front end<br />

processing, the host appropriately invokes the back end for either training or recognition.<br />

Core Algorithm: The core algorithm consists of frontend and backend of VRLite-1. The frontend<br />

is filter-bank based and extracts the features from the speech frames. The backend consists of<br />

HMM based training and recognition algorithms.<br />

Table 7-37 shows VRLite-1 Memory and MIPS figures for external memory on the DSP56F80x.<br />

1. The APIs provided in Chapter 3 are not for the “Handset” user but for the user who writes the “host software”. The test files provided in the<br />

library somewhat serve as “controller”.<br />

MOTOROLA Libraries<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

7-29<br />

ADC<br />

8KHz<br />

DAC<br />

8KHz<br />

VRLite-1<br />

Algorithm<br />

(Front end<br />

+<br />

Back end)<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Libraries<br />

Table 7-37. VRLite-1 Memory and MIPS Requirements for External Memory on the DSP56F80x<br />

Library allocates<br />

memory [includes<br />

vrlite1Create() and<br />

vrlite1Destroy()]<br />

User application<br />

allocates memory<br />

[does not include<br />

vrlite1Create() and<br />

vrlite1Destroy()]<br />

Program<br />

Memory<br />

(words)<br />

Data ROM<br />

(words)<br />

Software<br />

Stack Per<br />

Channel<br />

(words)<br />

Data RAM<br />

Per Channel<br />

(words)<br />

7100 540 51 4670<br />

(only one<br />

channel is<br />

possible)<br />

7100 540 51 4670<br />

(only one<br />

channel is<br />

possible)<br />

Table 7-38 shows the Instruction Cycle Count figures for external memory on the DSP56F80x<br />

(which equals Oscillator Cycle Count / 2) for Training, Rejection Analysis, and Recognition,<br />

non-real time modules.<br />

Notes:<br />

• Memory resources in Table 7-38 include the gaps (unused memory) that are introduced due to<br />

circular buffers. These buffers take advantage of the modulo buffer indexing feature of the<br />

Motorola DSP architecture, which has strict memory alignment requirements.<br />

• Table 7-38 does not include memory requirements for the input and output buffers and the<br />

structures which must be passed to the calling modules.<br />

This library is described in more detail in the document Voice Recognition (VRLite-1) Library.<br />

7-30 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

MIPS<br />

28 for front end only, which<br />

is real time<br />

28 for front end only, which<br />

is real time<br />

Table 7-38. Instruction Cycle Counts for External Memory on the DSP56F80x<br />

Module Instruction Cycle Count<br />

Training of a word 1440766<br />

Rejection Analysis per trained word in the<br />

vocabulary<br />

Recognition per trained word in the<br />

vocabulary<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

626078<br />

568926<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Chapter 8<br />

Library Tests<br />

The <strong>SDK</strong> for the DSP56F80x platform comes with several tests. These tests are used to verify that<br />

the libraries in the <strong>SDK</strong> are functioning correctly. The following sections describe these tests in<br />

more detail.<br />

8.1 System Library<br />

The system test, used to verify the system library, is found in:<br />

...\sdk\src\dsp5680xevm\nos\sys\test\testsys.mcp for the DSP56F80x device you’re<br />

implementing.<br />

8.1.1 System Test<br />

The system test verifies the correct operation of the intrinsic functions; <strong>SDK</strong> handling of<br />

interrupts; and the <strong>SDK</strong> memory management functions.<br />

8.1.1.1 Set-up for System Test<br />

EVM Jumper Settings:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Use the default settings shown in the DSP56F80x Evaluation Module User’s Manual for the<br />

device you’re implementing<br />

8.1.1.2 Procedure for System Test<br />

• Using CodeWarrior, open:<br />

...\nos\sys\test\testsys.mcp<br />

• Build and download the project; when the debugger reaches main(), it will stop<br />

• Select Run in the debugger to continue executing the test<br />

• The test results will be displayed on CodeWarrior’s console<br />

MOTOROLA Library Tests<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

8-1<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Library Tests<br />

8.2 Tools Library<br />

The tools tests, used to verify the tools library, are found in:<br />

...\sdk\src\dsp5680xevm\nos\tools\Debug\tools.lib<br />

The tools library includes the FIFO, stack check, and debug functions of the <strong>SDK</strong>.<br />

8.2.1 FIFO Test<br />

The FIFO test verifies the correct operation of the FIFO functions provided by the <strong>SDK</strong>.<br />

8.2.1.1 Set-up for FIFO Test<br />

EVM Jumper Settings:<br />

Use the default settings shown in the DSP56F80x Evaluation Module User’s Manual for the<br />

device you’re implementing.<br />

8.2.1.2 Procedure for FIFO Test<br />

• Using CodeWarrior, open:<br />

...\nos\tools\test\fifo.mcp<br />

• Build and download the project; when the debugger reaches main(), it will stop<br />

• Select Run in the debugger to continue executing the test<br />

• The test results will be displayed on CodeWarrior’s console<br />

8.3 DSP Functions Library<br />

The DSP function tests are used to verify the DSP functions library, found in:<br />

...\sdk\src\dsp5680xevm\nos\signal\dspfunc\Debug\dspfunc.lib<br />

The DSP Functions library includes the Math, Filters, RFFT, and CFFT functions of the <strong>SDK</strong>.<br />

8.3.1 Math Tests<br />

The math tests verify the correct operation of the math functions provided by the <strong>SDK</strong>. There are<br />

separate tests available to test 16-bit math operations and 32-bit math operations.<br />

8.3.1.1 Set-up for Math Test<br />

EVM Jumper Settings:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Use the default settings shown in the DSP56F80x Evaluation Module User’s Manual for the<br />

device you’re implementing.<br />

8-2 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP Functions Library<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

8.3.1.2 Procedures for Math Tests<br />

To test 16-bit math operations:<br />

• Using CodeWarrior, open:<br />

...\nos\signal\dspfunc\test\math\math.mcp<br />

• Build and download the project; when the debugger reaches main(), it will stop<br />

• Select Run in the debugger to continue executing the test<br />

• The test results will be displayed on CodeWarrior’s console<br />

To test 32-bit math operations:<br />

• Using CodeWarrior, open:<br />

...\nos\signal\dspfunc\test\math2\math2.mcp<br />

• Build and download the project; when the debugger reaches main(), it will stop<br />

• Select Run in the debugger to continue executing the test<br />

• The test results will be displayed on CodeWarrior’s console<br />

8.3.2 Filter Test<br />

The filter test verifies the correct operation of the filter functions provided by the <strong>SDK</strong>.<br />

8.3.2.1 Set-up for Filter Test<br />

EVM Jumper Settings:<br />

Use the default settings shown in the DSP56F80x Evaluation Module User’s Manual for the<br />

device you’re implementing.<br />

8.3.2.2 Procedure for Filter Test<br />

• Using CodeWarrior, open:<br />

...\nos\signal\dspfunc\test\filters\filters.mcp<br />

• Build and download the project; when the debugger reaches main(), it will stop<br />

• Select Run in the debugger to continue executing the test<br />

• The test results will be displayed on CodeWarrior’s console<br />

8.3.3 RFFT Test<br />

The RFFT test verifies the correct operation of the RFFT functions provided by the <strong>SDK</strong>.<br />

8.3.3.1 Set-up for RFFT Test<br />

EVM Jumper Settings:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Use the default settings shown in the DSP56F80x Evaluation Module User’s Manual for the<br />

device you’re implementing.<br />

MOTOROLA Library Tests<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

8-3<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Library Tests<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

8.3.3.2 Procedure for RFFT Test<br />

• Using CodeWarrior, open:<br />

...\nos\signal\dspfunc\test\rfft\testrfft.mcp<br />

• Build and download the project; when the debugger reaches main(), it will stop<br />

• Select Run in the debugger to continue executing the test<br />

• The test results will be displayed on CodeWarrior’s console<br />

8.3.4 CFFT Test<br />

The RFFT test verifies correct operation of the CFFT functions provided by the <strong>SDK</strong>.<br />

8.3.4.1 Set-up for CFFT Test<br />

EVM Jumper Settings:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Use the default settings shown in the DSP56F80x Evaluation Module User’s Manual for the<br />

device you’re implementing.<br />

8.3.4.2 Procedure for CFFT Test<br />

• Using CodeWarrior, open:<br />

...\nos\signal\dspfunc\test\cfft\testcfft.mcp<br />

• Build and download the project; when the debugger reaches main(), it will stop<br />

• Select Run in the debugger to continue executing the test<br />

• The test results will be displayed on CodeWarrior’s console<br />

• Select Run in the debugger to continue executing the test<br />

• The test results will be displayed on CodeWarrior’s console<br />

8-4 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Chapter 9<br />

DSP56F801/802 Applications<br />

9.1 Porting 801 Applications to 802<br />

Due to the many similarities between the DSP56F801 and DSP56F802, applications written for<br />

the DSP56F801 may easily be ported to the DSP56F802 . In fact, the DSP56F802 is supported by<br />

the DSP56F801 Evaluation Module (EVM) target hardware and <strong>Embedded</strong> <strong>SDK</strong> software<br />

libraries. It is the user’s responsibility to understand the differences between the processors and<br />

avoid the use of software libraries that are not supported by the hardware. All applications<br />

described in this section will run on the DSP56F801 by default using the external oscillator,<br />

except the Serial Bootloader, which uses the internal relaxation oscillator by default. These same<br />

applications will run on the DSP56F802 simply by changing the configuration of the clock<br />

selection from external to internal. This internal clock selection may be accomplished by adding<br />

the code shown in Code Example 9-1 to the appconfig.h file of the selected application.<br />

Code Example 9-1. Internal Clock Selection<br />

#define PLL_CONTROL_REG ( PLL_LOCK_DETECTOR \<br />

| PLL_ZCLOCK_POSTSCALER \<br />

| PLL_PRESCALER_INTERNAL_CLK_SELECT)<br />

9.2 Common Hardware Configuration for Motor<br />

Control Applications<br />

The DSP56F801EVM board provides hardware interfaces for motor control applications. These<br />

include Encoder/Hall Effect Interface; Overvoltage Sensing; Overcurrent Sensing; Back-EMF<br />

zero-crossing detection logic; and Start/Stop motor overide switch. For more specific<br />

DSP56F801 information, refer to the DSP56F80x User’s Manual.<br />

9.2.1 Settings for EVM Trimpots<br />

Settings for the DSP56F801 board-required fault trimpots are shown in Figure 9-1, Table 9-1:<br />

MOTOROLA DSP56F801/802 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

9-1<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F801/802 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 9-1. Trimpot Pins (Top View)<br />

Table 9-1. Trimpot Settings for EVM Motor Board BLDC Motor Control Application<br />

9.3 BLDC Sensorless with Back-EMF Zero Crossing<br />

Using ADC Application<br />

This application exercises sensorless control of the BLDC motor on the DSP56F801EVM board<br />

and the EVM Motor Kit.<br />

9.3.1 Files<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

GND - pin TP2<br />

Trimpot Comment<br />

POT<br />

The BLDC Sensorless with BEMF Zero Crossing using ADC application is composed of the<br />

following files:<br />

• ...\dsp56801evm\nos\applications\bldc_adc_zerocross\bldcadczcapplication.c,<br />

main program<br />

• ...\dsp56801evm\nos\applications\bldc_adc_zerocross\bldcadczcdefines.h,<br />

main program definitions<br />

• ...\dsp56801evm\nos\applications\bldc_adc_zerocross\bldc_adc_zerocross.mcp,<br />

application project file<br />

• ...\dsp56801evm\nos\applications\bldc_adc_zerocross\configflash\appconfig.c,<br />

application configuration file for Flash<br />

• ...\dsp56801evm\nos\applications\bldc_adc_zerocross\configflash\appconfig.h,<br />

application configuration file for Flash<br />

• ...\dsp56801evm\nos\applications\bldc_adc_zerocross\configflash\linker.cmd,<br />

linker command file for Flash<br />

• ...\dsp56801evm\nos\applications\bldc_adc_zerocross\configflash\flash.cfg,<br />

configuration file for Flash<br />

These files are located in the <strong>SDK</strong> installation directory.<br />

Voltage<br />

POT - Pin 2 to GND<br />

R25 Overvoltage Fault Detection UNI-3 3.3V<br />

R30 Overcurrent Fault Detection UNI-3 3.3V<br />

2<br />

1 3<br />

9-2 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

9.3.2 Specifications<br />

BLDC Sensorless with Back-EMF Zero Crossing Using ADC Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

This application performs a sensorless control of the BLDC motor on the DSP56F801 processor<br />

with closed loop speed control. In the application, the PWM module is set to independent mode<br />

with a 10.0KHz switching frequency. The state of the zero crossing signals are read from the<br />

Input Monitor Register of the Quadrature Encoder. The masking of the PWM channels is<br />

controlled by the PWM Channel Control Register. The content of this register is derived from<br />

Back-EMF zero crossing signals.<br />

The application can run on:<br />

• Flash<br />

• EVM Motor Board<br />

• Manual Operating Mode<br />

• 12V AC Power Supply<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

This BLDC sensorless motor control application can operate in the following mode:<br />

1. Manual Operating Mode<br />

The drive is controlled by the RUN/STOP switch, which enables/disables motor<br />

spinning. The required speed is set independently on the commutation by the IRQA<br />

push button; refer to Figure 9-2. When the application is running and RUN/STOP<br />

switch is set to STOP, the green user LED, shown in Figure 9-2, will blink. When the<br />

switch is set to RUN, the green user LED is on constantly. In the RUN mode, pressing<br />

the IRQA button causes the motor to spin the motor incrementally faster in one<br />

direction until it reaches the maximum speed. Subsequent keypresses will<br />

incrementally slow the motor until it reaches a stop state and then will begin spinning<br />

incrementally faster in the opposite direction. If a DCBus Overcurrent condition<br />

occurs, the internal fault logic is asserted and the application enters a fault state (the<br />

green LED is turned off). This state can be exited only by an application RESET. It<br />

is strongly recommended that you inspect the entire application to locate the source<br />

of the fault before starting it again.<br />

MOTOROLA DSP56F801/802 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

9-3<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

DSP56F801/802 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 9-2. RUN/STOP Switch and IRQA Button<br />

9-4 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

9.3.3 Set-up<br />

BLDC Sensorless with Back-EMF Zero Crossing Using ADC Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 9-3 illustrates the hardware set-up for the BLDC Sensorless with BEMF Zero Crossing<br />

using ADC application when using the EVM motor board.<br />

Figure 9-3. Set-up of the EVM motor board BLDC Motor Control Application<br />

9.3.3.1 EVM Jumper Settings<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

To execute the BLDC Sensorless with BEMF Zero Crossing using ADC application, the<br />

DSP56F801EVM board requires the strap settings shown in Figure 9-4 and Table 9-2.<br />

MOTOROLA DSP56F801/802 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

9-5<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F801/802 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Jumper<br />

Group<br />

Figure 9-4. DSP56F801EVM Jumper Reference<br />

Note: When running the EVM target system in a stand-alone mode from Flash, the JG5<br />

jumper must be set in the 1-2 configuration to disable the command converter parallel<br />

port interface.<br />

9.3.4 Build<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

3<br />

2<br />

1<br />

JG9<br />

JG1<br />

1 2<br />

3 4<br />

3<br />

2<br />

1<br />

JG4<br />

3<br />

2<br />

1<br />

JG2<br />

P3<br />

J7 JG3<br />

3<br />

2<br />

1<br />

J5 JG9 JG2<br />

JG1<br />

3<br />

2<br />

1<br />

JG4<br />

S3<br />

RUN/STOP<br />

Table 9-2. DSP56F801EVM Jumper Settings<br />

Comment<br />

DSP56F801EVM<br />

Jumpers<br />

Connections<br />

JG1 UNI-3 Serial Selected; PFC Disabled 1-2, 3-4<br />

JG2 Zero Cross Selected 1-2, 4-5 & 7-8<br />

JG3 UNI-3 Overcurrent Selected for FAULT0 2-3<br />

JG4 UNI-3 Back-EMF Selected as inputs to A/D 1-2, 4-5 & 7-8<br />

JG5 Enable On-board Parallel JTAG Host/Target Interface NC<br />

JG6 Enable RS-232 output NC<br />

JG7 Use on-board EXTAL crystal input for DSP oscillator 1-2<br />

JG8 Use on-board XTAL crystal input for DSP oscillator 1-2<br />

J3<br />

JG9 Encoder Input Selected to TD1 and TD2 2-3, 5-6<br />

To build this application, open the bldc_adc_zerocross.mcp project file and execute the Make<br />

command, as shown in Figure 9-5. This will build and link the BLDC Motor Control application<br />

and all needed Metrowerks and <strong>SDK</strong> libraries<br />

J1<br />

9-6 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

S2<br />

1<br />

JG7<br />

JG3<br />

U1<br />

S1<br />

RESET IRQA<br />

S4 S5<br />

UP<br />

DOWN<br />

Y1<br />

3<br />

J4<br />

JG5<br />

JTAG<br />

U5<br />

J2<br />

JG8<br />

J6<br />

U2<br />

JG6<br />

J8<br />

P2<br />

P4<br />

P1<br />

1<br />

JG7<br />

3<br />

JG8<br />

JG5<br />

JG6<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

9.3.5 Execute<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

BLDC Sensorless with Back-EMF Zero Crossing Using ADC Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 9-5. Execute Make Command<br />

To execute the BLDC Motor Control application, choose the Program/Debug command in the<br />

CodeWarrior IDE, followed by the Run command. For more help with these commands, refer to<br />

the CodeWarrior tutorial documentation in the following file, which is located in the CodeWarrior<br />

installation directory:<br />

\CodeWarrior Documentation\PDF\Targeting_DSP56800.pdf<br />

Once the application is running, indicated by a flashing green LED, move the RUN/STOP switch<br />

to the RUN position and set the required voltage with the IRQA push button. If successful, the<br />

BLDC motor will be spinning. The switch is in RUN position when it is flipped down toward the<br />

RUN/STOP lettering on the EVM board.<br />

Note: If the RUN/STOP switch is set to the RUN position when the application starts, toggle<br />

the RUN/STOP switch between the STOP and RUN positions to enable motor<br />

spinning. This is a protection feature that prevents the motor from starting<br />

automatically without human intervention.<br />

9.4 3-Phase AC Induction Motor Control V/Hz<br />

Application - Open Loop<br />

This application demonstrates a principal of the V/Hz control of the 3-Phase AC Induction motor<br />

using the DSP56F801EVM board, Optoisolation board, and 3-phase AC BLDC High Voltage<br />

power stage.<br />

MOTOROLA DSP56F801/802 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

9-7<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F801/802 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

9.4.1 Files<br />

The 3-Phase AC Induction Motor Control V/Hz Application - Open Loop is found in directory:<br />

..\src\dsp56801evm\nos\applications\3ph_AC_VHz_OL\<br />

and is composed of the following files:<br />

• 3ph_AC_VHz_OL.c, Open Loop main application program<br />

• 3ph_AC_VHz_OL.h, Open Loop application header file<br />

• 3ph_AC_VHz_OL.mcp, Open Loop project file<br />

• configflash\appconfig.c, application configuration file for Flash<br />

• configflash\appconfig.h, application configuration file for Flash<br />

• configflash\linker.cmd, linker command file used for Flash<br />

• appconst.c, application constants placed in data Flash<br />

• appconst.h, header file for appconst.c<br />

These files are located in the <strong>SDK</strong> installation directory.<br />

9.4.2 Specification<br />

This application performs principal control of the 3-phase AC induction motor using the<br />

DSP56F801 processor. The control technique sets the speed ([rpm], [Hz]) of the magnetic field<br />

and calculates the phase voltage amplitude according to a V/Hz table. This table is private to the<br />

application and reflects the AC induction motor parameters Base Voltage/frequency; Boost<br />

Voltage/frequency; and DC Boost Voltage. The incremental encoder is used to derive the actual<br />

rotor speed. Protection is provided against drive faults Overcurrent, Overvoltage, Undervoltage<br />

and Overheating.<br />

System Outline<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The system is designed to drive a 3-phase AC induction motor (ACIM). The application has the<br />

following specifications:<br />

• Volt per Hertz control technique used for ACIM control<br />

• Targeted for DSP56F801EVM<br />

• Running on 3-phase AC induction motor control development platform at variable line<br />

voltage 115V AC and 230V AC (range -15% to +10%)<br />

• Motor mode<br />

• Generator mode<br />

• DCBus brake<br />

• Minimum speed 50 rpm<br />

• Maximum speed 2250 rpm at input power line 230V AC<br />

• Maximum speed 1200 rpm at input power line 115V AC<br />

• Power stage and optoisolation board identification<br />

• Fault protection<br />

• Manual interface (RUN/STOP switch; UP/DOWN push buttons control; LED indication)<br />

• PC master software remote control interface (speed set-up)<br />

• PC master software remote monitor<br />

• PC master software monitor interface (required speed; actual motor speed; drive fault<br />

status; DCBus voltage level; identified power stage boards)<br />

9-8 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Application Description<br />

BLDC Sensorless with Back-EMF Zero Crossing Using ADC Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The Volt per Hertz control algorithm is calculated on the Motorola DSP56F801. The algorithm<br />

generates 3-phase PWM signals for an AC induction motor inverter according to the<br />

user-required inputs, measured and calculated signals.<br />

The concept of the ACIM drive incorporates the following hardware components:<br />

• AC induction motor-brake set<br />

• 3-phase AC/BLDC high voltage power stage<br />

• DSP56F801EVM boards<br />

• Optoisolation box, which is connected between the power stage board and the<br />

DSP56F801EVM<br />

The AC induction motor--brake set incorporates a 3-phase AC induction motor and attached<br />

BLDC motor brake. The AC induction motor has four poles. The incremental position sensor<br />

(encoder) is coupled on the motor shaft. The detailed motor--brake specifications are listed in<br />

Table 9-3.<br />

The following software tools are needed for compiling, debugging, loading to the EVM, remote<br />

control and monitoring:<br />

• Metrowerks CodeWarrior 4.0<br />

• PC master software<br />

• <strong>SDK</strong> 2.4 or later<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Table 9-3. Motor--Brake Specifications<br />

Set Manufactured EM Brno, Czech Republic<br />

Motor Specification Motor Type AM40V<br />

3-Phase AC Induction Motor<br />

Pole-Number 4<br />

Nominal Speed 1300 rpm<br />

Nominal Voltage 3 x 200V<br />

Nominal Current: 0.88A<br />

Brake Specification Brake Type SG40N<br />

3-Phase BLDC Motor<br />

Pole-Number 6<br />

Nominal Speed: 1500rpm<br />

Nominal Voltage 3 x 27V<br />

Nominal Current 2.6 A<br />

Position Sensor (Encoder) Type Baumer Electric<br />

BHK 16.05A 1024-12-5<br />

Pulses per revolution 1024<br />

MOTOROLA DSP56F801/802 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

9-9<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F801/802 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Measured quantities:<br />

• DCBus voltage<br />

• Power module temperature<br />

• Rotor speed<br />

The faults used for drive protection:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

• Overvoltage (PC master software error message - Overvoltage fault)<br />

• Undervoltage (PC master software error message - Undervoltage fault)<br />

• Overcurrent (PC master software error message - Overcurrent fault)<br />

• Overheating (PC master software error message - Overheating fault)<br />

• Wrong-hardware (PC master software error message - Wrong HW used)<br />

The 3-phase AC Induction Motor Control V/Hz Application can operate in two modes:<br />

1. Manual Operating Mode<br />

The drive is controlled by the RUN/STOP switch (S3). The motor speed is set by the<br />

UP (S4) and DOWN (S5) push buttons (refer to Figure 9-6). If the application runs<br />

and motor spinning is disabled (i.e., the system is ready), the green user LED (LED7;<br />

see Figure 9-6) will blink. When motor spinning is enabled, the green user LED will<br />

be On and the actual state of the PWM outputs are indicated by PWM output LEDs.<br />

If Overcurrent, Overvoltage or Overheating occur, the green user LED starts to flash<br />

quickly and the PC master software signals the identified fault. When the fault<br />

condition passes and the fault is acknowledged (the RUN/STOP switch is in the<br />

STOP position), the application returns to its normal state. It is strongly<br />

recommended that you inspect the entire application to locate the source of the fault<br />

before starting it again. Refer to Table 9-4 for application states.<br />

9-10 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

BLDC Sensorless with Back-EMF Zero Crossing Using ADC Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 9-6. RUN/STOP Switch and UP/DOWN Buttons<br />

2. PC master software (Remote) Operating Mode<br />

The drive is controlled remotely from a PC through the SCI communication channel of the<br />

DSP device via an RS-232 physical interface. The drive is enabled by the RUN/STOP<br />

switch, which can be used to safely stop the application at any time.<br />

The following control actions are supported:<br />

• Set the Required Speed of the motor<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Table 9-4. Motor Application States<br />

Application State Motor State Green LED State<br />

Stopped Stopped Blinking at a frequency of 2Hz<br />

Running Spinning ON<br />

Fault Stopped Blinking at a frequency of 8Hz<br />

MOTOROLA DSP56F801/802 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

9-11<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F801/802 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

PC master software displays the following information:<br />

• Actual and Required Speed of the motor<br />

• Phase voltage amplitude (related to given DCBus voltage)<br />

• Application mode - RUN/STOP<br />

• DCBus voltage, temperature of power module<br />

• Drive Fault status<br />

If Overcurrent, Overvoltage, Undervoltage, or Overheating occur , the internal fault logic is<br />

asserted and the application enters a fault state (the user LED will start to flash quickly). When the<br />

fault condition has passed and the fault is acknowledged (the RUN/STOP switch is in the STOP<br />

position), the application returns to its normal state. It is strongly recommended that you inspect<br />

the entire application to locate the source of the fault before starting it again.<br />

The PC master software project file is located in :<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

..\nos\applications\3ph_AC_VHz_OL\PC_Master\3ph_AC_VHz_Flash.pmp, which uses<br />

Map file for running in Flash<br />

Start the PC master software window’s application and choose the PC master software project for<br />

the desired PC master software Operating Mode. Figure 9-7 shows the PC master software control<br />

window for 3ph_AC_vHz_Flash.pmp.<br />

Figure 9-7. PC Master Software Control Window<br />

9-12 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

9.4.3 Set-up<br />

BLDC Sensorless with Back-EMF Zero Crossing Using ADC Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 9-8 illustrates the hardware set-up for the 3-phase AC Motor Control Application - Open<br />

Loop.<br />

Figure 9-8. Set-up of the 3-phase AC Induction Motor Control Application - Open Loop<br />

The correct order of phases (phase A, phase B, phase C) for the AC induction motor shown in<br />

Figure 9-8 follows:<br />

• phase A = red wire<br />

• phase B = white wire<br />

• phase C = black wire<br />

When facing a motor shaft, if the phase order is: phase A, phase B, phase C, the motor shaft<br />

should rotate clockwise (i.e., positive direction, positive speed).<br />

For detailed information, see the DSP56F801 Evaluation Module Hardware Reference<br />

Manual. The serial cable is needed for the PC master software debugging tool only.<br />

9.4.3.1 EVM Jumper Settings<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

To execute the 3-Phase AC Induction Motor Control V/Hz Application - Open Loop, the<br />

DSP56F801 board requires the strap settings shown in Figure 9-9 and Table 9-5.<br />

MOTOROLA DSP56F801/802 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

9-13<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F801/802 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Jumper<br />

Group<br />

Figure 9-9. DSP56F801EVM Jumper Reference<br />

When running the EVM target system in a stand-alone mode from Flash, the JG5 jumper must be<br />

set in the 1-2 configuration to disable the command converter parallel port interface.<br />

9.4.4 Build<br />

3<br />

2<br />

1<br />

JG9<br />

JG1<br />

1 2<br />

3 4<br />

3<br />

2<br />

1<br />

JG4<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

3<br />

2<br />

1<br />

JG2<br />

P3<br />

J5<br />

J7 JG3<br />

3<br />

2<br />

1<br />

JG9 JG2<br />

JG1<br />

3<br />

2<br />

1<br />

JG4<br />

S3<br />

RUN/STOP<br />

J3<br />

J1<br />

Table 9-5. DSP56F801EVM Jumper Settings<br />

Comment<br />

DSP56F801EVM<br />

Jumpers<br />

Connections<br />

JG1 UNI-3 Serial Selected; PFC Disabled 1-2, 3-4<br />

JG2 Encoder input selected for incremental encoder signals 2-3, 5-6 & 8-9<br />

JG3 UNI-3 Overcurrent Selected for FAULT0 2-3<br />

JG4 UNI-3 Phase current sensing selected as inputs to A/D 2-3, 5-6 & 8-9<br />

JG5 Enable On-board Parallel JTAG Host/Target Interface NC<br />

JG6 Enable RS-232 output NC<br />

JG7 Use on-board EXTAL crystal input for DSP oscillator 1-2<br />

JG8 Use on-board XTAL crystal input for DSP oscillator 1-2<br />

S2<br />

JG9 Encoder Input Selected to TD1 and TD2 2-3, 5-6<br />

To build this application, open the 3ph_AC_VHz_OL.mcp project file and execute the Make<br />

command; see Figure 9-10. This will build and link 3-phase AC V/Hz Motor Control application<br />

and all needed Metrowerks and <strong>SDK</strong> libraries.<br />

9-14 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

1<br />

JG7<br />

JG3<br />

U1<br />

S1<br />

RESET IRQA<br />

S4 S5<br />

UP<br />

DOWN<br />

J4<br />

Y1<br />

3<br />

JG5<br />

JG8<br />

J6<br />

JTAG<br />

U5<br />

J2<br />

U2<br />

JG6<br />

J8<br />

P2<br />

P4<br />

P1<br />

1<br />

JG7<br />

3<br />

JG8<br />

JG5<br />

JG6<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

9.4.5 Execute<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

BLDC Sensorless with Back-EMF Zero Crossing Using ADC Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 9-10. Execute Make Command<br />

To execute the 3-phase AC V/Hz Motor Control application, choose the Program/Debug<br />

command in the CodeWarrior IDE, followed by the Run command.<br />

To execute the 3-phase AC V/Hz Motor Control application’s internal Flash version, choose the<br />

Program/Debug command in the CodeWarrior IDE. When loading is finished, set jumper JG5 to<br />

disable the JTAG port and push the RESET button.<br />

For more help with these commands, refer to the CodeWarrior tutorial documentation in the<br />

following file, located in the CodeWarrior installation directory:<br />

\CodeWarrior Documentation\PDF\Targeting_DSP56800.pdf<br />

For jumper settings, see the DSP56F801 Evaluation Module Hardware User’s Manual.<br />

Once the application is running, move the RUN/STOP switch to the RUN position and set the<br />

required speed with the UP/DOWN push buttons. Pressing the UP/DOWN buttons should<br />

incrementally increase the speed of the motor until it reaches maximum speed. If successful, the<br />

3-phase AC Induction motor will be spinning.<br />

Note: If the RUN/STOP switch is set to the RUN position when the application starts, toggle<br />

the RUN/STOP switch between the STOP and RUN positions to enable motor<br />

spinning. This is a protection feature that prevents the motor from starting when the<br />

application is executed from CodeWarrior.<br />

You should also see a lighted green LED which indicates that the application is running. If the<br />

application is stopped, the green LED will blink at a 2Hz frequency.<br />

MOTOROLA DSP56F801/802 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

9-15<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F801/802 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

9.5 Serial Bootloader<br />

The Serial Bootloader has been developed to load and run a proprietary user application presented<br />

as an S-Record file into the Program and Data memory. The Serial Bootloader is located in the<br />

dedicated Program Memory region, called Boot Flash. The Serial Bootloader supports the<br />

simplest serial protocol, so a standard serial terminal program can be used on the host PC.<br />

The Serial Bootloader application reads the S-Record file of a user application (for example,<br />

generated by CodeWarrior) via serial interface, parses this S-Record file, and stores needed data<br />

in Program and Data Flash memory. When the processing of the S-Record file is finished, the<br />

Bootloader launches the loaded application. If any error occurs while loading the S-Record file,<br />

the Bootloader outputs an error message with an error number via the serial line and resets the<br />

processor.<br />

9.5.1 Files<br />

The Serial Bootloader application includes the following files:<br />

• ..\nos\applications\serial_bootloader\bootloader.mcp, project file<br />

• ..\nos\applications\serial_bootloader\bootloader.c, main program<br />

• ..\nos\applications\serial_bootloader\bootloader.h, header file with common parameters<br />

• ..\nos\applications\serial_bootloader\com.c, communication module<br />

• ..\nos\applications\serial_bootloader\com.h, header for communication module<br />

• ..\nos\applications\serial_bootloader\sparser.c, S-Record format parser module<br />

• ..\nos\applications\serial_bootloader\sparser.h, header for S-Record parser module<br />

• ..\nos\applications\serial_bootloader\prog.c, flash programming module<br />

• ..\nos\applications\serial_bootloader\prog.h, header for flash programming module<br />

• ..\nos\applications\serial_bootloader\bootstart.c, startup module<br />

• ..\nos\applications\serial_bootloader\constdata.asm, description of strings data<br />

• ..\nos\applications\serial_bootloader\resetvector.asm, Reset and COP Reset interrupt<br />

vectors description<br />

• ..\nos\applications\serial_bootloader\TargetDirectives, Board name definition<br />

• ..\nos\applications\serial_bootloader\config\linker.cmd, linker command file used for<br />

Boot Flash<br />

• ..\nos\applications\serial_bootloader\config\flash.cfg, Metrowerks CodeWarrior<br />

configuration file to work with Flash<br />

These files are located in the <strong>SDK</strong> installation directory. The Bootloader application does not use<br />

any other <strong>SDK</strong> files except port.h, arch.h and periph.h from the ..\nos\include directory. It can be<br />

compiled and used without other parts of the <strong>SDK</strong>.<br />

9.5.2 Target Configuration<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The Bootloader uses the minimum amount of DSP resources in order to reduce the possibility of<br />

conflict with the application being downloaded. Specifically, it uses SCI 0, Port E, and PLL DSP<br />

peripherals as well as internal RAM for data buffering. The SCI baud rate value is calculated<br />

statically with the assumption that the oscillator frequency is 8MHz. The DSP’s operational<br />

9-16 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Serial Bootloader<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

frequency is set to 72MHz. All peripherals used by the Bootloader are returned to their initial<br />

state prior to the execution of the application programmed.<br />

The Bootloader application relies on the TargetDirectives file to define the target for which the<br />

application will be built. When this file contains #define DSP56801EVM, this application is built<br />

assuming the existence of an internal relaxation oscillator and corresponding calibration value. At<br />

run-time, the application automatically calibrates the internal relaxation oscillator to run at 8MHz.<br />

Note: For the DSP56F801, only processors with a date code GREATER THAN 0152<br />

marked in the lower right corner of the part contain the internal oscillator calibration<br />

value. For parts built prior to this date, the TargetDirectives file should contain the<br />

following for correct operation:<br />

#define DSP56801EVM<br />

#define PLL_USE_EXTERNAL_OSC<br />

Note: The DSP56F802 does NOT have an external oscillator and must therefore have the<br />

following in the TargetDirectives file for correct operation:<br />

9.5.3 Set-up<br />

#define DSP56801EVM<br />

To use the Bootloader, it must be programmed into boot Flash; the EVM P3 socket must be<br />

connected by serial cable with the host PC’s COM serial port; and jumpers on the EVM must be<br />

set with usage of internal memory without debug interface.<br />

9.5.3.1 EVM Jumper Settings<br />

To load the Bootloader into the DSP56F801 board, the following jumper settings are required:<br />

• Do not set jumper JG5, “Enable on-board Parallel JTAG Host Target Interface”<br />

To start a previously-loaded Bootloader on the DSP56F801 board, the following jumper settings<br />

are needed:<br />

• Set jumper JG5, “Enable on-board Parallel JTAG Host Target Interface”<br />

9.5.4 Build<br />

To build the Serial Bootloader, open the bootloader.mcp project file in the CodeWarrior IDE and<br />

execute the Project/Make command. This will build and link the Serial Bootloader application.<br />

9.5.4.1 Download into Boot Flash<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

To download, build the Bootloader from Codewarrior and load it into board by choosing the<br />

Project/Debug command in the CodeWarrior IDE. Make sure that jumpers are set for loading as<br />

described in Section 9.5.3.1.<br />

MOTOROLA DSP56F801/802 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

9-17<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F801/802 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

9.5.4.2 Host Terminal Program Set-up<br />

A host terminal program is used to communicate with Bootloader. The Terminal must be<br />

configured to the following mode:<br />

The following description assumes that Microsoft Windows HyperTerminal program is used. To<br />

configure Microsoft HyperTerminal to communicate with Bootloader, the PC user should start<br />

HyperTerminal and create a new connection. Select the COM port previously connected to EVM<br />

and set Baud rate at 115200 bps; Data bits equal to 8, Parity none, Stop bits 1; and Flow control as<br />

Xon/Xoff. The Hyperterminal can now display Bootloader messages.<br />

9.5.5 Execute<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Baud rate 115200 bps<br />

8N1 8 data bits, no parity, 1 stop bit character format<br />

Flow control protocol Xon/Xoff<br />

To execute the Serial Bootloader application after loading it into Flash, set jumpers as described<br />

in Section 9.5.3.1. and push the RESET button.<br />

If the terminal program is properly set up and the EVM and the Host PC are properly connected,<br />

the terminal program will display a Bootloader startup message:<br />

"(c) 2000-2001 Motorola Inc. S-Record loader. Version 1.3"<br />

To load the S-Record file, select the Transfer/Send text file from the HyperTerminal menu and<br />

select a file. When the S-Record file is loaded and the application is started, the terminal windows<br />

displays a message similar to this:<br />

"(c) 2000-2001 Motorola Inc. S-Record loader. Version 1.3<br />

Loaded 0x044d Program and 0x000a Data words.<br />

Application started."<br />

The download rate is about 7660 bytes of S-Record file per second loaded from the terminal or<br />

about 1740 words of program or data memory stored into Flash per second.<br />

If an error is detected while loading the S-Record file, the Bootloader displays the error message<br />

and resets the processor. For example, if an S-record file contains a character that is not permitted<br />

for S-Records, the following message is displayed:<br />

"(c) 2000-2001 Motorola Inc. S-Record loader. Version 1.3<br />

Error # 0002<br />

Resetting the processor."<br />

After this message, the Bootloader resets the processor and waits for the S-Record file again.<br />

Other loading errors are described in Table 9-6.<br />

9-18 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Error<br />

Code<br />

Serial Bootloader<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 9-6. Error Codes for the Serial Bootloader Application<br />

Error Title Possible Reasons What to Do<br />

1 Data Receive Error •Any SCI error except Noise Error<br />

(Overrun, Frame Error, Parity<br />

Error)<br />

2 Invalid Character •Received character is not "S" or<br />

any hexadecimal digit<br />

3 Invalid S-Record<br />

Format<br />

4 Wrong S-Record<br />

Checksum<br />

If an application previously loaded via the Bootloader uses the <strong>SDK</strong> variable<br />

BSP_BOOTLOADER_DELAY, (see Section 9.5.6), the Bootloader waits for the S-Record file<br />

only until the required time-out expires, then launches the application. When this happens, the<br />

terminal window contains a message similar to this:<br />

"(c) 2000-2001 Motorola Inc. S-Record loader. Version 1.3<br />

Application started."<br />

•Invalid record type; permitted<br />

type is 0,3,7<br />

•S-Record length is less than<br />

address plus checksum length<br />

•Checksum calculated around<br />

received S-Record did not match<br />

with received one.<br />

9.5.6 Requirements for a Loaded Program<br />

•Check connections with Host PC and<br />

settings for host terminal program<br />

•Verify that S-Record file does not contain any<br />

invalid characters<br />

•Check connections and send mode in the<br />

terminal program<br />

•Verify S-Record file<br />

•Check S-Record file<br />

•Check connections and send mode in<br />

terminal program<br />

5 Buffer Overrun •Internal data buffer was full •Terminal program did not stop after receiving<br />

Xoff character<br />

•Confirm that the terminal program supports<br />

Xon/Xoff flow control protocol<br />

6 Flash<br />

Programming Error<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

•After program word into Flash<br />

this word is not equal to<br />

programmed one<br />

•The Bootloader tries to program Flash only<br />

once; there is a problem with internal DSP<br />

Flash<br />

7 Internal Error •Bootloader data corrupte. •Try to reload Bootloader via CodeWarrior<br />

If the application is loaded via the Bootloader, it must meet the following requirements:<br />

• Particular start address for application - The entry point for the loaded application must<br />

be located at address 0x0080 in Program memory, i.e., immediately after the interrupt table.<br />

• Application COP vector - To use COP interrupt vector in an application loaded via<br />

Bootloader, the entry point for the COP ISR must be located at address 0x0082 in Program<br />

memory.<br />

MOTOROLA DSP56F801/802 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

9-19<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F801/802 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

• Application start delay variable must be set at address 0x0085 in Program Flash - The<br />

<strong>SDK</strong> provides a configuration variable for this purpose. For details on managing the<br />

Bootloader without <strong>SDK</strong> support, see file config\vector.c in the <strong>SDK</strong>.<br />

• Restricted resources use - The application cannot occupy Reset and COP interrupt<br />

vectors, and cannot place code into Boot Flash memory area. There is no way to place any<br />

initialized variable from the application into internal data RAM while loading. This<br />

memory area is used by Bootloader. All data from the S-Record file that address to the<br />

restricted area will be ignored. External Program memory is unavailable while loading the<br />

application because the Bootloader is performed in DSP Mode 0A memory map.<br />

All applications built with the <strong>SDK</strong> can be loaded via the Serial Bootloader. The <strong>SDK</strong> provides a<br />

fixed address for application entry point; redirection for the application COP vector and has a<br />

configuration variable (BSP_BOOTLOADER_DELAY) for the appconfig.h file that determines<br />

the application’s start delay time-out.<br />

Possible values of BSP_BOOTLOADER_DELAY:<br />

0 Disable the Bootloader, start the application immediately.<br />

After loading the application with this setting, there are only<br />

two ways to re-enter Bootloader:<br />

If there is no BSP_BOOTLOADER_DELAY set in the appconfig.h file, the default value for<br />

timeout is 30 seconds.<br />

9.6 ADC Application<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

For details on building and executing this application, see Section 5.4.6.<br />

9.7 COP Driver Application<br />

• Reload the Bootloader from Metrowerks<br />

CodeWarrior into Boot Flash<br />

• Reprogram the value of the start delay variable<br />

located at address 0x0083 in the Program Flash to<br />

zero value (0x0000) in the loaded application<br />

0 - 254 Set waiting time for the start of the S-Record file for 0-255<br />

seconds before the start of a previously-loaded application<br />

255 Set waiting time to infinity. After reset, the Bootloader waits<br />

for the S-Record file without counting down any time-out<br />

Refer to Section 5.10.3 for information on building and executing the Computer Operating<br />

Properly Driver Application.<br />

9-20 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

PWM Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

9.8 PWM Application<br />

See Section 5.8.6 for more information on building and executing the PWM Driver Application.<br />

9.9 Quad Timer Application<br />

To learn more about building and executing this application, refer to Section 5.5.6.<br />

9.10 SCI Application<br />

Section 5.3.6 contains details on building and executing the SCI Driver Application.<br />

9.11 Timer Application<br />

This application exercises the Timer peripheral located on the DSP56F8xx processor.<br />

9.11.1 Files<br />

The Timer application is composed of the following files:<br />

• ...\dsp568xxevm\nos\applications\timers\timers.c, main program<br />

• ...\dsp568xxevm\nos\applications\timers\timers.mcp, application project file<br />

• ...\dsp568xxevm\nos\applications\timers\Config\appconfig.c, application configuration<br />

file<br />

• ...\dsp568xxevm\nos\applications\timers\Config\appconfig.h, application configuration<br />

file<br />

• ...\dsp568xxevm\nos\applications\timers\Config\linker.cmd, linker command file<br />

These files are located in the <strong>SDK</strong> installation directory.<br />

9.11.2 Specifications<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

This application exercises Timer0, Timer1, and Timer2 peripherals located in the DSP56F8xx<br />

processor. It initializes Timer1 using clock ID CLOCK_AUX1 to 250ms with a reload value of<br />

250ms. Timer2 is initialized using clock ID CLOCK_AUX2 to 125ms with a reload value of<br />

125ms. When these timers expire, the application changes the On/Off state of the yellow and red<br />

LEDs. The net effect of this is that the yellow LED will come On once every 0.5 seconds, and the<br />

red LED will come On once every 0.25 seconds.<br />

For interaction with Timer0, the application uses the <strong>SDK</strong> timer services. The <strong>SDK</strong> timer services<br />

reserve Timer0 with clock ID CLOCK_REALTIME, and utilizes this timer for nanosleep<br />

functionality. This application calls the nanosleep interface with a time-out value of 0.5 seconds<br />

MOTOROLA DSP56F801/802 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

9-21<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F801/802 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

in a tight loop. The net effect of this call will be suspension of the main function execution for 0.5<br />

seconds.<br />

9.11.3 Set-up<br />

Jumper Settings:<br />

Use the default jumper settings for the DSP56F801EVM board. See the DSP56F801 Evaluation<br />

Module Hardware User’s Manual for more information on jumper settings.<br />

9.11.4 Build<br />

To make this application, open the timers.mcp project file and execute the Make command as<br />

shown in Figure 9-11. This will build and link the Timer application and all needed Metrowerks<br />

and <strong>SDK</strong> libraries.<br />

9.11.5 Execute<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 9-11. Execute Make Command<br />

To execute the Timer application, choose the Program/Debug command in the CodeWarrior IDE,<br />

followed by the Run command. For more help with these commands, refer to the CodeWarrior<br />

tutorial documentation in the following file, located in the CodeWarrior installation directory:<br />

\CodeWarrior Documentation\PDF\Targeting_DSP56800.pdf<br />

Once the application is running, you should see the green LED come On every 1 second, the<br />

yellow LED come On every 0.5 seconds , and the red LED come On every 0.25 seconds.<br />

9-22 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Chapter 10<br />

DSP56F803 Applications<br />

10.1 Common Hardware Configuration for Motor<br />

Control Applications<br />

10.1.1 Settings for EVM Trimpots<br />

Settings for the DSP56F803 board-required fault trimpots are shown in Figure 10-1, Table 10-1,<br />

Table 10-2, and Table 10-3.<br />

GND - pin TP2<br />

Figure 10-1. Trimpot Pins (Top View)<br />

Table 10-1. Trimpot Settings for EVM Motor Board BLDC Motor Control Application<br />

Trim pot Comment<br />

Voltage<br />

POT - Pin 2 to GND<br />

R45 Overvoltage Fault Detection UNI-3 3.3V<br />

R40 Overcurrent Fault Detection UNI-3 3.3V<br />

Table 10-2. Trimpot Settings for Low-Voltage BLDC Motor Control Application<br />

Trimpot Comment<br />

Voltage<br />

POT - Pin 2 to GND<br />

R45 Overvoltage Fault Detection UNI-3 3.3V<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-1<br />

2<br />

POT<br />

1 3<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 10-2. Trimpot Settings for Low-Voltage BLDC Motor Control Application<br />

10.1.2 Communication Port Settings<br />

When utilizing the PC master software debugging tool, a communication port on a PC requires<br />

the following settings:<br />

10.2 BLDC Motor Control Application with Hall<br />

Sensors<br />

This application exercises simple control of the BLDC motor with the Hall Sensors on the<br />

DSP56F803EVM board and the EVM Motor Kit.<br />

10.2.1 Files<br />

R40 Overcurrent Fault Detection UNI-3 3.3V<br />

Table 10-3. Trimpot Settings for High-Voltage BLDC Motor Control Application<br />

Trimpot Comment<br />

Voltage<br />

POT - Pin 2 to GND<br />

R45 Overvoltage Fault Detection UNI-3 3.3V<br />

R40 Overcurrent Fault Detection UNI-3 3.3V<br />

Baud Rate<br />

Data Bits<br />

Parity<br />

Stop Bit<br />

Flow Control<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Trimpot Comment<br />

9600<br />

8<br />

None<br />

1<br />

None<br />

Voltage<br />

POT - Pin 2 to GND<br />

The BLDC Motor Control application with Hall Sensors is composed of the following files:<br />

• ...\dsp56803evm\nos\applications\bldc_sensor\bldc_sensor.c, main program<br />

• ...\dsp56803evm\nos\applications\bldc_sensor\bldc_sensor.mcp, application project file<br />

• ...\dsp56803evm\nos\applications\bldc_sensor\configextram\appconfig.c, application<br />

configuration file for external RAM<br />

• ...\dsp56803evm\nos\applications\bldc_sensor\configflash\appconfig.c, application<br />

configuration file for Flash<br />

10-2 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

• ...\dsp56803evm\nos\applications\bldc_sensor\configextram\appconfig.h, application<br />

configuration file for external RAM<br />

• ...\dsp56803evm\nos\applications\bldc_sensor\configflash\appconfig, application<br />

configuration file for Flash<br />

• ...\dsp56803evm\nos\applications\bldc_sensor\configextram\linker.cmd, linker<br />

command file for external RAM<br />

• ...\dsp56803evm\nos\applications\bldc_sensor\configflash\linker.cmd, linker command<br />

file for Flash<br />

• ...\dsp56803evm\nos\applications\bldc_sensor\configflash\flash.cfg, configuration file<br />

for Flash<br />

• ...\dsp56803evm\nos\applications\bldc_sensor\PCMaster\BLDC demo.pmp,<br />

PCMaster file<br />

These files are located in the <strong>SDK</strong> installation directory.<br />

10.2.2 Specifications<br />

This application performs simple control of a BLDC motor with Hall Sensors and closed loop<br />

control on the DSP56F803 processor. In the application, the PWM module is set to<br />

complementary mode with a 16kHz switching frequency. The state of the Hall Sensors is read<br />

from the Input Monitor Register of the Quadrature Decoder. The masking and swapping of the<br />

PWM channels is controlled by the PWM Channel Control Register. The content of this register is<br />

derived from the Hall Sensors’ signals. The commutation is done with each new edge of the Hall<br />

Sensors’ signals. The required voltage is set independently on the commutation by the speed PI<br />

controller. The speed is measured by the quad timer. The allowable range of speed for this motor<br />

application is from 400rpm to 1000rpm in both directions.<br />

The application can run on:<br />

• External RAM or Flash<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

This BLDC Motor Control Application with Hall Sensors can operate in two modes:<br />

1. Manual Operating Mode<br />

The drive is controlled by the RUN/STOP switch (S1). The motor speed is set by the<br />

UP (S3-IRQB) and DOWN (S2-IRQA) push buttons; see Figure 10-2. If the<br />

application runs and motor spinning is disabled (i.e., the system is ready), the USER<br />

LED (LED8), shown in Figure 10-3, will blink. When motor spinning is enabled, the<br />

USER LED is On. Refer to Table 10-4 for application states.<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-3<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 10-2. RUN/STOP Switch and UP/DOWN Buttons<br />

Figure 10-3. USER and PWM LEDs<br />

Table 10-4. Motor Application States<br />

Application State Motor State Green LED State<br />

Stopped Stopped Blinking at a frequency of 2Hz<br />

Running Spinning On<br />

Fault Stopped Blinking at a frequency of 8Hz<br />

10-4 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

2. PC master software (Remote) Operating Mode<br />

The drive is controlled remotely from a PC through the SCI communication channel<br />

of the DSP device via an RS-232 physical interface. The drive is again enabled by<br />

the RUN/STOP switch; this switch can be used to safely stop the application at any<br />

time.<br />

The following control actions are supported:<br />

• Set the Required Speed of the motor<br />

PC master software displays the following information:<br />

• Applied Voltage<br />

• Required Voltage<br />

• Speed<br />

• RUN/STOP Switch Status<br />

• Application Mode<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Project files for the PC master software are located in:<br />

..\nos\applications\bldc_sensors\PC_Master\bldc demo.pmp<br />

Start the PC master software window’s application, BLDC Demo.pmp; Figure 10-4 shows the PC<br />

master software control window for BLDC Demo.pmp.<br />

Note: If the PC master software project (.pmp file) is unable to control the application, it is<br />

possible that the wrong load map (.elf file) has been selected. PC master software uses<br />

the load map to determine addresses for global variables being monitored. Once the<br />

PC master software project has been launched, this option may be selected in the PC<br />

master software window under "Project/Select other Map FileReload".<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-5<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 10-4. PC Master Software Control Window<br />

10-6 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

10.2.3 Set-up<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 10-5 illustrates the hardware set-up for the BLDC Motor Control application with Hall<br />

Sensors.<br />

Figure 10-5. BLDC Motor Control Application Set-up<br />

For detailed information, see the DSP56F803 Evaluation Module Hardware Reference<br />

Manual. The serial cable is needed for the PC master software debugging tool only.<br />

10.2.3.1 EVM Jumper Settings<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

To execute the BLDC Motor Control application, the DSP56F803 board requires the strap settings<br />

shown in Figure 10-6 and Table 10-5.<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-7<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

1 2 3<br />

JG6<br />

JG1<br />

1 2<br />

7 8<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

7 8 9<br />

JG5<br />

9 8 7<br />

3 2 1<br />

1<br />

JG6<br />

2 3<br />

7 8 9<br />

USER LED<br />

LED3<br />

7 8 9<br />

JG7<br />

3 2 1<br />

PWM LEDs<br />

JG7<br />

JG5<br />

JG4<br />

JG10<br />

JG1<br />

1<br />

S2<br />

P4 IRQA<br />

J3<br />

J2<br />

JG10 1 3 JG9<br />

JG3<br />

DSP56F803EVM<br />

Figure 10-6. DSP56F803EVM Jumper Reference<br />

Table 10-5. DSP56F803EVM Jumper Settings<br />

Jumper Group Comment Connections<br />

JG1 UNI-3 serial selected 1-2, 3-4,5-6, 7-8<br />

JG2 Enable on-board parallel JTAG Command Converter Interface NC<br />

JG3 Use on-board crystal for DSP oscillator input 1-2<br />

JG4 Select DSP’s Mode 0 operation upon exit from reset 1-2<br />

JG5 Enable external SRAM 1-2<br />

JG6 UNI-3 3-Phase Current source selected 2-3, 5-6, 8-9<br />

JG7 Encoder Input Selected for Hall Sensor signals 2-3, 5-6, 8-9<br />

JG8 On-board Parallel JTAG command converter powered by Host system 1-2<br />

JG9 Use on-board crystal for DSP oscillator input 1-2<br />

JG10 Leave CAN bus un-terminated NC<br />

Note: When running the EVM target system in a stand-alone mode from Flash, the JG2<br />

jumper must be set in the 1-2 configuration to disable the command converter parallel<br />

port interface.<br />

J10<br />

1<br />

10-8 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

U15<br />

S3<br />

S/N<br />

RUN/STOP<br />

S4<br />

Y1<br />

U1<br />

P2<br />

J9<br />

1<br />

JG4<br />

JTAG<br />

JG4 S1<br />

JG2 JG8 J1<br />

IRQB<br />

1<br />

JG3<br />

RESET<br />

J8<br />

JG2<br />

JG9<br />

J4<br />

U6 U7<br />

JG8<br />

P3<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

10.2.4 Build<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

When building the BLDC Motor Control application with Hall Sensors, the user can create an<br />

application that runs from internal Flash or External RAM. To select the type of application to<br />

build, open the bldc_sensor.mcp project and select the target build type; see Figure 10-7. Selecting<br />

Build All will create all application build types. A definition of the projects associated with these<br />

target build types may be found under the Targets tab of the project window.<br />

Figure 10-7. Target Build Selection<br />

The project may now be built by executing the Make command, as shown in Figure 10-8. This will<br />

build and link the BLDC Motor Control application and all needed Metrowerks and <strong>SDK</strong><br />

libraries.<br />

Figure 10-8. Execute Make Command<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-9<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

10.2.5 Execute<br />

To execute the BLDC Motor Control application with Hall Sensors, select Project\Debug in the<br />

CodeWarrior IDE, followed by the Run command. For more help with these commands, refer to<br />

the CodeWarrior tutorial documentation in the following file, which is located in the CodeWarrior<br />

installation directory:<br />

\CodeWarrior Documentation\PDF\Targeting_DSP56800.pdf<br />

If the Flash target is selected, CodeWarrior will automatically program the DSP’s internal Flash<br />

with the executable generated during Build. If the External RAM target is selected, the executable<br />

will be loaded to off-chip RAM.<br />

Once Flash has been programmed with the executable, the EVM target system may be run in a<br />

stand-alone mode from Flash. To do this, set the JG2 jumper in the 1-2 configuration to disable<br />

the parallel port and press the RESET button.<br />

Once the application is running, switch the RUN/STOP switch to the RUN position and set the<br />

required speed with the UP/DOWN push buttons. Pressing the UP/DOWN buttons should<br />

incrementally increase the motor speed until it reaches maximum speed. If successful, the BLDC<br />

motor will be spinning.<br />

Note: If the RUN/STOP switch is set to the RUN position when the application starts, toggle<br />

the RUN/STOP switch between the STOP and RUN positions to enable motor<br />

spinning. This is a protection feature that prevents the motor from starting when the<br />

application is executed from CodeWarrior.<br />

You should also see a lighted green LED, which indicates that the application is running. If the<br />

application is stopped, the green LED will blink at a frequency of 2Hz. If an Undervoltage fault<br />

occurs, the green LED will blink at a frequency of 8Hz.<br />

10.3 BLDC Motor Control Application with<br />

Quadrature Encoder<br />

This application exercises simple control of the BLDC motor with the Quadrature Encoder on the<br />

DSP56F803EVM board and the EVM Motor Kit.<br />

10.3.1 Files<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The BLDC Motor Control application with Quadrature Encoder is composed of the following<br />

files:<br />

• ...\dsp56803evm\nos\applications\bldc_encoder\bldc_encoder.c, main program<br />

• ...\dsp56803evm\nos\applications\bldc_encoder\bldc_encoder.mcp, application project<br />

file<br />

• ...\dsp56803evm\nos\applications\bldc_encoder\configextram\appconfig.c, application<br />

configuration file for external RAM<br />

• ...\dsp56803evm\nos\applications\bldc_encoder\configflash\appconfig.c, application<br />

configuration file for Flash<br />

10-10 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

• ...\dsp56803evm\nos\applications\bldc_encoder\configextram\appconfig.h,<br />

application configuration file for external RAM<br />

• ...\dsp56803evm\nos\applications\bldc_encoder\configflash\appconfig.h, application<br />

configuration file for Flash<br />

• ...\dsp56803evm\nos\applications\bldc_encoder\configextram\linker.cmd, linker<br />

command file for external RAM<br />

• ...\dsp56803evm\nos\applications\bldc_encoder\configflash\linker.cmd, linker<br />

command file for Flash<br />

• ...\dsp56803evm\nos\applications\bldc_encoder\configflash\flash.cfg, configuration<br />

file for Flash<br />

• ...\dsp56803evm\nos\applications\bldc_encoder\PCMaster\BLDC_Encoder_demo.pmp,<br />

PCMaster file<br />

These files are located in the <strong>SDK</strong> installation directory.<br />

10.3.2 Specifications<br />

This application performs simple control of the BLDC motor with the Quadrature Encoder and<br />

close loop speed control on the DSP56F803 processor. In the application, the PWM module is set<br />

to complementary mode with a 16kHz switching frequency. The masking and swapping of the<br />

PWM channels is controlled by the PWM Channel Control Register. The content of this register is<br />

derived from Quadrature Encoder signals. The required voltage is set independently on the<br />

commutation by the speed PI controller. The speed is measured by the quad timer. The allowable<br />

range of speed is from 50rpm to 1000rpm in both directions.<br />

The application can run on:<br />

• External RAM or Flash<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

This BLDC Motor Control Application with Quadrature Encoder can operate in two modes:<br />

1. Manual Operating Mode<br />

The drive is controlled by the RUN/STOP switch (S1) and the motor speed is set by<br />

the UP (S3-IRQB) and DOWN (S2-IRQA) push buttons; see Figure 10-9. If the<br />

application runs and motor spinning is disabled (i.e., the system is ready), the USER<br />

LED (LED8), shown in Figure 10-10 will blink. When motor spinning is enabled, the<br />

USER LED is On. Refer to Table 10-6 for application states.<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-11<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 10-9. RUN/STOP Switch and UP/DOWN Buttons<br />

Figure 10-10. USER and PWM LEDs<br />

10-12 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 10-6. Motor Application States<br />

Application State Motor State Green LED State<br />

Stopped Stopped Blinking at a frequency of 2Hz<br />

Running Spinning On<br />

Fault Stopped Blinking at a frequency of 8Hz<br />

2. PC master software (Remote) Operating Mode<br />

The drive is controlled remotely from a PC through the SCI communication channel<br />

of the DSP device via an RS-232 physical interface. The drive is again enabled by<br />

the RUN/STOP switch and this switch can be used to safely stop the application at<br />

any time.<br />

The following control actions are supported:<br />

• Set the Required Speed of the motor<br />

PC master software displays the following information:<br />

• Required Speed<br />

• Actual Speed<br />

• Applied Voltage<br />

• DCBus Voltage<br />

• RUN/STOP Switch Status<br />

• Application Mode<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Projects files for the PC master software are located in:<br />

..\nos\applications\bldc_encoder\PC_Master\BLDC Encoder Demo.pmp<br />

Start the PC master software window’s application, BLDC Encoder Demo.pmp. Figure 10-11<br />

illustrates the PC master software control window for BLDC Encoder Demo.pmp.<br />

Note: If the PC master software project (.pmp file) is unable to control the application, it is<br />

possible that the wrong load map (.elf file) has been selected. PC master software uses<br />

the load map to determine addresses for global variables being monitored. Once the<br />

PC master software project has been launched, this option may be selected in the PC<br />

master software window under "Project/Select other Map FileReload".<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-13<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 10-11. PC Master Software Control Window<br />

10-14 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

10.3.3 Set-up<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 10-12 illustrates the hardware set-up for the BLDC Motor Control application with<br />

Quadrature Encoder.<br />

Figure 10-12. BLDC Motor Control Application Set-up<br />

For detailed information, see the DSP56F803 Evaluation Module Hardware Reference<br />

Manual. The serial cable is needed for the PC master software debugging tool only.<br />

10.3.3.1 EVM Jumper Settings<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

To execute the BLDC Motor Control Application with Quadrature Encoder, the DSP56F803<br />

board requires the strap settings shown in Figure 10-13 and Table 10-7.<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-15<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

1 2 3<br />

JG6<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

7 8 9<br />

JG1<br />

1 2<br />

7 8<br />

JG5<br />

9 8 7<br />

3 2 1<br />

1 2 3<br />

JG6<br />

7 8 9<br />

USER LED<br />

LED3<br />

7 8 9<br />

JG7<br />

3 2 1<br />

PWM LEDs<br />

JG7<br />

JG5<br />

JG4<br />

JG10<br />

JG1<br />

1<br />

S2<br />

P4 IRQA<br />

J3<br />

J2<br />

JG10 1 3 JG9<br />

JG3<br />

DSP56F803EVM<br />

Figure 10-13. DSP56F803EVM Jumper Reference<br />

Table 10-7. DSP56F803EVM Jumper Settings<br />

Jumper Group Comment Connections<br />

JG1 UNI-3 serial selected 1-2, 3-4, 5-6, 7-8<br />

JG2 Enable on-board parallel JTAG Command Converter Interface NC<br />

JG3 Use on-board crystal for DSP oscillator input 1-2<br />

JG4 Select DSP’s Mode 0 operation upon exit from reset 1-2<br />

JG5 Enable external SRAM 1-2<br />

JG6 UNI-3 3-Phase Current source selected 2-3, 5-6, 8-9<br />

JG7 Encoder Input Selected for Quadrature Encoder signals 2-3, 5-6, 8-9<br />

JG8 On-board Parallel JTAG command converter powered by Host system 1-2<br />

JG9 Use on-board crystal for DSP oscillator input 1-2<br />

JG10 Leave CAN bus un-terminated NC<br />

Note: When running the EVM target system in a stand-alone mode from Flash, the JG2<br />

jumper must be set in the 1-2 configuration to disable the command converter parallel<br />

port interface.<br />

J10<br />

1<br />

10-16 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

U15<br />

S3<br />

S/N<br />

RUN/STOP<br />

S4<br />

Y1<br />

U1<br />

P2<br />

J9<br />

1<br />

JG4<br />

JTAG<br />

JG4 S1<br />

JG2 JG8 J1<br />

IRQB<br />

1<br />

JG3<br />

RESET<br />

J8<br />

JG2<br />

JG9<br />

J4<br />

U6 U7<br />

JG8<br />

P3<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

10.3.4 Build<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

When building the BLDC Motor Control Application with Quadrature Encoder, the user can<br />

create an application that runs from internal Flash or External RAM. To select the type of<br />

application to build, open the bldc_encoder.mcp project and choose the target build type; see<br />

Figure 10-14. Selecting Build All will create all application build types. A definition of the<br />

projects associated with these target build types may be found under the Targets tab of the project<br />

window.<br />

Figure 10-14. Target Build Selection<br />

The project may now be built by executing the Make command; see Figure 10-15. This will build<br />

and link the BLDC Motor Control application and all needed Metrowerks and <strong>SDK</strong> libraries.<br />

Figure 10-15. Execute Make Command<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-17<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

10.3.5 Execute<br />

To execute the BLDC Motor Control Application with Quadrature Encoder, select Project\Debug<br />

in the CodeWarrior IDE, followed by the Run command. For more help with these commands,<br />

refer to the CodeWarrior tutorial documentation in the following file, which is located in the<br />

CodeWarrior installation directory:<br />

\CodeWarrior Documentation\PDF\Targeting_DSP56800.pdf<br />

If the Flash target is selected, CodeWarrior will automatically program the DSP’s internal Flash<br />

with the executable generated during Build. If the External RAM target is selected, the executable<br />

will be loaded to off-chip RAM.<br />

Once Flash has been programmed with the executable, the EVM target system may be run in a<br />

stand-alone mode from Flash. To do this, set the JG2 jumper in the 1-2 configuration to disable<br />

the parallel port and press the RESET button.<br />

Once the application is running, move the RUN/STOP switch to the RUN position and set the<br />

required speed by the UP/DOWN push buttons. Pressing the UP/DOWN buttons should<br />

incrementally increase the motor speed until it reaches maximum speed. If successful, the BLDC<br />

motor will be spinning.<br />

Note: If the RUN/STOP switch is set to the RUN position when application starts, toggle the<br />

RUN/STOP switch between the STOP and RUN positions to enable motor spinning.<br />

This is a protection feature that prevents the motor from starting when the application<br />

is executed from CodeWarrior.<br />

You should also see a lighted green LED, which indicates that the application is running. If the<br />

application is stopped, the green LED will be blinking at a 2Hz frequency. If an Undervoltage<br />

fault occurs, the green LED will blink at a frequency of 8Hz.<br />

10.4 Synchro PM Motor Control Application with<br />

Quadrature Encoder<br />

This application exercises simple control of the Synchro PM Motor with the Quadrature Encoder<br />

on the DSP56F803EVM board and the EVM Motor Kit.<br />

10.4.1 Files<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The Synchro PM Motor Control application is composed of the following files:<br />

• ...\dsp56803evm\nos\applications\bldc_synchro1\bldc_synchro1.c, main program<br />

• ...\dsp56803evm\nos\applications\bldc_synchro1\bldc_synchro1.mcp, application<br />

project file<br />

• ...\dsp56803evm\nos\applications\bldc_synchro1\configextram\appconfig.c,<br />

application configuration file for external RAM<br />

• ...\dsp56803evm\nos\applications\bldc_synchro1\configflash\appconfig.c, application<br />

configuration file for Flash<br />

10-18 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

• ...\dsp56803evm\nos\applications\bldc_synchro1\configextram\appconfig.h,<br />

application configuration file for external RAM<br />

• ...\dsp56803evm\nos\applications\bldc_synchro1\configflash\appconfig.h, application<br />

configuration file for Flash<br />

• ...\dsp56803evm\nos\applications\bldc_synchro1\configextram\linker.cmd, linker<br />

command file for external RAM<br />

• ...\dsp56803evm\nos\applications\bldc_synchro1\configflash\linker.cmd, linker<br />

command file for Flash<br />

• ...\dsp56803evm\nos\applications\bldc_synchro1\configflash\flash.cfg, configuration<br />

file for Flash<br />

• ...\dsp56803evm\nos\applications\bldc_synchro1\PCMaster\BLDC Synchro<br />

demo.pmp, PC master software file<br />

These files are located in the <strong>SDK</strong> installation directory.<br />

10.4.2 Specifications<br />

This application performs a simple control of the Synchro PM Motor with the Quadrature<br />

Encoder and speed close loop on the DSP56F803 processor. In the application, the PWM module<br />

is set to complementary mode with a 16kHz switching frequency. The masking and swapping of<br />

the PWM channels is controlled by the PWM Channel Control Register. The content of this<br />

register is derived from Quadrature Encoder signals. The required voltage is set independently on<br />

the commutation by the speed PI controller. The speed is measured by the quad timer. The<br />

allowable range of speed is from 50rpm to 1000rpm in both directions.<br />

The application can run on:<br />

• External RAM or Flash<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

This Synchro PM Motor Control Application with Quadrature Encoder can operate in two<br />

modes:<br />

1. Manual Operating Mode<br />

The drive is controlled by the RUN/STOP switch (S1) and the motor speed is set by<br />

the UP (S3-IRQB) and DOWN (S2-IRQA) push buttons; see Figure 10-16. If the<br />

application runs and motor spinning is disabled (i.e., the system is ready) the USER<br />

LED (LED8), shown in Figure 10-17, will blink. When motor spinning is enabled, the<br />

USER LED is On. Refer to Table 10-8 for application states.<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-19<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 10-16. RUN/STOP Switch and UP/DOWN Buttons<br />

Figure 10-17. USER and PWM LEDs<br />

10-20 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 10-8. Motor Application States<br />

Application State Motor State Green LED State<br />

Stopped Stopped Blinking at a frequency of 2Hz<br />

Running Spinning On<br />

Fault Stopped Blinking at a frequency of 8Hz<br />

2. PC master software (Remote) Operating Mode<br />

The drive is controlled remotely from a PC through the SCI communication channel<br />

of the DSP device via an RS-232 physical interface. The drive is enabled by the<br />

RUN/STOP switch, which can be used to safely stop the application at any time.<br />

The following control actions are supported:<br />

• Set the Required Speed of the motor<br />

PC master software displays the following information:<br />

• Required Speed<br />

• Actual Speed<br />

• Amplitude<br />

• DCBus Voltage<br />

• RUN/STOP Switch Status<br />

• Application Mode<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Project files for the PC master software are located in:<br />

..\nos\applications\bldc_synchro1\PC_Master\BLDC Synchro Demo.pmp<br />

Start the PC master software window’s application, BLDC Synchro Demo.pmp. Figure 10-18<br />

illustrates the PC master software control window for the BLDC Synchro Demo.pmp.<br />

Note: If the PC master software project (.pmp file) is unable to control the application, it is<br />

possible that the wrong load map (.elf file) has been selected. PC master software uses<br />

the load map to determine addresses for global variables being monitored. Once the<br />

PC master software project has been launched, this option may be selected in the PC<br />

master software window under "Project/Select other Map FileReload".<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-21<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 10-18. PC Master Software Control Window<br />

10-22 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

10.4.3 Set-up<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 10-19 illustrates the hardware set-up for the Synchro PM Motor Control application with<br />

Quadrature Encoder.<br />

Figure 10-19. Set-up of the Synchro PM Motor Control Application<br />

For detailed information, see the DSP56F803 Evaluation Module Hardware Reference<br />

Manual. The serial cable is needed for the PC master software debugging tool only.<br />

10.4.3.1 PM Synchronous Motor Versus BLDC Motor<br />

The application software is targeted for a PM Synchronous motor with sine-wave Back-EMF<br />

shape. In this particular demo application, the BLDC motor is used instead of a PM Synchronous<br />

motor, due to the availability of the BLDC motor supplied as ECMTREVAL. Although the<br />

Back-EMF shape of this motor is not ideally sine-wave, it can be controlled by the application<br />

software. The drive parameters will be improved when a PMSM motor with exactly sine-wave<br />

Back-EMF shape is used.<br />

10.4.3.2 EVM Jumper Settings<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

To execute the Synchro PM Motor Control Application with Quadrature Encoder, the DSP56F803<br />

board requires the strap settings shown in Figure 10-20 and Table 10-9.<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-23<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

1 2 3<br />

JG6<br />

JG1<br />

1 2<br />

7 8<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

7 8 9<br />

JG5<br />

9 8 7<br />

3 2 1<br />

1 2 3<br />

JG6<br />

7 8 9<br />

USER LED<br />

JG7<br />

3 2 1<br />

DSP56F803EVM<br />

Figure 10-20. DSP56F803EVM Jumper Reference<br />

Table 10-9. DSP56F803EVM Jumper Settings<br />

Jumper Group Comment Connections<br />

JG1 UNI-3 serial selected 1-2, 3-4, 5-6, 7-8<br />

JG2 Enable on-board parallel JTAG Command Converter Interface NC<br />

JG3 Use on-board crystal for DSP oscillator input 1-2<br />

JG4 Select DSP’s Mode 0 operation upon exit from reset 1-2<br />

JG5 Enable external SRAM 1-2<br />

JG6 UNI-3 3-Phase Current source selected 2-3, 5-6, 8-9<br />

JG7 Encoder Input Selected for Quadrature Encoder signals 2-3, 5-6, 8-9<br />

JG8 On-board Parallel JTAG command converter powered by Host<br />

system<br />

LED3<br />

7 8 9<br />

PWM LEDs<br />

JG7<br />

JG5<br />

JG4<br />

JG10<br />

JG1<br />

1<br />

S2<br />

P4 IRQA<br />

J3<br />

J2<br />

JG10 1 3 JG9<br />

JG3<br />

JG9 Use on-board crystal for DSP oscillator input 1-2<br />

JG10 Leave CAN bus un-terminated NC<br />

J10<br />

1<br />

Note: When running the EVM target system in a stand-alone mode from Flash, the JG2<br />

jumper must be set in the 1-2 configuration to disable the command converter parallel<br />

port interface.<br />

10-24 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

U15<br />

S3<br />

S/N<br />

RUN/STOP<br />

S4<br />

Y1<br />

U1<br />

P2<br />

J9<br />

1<br />

JG4<br />

JTAG<br />

JG4 S1<br />

JG2 JG8 J1<br />

IRQB<br />

1<br />

JG3<br />

RESET<br />

J8<br />

JG2<br />

JG9<br />

J4<br />

U6 U7<br />

JG8<br />

P3<br />

1-2<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

10.4.4 Build<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

When building this application, the user can create an application that runs from internal Flash or<br />

External RAM. To select the type of application to build, open the bldc_synchro1.mcp project and<br />

select the target build type; refer to Figure 10-21. Selecting Build All will create all application<br />

build types. A definition of the projects associated with these target build types may be viewed<br />

under the Targets tab of the project window.<br />

Figure 10-21. Target Build Selection<br />

The project may now be built by executing the Make command; seeFigure 10-22. This will build<br />

and link the Synchro PM Motor Control application and all needed Metrowerks and <strong>SDK</strong><br />

libraries.<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-25<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

10.4.5 Execute<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 10-22. Execute Make Command<br />

To execute the Synchro PM Motor Control application, select Project\Debug in the CodeWarrior<br />

IDE, followed by the Run command. For more help with these commands, refer to the<br />

CodeWarrior tutorial documentation in the following file, which is located in the CodeWarrior<br />

installation directory:<br />

\CodeWarrior Documentation\PDF\Targeting_DSP56800.pdf<br />

If the Flash target is selected, CodeWarrior will automatically program the DSP’s internal Flash<br />

with the executable generated during Build. If the External RAM target is selected, the executable<br />

will be loaded to off-chip RAM.<br />

Once Flash has been programmed with the executable, the EVM target system may be run in a<br />

stand-alone mode from Flash. To do this, set the JG2 jumper in the 1-2 configuration to disable<br />

the parallel port and press the RESET button.<br />

Once the application is running, move the RUN/STOP switch to the RUN position and set the<br />

required speed with the UP/DOWN push buttons. Pressing the UP/DOWN buttons should<br />

incrementally increase the motor speed until it reaches maximum speed. If successful, the<br />

Synchro PM Motor will be spinning.<br />

Note: If the RUN/STOP switch is set to the RUN position when the application starts, toggle<br />

the RUN/STOP switch between the STOP and RUN positions to enable motor<br />

spinning. This is a protection feature that prevents the motor from being started when<br />

the application is executed from CodeWarrior.<br />

You should also see a lighted green LED, which indicates that the application is running. If the<br />

application is stopped, the green LED will blink at a 2Hz frequency. If an Undervoltage fault<br />

occurs, the green LED will blink at a frequency of 8Hz.<br />

10-26 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

10.5 BLDC Sensorless with Back-EMF Zero<br />

Crossing Application<br />

This application exercises sensorless control of the BLDC motor on the DSP56F803EVM board<br />

and the EVM Motor Kit.<br />

10.5.1 Files<br />

The BLDC Sensorless with B-EMF Zero Crossing Application is composed of the following<br />

files:<br />

• ...\dsp56803evm\nos\applications\bldc_zerocross\bldczcapplication.c, main program<br />

• ...\dsp56803evm\nos\applications\bldc_zerocross\bldczcdefines.h, main program<br />

definitions<br />

• ...\dsp56803evm\nos\applications\bldc_zerocross\bldc_zerocross.mcp, application<br />

project file<br />

• ...\dsp56803evm\nos\applications\bldc_zerocross\configextram\appconfig.c,<br />

application configuration file for external RAM<br />

• ...\dsp56803evm\nos\applications\bldc_zerocross\configflash\appconfig.c, application<br />

configuration file for Flash<br />

• ...\dsp56803evm\nos\applications\bldc_zerocross\configextram\appconfig.h,<br />

application configuration file for external RAM<br />

• ...\dsp56803evm\nos\applications\bldc_zerocross\configflash\appconfig.h, application<br />

configuration file for Flash<br />

• ...\dsp56803evm\nos\applications\bldc_zerocross\configextram\linker.cmd, linker<br />

command file for external RAM<br />

• ...\dsp56803evm\nos\applications\bldc_zerocross\configflash\linker.cmd, linker<br />

command file for Flash<br />

• ...\dsp56803evm\nos\applications\bldc_zerocross\configflash\flash.cfg, configuration<br />

file for Flash<br />

• ...\dsp56803evm\nos\applications\bldc_zerocross\PCMaster\BLDC demo.pmp,<br />

PCMaster file<br />

These files are located in the <strong>SDK</strong> installation directory.<br />

10.5.2 Specifications<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

This application performs a sensorless control of the BLDC motor on the DSP56F803 processor<br />

with closed loop speed control. In the application, the PWM module is set to independent mode<br />

with a 14.4kHz switching frequency. The state of the zero crossing signals is read from the Input<br />

Monitor Register of the Quadrature Encoder. The masking of the PWM channels is controlled by<br />

the PWM Channel Control Register. The content of this register is derived from Back-EMF zero<br />

crossing signals.<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-27<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The application can run on:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

• External RAM or Flash<br />

• EVM Motor Board; 3-Phase AC/BLDC High-Voltage Power Stage; or 3-Phase AC/BLDC<br />

Low-Voltage Power Stage<br />

• Manual or PC master software Operating Mode<br />

• 115 or 230V AC Power Supply<br />

The correct power stage is identified automatically and the appropriate constants are set.<br />

This BLDC sensorless motor control application can operate in two modes:<br />

1. Manual Operating Mode<br />

The drive is controlled by the RUN/STOP switch, which enables/disables motor<br />

spinning. The required speed is set independently on the commutation by the<br />

UP/DOWN buttons; see Figure 10-23. If the application runs and motor spinning is<br />

disabled, the green user LED, shown in Figure 10-24, will blink. When motor<br />

spinning is enabled, the user LED lights. If Overcurrent or Overvoltage occurs, or if<br />

the wrong pcb is identified, the internal fault logic is asserted and the application<br />

enters a fault state (the green LED does not light).This state can be exited only by an<br />

application RESET. It is strongly recommended that you inspect the entire<br />

application to locate the source of fault before starting it again.<br />

Figure 10-23. RUN/STOP Switch and UP/DOWN Buttons<br />

10-28 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 10-24. USER and PWM LED<br />

2. PC master software (remote) Operating Mode<br />

The drive is controlled remotely from a PC through the SCI communication channel<br />

of the DSP device via an RS-232 physical interface. The drive is enabled by the<br />

RUN/STOP switch, which can be used to safely stop the application at any time.<br />

The following control actions are supported:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

• Start the motor (by setting the required speed on the bar graph)<br />

• Stop the motor (by setting the Zero speed on the bar graph)<br />

• Set the Required Speed of the motor<br />

PC master software displays the following information:<br />

• Required Speed of the motor<br />

• Actual Speed of the motor<br />

• DCBus voltage<br />

• DCBus current<br />

• Temperature of power stage<br />

• Fault status (No Fault, Overvoltage, Undervoltage, Overcurrents in phases, Overcurrent in<br />

DCBus, Overheating)<br />

• Motor status - Running/Stand-by<br />

If the Fault Status is different from No Faults of Overcurrent, Overvoltage or Undervoltage<br />

conditions, or if the wrong pcb was used, the green LED does not light and the motor is stopped.<br />

This state can be exited by an application RESET. It is strongly recommended that you inspect the<br />

entire application to locate the source of the fault before starting it again.<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-29<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Project files for the PC master software are located in:<br />

...nos\applications\bldc_zerocross\PC_Master\bldc_demo.pmp<br />

Start the PC master software window’s application, bldc_demo.pmp. Figure 10-25 illustrates the<br />

PC master software control window for the bldc_demo.pmp.<br />

Note: If the PC master software project (.pmp file) is unable to control the application, it is<br />

possible that the wrong load map (.elf file) has been selected. PC master software uses<br />

the load map to determine addresses for global variables being monitored. Once the<br />

PC master software project has been launched, this option may be selected in the PC<br />

master software window under "Project/Select other Map FileReload".<br />

10.5.3 Set-Up<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 10-25. PC Master Software Control Window<br />

Figure 10-26 illustrates the hardware set-up for BLDC Sensorless with B-EMF Zero Crossing<br />

Application when using an EVM motor board.<br />

10-30 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 10-26. Set-up of the EVM Motor Board BLDC Motor Control Application<br />

The serial cable is needed for PC master software debugging tool only.<br />

Thanks to automatic board identification, the software can also be run on:<br />

• 3-Phase AC/BLDC Low-Voltage Power Stage; see Figure 10-27<br />

• 3-Phase AC/BLDC High-Voltage Power Stage; see Figure 10-28<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-31<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 10-27. Set-up of the Low-Voltage BLDC Motor Control Application<br />

The correct order of phases (phase A, phase B, phase C) for the BLDC motor is:<br />

• phase A = white wire<br />

• phase B = red wire<br />

• phase C = black wire<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

When facing a motor shaft, if the phase order is: phase A, phase B, phase C, the motor shaft<br />

should rotate clockwise (i.e., positive direction, positive speed).<br />

10-32 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 10-28. Set-up of the High-Voltage BLDC Motor Control Application<br />

The correct order of phases (phase A, phase B, phase C) for the BLDC motor is:<br />

• phase A = white wire<br />

• phase B = red wire<br />

• phase C = black wire<br />

When facing a motor shaft, if the phase order is: phase A, phase B, phase C, the motor shaft<br />

should rotate clockwise (i.e., positive direction, positive speed).<br />

10.5.3.1 EVM Jumper Settings<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

To execute the BLDC Sensorless with B-EMF Zero Crossing application, the DSP56F803 board<br />

requires the strap settings shown in Figure 10-29 and Table 10-10.<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-33<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

1 2 3<br />

JG6<br />

JG1<br />

1 2<br />

7 8<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

7 8 9<br />

JG5<br />

9 8 7<br />

3 2 1<br />

1<br />

JG6<br />

2 3<br />

7 8 9<br />

USER LED<br />

LED3<br />

7 8 9<br />

JG7<br />

3 2 1<br />

PWM LEDs<br />

JG7<br />

JG5<br />

JG4<br />

JG10<br />

JG1<br />

1<br />

S2<br />

P4 IRQA<br />

J3<br />

J2<br />

JG10 1 3 JG9<br />

JG3<br />

DSP56F803EVM<br />

Figure 10-29. DSP56F803EVM Jumper Reference<br />

Table 10-10. DSP56F803EVM Jumper Settings<br />

Jumper Group Comment Connections<br />

JG1 UNI-3 serial selected 1-2, 3-4, 5-6, 7-8<br />

JG2 Enable on-board parallel JTAG Command Converter Interface NC<br />

JG3 Use on-board crystal for DSP oscillator input 1-2<br />

JG4 Select DSP’s Mode 0 operation upon exit from reset 1-2<br />

JG5 Enable external SRAM 1-2<br />

JG6 UNI-3 3-Phase Current source selected 2-3, 5-6, 8-9<br />

JG7 Encoder Input Selected for Zero Crossing signals 1-2, 4-5, 7-8<br />

JG8 On-board Parallel JTAG command converter powered by Host system 1-2<br />

JG9 Use on-board crystal for DSP oscillator input 1-2<br />

JG10 Leave CAN bus un-terminated NC<br />

J10<br />

1<br />

Note: When running the EVM target system in a stand-alone mode from Flash, the JG2<br />

jumper must be set in the 1-2 configuration to disable the command converter parallel<br />

port interface.<br />

10-34 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

U15<br />

S3<br />

S/N<br />

RUN/STOP<br />

S4<br />

Y1<br />

U1<br />

P2<br />

J9<br />

1<br />

JG4<br />

JTAG<br />

JG4 S1<br />

JG2 JG8 J1<br />

IRQB<br />

1<br />

JG3<br />

RESET<br />

J8<br />

JG2<br />

JG9<br />

J4<br />

U6 U7<br />

JG8<br />

P3<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

10.5.4 Build<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

To build this application, open the bldc_zerocross.mcp project file and execute the Make<br />

command, as shown in Figure 10-30. This will build and link the BLDC Motor Control<br />

application and all needed Metrowerks and <strong>SDK</strong> libraries.<br />

10.5.5 Execute<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 10-30. Execute Make Command<br />

To execute the BLDC Motor Control application, choose the Program/Debug command in the<br />

CodeWarrior IDE, followed by the Run command. For more help with these commands, refer to<br />

the CodeWarrior tutorial documentation in the following file, which is located in the CodeWarrior<br />

installation directory:<br />

\CodeWarrior Documentation\PDF\Targeting_DSP56800.pdf<br />

Once the application is running, move the RUN/STOP switch to the RUN position and set the<br />

required voltage with the UP/DOWN push buttons. Pressing the UP/DOWN buttons should<br />

incrementally increase the motor speed until it reaches maximum speed. If successful, the BLDC<br />

motor will be spinning.<br />

Note: If the RUN/STOP switch is set to the RUN position when the application starts, toggle<br />

the RUN/STOP switch between the STOP and RUN positions to enable motor<br />

spinning. This is a protection feature that prevents the motor from starting when the<br />

application is executed from CodeWarrior.<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-35<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

10.6 BLDC Sensorless with Back-EMF Zero<br />

Crossing Using AD Converter Application<br />

This application exercises sensorless control of the BLDC motor on the DSP56F803EVM board<br />

and the EVM Motor Kit.<br />

10.6.1 Files<br />

The BLDC Sensorless with B-EMF Zero Crossing using ADC application is composed of the<br />

following files:<br />

• ...\dsp56803evm\nos\applications\bldc_adc_zerocross\bldcadczcapplication.c, main<br />

program<br />

• ...\dsp56803evm\nos\applications\bldc_adc_zerocross\bldcadczcdefines.h, main<br />

program definitions<br />

• ...\dsp56803evm\nos\applications\bldc_adc_zerocross\bldc_adc_zerocross.mcp,<br />

application project file<br />

• ...\dsp56803evm\nos\applications\bldc_adc_zerocross\configextram\appconfig.c,<br />

application configuration file for external RAM<br />

• ...\dsp56803evm\nos\applications\bldc_adc_zerocross\configflash\appconfig.c,<br />

application configuration file for Flash<br />

• ...\dsp56803evm\nos\applications\bldc_adc_zerocross\configextram\appconfig.h,<br />

application configuration file for external RAM<br />

• ...\dsp56803evm\nos\applications\bldc_adc_zerocross\configflash\appconfig.h,<br />

application configuration file for Flash<br />

• ...\dsp56803evm\nos\applications\bldc_adc_zerocross\configextram\linker.cmd,<br />

linker command file for external RAM<br />

• ...\dsp56803evm\nos\applications\bldc_adc_zerocross\configflash\linker.cmd, linker<br />

command file for Flash<br />

• ...\dsp56803evm\nos\applications\bldc_adc_zerocross\configflash\flash.cfg,<br />

configuration file for Flash<br />

• ...\dsp56803evm\nos\applications\bldc_adc_zerocross\PCMaster\BLDC demo.pmp,<br />

PCMaster file<br />

These files are located in the <strong>SDK</strong> installation directory.<br />

10.6.2 Specifications<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

This application performs a sensorless control of the BLDC motor on the DSP56F803 processor<br />

with closed loop speed control. In the application, the PWM module is set to independent mode<br />

with a 10.0kHz switching frequency. The state of the zero crossing signals are read from the Input<br />

Monitor Register of the Quadrature Encoder. The masking of the PWM channels is controlled by<br />

the PWM Channel Control Register. The content of this register is derived from Back-EMF zero<br />

crossing signals.<br />

10-36 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The application can run on:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

• External RAM or Flash<br />

• EVM Motor Board; 3-Phase AC/BLDC High-Voltage Power Stage; or 3-Phase AC/BLDC<br />

Low-Voltage Power Stage<br />

• Manual or PC master software Operating Mode<br />

• 115 or 230V AC Power Supply<br />

The correct power stage is identified automatically and the appropriate constants are set.<br />

This BLDC sensorless motor control application can operate in two modes:<br />

1. Manual Operating Mode<br />

The drive is controlled by the RUN/STOP switch, which enables/disables motor<br />

spinning. The required speed is set independently on the commutation by the<br />

UP/DOWN buttons; refer to Figure 10-31. If the application runs and motor spinning<br />

is disabled, the green user LED, shown in Figure 10-32, will blink. When motor<br />

spinning is enabled, the green user LED lights. If Overcurrent or Overvoltage occur,<br />

or if the wrong pcb is identified, the internal fault logic is asserted and the application<br />

enters a fault state (the green LED does not light).This state can be exited only by an<br />

application RESET. It is strongly recommended that you inspect the entire<br />

application to locate the source of the fault before starting it again.<br />

Figure 10-31. RUN/STOP Switch and UP/DOWN Buttons<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-37<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 10-32. USER and PWM LED<br />

2. PC master software (Remote) Operating Mode<br />

The drive is controlled remotely from a PC through the SCI communication channel<br />

of the DSP device via an RS-232 physical interface. The drive is enabled by the<br />

RUN/STOP switch, which can be used to safely stop the application at any time.<br />

The following control actions are supported:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

• Start the motor (by setting the required speed on the bar graph)<br />

• Stop the motor (by setting the Zero speed on the bar graph)<br />

• Set the Required Speed of the motor<br />

PC master software displays the following information:<br />

• Required Speed of the motor<br />

• Actual Speed of the motor<br />

• DC - bus voltage<br />

• DC - bus current<br />

• Temperature of power stage<br />

• Fault status (No Fault, Overvoltage, Undervoltage, Overcurrents in phases, Overcurrent in<br />

DCBus, Overheating)<br />

• Motor status - Running/Stand-by<br />

If the Fault Status is different from the No Faults of Overcurrent, Overvoltage or Undervoltage<br />

conditions, or if the wrong pcb is being used, the green LED will not light and the motor will be<br />

stopped. This state can be exited by an application RESET. It is strongly recommended that you<br />

inspect the entire application to locate the source of the fault before starting it again.<br />

10-38 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Project files for the PC master software are located in:<br />

...nos\applications\bldc_adc_zerocross\PC_Master\bldc_demo.pmp<br />

Start the PC master software window’s application, bldc_demo.pmp. Figure 10-33 shows the PC<br />

master software control window for bldc_demo.pmp.<br />

Note: If the PC master software project (.pmp file) is unable to control the application, it is<br />

possible that the wrong load map (.elf file) has been selected. PC master software uses<br />

the load map to determine addresses for global variables being monitored. Once the<br />

PC master software project has been launched, this option may be selected in the PC<br />

master software window under "Project/Select other Map FileReload".<br />

Figure 10-33. PC Master Software Control Window<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-39<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

10.6.3 Set-up<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 10-34 illustrates the hardware set-up for the BLDC Sensorless with B-EMF Zero Crossing<br />

using ADC application when using the EVM motor board.<br />

NOT NEEDED<br />

Figure 10-34. Set-up of the EVM motor board BLDC Motor Control Application<br />

The serial cable is needed for the PC master software debugging tool only.<br />

Thanks to automatic board identification, the software can also be run on:<br />

• 3-Phase AC/BLDC Low-Voltage Power Stage; see Figure 10-35<br />

• 3-Phase AC/BLDC High-Voltage Power Stage; see Figure 10-36<br />

10-40 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 10-35. Set-upof the Low-Voltage BLDC Motor Control Application<br />

The correct order of phases (phase A, phase B, phase C) for the BLDC motor is:<br />

• phase A = white wire<br />

• phase B = red wire<br />

• phase C = black wire<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

When facing a motor shaft, if the phase order is: phase A, phase B, phase C, the motor shaft<br />

should rotate clockwise (i.e., positive direction, positive speed).<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-41<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 10-36. Set-up of the High-Voltage BLDC Motor Control Application<br />

The correct order of phases (phase A, phase B, phase C) for the BLDC motor is:<br />

• phase A = white wire<br />

• phase B = red wire<br />

• phase C = black wire<br />

When facing a motor shaft, if the phase order is: phase A, phase B, phase C, the motor shaft<br />

should rotate clockwise (i.e., positive direction, positive speed).<br />

10.6.3.1 EVM Jumper Settings<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

To execute the BLDC Sensorless with B-EMF Zero Crossing using ADC application, the<br />

DSP56F803 board requires the strap settings shown in Figure 10-37 and Table 10-11.<br />

10-42 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

1 2 3<br />

JG6<br />

JG1<br />

1 2<br />

7 8<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

7 8 9<br />

JG5<br />

9 8 7<br />

3 2 1<br />

1 2 3<br />

JG6<br />

7 8 9<br />

USER LED<br />

LED3<br />

7 8 9<br />

JG7<br />

3 2 1<br />

PWM LEDs<br />

JG7<br />

JG5<br />

JG4<br />

JG10<br />

JG1<br />

1<br />

S2<br />

P4 IRQA<br />

DSP56F803EVM<br />

Figure 10-37. DSP56F803EVM Jumper Reference<br />

Table 10-11. DSP56F803EVM Jumper Settings<br />

Jumper Group Comment Connections<br />

JG1 UNI-3 serial selected 1-2, 3-4, 5-6, 7-8<br />

JG2 Enable on-board parallel JTAG Command Converter Interface NC<br />

JG3 Use on-board crystal for DSP oscillator input 1-2<br />

JG4 Select DSP’s Mode 0 operation upon exit from reset 1-2<br />

JG5 Enable external SRAM 1-2<br />

JG6 UNI-3 3-Phase B-EMF Voltages source selected 1-2, 4-5, 7-8<br />

JG7 Encoder Input Selected for Zero Crossing signals 1-2, 4-5, 7-8<br />

JG8 On-board Parallel JTAG command converter powered by Host system 1-2<br />

JG9 Use on-board crystal for DSP oscillator input 1-2<br />

JG10 Leave CAN bus un-terminated NC<br />

J3<br />

J2<br />

JG10 1 3 JG9<br />

JG3<br />

Note: When running the EVM target system in a stand-alone mode from Flash, the JG2<br />

jumper must be set in the 1-2 configuration to disable the command converter parallel<br />

port interface.<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-43<br />

J10<br />

1<br />

U15<br />

S3<br />

S/N<br />

RUN/STOP<br />

S4<br />

Y1<br />

U1<br />

P2<br />

J9<br />

1<br />

JG4<br />

JTAG<br />

JG4 S1<br />

JG2 JG8 J1<br />

IRQB<br />

1<br />

JG3<br />

RESET<br />

J8<br />

JG2<br />

JG9<br />

J4<br />

U6 U7<br />

JG8<br />

P3<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

10.6.4 Build<br />

To build this application, open the bldc_adc_zerocross.mcp project file and execute the Make<br />

command, as shown in Figure 10-38. This will build and link the BLDC Motor Control<br />

application and all needed Metrowerks and <strong>SDK</strong> libraries<br />

10.6.5 Execute<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 10-38. Execute Make Command<br />

To execute the BLDC Motor Control application, choose the Program/Debug command in the<br />

CodeWarrior IDE, followed by the Run command. For more help with these commands, refer to<br />

the CodeWarrior tutorial documentation in the following file, which is located in the CodeWarrior<br />

installation directory:<br />

\CodeWarrior Documentation\PDF\Targeting_DSP56800.pdf<br />

Once the application is running, move the RUN/STOP switch to the RUN position and set the<br />

required voltage with the UP/DOWN push buttons. Pressing the UP/DOWN buttons should<br />

incrementally increase the motor speed until it reaches maximum speed. If successful, the BLDC<br />

motor will be spinning.<br />

Note: If the RUN/STOP switch is set to the RUN position when the application starts, toggle<br />

the RUN/STOP switch between the STOP and RUN positions to enable motor<br />

spinning. This is a protection feature that prevents the motor from starting when the<br />

application is executed from CodeWarrior.<br />

10-44 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

10.7 3-Phase PM Synchronous Motor Vector Control<br />

This application exercises vector control of the 3-Phase Permanent Magnet (PM) synchronous<br />

motor on the DSP56F803EVM board and 3-phase AC/BLDC High-Voltage power stage.<br />

10.7.1 Files<br />

The 3-Phase PM synchronous Motor Control application is composed of the following files:<br />

• ...\dsp56803evm\nos\applications\3ph_PMSM_VectorControl\3ph_PMSM_VectorControl.c,<br />

main program<br />

• ...\dsp56803evm\nos\applications\3ph_PMSM_VectorControl\3ph_PMSM_VectorControl.h,<br />

main header file of the program used for storing application references and defined<br />

constants that are required by the 3ph_PMSM_VectorControl.c file.<br />

• ...\dsp56803evm\nos\applications\3ph_PMSM_VectorControl\appconst.c, application<br />

constants for Data flash<br />

• ...\dsp56803evm\nos\applications\3ph_PMSM_VectorControl\appconst.h, header file to<br />

store the external references and defined constants related to the appconst.c file<br />

• ...\dsp56803evm\nos\applications\3ph_PMSM_VectorControl\3ph_PMSM_VectorControl.mcp<br />

application project file<br />

• ...\dsp56803evm\nos\applications\3ph_PMSM_VectorControl\configextram\appconfig.c,<br />

application configuration file for external RAM<br />

• ...\dsp56803evm\nos\applications\3ph_PMSM_VectorControl\configflash\appconfig.c,<br />

application configuration file for Flash<br />

• ...\dsp56803evm\nos\applications\3ph_PMSM_VectorControl\configextram\appconfig.h,<br />

application configuration header file for external RAM<br />

• ...\dsp56803evm\nos\applications\3ph_PMSM_VectorControl\configflash\appconfig.h,<br />

application configuration header file for Flash<br />

• ...\dsp56803evm\nos\applications\3ph_PMSM_VectorControl\configextram\linker.cmd,<br />

linker command file for external RAM<br />

• ...\dsp56803evm\nos\applications\3ph_PMSM_VectorControl\configflash\linker.cmd, linker<br />

command file for Flash<br />

• ...\dsp56803evm\nos\applications\3ph_PMSM_VectorControl\configflash\flash.cfg,<br />

configuration file for Flash<br />

These files are located in the <strong>SDK</strong> installation directory.<br />

10.7.2 Specifications<br />

The 3-Phase PM Synchronous Motor Vector Control Application demonstrates the Permanent<br />

Magnet Synchronous Motor Control application using field-oriented theory on the DSP56F803<br />

processor.<br />

System Outline<br />

The application has the following specifications:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

• Vector control technique used for Permanent Magnet (PM) synchronous motor control<br />

• Speed control loop<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-45<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

• Targeted for DSP56F803EVM<br />

• Running on 3-phase Permanent Magnet (PM) synchronous motor control development<br />

platform at variable line voltage 115V AC and 230V AC (range -15% to +10%)<br />

• Motor mode<br />

• Generator mode<br />

• DCBus brake<br />

• Minimum speed 50 rpm<br />

• Maximum speed 3000 rpm at input power line 230V AC<br />

• Maximum speed 1500 rpm at input power line 115V AC<br />

• Power stage and optoisolation board identification<br />

• Fault protection<br />

• Manual interface (RUN/STOP switch, UP/DOWN push buttons control, LED indication)<br />

• PC master software remote control interface (START MOTOR/STOP MOTOR push<br />

buttons, speed set-up)<br />

• PC master software remote monitor<br />

— PC master software monitor interface (required speed; actual motor speed; PC master software<br />

mode; START MOTOR/STOP MOTOR controls; drive fault status; DCBus voltage level;<br />

identified power stage boards; drive status; mains detection)<br />

— PC master software speed scope (observes actual and desired speed)<br />

Application Description<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The vector control algorithm is calculated on Motorola DSP56F803. The algorithm generates the<br />

3-phase PWM signals for the Permanent Magnet (PM) synchronous motor inverter according to<br />

the user-required inputs, measured and calculated signals.<br />

The concept of the PMSM drive incorporates the following hardware components:<br />

• BLDC motor-brake set<br />

• 3-phase AC/BLDC high voltage power stage<br />

• DSP56F803EVM boards<br />

• ECOPTINL - In-line optoisolation box, which is connected between the host computer and<br />

the DSP56F803EVM<br />

The BLDC motor-brake set incorporates a 3-phase BLDC motor and attached BLDC motor<br />

brake. The BLDC motor has six poles. The incremental position sensor (encoder) is coupled on<br />

the motor shaft and position Hall Sensors are mounted between the motor and the brake. They<br />

allow position sensing if required by the control algorithm. Detailed motor--brake specifications<br />

are shown in Table 10-12.<br />

Table 10-12. Motor - Brake Specifications<br />

Motor Characteristics Motor Type 6 poles, 3-phase, star connected,<br />

BLDC motor<br />

Speed Range 2500 rpm (at 310V)<br />

Max. Electrical Power 150 W<br />

Phase Voltage 3*220V<br />

Phase Current 0.55A<br />

10-46 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 10-12. Motor - Brake Specifications<br />

Drive Characteristics Speed Range < 2500 rpm<br />

The following software tools are needed for compiling, debugging, loading to the EVM, remote<br />

control and monitoring:<br />

• Metrowerks CodeWarrior 4.0<br />

• PC master software<br />

• <strong>SDK</strong> 2.4 or later<br />

The drive can be controlled in two different operating modes:<br />

• Manual operating mode - the required speed is set by UP/DOWN push buttons; the drive is<br />

started and stopped by the RUN/STOP switch on the EVM board<br />

• PC master software operating mode - the required speed is set by the PC master software<br />

active bar graph; the drive is started and stopped by the START MOTOR and STOP<br />

MOTOR controls.<br />

Measured quantities:<br />

• DCBus voltage<br />

• Phase currents (phase A, phase B, phase C)<br />

• Power module temperature<br />

• Rotor speed<br />

The faults used for drive protection:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

• Overvoltage (PC master software error message = Overvoltage fault)<br />

• Undervoltage (PC master software error message = Undervoltage fault)<br />

• Overcurrent (PC master software error message = Overcurrent fault)<br />

• Overheating (PC master software error message = Overheating fault)<br />

• Wrong-hardware (PC master software error message = Wrong HW used)<br />

States of the application state machine; see Table 10-13:<br />

Input Voltage 310V DC<br />

Max DCBus Voltage 380 V<br />

Control Algorithm Speed Closed Loop Control<br />

Optoisolation Required<br />

Motor Characteristics Motor Type 6 poles, 3-phase, star connected,<br />

BLDC motor<br />

Speed Range 2500 rpm (at 310V)<br />

Max. Electrical Power 150 W<br />

• INIT - application initialization; operating mode changing<br />

• STOP - PWM outputs disabled; operating mode changing<br />

• RUN - PWM outputs enabled; motor running<br />

FAULT - PWM outputs disabled; waiting for manual fault acknowledgement<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-47<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Control Process<br />

After RESET, the drive enters the INIT state in MANUAL operation mode. When the<br />

RUN/STOP switch is detected in the STOP position and there are no faults pending, the STOP<br />

application state is entered. Otherwis, the drive waits in the INIT state or, if faults occur, goes to<br />

the FAULT state. In the INIT and STOP states, the operation mode can be changed from<br />

PCMaster. In the MANUAL operational mode, the application is operated by the RUN/STOP<br />

switch and UP/DOWN buttons; in the PCMaster remote mode, the application is operated<br />

remotely by the PCMaster.<br />

When the start command is accepted (using the RUN/STOP Switch or the PC master software<br />

command) the rotor position is aligned to a predefined position to begin at a known rotor position.<br />

The rotor alignment is done at the first start command only. The required speed is then calculated<br />

via the UP/DOWN push buttons in manual mode or PC master software commands in PC master<br />

software remote mode. The required speed goes through an acceleration/deceleration ramp. The<br />

comparison between the actual speed command and the measured speed generates a speed error.<br />

Based on the error, the speed controller generates a stator current Is_qReq which correspond to<br />

torque. A second part of the stator current Is_dReq, which correspond to flux, is given by the Field<br />

Weakening Controller. Simultaneously, the stator curents Is_a, Is_b and Is_c are measured and<br />

transformed from instantaneous values to the stationary reference frame α, β and consecutively to<br />

the rotary reference frame d-q (Clarke-Park transformation). Based on the errors between required<br />

and actual currents in the rotary reference frame, the current controllers generate output voltages<br />

Us_q and Us_d (in the rotary reference frame d-q). The voltages Us_q and Us_d are transformed<br />

back to the stationary reference frame α, β and, after DCBus ripple elimination, are recalculated<br />

to the 3-phase voltage system which is applied on the motor.<br />

Drive Protection<br />

The DCBus voltage, DCBus current and power stage temperature are measured during the control<br />

process. They protect the drive from Overvoltage, Undervoltage, Overcurrent and Overheating.<br />

The Undervoltage and Overheating protection is performed by software, while the Overcurrent<br />

and Overvoltage fault signal utilizes a fault input of the DSP. The power stage is identified using<br />

board identification. If the correct power stage is not identified, the fault "Wrong Power Stage"<br />

disables the drive operation. Line voltage is measured during application initializationand the<br />

application automatically adjusts itself to run at either 115V AC or 230V AC, depending on the<br />

measured value.<br />

If any of the above-mentioned faults occur, the motor control PWM outputs are disabled to<br />

protect the drive, and the application enters the FAULT state. The FAULT state can be left only<br />

when the fault conditions disappear and the RUN/STOP switch is moved to the STOP position in<br />

manual mode and by PC master software in PC master software remote mode.<br />

The application can run on:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

• External RAM or Flash<br />

• 3-Phase AC/BLDC High-Voltage Power Stage powered by 115V AC or 230V AC<br />

• Manual or PC master software Operating Mode<br />

The correct power stage and voltage level is identified automatically and the appropriate<br />

constants are set.<br />

10-48 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The 3-phase PM synchronous motor control application can operate in two modes:<br />

1. Manual Operating Mode<br />

The drive is controlled by the RUN/STOP switch. The motor speed is set by the UP<br />

and DOWN push buttons (see Figure 10-39). The actual state of the application is<br />

indicated by the user LEDs (see Figure 10-40). If the application runs and motor<br />

spinning is disabled (i.e., the system is ready), the GREEN user LED will flash at a<br />

frequency of 2Hz. When motor spinning is enabled, the GREEN user LED will be<br />

On. If a fault occurs on the power stage, the GREEN user LED will flash at a<br />

frequency of 8Hz. The actual state of the PWM outputs are indicated by PWM output<br />

LEDs.<br />

Figure 10-39. RUN/STOP Switch and UP/DOWN Buttons<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-49<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 10-40. USER and PWM LEDs<br />

Table 10-13. Application States<br />

Application State Motor State Green LED State<br />

INIT Stopped Blinking at a frequency of 2Hz (slow)<br />

STOP Stopped Blinking at a frequency of 2Hz (slow)<br />

RUN Spinning On<br />

FAULT Stopped Blinking at a frequency of 8Hz (fast)<br />

2. PC master software (Remote) Operating Mode<br />

The drive is controlled remotely from a PC through the SCI communication channel<br />

of the DSP device via an RS-232 physical interface. The PC master software control<br />

can be taken over only if the RUN/STOP switch is in the STOP position; until then,<br />

the push buttons and RUN/STOP switch has no effect on the application control.<br />

The following PC master software control actions are supported:<br />

• Set PC master software Mode of the motor control system<br />

• Set Manual Mode of the motor control system<br />

• Start the motor<br />

• Stop the motor<br />

• Set the Required Speed of the motor<br />

10-50 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

PC master software displays the following information:<br />

• Required Speed of the motor<br />

• Actual Speed of the motor<br />

• Application status - Init/Stop/Run/Fault<br />

• DCBus voltage level<br />

• Identified line voltage<br />

• Fault Status - No_Fault/Overvoltage/Overcurrent/Undervoltage/Overheating<br />

• Identified Power Stage<br />

Project files for the PC master software are located in:<br />

...\nos\applications\3ph_PMSM_VectorControl\PC_Master\3ph_PMSM_VectorControl.pmp<br />

Start the PC master software window’s application, 3ph_PMSM_VectorControl.pmp. Figure 10-41<br />

shows the PC master software control window after this project has been launched.<br />

Note: If the PC master software project (.pmp file) is unable to control the application, it is<br />

possible that the wrong load map (.elf file) has been selected. PC master software uses<br />

the load map to determine addresses for global variables being monitored. Once the<br />

PC master software project has been launched, this option may be selected in the PC<br />

master software window under Project/Select Other Map File.<br />

Figure 10-41. PC Master Software Control Window<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-51<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

10.7.3 Set-up<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 10-42 illustrates the hardware set-up for the 3-phase PM Synchronous Motor Control<br />

application. The EVM board, power stage and motor are mounted into a suitcase for<br />

demonstration purposes.<br />

WARNING:<br />

Danger, high-voltage--risk of electric shock!<br />

The application PCB modules and serial interface (connector,<br />

cable) are not electrically isolated from the mains voltage--they<br />

are live.<br />

Use the In-line Optoisolation Box (ECOPTINL) between the<br />

PC and DSP56803 EVM as protection from dangerous voltage<br />

on the PC-user side, and to prevent damage to the PC and other<br />

hardware.<br />

Do not touch any part of the EVM or the serial cable between<br />

the EVM and the In-line Optoisolation Box unless you are<br />

using an insulation transformer. The application is designed to<br />

be fully controllable only from PC master software.<br />

To avoid inadvertently touching live parts, use plastic cover.<br />

In the rest of this application, the description supposes the use of an insulation transformer.<br />

10-52 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 10-42. Set-up of the 3-phase PM Synchronous Motor Control Application<br />

The correct order of phases (phase A, phase B, phase C) for the PM Synchronous motor is:<br />

• phase A = white wire<br />

• phase B = red wire<br />

• phase C = black wire<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

When facing a motor shaft, if the phase order is: phase A, phase B, phase C, the motor shaft<br />

should rotate clockwise (i.e., positive direction, positive speed).<br />

For detailed information, see the DSP56F803 Evaluation Module Hardware Reference<br />

Manual. The serial cable is needed for the PC master software debugging/control.<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-53<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

10.7.3.1 PM Synchronous Motor Versus BLDC Motor<br />

The application software is targeted for a PM synchronous motor with sine-wave Back-EMF<br />

shape. In this particular demo application, a BLDC motor is used instead, due to the availability of<br />

the BLDC motor - Brake SM40V+SG40N, supplied as ECMTRHIVBLDC. Although the<br />

Back-EMF shape of this motor is not ideally sine-wave, it can be controlled by the application<br />

software. The drive parameters will be improved when a PMSM motor with exact sine-wave<br />

Back-EMF shape is used.<br />

10.7.3.2 EVM Jumper Settings<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

To execute the 3-Phase PM Synchronous Motor Control application, the DSP56F803 board<br />

requires the strap settings shown in Figure 10-43 and Table 10-14.<br />

1 2 3<br />

JG6<br />

7 8 9<br />

JG1<br />

1 2<br />

7 8<br />

JG5<br />

9 8 7<br />

3 2 1<br />

1 2 3<br />

JG6<br />

7 8 9<br />

USER LED<br />

JG7<br />

3 2 1<br />

LED3<br />

7 8 9<br />

PWM LEDs<br />

JG7<br />

JG5<br />

JG4<br />

JG10<br />

JG1<br />

1<br />

P4 IRQA<br />

DSP56F803EVM<br />

Figure 10-43. DSP56F803EVM Jumper Reference<br />

Table 10-14. DSP56F803EVM Jumper Settings<br />

Jumper Group Comment Connections<br />

S2<br />

JG1 UNI-3 serial selected 1-2, 3-4, 5-6, 7-8<br />

JG2 Enable on-board parallel JTAG Command Converter Interface 1-2<br />

JG3 Use on-board crystal for DSP oscillator input 1-2<br />

JG4 Select DSP’s Mode 0 operation upon exit from reset 1-2<br />

10-54 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

J3<br />

J2<br />

JG10 1 3 JG9<br />

JG3<br />

J10<br />

1<br />

U15<br />

S3<br />

S/N<br />

RUN/STOP<br />

S4<br />

Y1<br />

U1<br />

P2<br />

J9<br />

1<br />

JG4<br />

JTAG<br />

JG4 S1<br />

JG2 JG8 J1<br />

IRQB<br />

1<br />

JG3<br />

RESET<br />

J8<br />

JG2<br />

JG9<br />

J4<br />

U6 U7<br />

JG8<br />

P3<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 10-14. DSP56F803EVM Jumper Settings<br />

Jumper Group Comment Connections<br />

JG5 Enable external SRAM 1-2<br />

JG6 UNI-3 3-Phase Current source selected 2-3, 5-6, 8-9<br />

JG7 Encoder Input Selected for Hall Sensor signals 2-3, 5-6, 8-9<br />

JG8 On-board Parallel JTAG command converter powered by Host system 1-2<br />

JG9 Use on-board crystal for DSP oscillator input 1-2<br />

JG10 Leave CAN bus un-terminated NC<br />

Note: When running the EVM target system in a stand-alone mode from Flash, the JG2<br />

jumper must be set in the 1-2 configuration to disable the command converter parallel<br />

port interface. For this application, this is permanently set as short-connected.<br />

10.7.4 .Build<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

When building this application, the user can create an application that runs from internal Flash or<br />

External RAM. To select the type of application to build, open the<br />

3ph_PMSM_VectorControl.mcp project and select the target build type; see Figure 10-44.<br />

Selecting Build All will build all application build types. A definition of the projects associated<br />

with these target build types may be viewed under the Targets tab of the project window.<br />

Figure 10-44. Target Build Selection<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-55<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

To make this application, open the 3ph_PMSM_VectorControl.mcp project file and execute the<br />

Make command, shown in Figure 10-45. This will build and link the 3-phase PM Synchronous<br />

Motor Control application and all needed Metrowerks and <strong>SDK</strong> libraries<br />

10.7.5 Execute<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 10-45. Execute Make Command<br />

To execute the 3-phase PM Synchronous Motor Control application, choose the Program/Debug<br />

command in the CodeWarrior IDE, followed by the Run command. For more help with these<br />

commands, refer to the CodeWarrior tutorial documentation in the following file located in the<br />

CodeWarrior installation directory:<br />

\CodeWarrior Documentation\PDF\Targeting_DSP56800.pdf<br />

If the Flash target is selected, CodeWarrior will automatically program the DSP’s internal Flash<br />

with the executable generated during Build. If the External RAM target is selected, the executable<br />

will be loaded to off-chip RAM.<br />

Once Flash has been programmed with the executable, the EVM target system may be run in a<br />

stand-alone mode from Flash. When loading is finished, the JG4 jumper must be connected to<br />

boot from internal Flash and the RESET button pushed.<br />

Once the application is executing, the motor can be started. When the switch is moved from the<br />

STOP position to the RUN position, the motor will start. The speed can be changed by the<br />

UP/DOWN buttons. Pressing the UP/DOWN buttons should incrementally increase the motor<br />

speed until it reaches maximum speed.<br />

Note: If the RUN/STOP switch is set to the RUN position when the application starts, toggle<br />

the RUN/STOP switch between the STOP and RUN positions to enable motor<br />

spinning. This is a protection feature that prevents the motor from starting when the<br />

application is executed from CodeWarrior.<br />

You should also see blinking or lighted LEDs which indicate the application’s status.<br />

10-56 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

10.7.6 PC Master Software<br />

To run the application from Flash or ExtRAM, perform the following steps to set the PC master<br />

software control:<br />

• The RUN/STOP switch must be in the STOP position<br />

• Check the PC master software mode on the PC master software control page<br />

• The motor can be started by pressing the Start PC master software push button and stopped<br />

by pushing the Stop PC master software push button<br />

• The speed can be set by the bar graph<br />

When the RUN/STOP switch on the EVM is in the STOP position, the manual mode can be set<br />

again by unchecking the PC master software mode on the PC master software control page.<br />

The application can be monitored in PC master software during both the PC master software<br />

mode and the manual mode.<br />

PC master software displays the following information:<br />

• Operation mode<br />

• Application state<br />

• RUN/STOP switch state<br />

• Change operation mode request<br />

• PC master software Start/Stop<br />

• Mains<br />

• Fault status<br />

• Actual speed<br />

• Required speed<br />

• PC master software required speed<br />

• Power stage temperature<br />

• Identified power stage<br />

The following windows are available:<br />

Speed Scope monitors:<br />

• Required Speed<br />

• Actual Speed<br />

• Desired Id Current<br />

• Desired Iq Current<br />

Speed Recorder monitors:<br />

• Required Speed<br />

• Actual Speed<br />

• Desired Id Current<br />

• Desired Iq Current<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The recorder can be used only when the application is running from External RAM due to the<br />

limited on-chip memory. The length of the recorded window may be set in “Recorder Properties”<br />

=> bookmark “Main” => “Recorded Samples”. It is limited by the dedicated memory space in the<br />

appconfig.h file. The recorder samples are taken every 125µsec.<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-57<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

10.8 3-Phase SR Motor Control Application<br />

This application exercises a principal control of the 3-Phase Switched Reluctance (SR) motor<br />

with Hall Sensors on the DSP56F803EVM board, Optoisolation board, and 3-phase SR<br />

High-Voltage power stage.<br />

10.8.1 Files<br />

The 3-Phase SR Motor Control application is composed of the following files:<br />

• ...\dsp56803evm\nos\applications\3ph_SRM_Hall_Sensor_Type1\3ph_SRM_Hall_Sensor_Type1.c,<br />

main program<br />

• ...\dsp56803evm\nos\applications\3ph_SRM_Hall_Sensor_Type1\3ph_SRM_Hall_Sensor_Type1.mcp,<br />

application project file<br />

• ...\dsp56803evm\nos\applications\3ph_SRM_Hall_Sensor_Type1\configextram\appconfig.c,<br />

application configuration file for external RAM<br />

• ...\dsp56803evm\nos\applications\3ph_SRM_Hall_Sensor_Type1\configflash\appconfig.c,<br />

application configuration file for Flash<br />

• ...\dsp56803evm\nos\applications\3ph_SRM_Hall_Sensor_Type1\configextram\appcon-fig.h,<br />

application configuration file for external RAM<br />

• ...\dsp56803evm\nos\applications\3ph_SRM_Hall_Sensor_Type1\configflash\appconfig.h,<br />

application configuration file for Flash<br />

• ...\dsp56803evm\nos\applications\3ph_SRM_Hall_Sensor_Type1\configextram\linker.cmd, linker<br />

command file for external RAM<br />

• ...\dsp56803evm\nos\applications\3ph_SRM_Hall_Sensor_Type1\configflash\linker.cmd, linker<br />

command file for Flash<br />

• ...\dsp56803evm\nos\applications\3ph_SRM_Hall_Sensor_Type1\configflash\flash.cfg, configuration<br />

file for Flash<br />

These files are located in the <strong>SDK</strong> installation directory.<br />

10.8.2 Specifications<br />

This application performs a principal control of the 3-phase SR motor with Hall Sensors on the<br />

DSP56F803 processor. The control technique sets the motor speed ([rpm]) to the required value<br />

using the speed closed loop with Hall position Sensors to derive the proper commutation<br />

action/moment. Protection is provided against Overcurrent, Overvoltage, Undervoltage, and<br />

Overheating drive faults.<br />

The application can run on:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

• External RAM or Flash<br />

• 3-Phase SR High-Voltage Power Stage powered by 115 or 230V AC<br />

• 3-Phase SR Low-Voltage Power Stage powered by 12V DC<br />

• Manual or PC master software Operating Mode<br />

The correct power stage and voltage level is identified automatically and the appropriate<br />

constants are set.<br />

10-58 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

This 3-phase SR motor control application can operate in two modes:<br />

1. Manual Operating Mode<br />

The drive is controlled by the RUN/STOP switch. The motor speed is set by UP and<br />

DOWN push buttons; see Figure 10-46. The actual state of the application is indicated<br />

by the USER LED. If the application runs and motor spinning is disabled, (i.e., the<br />

system is ready), the green USER LED will be flashing at a frequency of 4Hz. When<br />

motor spinning is enabled, the GREEN user LED will be ON. In the case of a fault<br />

on the power stage the green USER LED will blink at a frequency of 8Hz. If the<br />

wrong power board is identified, the green USER LED will blink at a frequency of<br />

1Hz. The actual state of the PWM outputs are indicated by PWM output LEDs; see<br />

Figure 10-47.<br />

Figure 10-46. RUN/STOP Switch and UP/DOWN Buttons<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-59<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 10-47. USER and PWM LEDs<br />

2. PC master software (Remote) Operating Mode<br />

The drive is controlled remotely from a PC through the SCI communication channel<br />

of the DSP device via an RS-232 physical interface. The drive is enabled by the<br />

RUN/STOP switch, which can be used to stop the application safely at any time.<br />

The following control actions are supported:<br />

• Set PC master software Mode of the motor control system<br />

• Set Manual Mode of the motor control system<br />

• Start the motor<br />

• Stop the motor<br />

• Set the Required Speed of the motor<br />

PC master software displays the following information:<br />

• Required Speed of the motor<br />

• Actual Speed of the motor<br />

• Motor status - Running/Stand-by<br />

• Fault Status<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Project files for the PC master software are located in:<br />

...nos\applications\3ph_srm_hall_sensor_type1\PC_Master\3ph_sr_drive.pmp<br />

Start the PC master software windows application, 3ph_SR_Drive.pmp. Figure 10-48 shows the<br />

PC master software control window after this project has been launched.<br />

10-60 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Note: If the PC master software project (.pmp file) is unable to control the application, it is<br />

possible that the wrong load map (.elf file) has been selected. PC master software uses<br />

the load map to determine addresses for global variables being monitored. Once the<br />

PC master software project has been launched, this option may be selected in the PC<br />

master software window under Project/Select Other Map FileReload.<br />

10.8.3 Set-up<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 10-48. PC Master Software Control Window<br />

Figure 10-49 and Figure 10-50 illustrate the hardware set-up for 3-phase SR Motor Control<br />

applications. The Hall Sensors’ connector on the motor must be attached to connector J2 on the<br />

EVM Board.<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-61<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 10-49. Set-up of the 3-phase HV SR Motor Control Application<br />

10-62 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 10-50. Set-up of the 3-phase LV SR Motor Control Application<br />

The correct order of phases (phase A, phase B, phase C) for the SR motor is:<br />

• Phase A = white wire<br />

• Phase B = red wire<br />

• Phase C = black wire<br />

When facing a motor shaft, the motor shaft should rotate clockwise (i.e., positive direction,<br />

positive speed).<br />

For detailed information, see the DSP56F803 Evaluation Module Hardware Reference<br />

Manual. The serial cable is needed for the PC master software debugging tool only.<br />

10.8.3.1 EVM Jumper Settings<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

To execute the 3-Phase SR Motor Control application, the DSP56F803 board requires the strap<br />

settings shown in Figure 10-51 and Table 10-15.<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-63<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

1 2 3<br />

JG6<br />

7 8 9<br />

JG1<br />

1 2<br />

7 8<br />

JG5<br />

9 8 7<br />

3 2 1<br />

1 2 3<br />

JG6<br />

7 8 9<br />

USER LED<br />

LED3<br />

7 8 9<br />

JG7<br />

3 2 1<br />

PWM LEDs<br />

JG7<br />

JG5<br />

JG4<br />

JG10<br />

JG1<br />

1<br />

P4 IRQA<br />

DSP56F803EVM<br />

Figure 10-51. DSP56F803EVM Jumper Reference<br />

Table 10-15. DSP56F803EVM Jumper Settings<br />

Jumper Group Comment Connections<br />

JG1 UNI-3 serial selected 1-2, 3-4, 5-6, 7-8<br />

JG2 Enable on-board parallel JTAG Command Converter Interface NC<br />

JG3 Use on-board crystal for DSP oscillator input 1-2<br />

JG4 Select DSP’s Mode 0 operation upon exit from reset 1-2<br />

JG5 Enable external SRAM 1-2<br />

JG6 UNI-3 3-Phase Current source selected 2-3, 5-6, 8-9<br />

JG7 Encoder Input Selected for Hall Sensor signals 2-3, 5-6, 8-9<br />

JG8 On-board Parallel JTAG command converter powered by Host system 1-2<br />

JG9 Use on-board crystal for DSP oscillator input 1-2<br />

JG10 Leave CAN bus un-terminated NC<br />

S2<br />

10-64 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

J3<br />

J2<br />

JG10 1 3 JG9<br />

JG3<br />

J10<br />

1<br />

U15<br />

S3<br />

S/N<br />

RUN/STOP<br />

S4<br />

Y1<br />

U1<br />

P2<br />

J9<br />

1<br />

JG4<br />

JTAG<br />

JG4 S1<br />

JG2 JG8 J1<br />

IRQB<br />

1<br />

JG3<br />

RESET<br />

J8<br />

JG2<br />

JG9<br />

J4<br />

U6 U7<br />

JG8<br />

P3<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Note: When running the EVM target system in a stand-alone mode from Flash, the JG2<br />

jumper must be set in the 1-2 configuration to disable the command converter parallel<br />

port interface<br />

10.8.4 .Build<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

When building this application, the user can create an application that runs from internal Flash or<br />

External RAM. To select the type of application to build, open the<br />

3ph_SRM_Hall_Sensor_Type1.mcp project and select the target build type; see Figure 10-52.<br />

Selecting Build All will build all application build types. A definition of the projects associated<br />

with these target build types may be viewed under the Targets tab of the project window.<br />

Figure 10-52. Target Build Selection<br />

To make this application, open the 3ph_SRM_Hall_Sensor_Type1.mcp project file and execute<br />

the Make command, shown in Figure 10-53. This will build and link the 3-phase SR Motor<br />

Control application and all needed Metrowerks and <strong>SDK</strong> libraries<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-65<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

10.8.5 Execute<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 10-53. Execute Make Command<br />

To execute the 3-phase SR Motor Control application, choose the Program/Debug command in<br />

the CodeWarrior IDE, followed by the Run command.For more help with these commands, refer<br />

to the CodeWarrior tutorial documentation in the following file, which is located in the<br />

CodeWarrior installation directory:<br />

\CodeWarrior Documentation\PDF\Targeting_DSP56800.pdf<br />

If the Flash target is selected, CodeWarrior will automatically program the DSP’s internal Flash<br />

with the executable generated during Build. If the External RAM target is selected, the executable<br />

will be loaded to off-chip RAM.<br />

Once Flash has been programmed with the executable, the EVM target system may be run in a<br />

stand-alone mode from Flash. To do this, set the JG2 jumper in the 1-2 configuration to disable<br />

the parallel port and press the RESET button.<br />

Once the application is executing, the motor can be started. When the switch is moved from the<br />

STOP position to the RUN position, the motor will start. The speed can be changed with<br />

UP/DOWN buttons. Pressing the UP/DOWN buttons should incrementally increase the motor<br />

speed until it reaches maximum speed.<br />

Note: If the RUN/STOP switch is set to the RUN position when the application starts, toggle<br />

the RUN/STOP switch between the STOP and RUN positions to enable motor<br />

spinning. This is a protection feature that prevents the motor from starting when the<br />

application is executed from CodeWarrior.<br />

You should also see blinking or lighted LEDs, which indicates the application’s status. The<br />

application can be observed in PC master software during the manual mode.<br />

10-66 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

PC Master Software Mode Control<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

To set the PC master software control, perform the following steps:<br />

• The RUN/STOP switch must be in the STOP position<br />

• Check the PC master software mode on the PC master software control page<br />

• Enabled the application by setting the RUN/STOP switch in the RUN position<br />

• Start the motor by pressing the Start PC master software Push Button, and stop it by Stop<br />

pressing the Stop PC master software Push Button<br />

• Set the speed with the bar graph<br />

• The motor can be stopped any time with the RUN/STOP switch on the EVM. When the<br />

RUN/STOP switch on the EVM is in the STOP position, the manual mode can be set again<br />

by unchecking the PC master software mode on the PC master software control page.<br />

10.9 3-Phase SR Sensorless Motor Control<br />

Application<br />

This application exercises sensorless control of the 3-Phase Switched Reluctance (SR) motor on<br />

the DSP56F803EVM board, Optoisolation board, and 3-phase SR High-Voltage power stage.<br />

10.9.1 Files<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The 3-Phase SR Motor Control application is composed of the following files:<br />

• ...\dsp56803evm\nos\applications\3ph_srm_sensorless\3ph_srm_sensorless.c, main<br />

program<br />

• ...\dsp56803evm\nos\applications\3ph_srm_sensorless\3ph_srm_sensorless.h, main<br />

header file of the program used for storing application references and defined constants that<br />

are required by the 3ph_srm_sensorless.c file<br />

• ...\dsp56803evm\nos\applications\3ph_srm_sensorless\appconst.c, application<br />

constants for Data flash<br />

• ...\dsp56803evm\nos\applications\3ph_srm_sensorless\appconst.h, header file to store<br />

the external references and defined constants related to the appconst.c file<br />

• ...\dsp56803evm\nos\applications\3ph_srm_sensorless\3ph_srm_sensorless.mcp,<br />

application project file<br />

• ...\dsp56803evm\nos\applications\3ph_srm_sensorless\configextram\appconfig.c,<br />

application configuration file for external RAM<br />

• ...\dsp56803evm\nos\applications\3ph_srm_sensorless\configflash\appconfig.c,<br />

application configuration file for Flash<br />

• ...\dsp56803evm\nos\applications\3ph_srm_sensorless\configextram\appconfig.h,<br />

application configuration header file for external RAM<br />

• ...\dsp56803evm\nos\applications\3ph_srm_sensorless\configflash\appconfig.h,<br />

application configuration header file for Flash<br />

• ...\dsp56803evm\nos\applications\3ph_srm_sensorless\configextram\linker.cmd,<br />

linker command file for external RAM<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-67<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

• ...\dsp56803evm\nos\applications\3ph_srm_sensorless\configflash\linker.cmd, linker<br />

command file for Flash<br />

• ...\dsp56803evm\nos\applications\3ph_srm_sensorless\configflash\flash.cfg,<br />

configuration file for Flash<br />

These files are located in the <strong>SDK</strong> installation directory.<br />

10.9.2 Specifications<br />

The 3-Phase SR Sensorless Motor Control Application demonstrates the sensorless Switched<br />

Reluctance Motor Control application using flux linkage position estimation on the DSP56F803<br />

processor. An estimation of the phase resistance for low speed range is included.<br />

Control Process<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

After RESET, the drives enters the INIT state in MANUAL mode.When the RUN/STOP switch is<br />

detected (using RUN/STOP Switch or PC master software command) in the STOP position and<br />

there are no faults pending, the STOP application state is entered. When the start command is<br />

detected (using the RUN/STOP switch or the PC master software Start button), the drive enters<br />

the RUN application state; the motor is started. The following start-up sequence with rotor<br />

alignment is provided:<br />

• MOTOR_STOPPED Motor stopped<br />

• ALIGNMENT_COMMAND Alignment command accepted<br />

• ALIGNMENT_STAGE_ONE Alignment in progress; phases B and C switched on<br />

• ALIGNMENT_STAGE_TWO Alignment in progress; phase B switched on<br />

• START_UP_COMMAND Alignment finalized; start the motor<br />

• START_UP_FINISHED Motor running; start-up finalized<br />

The rotor position is evaluated using the sensorless flux linkage estimation algorithm. The actual<br />

flux linkage is calculated using the PWM frequency rate and compared with the reference flux<br />

linkage for the given commutation angle. The commutation angle is calculated according to the<br />

desired speed, current and actual DCBus voltage. When the actual flux linkage exceeds the<br />

reference flux linkage, the commutation of the phases in the desired rotation direction is done.<br />

The flux linkage error is used for the phase resistance estimation in low speeds (US Patent<br />

Pending). The commutation instances are used for actual motor speed calculation. According to<br />

the control signals (RUN/STOP switch, UP/DOWN push buttons) and PC master software<br />

commands (during PC master software control) the reference speed command is calculated using<br />

an acceleration/deceleration ramp. The comparison between the actual speed command and the<br />

measured speed generates a speed error. Based on the error, the speed controller generates the<br />

desired phase current. When the phase is commutated, it is turned on with duty cycle 100 percent<br />

(or Output_duty_cycle_startup during motor start-up). Then during each PWM cycle, the actual<br />

phase current is compared with the desired current. As soon as the actual current exceeds the<br />

command current, the current controller is turned on. The procedure is repeated for each<br />

commutation cycle of the motor. The current controller generates the desired duty cycle. Finally,<br />

the 3-ph PWM SR Motor Control signals are generated.<br />

10-68 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Drive Protection<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The DCBus voltage, DCBus current and power stage temperature are measured during the control<br />

process. They protect the drive from Overvoltage, Undervoltage, Overcurrent and Overheating.<br />

The Undervoltage and Overheating protection is performed by software, while the Overcurrent<br />

and Overvoltage fault signal utilizes a fault input of the DSP. The power stage is identified using<br />

board identification. If the correct power stage is not identified, the fault "Wrong Power Stage"<br />

disables the drive operation. Line voltage is measured during application initialization and the<br />

application automatically adjusts itself to run at either 115V AC or 230V AC, depending on the<br />

measured value. If the line voltage is detected to be out of the -15% to +10% of nominal voltage,<br />

the fault "Out of the Mains Limit" disables the drive operation.<br />

If any of the above-mentioned faults occur, the motor control PWM outputs are disabled in order<br />

to protect the drive and the application enters the FAULT state. The FAULT state can be left only<br />

when the fault conditions disappear and the RUN/STOP switch is moved to the STOP position<br />

The application can run on:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

• External RAM or Flash<br />

• 3-Phase SR High-Voltage Power Stage powered by 115V AC or 230V AC<br />

• Manual or PC master software Operating Mode<br />

The correct power stage and voltage level is identified automatically and the appropriate<br />

constants are set.<br />

The 3-phase SR motor control application can operate in two modes:<br />

1. Manual Operating Mode<br />

The drive is controlled by the RUN/STOP switch. The motor speed is set by the UP<br />

and DOWN push buttons (see Figure 10-54). The actual state of the application is<br />

indicated by the user LEDs (see Figure 10-55). If the application runs and motor<br />

spinning is disabled (i.e., the system is ready), the GREEN user LED will flash at a<br />

frequency of 2Hz. When motor spinning is enabled, the GREEN user LED will be<br />

On. If a fault occurs on the power stage, the GREEN user LED will flash at a<br />

frequency of 8Hz. The actual state of the PWM outputs are indicated by PWM output<br />

LEDs.<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-69<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 10-54. RUN/STOP Switch and UP/DOWN Buttons<br />

Figure 10-55. USER and PWM LEDs<br />

10-70 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

2. PC master software (Remote) Operating Mode<br />

The drive is controlled remotely from a PC through the SCI communication channel<br />

of the DSP device via an RS-232 physical interface. The PC master software control<br />

can be taken over only if the RUN/STOP switch is in STOP position; until then, the<br />

push buttons and RUN/STOP switch have no effect on the application control.<br />

The following PC master software control actions are supported:<br />

• Set PC master software Mode of the motor control system<br />

• Set Manual Mode of the motor control system<br />

• Start the motor<br />

• Stop the motor<br />

• Set the Required Speed of the motor<br />

PC master software displays the following information:<br />

• Required Speed of the motor<br />

• Actual Speed of the motor<br />

• Application status - Init/Stop/Run/Fault<br />

• DCBus voltage level<br />

• Identified line voltage<br />

• Fault Status - No_Fault/Overvoltage/Overcurrent/Undervoltage/Overheating<br />

• Identified Power Stage<br />

Project files for the PC master software are located in:<br />

...\nos\applications\3ph_srm_sensorless\PC_Master\3ph_srm_sensorless.pmp<br />

Start the PC master software window’s application, 3ph_srm_sensorless.pmp. Figure 10-56 shows<br />

the PC master software control window after this project has been launched.<br />

Note: If the PC master software project (.pmp file) is unable to control the application, it is<br />

possible that the wrong load map (.elf file) has been selected. PC master software uses<br />

the load map to determine addresses for global variables being monitored. Once the<br />

PC master software project has been launched, this option may be selected in the PC<br />

master software window under Project/Select Other Map File.<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-71<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 10-56. PC Master Software Control Window<br />

10-72 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

10.9.3 Set-up<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 10-57 illustrates the hardware set-up for the 3-phase SR Motor Control applications. The<br />

motor’s Encoder connector, attached to connector J2 on the EVM Board, is not required for<br />

motor operation. It serves only as a PC master software position reference.<br />

Figure 10-57. Set-up of the 3-phase HV SR Motor Control Application<br />

The correct order of phases (phase A, phase B, phase C) for the SR motor is:<br />

• Phase A = white wire<br />

• Phase B = red wire<br />

• Phase C = black wire<br />

When facing a motor shaft, the motor shaft should rotate clockwise (i.e., positive direction,<br />

positive speed).<br />

For detailed information, see the DSP56F803 Evaluation Module Hardware Reference<br />

Manual. The serial cable is needed for the PC master software debugging/control.<br />

10.9.3.1 EVM Jumper Settings<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

To execute the 3-Phase SR Sensorless Motor Control application, the DSP56F803 board requires<br />

the strap settings shown in Figure 10-51 and Table 10-15.<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-73<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

1 2 3<br />

JG6<br />

7 8 9<br />

JG1<br />

1 2<br />

7 8<br />

JG5<br />

9 8 7<br />

3 2 1<br />

1 2 3<br />

JG6<br />

7 8 9<br />

USER LED<br />

LED3<br />

7 8 9<br />

JG7<br />

3 2 1<br />

PWM LEDs<br />

JG7<br />

JG5<br />

JG4<br />

JG10<br />

JG1<br />

1<br />

P4 IRQA<br />

DSP56F803EVM<br />

Figure 10-58. DSP56F803EVM Jumper Reference<br />

Table 10-16. DSP56F803EVM Jumper Settings<br />

Jumper Group Comment Connections<br />

JG1 UNI-3 serial selected 1-2, 3-4, 5-6, 7-8<br />

JG2 Enable on-board parallel JTAG Command Converter Interface NC<br />

JG3 Use on-board crystal for DSP oscillator input 1-2<br />

JG4 Select DSP’s Mode 0 operation upon exit from reset 1-2<br />

JG5 Enable external SRAM 1-2<br />

JG6 UNI-3 3-Phase Current source selected 2-3, 5-6, 8-9<br />

JG7 Encoder Input Selected for Hall Sensor signals 2-3, 5-6, 8-9<br />

JG8 On-board Parallel JTAG command converter powered by Host system 1-2<br />

JG9 Use on-board crystal for DSP oscillator input 1-2<br />

JG10 Leave CAN bus un-terminated NC<br />

S2<br />

Note: When running the EVM target system in a stand-alone mode from Flash, the JG2<br />

jumper must be set in the 1-2 configuration to disable the command converter parallel<br />

port interface<br />

10-74 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

J3<br />

J2<br />

JG10 1 3 JG9<br />

JG3<br />

J10<br />

1<br />

U15<br />

S3<br />

S/N<br />

RUN/STOP<br />

S4<br />

Y1<br />

U1<br />

P2<br />

J9<br />

1<br />

JG4<br />

JTAG<br />

JG4 S1<br />

JG2 JG8 J1<br />

IRQB<br />

1<br />

JG3<br />

RESET<br />

J8<br />

JG2<br />

JG9<br />

J4<br />

U6 U7<br />

JG8<br />

P3<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

10.9.4 Build<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

When building this application, the user can create an application that runs from internal Flash or<br />

External RAM. To select the type of application to build, open the 3ph_sr_sensorless.mcp project<br />

and select the target build type; see Figure 10-59. Selecting Build All will build all application<br />

build types. A definition of the projects associated with these target build types may be viewed<br />

under the Targets tab of the project window.<br />

Figure 10-59. Target Build Selection<br />

To make this application, open the 3ph_sr_sensorless.mcp project file and execute the Make<br />

command, shown in Figure 10-60. This will build and link the 3-phase SR sensorless Motor<br />

Control application and all needed Metrowerks and <strong>SDK</strong> libraries<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-75<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

10.9.5 Execute<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 10-60. Execute Make Command<br />

To execute the 3-phase SR Motor Control application, choose the Program/Debug command in<br />

the CodeWarrior IDE, followed by the Run command. For more help with these commands, refer<br />

to the CodeWarrior tutorial documentation in the following file, located in the CodeWarrior<br />

installation directory:<br />

\CodeWarrior Documentation\PDF\Targeting_DSP56800.pdf<br />

If the Flash target is selected, CodeWarrior will automatically program the DSP’s internal Flash<br />

with the executable generated during Build. If the External RAM target is selected, the executable<br />

will be loaded to off-chip RAM.<br />

Once Flash has been programmed with the executable, the EVM target system may be run in a<br />

stand-alone mode from Flash. To do this, set the JG2 jumper in the 1-2 configuration to disable<br />

the parallel port and press the RESET button.<br />

Once the application is executing, the motor can be started. When the switch is moved from the<br />

STOP position to the RUN position, the motor will start. The speed can be changed by the<br />

UP/DOWN buttons. Pressing the UP/DOWN buttons should incrementally increase the motor<br />

speed until it reaches maximum speed.<br />

Note: If the RUN/STOP switch is set to the RUN position when the application starts, toggle<br />

the RUN/STOP switch between the STOP and RUN positions to enable motor<br />

spinning. This is a protection feature that prevents the motor from starting when the<br />

application is executed from CodeWarrior.<br />

You should also see blinking or lighted LEDs which indicate the application’s status.<br />

10-76 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

10.9.6 PC Master Software<br />

Perform the following steps to set the PC master software control:<br />

• The RUN/STOP switch must be in the STOP position<br />

• Check the PC master software mode on the PC master software control page<br />

• The motor can be started by pushing the Start PC master software Push Button and stopped<br />

by pushing the Stop PC master software Push Button<br />

• The speed can be set by the bar graph<br />

When the RUN/STOP switch on the EVM is in the STOP position, the manual mode can be set<br />

again by unchecking the PC master software mode on the PC master software control page.<br />

The application can be monitored in PC master software during the PC master software mode and<br />

in manual mode.<br />

The following windows are available:<br />

Speed Scope monitors:<br />

• Required Speed<br />

• Actual Speed<br />

• Desired Phase Current<br />

Start-up Recorder captures:<br />

• Desired Phase Current<br />

• Active Phase Current<br />

• Reference Flux Linkage<br />

• Active Flux Linkage<br />

• Output Duty Cycle<br />

• Encoder Position Reference<br />

Start-up Recorder is initiated with the motor start only.<br />

Flux Linkage Recorder captures:<br />

• Active Phase Current<br />

• Discharge Phase Current<br />

• Active Flux Linkage<br />

• Discharge Flux Linkage<br />

• Reference Flux Linkage<br />

• Encoder Position Reference<br />

Flux Linkage Recorder may be initiated any time during the motor run.<br />

Current Controller Recorder captures:<br />

• Desired Phase Current<br />

• Active Phase Current<br />

• Output Duty Cycle<br />

• Encoder Position Reference<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Current Controller Recorder may be initiated any time during the motor run.<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-77<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The Recorder can be used only when the application is running from External RAM due to the<br />

limited on-chip memory. The length of the recorded window may be set in “Recorder Properties”<br />

=> bookmark “Main” => “Recorded Samples”. It is limited by the dedicated memory space in the<br />

appconfig.h file. The recorder samples are taken every 64.5 µsec.<br />

10.10 3-Phase SR Motor Control with Encoder<br />

Application<br />

This application exercises control of the 3-Phase Switched Reluctance (SR) motor with encoder<br />

position sensor on the DSP56F803EVM board, Optoisolation board, and 3-phase SR<br />

High-Voltage power stage.<br />

10.10.1 Files<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The 3-Phase SR Motor Control application is composed of the following files:<br />

• ...\dsp56803evm\nos\applications\3ph_srm_Encoder\3ph_srm_Encoder.c, main<br />

program<br />

• ...\dsp56803evm\nos\applications\3ph_srm_Encoder\3ph_srm_Encoder.h, main<br />

header file of the program used for storing application references and defined constants that<br />

are required by the 3ph_srm_Encoder.c file.<br />

• ...\dsp56803evm\nos\applications\3ph_srm_Encoder\appconst.c, application constants<br />

for Data flash<br />

• ...\dsp56803evm\nos\applications\3ph_srm_Encoder\appconst.h, header file to store<br />

the external references and defined constants related to the appconst.c file<br />

• ...\dsp56803evm\nos\applications\3ph_srm_Encoder\3ph_srm_Encoder..mcp,<br />

application project file<br />

• ...\dsp56803evm\nos\applications\3ph_srm_Encoder\configextram\appconfig.c,<br />

application configuration file for external RAM<br />

• ...\dsp56803evm\nos\applications\3ph_srm_Encoder\configflash\appconfig.c,<br />

application configuration file for Flash<br />

• ...\dsp56803evm\nos\applications\3ph_srm_Encoder\configextram\appconfig.h,<br />

application configuration header file for external RAM<br />

• ...\dsp56803evm\nos\applications\3ph_srm_Encoder\configflash\appconfig.h,<br />

application configuration header file for Flash<br />

• ...\dsp56803evm\nos\applications\3ph_srm_Encoder\configextram\linker.cmd, linker<br />

command file for external RAM<br />

• ...\dsp56803evm\nos\applications\3ph_srm_Encoder\configflash\linker.cmd, linker<br />

command file for Flash<br />

• ...\dsp56803evm\nos\applications\3ph_srm_Encoder\configflash\flash.cfg,<br />

configuration file for Flash<br />

These files are located in the <strong>SDK</strong> installation directory.<br />

10-78 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

10.10.2 Specifications<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The 3-Phase SR Motor Control with Encoder Application demonstrates the Switched Reluctance<br />

Motor Control application using position sensor on the DSP56F803 processor.<br />

Control Process<br />

After RESET the drives enters the INIT state in MANUAL mode.When the start/stop switch is<br />

detected (using Start/Stop Switch or PC master software command) in STOP position and there<br />

are no faults pending the STOP application state is entered. When the start command is detected<br />

(using Start/Stop switch or PC master software Start button), the drive enters RUN application<br />

state - motor is started. The following start-up sequence with the rotor alignment is provided:<br />

• MOTOR_STOPPED, Motor stopped<br />

• ALIGNMENT_COMMAND, Alignment command accepted<br />

• ALIGNMENT_STAGE_ONE, Alignment in progress - phases B&C switched on<br />

• ALIGNMENT_STAGE_TWO, Alignment in progress - phase B switched on<br />

• START_UP_FINISHED Alignment finalized, motor running, start-up finalized<br />

The rotor position is evaluated with encoder position sensor through timer module A of channel 0,<br />

which is set into quadrature mode.Channel 1 of the same module performs commutation call<br />

under successful comapring of CMP2. Every commutation occurrence the CMP2 is anew loaded<br />

with recently calculated value, which is adjusted by advance angle routine considering actual<br />

speed, desired current and applied voltage across corresponding phase. The individual phase is<br />

supposed to be switched on before overlapping rotor and stator teeth.<br />

According to the control signals (Start/Stop switch, Up/Down push buttons) and PC master<br />

software commands (in case of PC master software control) the reference speed command is<br />

calculated using an acceleration/deceleration ramp. The comparison between the actual speed<br />

command and the measured speed generates a speed error. Base on the error the speed controller<br />

generates desired phase current. When the phase is commutated, it is turned-on with duty cycle<br />

100% (or Output_duty_cycle_startup during motor start-up). Then during each PWM cycle the<br />

actual phase current is compared with the desired current. As soon as the actual current exceeds<br />

the command one, the current controller is turned-on. The procedure is repeated for each<br />

commutation cycle of the motor. The current controller generates the desired duty cycle Finally<br />

the 3-phase PWM SR Motor Control signals are generated.<br />

Drive Protection<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The DCBus voltage, DCBus current and power stage temperature are measured during the control<br />

process. They are used for overvoltage, undervoltage, overcurrent and overtemperature protection<br />

of the drive. The undervoltage and overtemperature protection is performed by software while the<br />

overcurrent and overvoltage fault signal utilizes a Fault inputs of the DSP. The power stage is<br />

identified using board identification. If the correct power stage is not identified, the fault "Wrong<br />

Power Stage" disables the drive operation. The line voltage is measured during application<br />

initialization. According the detected level the 115VAC or 230VAC mains is set. If the line<br />

voltage out of the -15% .. +10% of nominal voltage is detected, the fault "Out of the Mains Limit"<br />

disables the drive operation.<br />

If any of the above mentioned fault occurs, the motor control PWM outputs are disabled in order<br />

to protect the drive and the application enters the FAULT state. The FAULT state can be left only<br />

when the fault conditions disappear and the start/stop switch is moved to the STOP position<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-79<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The application can run on:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

• External RAM or Flash<br />

• 3-Phase SR High-Voltage Power Stage powered by 115V AC or 230V AC<br />

• Manual or PC master software Operating Mode<br />

The correct power stage and voltage level is identified automatically and the appropriate<br />

constants are set.<br />

The 3-phase SR motor control application can operate in two modes:<br />

1. Manual Operating Mode<br />

The drive is controlled by the RUN/STOP switch. The motor speed is set by the UP<br />

and DOWN push buttons (see Figure 10-54). The actual state of the application is<br />

indicated by the user LEDs (see Figure 10-55). If the application runs and motor<br />

spinning is disabled (i.e., the system is ready), the GREEN user LED will flash at a<br />

frequency of 2Hz. When motor spinning is enabled, the GREEN user LED will be<br />

On. If a fault occurs on the power stage, the GREEN user LED will flash at a<br />

frequency of 8Hz. The actual state of the PWM outputs are indicated by PWM output<br />

LEDs.<br />

Figure 10-61. RUN/STOP Switch and UP/DOWN Buttons<br />

10-80 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 10-62. USER and PWM LEDs<br />

2. PC master software (Remote) Operating Mode<br />

The drive is controlled remotely from a PC through the SCI communication channel<br />

of the DSP device via an RS-232 physical interface. The PC master software control<br />

can be taken over only if the RUN/STOP switch is in STOP position. Then the push<br />

buttons and start/stop switch has no effect to the application control.<br />

The following PC master software control actions are supported:<br />

• Set PC master software Mode of the motor control system<br />

• Set Manual Mode of the motor control system<br />

• Start the motor<br />

• Stop the motor<br />

• Set the Required Speed of the motor<br />

PC master software displays the following information:<br />

• Required Speed of the motor<br />

• Actual Speed of the motor<br />

• Application status - Init/Stop/Run/Fault<br />

• DCBus voltage level<br />

• Identified line voltage<br />

• Fault Status - No_Fault/Overvoltage/Overcurrent/Undervoltage/Overheating<br />

• Identified Power Stage<br />

...\nos\applications\3ph_srm_Encoder\pc_master\3ph_srm_Encoder.pmp<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-81<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Start the PC master software window’s application, 3ph_srm_Encoder.pmp. Figure 10-56 shows<br />

the PC master software control window after this project has been launched.<br />

Note: If the PC master software project (.pmp file) is unable to control the application, it is<br />

possible that the wrong load map (.elf file) has been selected. PC master software uses<br />

the load map to determine addresses for global variables being monitored. Once the<br />

PC master software project has been launched, this option may be selected in the PC<br />

master software window under Project/Select Other Map File.<br />

10.10.3 Set-up<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 10-63. PC Master Software Control Window<br />

Figure 10-57 illustrates the hardware set-ups for the 3-phase SR Motor Control applications. The<br />

motor’s Encoder connector attached to connector J2 on the EVM Board is not required for the<br />

motor operation. It serves only for PC master software position reference.<br />

10-82 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 10-64. Set-up of the 3-phase HV SR Motor Control Application<br />

The correct phase order (phase A, phase B, phase C) for SR motor is as follows:<br />

• Phase A - white wire<br />

• Phase B - red wire<br />

• Phase C - black wire<br />

If you look at a motor shaft (face to shaft) the motor shaft should rotate in clockwise direction (i.e.<br />

positive direction, positive speed).<br />

For detailed information, see the DSP56F803 Evaluation Module Hardware Reference<br />

Manual. The serial cable is needed for the PC master software debugging/control.<br />

10.10.3.1 EVM Jumper Settings<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

To execute the 3-Phase SR Motor Control with Encoder application, the DSP56F803 board<br />

requires the strap settings shown in Figure 10-51 and Table 10-15.<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-83<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

1 2 3<br />

JG6<br />

7 8 9<br />

JG1<br />

1 2<br />

7 8<br />

JG5<br />

9 8 7<br />

3 2 1<br />

1 2 3<br />

JG6<br />

7 8 9<br />

USER LED<br />

LED3<br />

7 8 9<br />

JG7<br />

3 2 1<br />

PWM LEDs<br />

JG7<br />

JG5<br />

JG4<br />

JG10<br />

JG1<br />

1<br />

P4 IRQA<br />

DSP56F803EVM<br />

Figure 10-65. DSP56F803EVM Jumper Reference<br />

Table 10-17. DSP56F803EVM Jumper Settings<br />

Jumper Group Comment Connections<br />

JG1 UNI-3 serial selected 1-2, 3-4, 5-6, 7-8<br />

JG2 Enable on-board parallel JTAG Command Converter Interface NC<br />

JG3 Use on-board crystal for DSP oscillator input 1-2<br />

JG4 Select DSP’s Mode 0 operation upon exit from reset 1-2<br />

JG5 Enable external SRAM 1-2<br />

JG6 UNI-3 3-Phase Current source selected 2-3, 5-6, 8-9<br />

JG7 Encoder Input Selected 2-3, 5-6, 8-9<br />

JG8 On-board Parallel JTAG command converter powered by Host system 1-2<br />

JG9 Use on-board crystal for DSP oscillator input 1-2<br />

JG10 Leave CAN bus un-terminated NC<br />

S2<br />

Note: When running the EVM target system in a stand-alone mode from Flash, the JG2<br />

jumper must be set in the 1-2 configuration to disable the command converter parallel<br />

port interface<br />

10-84 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

J3<br />

J2<br />

JG10 1 3 JG9<br />

JG3<br />

J10<br />

1<br />

U15<br />

S3<br />

S/N<br />

RUN/STOP<br />

S4<br />

Y1<br />

U1<br />

P2<br />

J9<br />

1<br />

JG4<br />

JTAG<br />

JG4 S1<br />

JG2 JG8 J1<br />

IRQB<br />

1<br />

JG3<br />

RESET<br />

J8<br />

JG2<br />

JG9<br />

J4<br />

U6 U7<br />

JG8<br />

P3<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

10.10.4 .Build<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

When building this application, the user can create an application that runs from internal Flash or<br />

External RAM. To select the type of application to build, open the 3ph_srm_Encoder.mcp project<br />

and select the target build type; see Figure 10-59. Selecting Build All will build all application<br />

build types. A definition of the projects associated with these target build types may be viewed<br />

under the Targets tab of the project window.<br />

Figure 10-66. Target Build Selection<br />

To make this application, open the 3ph_srm_Encoder.mcp project file and execute the Make<br />

command, shown in Figure 10-60. This will build and link the 3-phase SR sensorless Motor<br />

Control application and all needed Metrowerks and <strong>SDK</strong> libraries<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-85<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

10.10.5 Execute<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 10-67. Execute Make Command<br />

To execute the 3-phase SR Motor Control application, choose the Program/Debug command in<br />

the CodeWarrior IDE, followed by the Run command. For more help with these commands, refer<br />

to the CodeWarrior tutorial documentation in the following file located in the CodeWarrior<br />

installation directory:<br />

\CodeWarrior Documentation\PDF\Targeting_DSP56800.pdf<br />

If the Flash target is selected, CodeWarrior will automatically program the DSP’s internal Flash<br />

with the executable generated during Build. If the External RAM target is selected, the executable<br />

will be loaded to off-chip RAM.<br />

Once Flash has been programmed with the executable, the EVM target system may be run in a<br />

stand-alone mode from Flash. To do this, set the JG2 jumper in the 1-2 configuration to disable<br />

the parallel port and press the RESET button.<br />

Once the application is executing, the motor can be started. When the switch is moved from the<br />

STOP position to the RUN position, the motor will start. The speed can be changed by the<br />

UP/DOWN buttons. Pressing the Up/Down buttons should cause to incrementally increase the<br />

speed of the motor until it reaches a maximum speed.<br />

Note: If the RUN/STOP switch is set to the RUN position when the application starts, toggle<br />

the RUN/STOP switch between the STOP and RUN positions to enable motor<br />

spinning. This is a protection feature that prevents the motor from starting when the<br />

application is executed from CodeWarrior.<br />

You should also see blinking or lighted LEDs which indicate the application’s status.<br />

10-86 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

10.10.6 PC Master Software<br />

Perform the following steps to set the PC master software control:<br />

• The RUN/STOP switch must be in the STOP position<br />

• Check the PC master software mode on the PC master software control page<br />

• The motor can be started by pushing the Start PC master software Push Button and stopped<br />

by pushing the Stop PC master software Push Button<br />

• The speed can be set by the bar graph<br />

When the RUN/STOP switch on the EVM is in the STOP position, the manual mode can be set<br />

again by unchecking the PC master software mode on the PC master software control page<br />

The application can be monitored in PC master software during the PC master software mode as<br />

well as manual mode.<br />

The following windows are available:<br />

Speed Scope monitors:<br />

• Required Speed<br />

• Actual Speed<br />

Current Controller Recorder captures:<br />

• Desired Phase Current<br />

• Active Phase Current<br />

• Output Duty Cycle<br />

Current Controller Recorder may be initiated any time during the motor run.<br />

The Recorder can be used ONLY when the application is running from External RAM due to the<br />

limited on-chip memory. The length of the recorded window may be set in “Recorder Properties”<br />

=> bookmark “Main” => “Recorded Samples”. It is limited by the dedicated memory space in<br />

appconfig.h file. The recorder samples are taken each 100µsec.<br />

10.11 3-Phase AC Induction Motor Control V/Hz<br />

Application - Open Loop<br />

This application demonstrates a principal of the V/Hz control of the 3-Phase AC induction motor<br />

using the DSP56F803EVM board, Optoisolation board and 3-phase AC BLDC High-Voltage<br />

power stage.<br />

10.11.1 Files<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The 3-Phase AC Induction Motor Control V/Hz Application - Open Loop is found in directory:<br />

..\src\dsp56803evm\nos\applications\3ph_AC_VHz_OpenLoop\<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-87<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

and is composed of the following files:<br />

• 3ph_AC_VHz_OL.c, Open Loop main application program<br />

• 3ph_AC_VHz_OL.h, Open Loop application header file<br />

• 3ph_AC_VHz_OL.mcp, Open Loop project file<br />

• ConfigExtRam\appconfig.c, application configuration file for External RAM<br />

• ConfigExtRam\appconfig.h, application configuration file for External RAM<br />

• ConfigExtRam\linker.cmd, linker command file used for RAM<br />

• ConfigFlash\appconfig.c, application configuration file for Flash<br />

• ConfigFlash\appconfig.h, application configuration file for Flash<br />

• ConfigFlash\linker.cmd, linker command file used for Flash<br />

• appconst.c, application constants placed in data Flash<br />

• appconst.h, header file for appconst.c<br />

These files are located in the <strong>SDK</strong> installation directory.<br />

10.11.2 Specification<br />

This application performs a principal control of the 3-phase AC Induction motor using the<br />

DSP56F803 processor. The control technique sets the speed ([rpm], [Hz]) of the magnetic field<br />

and calculates the phase voltage amplitude according to a V/Hz table. This table is private to the<br />

application and reflects the AC Induction motor parameters (Base Voltage/frequency; Boost<br />

Voltage/frequency; and DC Boost Voltage). The incremental encoder is used to derive the actual<br />

rotor speed. Protection is provided against Overcurrent, Overvoltage, Undervoltage, and<br />

Overheating drive faults. If the wrong system board is identified, the green USER LED will blink<br />

at a frequency of 8Hz and the PC master software signals a connection to the wrong hardware.<br />

System Outline<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The system is designed to drive a 3-phase AC induction motor (ACIM). The application has the<br />

following specifications:<br />

• Volt per Hertz control technique used for ACIM control<br />

• Targeted for DSP56F803EVM<br />

• Running on 3-phase AC induction motor control development platform at variable line<br />

voltage 115V AC and 230V AC (range -15% to +10%)<br />

• Motor mode<br />

• Generator mode<br />

• DCBus brake<br />

• Minimum speed 50 rpm<br />

• Maximum speed 2250 rpm at input power line 230V AC<br />

• Maximum speed 1200 rpm at input power line 115V AC<br />

• Power stage and optoisolation board identification<br />

• Fault protection<br />

• Manual interface (RUN/STOP switch; UP/DOWN push buttons control; LED indication)<br />

• PC master software remote control interface (speed set-up)<br />

• PC master software remote monitor<br />

— PC master software monitor interface (required speed; actual motor speed; drive fault status;<br />

DCBus voltage level; identified power stage boards)<br />

10-88 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Application Description<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The Volt per Hertz control algorithm is calculated on Motorola DSP56F803. The algorithm<br />

generates the 3-phase PWM signals for AC induction motor inverter according to the<br />

user-required inputs, measured and calculated signals.<br />

The concept of the ACIM drive incorporates the following hardware components:<br />

• AC induction motor--brake set<br />

• 3-phase AC/BLDC high voltage power stage<br />

• DSP56F803EVM boards<br />

• Optoisolation box which is connected between the power stage board and the<br />

DSP56F803EVM<br />

The AC induction motor--brake set incorporates a 3-phase AC induction motor and attached<br />

BLDC motor brake. The AC induction motor has four poles. The incremental position sensor<br />

(encoder) is coupled on the motor shaft. The detailed motor--brake specifications are listed in<br />

Table 10-18.<br />

The following software tools are needed for compiling, debugging, loading to the EVM, remote<br />

control and monitoring:<br />

• Metrowerks CodeWarrior 4.0<br />

• PC master software<br />

• <strong>SDK</strong> 2.4 or later<br />

Table 10-18. Motor - Brake Specifications<br />

Set Manufactured EM Brno, Czech Republic<br />

Motor Specification eMotor Type AM40V<br />

3-Phase AC Induction Motor<br />

Brake Specification<br />

Position Sensor (Encoder)<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Pole-Number 4<br />

Nominal Speed 1300 rpm<br />

Nominal Voltage 3 x 200V<br />

Nominal Current: 0.88A<br />

Brake Type<br />

SG40N<br />

3-Phase BLDC Motor<br />

Pole-Number 6<br />

Nominal Speed 1500rpm<br />

Nominal Voltage 3 x 27V<br />

Nominal Current: 2.6 A<br />

Type<br />

Baumer Electric<br />

BHK 16.05A 1024-12-5<br />

Pulses per revolution 1024<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-89<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Measured quantities:<br />

• DCBus voltage<br />

• Power module temperature<br />

• Rotor speed<br />

The faults used for drive protection:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

• Overvoltage (PC master software error message = Overvoltage fault)<br />

• Undervoltage (PC master software error message = Undervoltage fault)<br />

• Overcurrent (PC master software error message = Overcurrent fault)<br />

• Overheating (PC master software error message = Overheating fault)<br />

• Wrong-hardware (PC master software error message = Wrong HW<br />

This 3-phase AC Induction motor V/Hz application can operate in two modes:<br />

1. Manual Operating Mode<br />

The drive is controlled by the RUN/STOP switch (S1). The motor speed is set by the<br />

UP (S2-IRQA) and DOWN (S3-IRQB) push buttons; see Figure 10-68. If the<br />

application runs and motor spinning is disabled (i.e., the system is ready), the green<br />

USER LED (LED8, shown in Figure 10-69) will blink. When motor spinning is<br />

enabled, the green USER LED will be On and the actual state of the PWM outputs<br />

are indicated by PWM output LEDs. If Overcurrent, Overvoltage or Overheating<br />

occur or if the wrong system board is identified, the green USER LED starts to flash<br />

quickly and the PC master software signals the identified type of fault. This state can<br />

be exited only by an application RESET. It is strongly recommended that you inspect<br />

the entire application to locate the source of the fault before starting it again. Refer to<br />

Table 10-19 for application states.<br />

Figure 10-68. RUN/STOP Switch and UP/DOWN Buttons<br />

10-90 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The green LED (highlighted in Figure 10-69) indicates the Stand-by State (LED flashing) or the<br />

Run State (LED On).<br />

Figure 10-69. USER and PWM LEDs<br />

2. PC master software (remote) Operating Mode<br />

The drive is controlled remotely from a PC through the SCI communication channel<br />

of the DSP device via an RS-232 physical interface. The drive is enabled by the<br />

RUN/STOP switch, which can be used to safely stop the application at any time.<br />

The following control actions are supported:<br />

• Set the Required Speed of the motor<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Table 10-19. Motor Application States<br />

Application State Motor State Green LED State<br />

Stopped Stopped Blinking at a frequency of 2Hz<br />

Running Running On<br />

Fault Stopped Blinking at a frequency of 8Hz<br />

PC master software displays the following information:<br />

• Actual and Required Speed of the motor<br />

• Phase voltage amplitude (related to the given DCBus voltage)<br />

• Application mode - RUN/STOP<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-91<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

• DCBus voltage and temperature of power stage module<br />

• Drive Fault status<br />

• Identified hardware<br />

If Overcurrent, Overvoltage, Undervoltage, or Overheating occur, the internal fault logic is<br />

asserted and the application enters a fault state (the USER LED will start to flash quickly). This<br />

state can be exited only by an application RESET. It is strongly recommended that you inspect the<br />

entire application to locate the source of the fault before starting it again.<br />

Project files for the PC master software are located in:<br />

..\nos\applications\3ph_AC_VHz_OpenLoop\PC_Master\3ph_AC_VHz_Flash.pmp, which<br />

uses Map file for running in Flash<br />

..\nos\applications\3ph_AC_VHz_OpenLoop\PC_Master\3ph_AC_VHz_ExtRam.pmp,<br />

which uses Map file for running in External Memory<br />

Start the PC master software window’s application and choose the correct PC master software<br />

project for the desired PC master software Operating Mode. Figure 10-70 shows the PC master<br />

software control window for 3ph_AC_VHz_ExtRam.pmp.<br />

Figure 10-70. PC Master Software Control Window<br />

10-92 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

10.11.3 Set-up<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 10-71 illustrates the hardware set-up for the 3-phase AC Motor Control application - Open<br />

Loop.<br />

Figure 10-71. Set-up of the 3-phase AC Induction Motor Control Application - Open Loop<br />

The correct order of phases (phase A, phase B, phase C) for the AC induction motor shown in<br />

Figure 10-71 is:<br />

• phase A = red wire<br />

• phase B = white wire<br />

• phase C = black wire<br />

When facing a motor shaft, if the phase order is: phase A, phase B, phase C, the motor shaft<br />

should rotate clockwise (i.e., positive direction, positive speed).<br />

The serial cable is needed for the PC master software debugging tool only. For detailed<br />

information, see the DSP56F803 Evaluation Module Hardware Reference Manual.<br />

10.11.3.1 EVM Jumper Settings<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

To execute the 3-Phase SR Motor Control application, the DSP56F803 board requires the strap<br />

settings shown in Figure 10-72 and Table 10-20.<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-93<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

.<br />

1 2 3<br />

JG6<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

7 8 9<br />

JG1<br />

1 2<br />

7 8<br />

JG5<br />

9 8 7<br />

3 2 1<br />

1 2 3<br />

JG6<br />

7 8 9<br />

USER LED<br />

LED3<br />

7 8 9<br />

JG7<br />

3 2 1<br />

PWM LEDs<br />

JG7<br />

JG5<br />

JG4<br />

JG10<br />

JG1<br />

1<br />

S2<br />

P4 IRQA<br />

DSP56F803EVM<br />

Figure 10-72. DSP56F803EVM Jumper Reference<br />

Table 10-20. DSP56F803EVM Jumper Settings<br />

Jumper Group Comment Connections<br />

JG1 UNI-3 serial selected 1-2, 3-4, 5-6, 7-8<br />

JG2 Enable on-board parallel JTAG Command Converter Interface NC<br />

JG3 Use on-board crystal for DSP oscillator input 1-2<br />

JG4 Select DSP’s Mode 0 operation upon exit from reset 1-2<br />

JG5 Enable external SRAM 1-2<br />

JG6 UNI-3 3-Phase Current source selected 2-3, 5-6, 8-9<br />

JG7 Encoder Input Selected for Incremental Encoder signals 2-3, 5-6, 8-9<br />

JG8 On-board Parallel JTAG command converter powered by Host system 1-2<br />

JG9 Use on-board crystal for DSP oscillator input 1-2<br />

JG10 Leave CAN bus un-terminated NC<br />

J3<br />

J2<br />

JG10 1 3 JG9<br />

JG3<br />

Note: When running the EVM target system in a stand-alone mode from Flash, the JG2<br />

jumper must be set in the 1-2 configuration to disable the command converter parallel<br />

port interface.<br />

10-94 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

J10<br />

1<br />

U15<br />

S3<br />

S/N<br />

RUN/STOP<br />

S4<br />

Y1<br />

U1<br />

P2<br />

J9<br />

1<br />

JG4<br />

JTAG<br />

JG4 S1<br />

JG2 JG8 J1<br />

IRQB<br />

1<br />

JG3<br />

RESET<br />

J8<br />

JG2<br />

JG9<br />

J4<br />

U6 U7<br />

JG8<br />

P3<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

10.11.4 Build<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

To build this application, open the 3ph_AC_VHz_OL.mcp project file and execute the Make<br />

command, as shown in Figure 10-73. This will build and link the 3-phase AC V/Hz Motor Control<br />

application and all needed Metrowerks and <strong>SDK</strong> libraries.<br />

10.11.5 Execute<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 10-73. Execute Make Command<br />

To execute the 3-phase AC V/Hz Motor Control application, choose the Program/Debug<br />

command in the CodeWarrior IDE, followed by the Run command. For more help with these<br />

commands, refer to the CodeWarrior tutorial documentation in the following file, which is located<br />

in the CodeWarrior installation directory:<br />

\CodeWarrior Documentation\PDF\Targeting_DSP56800.pdf<br />

For jumper settings, see the DSP56F803 Evaluation Module Hardware User’s Manual.<br />

To execute the 3-phase AC V/Hz Motor Control application’s internal Flash version, choose the<br />

Program/Debug command in the CodeWarrior IDE. When loading is finished, set jumper JG2 to<br />

disable the JTAG port and jumper JG4 to enable boot from internal flash, then push the RESET<br />

button.<br />

Once the application is running, move the RUN/STOP switch to the RUN position and set the<br />

required speed with the UP/DOWN push buttons. Pressing the UP/DOWN buttons should<br />

incrementally increase the motor speed until it reaches maximum speed. If successful, the<br />

3-phase AC induction motor will be spinning.<br />

Note: If the RUN/STOP switch is set to the RUN position when the application starts, toggle<br />

the RUN/STOP switch between the STOP and RUN positions to enable motor<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-95<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

spinning. This is a protection feature that prevents the motor from starting when the<br />

application is executed from CodeWarrior.<br />

You should also see a lighted green LED, which indicates that the application is running. If the<br />

application is stopped, the green LED will blink at a 2Hz frequency.<br />

10.12 3-Phase AC Induction Motor Control V/Hz<br />

Application - Closed Loop<br />

This application demonstrates a principal of the V/Hz control of the 3-Phase AC Induction motor<br />

in closed loop using the DSP56F803EVM board, Optoisolation board, and 3-phase AC BLDC<br />

High-Voltage power stage.<br />

10.12.1 Files<br />

The 3-Phase AC Induction Motor Control V/Hz Application - Closed Loop is found in directory:<br />

..\src\dsp56803evm\nos\applications\3ph_AC_VHz_CloseLoop\<br />

and is composed of the following files:<br />

• 3ph_AC_VHz_CL.c, Closed Loop main application program<br />

• 3ph_AC_VHz_CL.h, Closed Loop application header file<br />

• 3ph_AC_VHz_CL.mcp, Closed Loop project file<br />

• ConfigExtRam\appconfig.c, application configuration file for External RAM<br />

• ConfigExtRam\appconfig.h, application configuration file for External RAM<br />

• ConfigExtRam\linker.cmd, linker command file used for RAM<br />

• ConfigFlash\appconfig.c, application configuration file for Flash<br />

• ConfigFlash\appconfig.h, application configuration file for Flash<br />

• ConfigFlash\linker.cmd, linker command file used for Flash<br />

• appconst.c, application constants placed in data Flash<br />

• appconst.h, header file for appconst.c<br />

These files are located in the <strong>SDK</strong> installation directory.<br />

10.12.2 Specification<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

This application performs a principal control of the 3-phase AC induction motor using the<br />

DSP56F803 processor. The control technique sets the speed ([rpm], [Hz]) of the magnetic field<br />

and calculates the phase voltage amplitude according to a V/Hz table. This table is private to the<br />

application and reflects the AC induction motor parameters Base Voltage/frequency; Boost<br />

Voltage/frequency; and DC Boost Voltage. The incremental encoder is used to derive the actual<br />

rotor speed.<br />

The closed loop system is characterized by a feedback signal (Actual Speed), derived from a<br />

quadrature decoder in the controlled system. This signal monitors the actual behavior of the<br />

system, and is compared with the reference signal (Required Speed). The magnitude and polarity<br />

10-96 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

of the resulting error signal are directly related to the difference between the required and actual<br />

values of the controlled variable, which may be the speed of a motor. The error signal is amplified<br />

by the controller, and the controller output makes a correction to the controlled system, reducing<br />

the error signal.<br />

Protection is provided against Overcurrent, Overvoltage, Undervoltage, and Overheating drive<br />

faults.<br />

System Outline<br />

The system is designed to drive a 3-phase AC induction motor (ACIM). The application has the<br />

following specifications:<br />

• Volt per Hertz control technique used for ACIM control<br />

• Close loop control<br />

• Targeted for DSP56F803EVM<br />

• Running on 3-phase AC induction motor control development platform at variable line<br />

voltage 115V AC and 230V AC (range -15% to +10%)<br />

• Motor mode<br />

• Generator mode<br />

• DCBus brake<br />

• Minimum speed 50 rpm<br />

• Maximum speed 2250 rpm at input power line 230V AC<br />

• Maximum speed 1200 rpm at input power line 115V AC<br />

• Power stage and optoisolation board identification<br />

• Fault protection<br />

• Manual interface (RUN/STOP switch; UP/DOWN push buttons control; LED indication)<br />

• PC master software remote control interface (speed set-up)<br />

• PC master software remote monitor<br />

— PC master software monitor interface (required speed; actual motor speed; drive fault status;<br />

DCBus voltage level; identified power stage boards)<br />

Application Description<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The Volt per Hertz control algorithm is calculated on Motorola DSP56F803. The algorithm<br />

generates the 3-phase PWM signals for AC induction motor inverter according to the<br />

user-required inputs, measured and calculated signals.<br />

The concept of the ACIM drive incorporates the following hardware components:<br />

• AC induction motor--brake set<br />

• 3-phase AC/BLDC high voltage power stage<br />

• DSP56F803EVM boards<br />

• Optoisolation box which is connected between the power stage board and the<br />

DSP56F803EVM<br />

The AC induction motor--brake set incorporates a 3-phase AC induction motor and attached<br />

BLDC motor brake. The AC induction motor has four poles. The incremental position sensor<br />

(encoder) is coupled on the motor shaft. The detailed motor--brake specifications are listed in<br />

Table 10-21.<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-97<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The following software tools are needed for compiling, debugging, loading to the EVM, remote<br />

control and monitoring:<br />

• Metrowerks CodeWarrior 4.0<br />

• PC master software<br />

• <strong>SDK</strong> 2.4<br />

Measured quantities:<br />

• DCBus voltage<br />

• Power module temperature<br />

• Rotor speed<br />

The faults used for drive protection:<br />

Table 10-21. Motor - Brake Specifications<br />

Set Manufactured EM Brno, Czech Republic<br />

Motor Specification Motor Type AM40V<br />

3-Phase AC Induction Motor<br />

Brake Specification<br />

Position Sensor (Encoder)<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Pole-Number 4<br />

Nominal Speed 1300 rpm<br />

Nominal Voltage 3 x 200V<br />

Nominal Current: 0.88A<br />

Brake Type<br />

• Overvoltage (PC master software error message = Overvoltage fault)<br />

• Undervoltage (PC master software error message = Undervoltage fault)<br />

• Overcurrent (PC master software error message = Overcurrent fault)<br />

• Overheating (PC master software error message = Overheating fault)<br />

• Wrong-hardware (PC master software error message = Wrong HW used)<br />

This 3-phase AC Induction motor V/Hz application can operate in two modes:<br />

SG40N<br />

3-Phase BLDC Motor<br />

Nominal Voltage 3 x 27V<br />

Nominal Current: 2.6 A<br />

Pole-Number 6<br />

Nominal Speed 1500rpm<br />

Type<br />

Baumer Electric<br />

BHK 16.05A 1024-12-5<br />

Pulses per revolution 1024<br />

1. Manual Operating Mode<br />

The drive is controlled by the RUN/STOP switch (S1). The motor speed is set by the<br />

UP (S2-IRQA) and DOWN (S3-IRQB) push buttons; see Figure 10-74. If the<br />

application runs and motor spinning is disabled (i.e., the system is ready), the green<br />

10-98 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

USER LED (LED8, shown in Figure 10-75) will blink. When motor spinning is<br />

enabled, the green USER LED will be On and the actual state of the PWM outputs is<br />

indicated by PWM output LEDs. If Overcurrent, Overvoltage or Overheating occur<br />

or if the wrong system board is identified, the green USER LED starts to flash<br />

quickly and the PC master software signals the identified type of fault. This state can<br />

be exited only by an application RESET. It is strongly recommended that you inspect<br />

the entire application to locate the source of the fault before starting it again. Refer to<br />

Table 10-22 for application states.<br />

Figure 10-74. RUN/STOP Switch and UP/DOWN Buttons<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-99<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 10-75. USER and PWM LEDs<br />

2. PC master software (remote) Operating Mode<br />

The drive is controlled remotely from a PC through the SCI communication channel<br />

of the DSP device via an RS-232 physical interface. The drive is enabled by the<br />

RUN/STOP switch, which can be used to safely stop the application at any time.<br />

The following control actions are supported:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Table 10-22. Motor Application States<br />

Application State Motor State Green LED State<br />

Stopped Stopped Blinking at a frequency of 2Hz<br />

Running Running On<br />

Fault Stopped Blinking at a frequency of 8Hz<br />

• Set the Required Speed of the motor<br />

• Set Close/Open loop by checking/unchecking the Close Loop check box; see Figure 10-76<br />

10-100 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

PC master software displays the following information:<br />

• Actual and Required Speed of the motor<br />

• Phase voltage amplitude (related to given the DCBus voltage)<br />

• Application mode - RUN/STOP<br />

• DCBus voltage and temperature of power stage module<br />

• Drive Fault status<br />

• Identified hardware<br />

If Overcurrent, Overvoltage, Undervoltage or over-heating occur, the internal fault logic is<br />

asserted and the application enters a fault state (the USER LED starts to flash quickly). This state<br />

can be exited only by an application RESET. It is strongly recommended that you inspect the<br />

entire application to locate the source of a fault before starting it again.<br />

Project files for the PC master software are located in:<br />

..\nos\applications\3ph_AC_VHz_CloseLoop\PC_Master\3ph_AC_VHz_Flash.pmp, which<br />

uses Map file for running in Flash<br />

..\nos\applications\3ph_AC_VHz_CloseLoop\PC_Master\3ph_AC_VHz_ExtRam.pmp,<br />

which uses Map file for running in External Memory<br />

Start the PC master software window’s application and choose the correct PC master software<br />

project for the desired PC master software Operating Mode. Figure 10-76 shows the PC master<br />

software control window for 3ph_AC_VHz_Flash.pmp.<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-101<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 10-76. PC Master Software Control Window<br />

10-102 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

10.12.3 Set-up<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 10-77 illustrates the hardware set-up for the 3-phase AC Motor Control Application -<br />

Closed Loop.<br />

Figure 10-77. Set-up of the 3-phase AC Induction Motor Control Application - Closed Loop<br />

The correct order of phases (phase A, phase B, phase C) for the AC induction motor shown in<br />

Figure 10-77 is:<br />

• phase A = red wire<br />

• phase B = white wire<br />

• phase C = black wire<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

When facing a motor shaft, if the phase order is: phase A, phase B, phase C, the motor shaft<br />

should rotate clockwise (i.e., positive direction, positive speed).<br />

For detailed information, see the DSP56F803 Evaluation Module Hardware Reference<br />

Manual. The serial cable is needed for the PC master software debugging tool only.<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-103<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

10.12.3.1 EVM Jumper Settings<br />

To execute the 3-Phase AC Induction Motor Control V/Hz Application - Closed Loop, the<br />

DSP56F803EVM board requires the strap settings shown in Figure 10-78 and Table 10-23.<br />

1 2 3<br />

JG6<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

7 8 9<br />

JG1<br />

1 2<br />

7 8<br />

JG5<br />

9 8 7<br />

3 2 1<br />

1 2 3<br />

JG6<br />

7 8 9<br />

USER LED<br />

LED3<br />

7 8 9<br />

JG7<br />

3 2 1<br />

PWM LEDs<br />

JG7<br />

JG5<br />

JG4<br />

JG10<br />

JG1<br />

1<br />

S2<br />

P4 IRQA<br />

DSP56F803EVM<br />

Figure 10-78. DSP56F803EVM Jumper Reference<br />

Table 10-23. DSP56F803EVM Jumper Settings<br />

Jumper Group Comment Connections<br />

JG1 UNI-3 serial selected 1-2, 3-4, 5-6, 7-8<br />

JG2 Enable on-board parallel JTAG Command Converter Interface NC<br />

JG3 Use on-board crystal for DSP oscillator input 1-2<br />

JG4 Select DSP’s Mode 0 operation upon exit from reset 1-2<br />

JG5 Enable external SRAM 1-2<br />

JG6 UNI-3 3-Phase Current source selected 2-3, 5-6, 8-9<br />

JG7 Encoder Input Selected for Incremental Encoder signals 2-3, 5-6, 8-9<br />

JG8 On-board Parallel JTAG command converter powered by Host system 1-2<br />

JG9 Use on-board crystal for DSP oscillator input 1-2<br />

JG10 Leave CAN bus un-terminated NC<br />

10-104 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

J3<br />

J2<br />

JG10 1 3 JG9<br />

JG3<br />

J10<br />

1<br />

U15<br />

S3<br />

S/N<br />

RUN/STOP<br />

S4<br />

Y1<br />

U1<br />

P2<br />

J9<br />

1<br />

JG4<br />

JTAG<br />

JG4 S1<br />

JG2 JG8 J1<br />

IRQB<br />

1<br />

JG3<br />

RESET<br />

J8<br />

JG2<br />

JG9<br />

J4<br />

U6 U7<br />

JG8<br />

P3<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Note: When running the EVM target system in a stand-alone mode from Flash, the JG2<br />

jumper must be set in the 1-2 configuration to disable the command converter parallel<br />

port interface.<br />

10.12.4 Build<br />

To build this application, open the 3ph_AC_VHz_CL.mcp project file and execute the Make<br />

command as shown in Figure 10-79. This will build and link the 3-phase AC V/Hz Motor Control<br />

application and all needed Metrowerks and <strong>SDK</strong> libraries.<br />

10.12.5 Execute<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 10-79. Execute Make Command<br />

To execute the 3-phase AC V/Hz Motor Control application, the choose Program/Debug<br />

command in the CodeWarrior IDE, followed by the Run command. For more help with these<br />

commands, refer to the CodeWarrior tutorial documentation in the following file, which is located<br />

in the CodeWarrior installation directory:<br />

\CodeWarrior Documentation\PDF\Targeting_DSP56800.pdf<br />

For jumper settings, see the DSP56F803 Evaluation Module Hardware User’s Manual.<br />

To execute the 3-phase AC V/Hz Motor Control application’s internal Flash version, choose the<br />

Program/Debug command in the CodeWarrior IDE. When loading is finished, set jumper JG2 to<br />

disable the JTAG port and jumper JG4 to enable boot from internal flash, then press the RESET<br />

button.<br />

Once the application is running, move the RUN/STOP switch to the RUN position and set the<br />

required speed with the UP/DOWN push buttons. Pressing the UP/DOWN buttons should<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-105<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

incrementally increase the motor speed until it reaches maximum speed. If successful, the<br />

3-phase AC Induction motor will be spinning.<br />

Note: If the RUN/STOP switch is set to the RUN position when the application starts, toggle<br />

the RUN/STOP switch between the STOP and RUN positions to enable motor<br />

spinning. This is a protection feature that prevents the motor from starting when the<br />

application is executed from CodeWarrior.<br />

You should also see a lighted green LED, which indicates that the application is running. If the<br />

application is stopped, the green LED will blink at a 2Hz frequency.<br />

10.13 3-Phase ACIM Vector ControlApplication<br />

This application demonstrates a principle of the vector control of the 3-phase AC induction motor<br />

(ACIM) using the DSP56F803EVM board, the In-line optoisolation box, and the 3-phase AC<br />

BLDC high voltage power stage.<br />

10.13.1 Files<br />

The 3-phase ACIM vector control application can be found in the <strong>SDK</strong> installation directory:<br />

..\src\dsp56803evm\nos\applications\3ph_ACIM_VectorControl\<br />

and is composed of the following files:<br />

• 3ph_ACIM_VectorControl.c, main application program<br />

• 3ph_ACIM_VectorControl.h, application header file<br />

• 3ph_ACIM_VectorControl.mcp, application project file<br />

• ConfigExtRam\appconfig.c, application configuration file for External RAM<br />

• ConfigExtRam\appconfig.h, application configuration file for External RAM<br />

• ConfigExtRam\linker.cmd, linker command file used for RAM<br />

• ConfigFlash\appconfig.c, application configuration file for Flash<br />

• ConfigFlash\appconfig.h, application configuration header file for Flash<br />

• ConfigFlash\linker.cmd, linker command file used for Flash<br />

• ConfigFlash\flash.cfg, configuration file for Flash<br />

• appconst.c, application constants placed in data Flash<br />

• appconst.h, header file for appconst.c<br />

10.13.2 Specification<br />

System Outline<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The system is designed to drive a 3-phase AC induction motor (ACIM). The application has the<br />

following specifications:<br />

• Vector control technique used for ACIM control<br />

• Speed control loop<br />

• Targeted for DSP56F803EVM<br />

10-106 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

• Running on 3-phase AC induction motor control development platform at variable line<br />

voltage 115V AC and 230V AC (range -15% to +10%)<br />

• Motor mode<br />

• Generator mode<br />

• DCBus brake<br />

• Minimum speed 50 rpm<br />

• Maximum speed 2500 rpm at input power line 230V AC<br />

• Maximum speed 1100 rpm at input power line 115V AC<br />

• Power stage and optoisolation board identification<br />

• Fault protection<br />

• Manual interface (RUN/STOP switch; UP/DOWN push buttons control; LED indication)<br />

• PC master software remote control interface (START MOTOR/STOP MOTOR push<br />

buttons, speed set-up)<br />

• PC master software remote monitor<br />

— PC master software monitor interface (required speed; actual motor speed; PC master<br />

software mode; START MOTOR/STOP MOTOR controls; drive fault status; DCBus voltage<br />

level; identified power stage boards; drive status; mains detection)<br />

— PC master software speed scope (observes actual and desired speed)<br />

Application Description<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The vector control algorithm is calculated on the Motorola DSP56F803. The algorithm generates<br />

the 3-phase PWM signals for AC induction motor inverter according to the user-required inputs,<br />

measured and calculated signals.<br />

The concept of the ACIM drive incorporates the following hardware components:<br />

• AC induction motor--brake set<br />

• 3-phase AC/BLDC high voltage power stage<br />

• DSP56F803EVM boards<br />

• ECOPTINL--In-line optoisolation box, which is connected between the host computer and<br />

the DSP56F803EVM<br />

The AC induction motor--brake set incorporates a 3-phase AC induction motor and attached<br />

BLDC motor brake. The AC induction motor has four poles. The incremental position sensor<br />

(encoder) is coupled on the motor shaft and position Hall Sensors are mounted between the motor<br />

and the brake. They allow position sensing if is required by the control algorithm. The detailed<br />

motor--brake specifications are listed in Table 10-24.<br />

Table 10-24. Motor - Brake Specifications<br />

Set Manufactured EM Brno, Czech Republic<br />

Motor Specification Motor Type AM40V<br />

3-Phase AC Induction Motor<br />

Pole-Number 4<br />

Nominal Speed 1300 rpm<br />

Nominal Voltage 3 x 200V<br />

Nominal Current 0.88A<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-107<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 10-24. Motor - Brake Specifications<br />

Brake Specification<br />

Position Sensor (Encoder)<br />

The following software tools are needed for compiling, debugging, loading to the EVM, remote<br />

control and monitoring:<br />

• Metrowerks CodeWarrior 4.0<br />

• PC master software<br />

• <strong>SDK</strong> 2.4 or later<br />

The drive can be controlled in two different operating modes:<br />

• Manual operating mode - the required speed is set by the UP/DOWN push buttons and the<br />

drive is started and stopped by the RUN/STOP switch on the EVM board<br />

• PC master software operating mode - the required speed is set by the PC master software<br />

active bar graph and the drive is started and stopped by the START MOTOR and STOP<br />

MOTOR controls<br />

Measured quantities:<br />

• DCBus voltage<br />

• Phase currents (phase A, phase B, phase C)<br />

• Power module temperature<br />

• Rotor speed<br />

The faults used for drive protection:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Brake Type<br />

• Overvoltage (PC master software error message = Overvoltage fault)<br />

• Undervoltage (PC master software error message = Undervoltage fault)<br />

• Overcurrent (PC master software error message = Overcurrent fault)<br />

• Overheating (PC master software error message = Overheating fault)<br />

• Wrong-mains (PC master software error message = Mains out of range)<br />

• Wrong-hardware (PC master software error message = Wrong HW used)<br />

• Overload (PC master software error message = Overload) An informative message; the<br />

actual application state is not changed to FAULT state<br />

States of the application state machine; see Table 10-25:<br />

SG40N<br />

3-Phase BLDC Motor<br />

Pole-Number 6<br />

Nominal Speed 1500rpm<br />

Nominal Voltage 3 x 27V<br />

Nominal Current 2.6 A<br />

Type<br />

Baumer Electric<br />

BHK 16.05A 1024-12-5<br />

Pulses per revolution 1024<br />

• INIT - application initialization; operating mode changing.<br />

• STOP - PWM outputs disabled; operating mode changing.<br />

• RUN - PWM outputs enabled; motor running<br />

• FAULT - PWM outputs disabled; waiting for manual fault acknowledgement or application<br />

reset<br />

10-108 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Control Process<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

After reset, the drive is in the INIT state and in the Manual operating mode.When the RUN/STOP<br />

switch is detected in the STOP position and there are no faults pending, the INIT state is changed<br />

to the STOP state. Otherwise, the drive waits in the INIT state. If a fault occurs, the drive goes to<br />

the FAULT state. In INIT and STOP states, the operation mode can be changed from PC master<br />

software. In the Manual operating mode, the application is controlled by the RUN/STOP switch<br />

and UP/DOWN buttons; in the PC master software remote control mode, the application is<br />

controlled by the PC master software environment.<br />

When the start command is accepted (using the RUN/STOP switch or PC master software<br />

command), the STOP state is changed to the RUN state. Then required speed is calculated from<br />

the UP/DOWN push buttons in manual mode or from PC master software commands when in PC<br />

master software remote control mode. The required speed is the input into the<br />

acceleration/deceleration ramp. The difference between the actual speed and the required speed<br />

generates a speed error. Based on the error, the speed controller generates an Is_q_Req current<br />

which corresponds to the torque component. The second Is_d_Req component of the stator<br />

current, which corresponds to rotor flux, is given by the flux controller. The field-weakening<br />

algorithm generates the required rotor flux, which is compared with calculated rotor flux from the<br />

AC induction flux model calculation algorithm. The difference between required rotor flux and<br />

calculated rotor flux generates a flux error. Based on the flux error, the flux controller generates<br />

the required Is_d_Req stator current. Simultaneously, the stator currents Is_a, Is_b and Is_c<br />

(3-phase system) are measured and transformed to the stationary reference frame α, β (2-phase<br />

system) and to the d-q rotating reference frame consecutively. The decoupling algorithm<br />

generates Us_q and Us_d voltages (d-q rotating reference frame). The Us_q and Us_d voltages<br />

are transformed back to the stationary reference frame α, β and then the space vector modulation<br />

generates the three-phase voltage system which is applied on the motor.<br />

Drive Protection<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The DCBus voltage, DCBus current and power stage temperature are measured during the control<br />

process. They protect the drive from Overvoltage, Undervoltage, Overcurrent, Overheating and<br />

Wrong-mains. The Undervoltage, Overheating, Wrong-hardware and Wrong-mains protection are<br />

performed by software. The Overcurrent and the Overvoltage fault signals utilize fault inputs of<br />

the DSP controlled by hardware. The power stage is identified using board identification. If the<br />

correct boards are not identified, the Wrong-hardware fault disables the drive operation. The line<br />

voltage is measured during application initialization. According to the detected voltage level, the<br />

115VAC or 230VAC mains is recognized. If the mains is out of range, the Wrong-mains fault is<br />

set and the drive operation is disabled.<br />

If any of the mentioned faults occur, the motor control PWM outputs are disabled in order to<br />

protect the drive and the application enters the FAULT state. The FAULT state can be left only<br />

when the fault conditions disappear and the RUN/STOP switch is moved to the STOP position in<br />

manual mode, or by the PC master software in PC master software remote mode. If<br />

Wrong-hardware or Wrong-mains occur, the FAULT state can be left only by application reset.<br />

The 3-phase ACIM vector control application can operate in two modes:<br />

1. Manual Operating Mode<br />

The drive is controlled by the RUN/STOP switch (S6). The motor speed is set by the<br />

UP (S2-IRQB) and DOWN (S1-IRQA) push buttons (see Figure 10-80). The actual<br />

state of the application is indicated by the user LEDs (see Figure 10-81). If the<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-109<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

application runs and motor spinning is disabled (i.e., the system is ready), the green<br />

user LED will blink at a frequency of 2Hz. When motor spinning is enabled, the<br />

green user LED will be turned on and the actual state of the PWM outputs are<br />

indicated by PWM output LEDs. If any fault occurs (Overcurrent, Overvoltage,<br />

Undervoltage, Wrong-mains, Overheating or Wrong-hardware), the green user LED<br />

will blink at a frequency of 8Hz. The PC master software control page shows the<br />

identified fault. The faults can be handled by switching the RUN/STOP switch to<br />

STOP, which acknowledges the fault state. Meanwhile, the Wrong-mains and the<br />

Wrong-hardware faults can be quit only with the application reset. It is strongly<br />

recommended that the user inspect the entire application to locate the source of the<br />

fault before starting it again. Refer to Table 10-25 for application states.<br />

Figure 10-80. RUN/STOP Switch and UP/DOWN Buttons<br />

10-110 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 10-81. USER and PWM LEDs<br />

Table 10-25. Motor Application States<br />

Application State Motor State Green LED State<br />

INIT Stopped Blinking at a frequency of 2Hz (slow)<br />

STOP Stopped Blinking at a frequency of 2Hz (slow)<br />

RUN Spinning On<br />

FAULT Stopped Blinking at a frequency of 8Hz (fast)<br />

2. PC master software Operating Mode<br />

The drive is controlled remotely from a PC through the SCI communication channel<br />

of the DSP device via an RS-232 physical interface. The whole application is fully<br />

controllable from the PC master software environment regardless of the<br />

RUN/STOP switch position on the EVM board.<br />

The following PC master software control actions are supported:<br />

• Set PC master software mode of the motor control system<br />

• Set Manual mode of the motor control system<br />

• Start the motor<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-111<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

• Stop the motor<br />

• Set the required speed of the motor<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

PC master software displays the following information:<br />

• Actual and required speed of the motor<br />

• Application status - INIT/STOP/RUN/FAULT<br />

• DCBus voltage<br />

• Identified mains voltage<br />

• Identified hardware<br />

• Temperature of power module<br />

• START MOTOR and STOP MOTOR controls (active only in PC master software mode)<br />

• PC master software check-box (defines full PC master software control or full Manual<br />

control)<br />

• Fault status<br />

If any fault occurs (Overcurrent, Overvoltage, Wrong-mains, Overheating or Wrong-hardware),<br />

the green user LED will blink at a frequency of 8Hz. The PC master software control page shows<br />

the identified fault. The faults can be handled by switching the START MOTOR/STOP MOTOR<br />

icon to STOP MOTOR, which acknowledges the fault state. Meanwhile, the Wrong-mains and<br />

the Wrong-hardware faults can be quit only with the application reset. It is strongly recommended<br />

that the user inspect the entire application to locate the source of the fault before starting it again.<br />

Project files for the PC master software are located in :<br />

..\nos\applications\3ph_ACIM_VectorControl\PC_Master\3ph_ACIM_VectorControl.pmp<br />

Start the PC master software 3ph_ACIM_VectorControl.pmp application. Figure 10-82 shows the<br />

PC master software control window.<br />

Note: If the PC master software project (.pmp file) is unable to control the application, it is<br />

possible that wrong load map (.elf file) has been selected. PC master software uses the<br />

load map to determine addresses for global variables that are monitored. Once the PC<br />

master software project has been launched, this option may be selected in the PC<br />

master software menu under Project/Select Other Map File.<br />

10-112 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

10.13.3 Set-up<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 10-82. PC Master Software Control Window<br />

Figure 10-83 illustrates the hardware set-up for the 3-phase ACIM vector control application.<br />

WARNING:<br />

Danger, high-voltage--risk of electric shock!<br />

The application PCB modules and serial interface (connector,<br />

cable) are not electrically isolated from the mains voltage--they<br />

are live.<br />

Use the In-line Optoisolation Box (ECOPTINL) between the<br />

PC and DSP56803 EVM as protection from dangerous voltage<br />

on the PC-user side, and to prevent damage to the PC and other<br />

hardware.<br />

Do not touch any part of the EVM or the serial cable between<br />

the EVM and the In-line Optoisolation Box unless you are<br />

using an insulation transformer. The application is designed to<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-113<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

be fully controllable only from PC master software.<br />

To avoid inadvertently touching live parts, use plastic covers.<br />

In the rest of this application, the description supposes the use of an insulation transformer.<br />

Figure 10-83. Set-up of the 3-phase ACIM Vector Control Application<br />

The correct order of phases (phase A, phase B, phase C) for the AC induction motor shown in<br />

Figure 10-83 is:<br />

• phase A = red wire<br />

• phase B = white wire<br />

• phase C = black wire<br />

When facing a motor shaft, if the phase order is: phase A, phase B, phase C, the motor shaft<br />

should rotate clockwise (i.e., positive direction, positive speed).<br />

For detailed information, see the DSP56F803 Evaluation Module Hardware Reference<br />

Manual. The serial cable to PC is needed for the PC master software debugging tool only.<br />

10-114 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

10.13.3.1 EVM Jumper Settings<br />

To execute the 3-phase ACIM vector control application, the DSP56F803 board requires the strap<br />

settings shown in Figure 10-84 and Table 10-26.<br />

1 2 3<br />

JG6<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

7 8 9<br />

JG1<br />

1 2<br />

7 8<br />

JG5<br />

9 8 7<br />

3 2 1<br />

1 2 3<br />

JG6<br />

7 8 9<br />

USER LED<br />

LED3<br />

7 8 9<br />

JG7<br />

3 2 1<br />

PWM LEDs<br />

JG7<br />

JG5<br />

JG4<br />

JG10<br />

JG1<br />

1<br />

S2<br />

P4 IRQA<br />

J3<br />

J2<br />

JG10 1 3 JG9<br />

JG3<br />

DSP56F803EVM<br />

Figure 10-84. DSP56F803EVM Jumper Reference<br />

Table 10-26. DSP56F803EVM Jumper Settings<br />

Jumper Group Comment Connections<br />

JG1 UNI-3 serial selected 1-2, 3-4, 5-6, 7-8<br />

JG2 Enable on-board parallel JTAG Command Converter Interface 1-2<br />

JG3 Use on-board crystal for DSP oscillator input 1-2<br />

JG4 Select DSP’s Mode 0 operation upon exit from reset 1-2<br />

JG5 Enable external SRAM 1-2<br />

JG6 UNI-3 3-Phase Current source selected 2-3, 5-6, 8-9<br />

JG7 Encoder Input Selected for Incremental Encoder signals 2-3, 5-6, 8-9<br />

JG8 On-board Parallel JTAG command converter powered by Host system 1-2<br />

JG9 Use on-board crystal for DSP oscillator input 1-2<br />

JG10 Leave CAN bus un-terminated NC<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-115<br />

J10<br />

1<br />

U15<br />

S3<br />

S/N<br />

RUN/STOP<br />

S4<br />

Y1<br />

U1<br />

P2<br />

J9<br />

1<br />

JG4<br />

JTAG<br />

JG4 S1<br />

JG2 JG8 J1<br />

IRQB<br />

1<br />

JG3<br />

RESET<br />

J8<br />

JG2<br />

JG9<br />

J4<br />

U6 U7<br />

JG8<br />

P3<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Note: When running the EVM target system in a stand-alone mode from Flash, the JG2<br />

jumper must be set in the 1-2 configuration to disable the command converter parallel<br />

port interface. For this application, this is permanently set as short-connected.<br />

10.13.4 Build<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

When building this application, the user can create an application that runs from internal Flash or<br />

External RAM, which can be selected from the File menu in the project window. To choose the<br />

desired type, open the 3ph_ACIM_VectorControl.mcp project and select the target build type; see<br />

Figure 10-85. Selecting Build All will create all application build types. Definition of the projects<br />

associated with these target build types may be viewed under the Targets tab of the project<br />

window.<br />

When the 3ph_ACIM_VectorControl.mcp project file is opened, execute the Make command or<br />

press [F7]; see Figure 10-86. This will build and link the 3-phase ACIM vector control application<br />

and all needed libraries from Metrowerks CodeWarrior and the <strong>SDK</strong>.<br />

Figure 10-85. Target Build Selection<br />

10-116 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

10.13.5 Execute<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 10-86. Execute Make Command<br />

To execute the 3-phase ACIM vector control application, choose the Program/Debug command in<br />

the CodeWarrior IDE, and follow with the Run command.<br />

To execute the 3-phase ACIM vector control application’s internal Flash version, choose the<br />

Program/Debug command in the CodeWarrior IDE. When loading is finished, JG4 must be<br />

connected to boot from internal Flash and the RESET button pushed.<br />

For more help with these commands, refer to the CodeWarrior tutorial documentation file, located<br />

in the CodeWarrior installation directory:<br />

\CodeWarrior Documentation\PDF\Targeting_DSP56800.pdf<br />

For jumper settings, see the DSP56F803 Evaluation Module Hardware User’s Manual.<br />

Once the application is running, move the RUN/STOP switch to the RUN position and set the<br />

required speed with the UP/DOWN push buttons. Pressing the UP/DOWN buttons should<br />

incrementally increase the motor speed until it reaches maximum speed. If successful, the<br />

3-phase ACIM will be spinning.<br />

Note: If the RUN/STOP switch is set to the RUN position when the application starts, toggle<br />

this switch back and forth to enable motor spinning. This is a protection feature that<br />

prevents the motor from starting when the application is executed from the<br />

CodeWarrior.<br />

You should also see blinking or lighted LEDs, which indicate the application’s status.<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-117<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

10.13.6 PC Master Software Control<br />

To run the application from Flash or ExtRAM, perform the following steps to set the PC master<br />

software control:<br />

• The application must be in the STOP or INIT state, indicated on the PC master software<br />

control page<br />

• Check the PC master software mode on the PC master software control page<br />

• The motor can be started by pushing the “START MOTOR” PC master software icon and<br />

stopped by pushing the “STOP MOTOR” PC master software icon<br />

• The speed can be set by the bar graph<br />

When the application is in the STOP or INIT state, the Manual mode can be set again by<br />

unchecking the PC master software mode on the PC master software control page.<br />

The application can be monitored in PC master software during the PC master software mode and<br />

during Manual mode.<br />

The following PC master software windows are available:<br />

Speed Scope monitors:<br />

• Required Speed<br />

• Actual Speed<br />

Recorder:<br />

The recorder is prepared for fast events capture.<br />

Note: It is recomended to use the Recorder only when the application is running from<br />

External RAM due to limited on-chip memory. The length of the recorded window<br />

may be changed by left-clicking on the Recorder in the tree structure of the PC master<br />

software items; selecting Recorder Properties in the menu Item/Properties; and<br />

defining the value as Recorded Samples. It is limited by the dedicated memory space<br />

in the appconfig.h file. The recorder samples are taken every 1 ms.<br />

10.14 Digital Power Factor Correction<br />

This application demonstrates Power Factor Correction without motor control. A<br />

DSP56F803EVM board, an Optoisolation board, and a 3-phase AC/BLDC High-Voltage power<br />

stage board are used.<br />

10.14.1 Files<br />

The Digital Power Factor Correction Application is found in directory:<br />

..\src\dsp56803evm\nos\applications\Digital_PFC\<br />

and is composed of the following files:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

• Digital_PFC.mcp, application project file<br />

10-118 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

• dpfc.h, application header file<br />

• dpfc.c, main application program<br />

• appconst.c, application constants placed in data Flash<br />

• appconst.h, header file for appconst.c<br />

• ConfigExtRam\appconfig.c, application configuration file for External RAM<br />

• ConfigExtRam\appconfig.h, application configuration file for External RAM<br />

• ConfigExtRam\linker.cmd, linker command file used for RAM<br />

• ConfigFlash\appconfig.c, application configuration file for Flash<br />

• ConfigFlash\appconfig.h, application configuration file for Flash<br />

• ConfigFlash\linker.cmd, linker command file used for Flash<br />

These files are located in the <strong>SDK</strong> installation directory.<br />

The targeting for the DSP56F803EVM has some specific lines in the dpfc.c C-source file. The<br />

following lines indicate which pin will be used to provide the PFC inhibit output functionality:<br />

/* Uncomment one of the following lines */<br />

// #define DSP56F805EVM<br />

#define DSP56F803EVM<br />

The DSP56F803EVM uses a GPIO output pin, the following timer channel configuration line,<br />

required for the DSP56F805EVM, must be removed from the appconfig.h file:<br />

// #define INCLUDE_USER_TIMER_C_0 0<br />

10.14.2 Specification<br />

The Digital PFC application performs power factor correction for 3-phase AC/BLDC<br />

High-Voltage Power Stage hardware without motor drive. It is a demo that evaluates the basic<br />

algorithm of power factor correction for current hardware implementation. The PFC software was<br />

designed for use with motor control applications. The Digital PFC application allows target<br />

memory configurations of both RAM and Flash. The input power line must meet the following<br />

requirements:<br />

• Input voltage value of 115 or 220 volts<br />

• Input voltage frequency of 50 or 60 Hz<br />

The Digital PFC application can be used in the Manual Operating Mode. The remote control<br />

functionality of the PC master software application is not implemented.<br />

Manual Operating Mode<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The PFC conversion is controlled by the RUN/STOP switch (S1), shown in Figure 10-87. The<br />

USER LED (LED8, highlighted in Figure 10-88) indicates the application’s state. When the<br />

application is ready, the USER LED blinks at a 2Hz frequency.<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-119<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 10-87. RUN/STOP Switch and UP/DOWN Buttons<br />

Figure 10-88. USER and PWM LEDs<br />

10-120 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The PFC conversion can be enabled after the RUN/STOP switch is moved to the RUN position.<br />

The normal PFC conversion process is indicated when the USER LED lights continuously. To<br />

disable PFC conversion, the RUN/STOP switch must be moved to the STOP position.<br />

10.14.3 Set-up<br />

Figure 10-89 illustrates the hardware set-up for the Digital PFC application, which does not<br />

require the motor drive. The AC/BLDC High-Voltage Power Stage board contains the JP201<br />

jumper, which selects the power supply device. By default, a wire is soldered between the 2-3<br />

pins of the JP201 jumper to correspond to a simple rectifier-capacitor power stage. The PFC<br />

hardware set-up requires that the wire between the JP201’s pins be disconnected and a wire to be<br />

soldered across the pins 1-2 of the JP201 jumper, thereby selecting the PFC inductor.<br />

10.14.3.1 EVM Jumper Settings<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 10-89. Set-up of the Digital PFC Application<br />

To execute the Digital PFC application, the DSP56F803 board requires the strap settings shown in<br />

Figure 10-90 and Table 10-27.<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-121<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

1 2 3<br />

JG6<br />

JG1<br />

1 2<br />

7 8<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

7 8 9<br />

JG5<br />

9 8 7<br />

3 2 1<br />

1 2 3<br />

JG6<br />

7 8 9<br />

USER LED<br />

JG7<br />

3 2 1<br />

LED3<br />

DSP56F803EVM<br />

Figure 10-90. DSP56F803EVM Jumper Reference<br />

Table 10-27. DSP56F803EVM Jumper Settings<br />

Jumper Group Comment Connections<br />

JG1 UNI-3 serial selected 1-2, 3-4, 5-6, 7-8<br />

JG2 Enable on-board parallel JTAG Command Converter Interface NC<br />

JG3 Use on-board crystal for DSP oscillator input 1-2<br />

JG4 Select DSP’s Mode 0 operation upon exit from reset 1-2<br />

JG5 Enable external SRAM 1-2<br />

JG6 UNI-3 3-Phase Current source selected 2-3, 5-6, 8-9<br />

JG7 Encoder Input Selected for Incremental Encoder signals 2-3, 5-6, 8-9<br />

JG8 On-board Parallel JTAG command converter powered by Host<br />

system<br />

7 8 9<br />

PWM LEDs<br />

JG7<br />

JG5<br />

JG4<br />

JG10<br />

JG1<br />

1<br />

S2<br />

P4 IRQA<br />

J3<br />

J2<br />

JG10 1 3 JG9<br />

JG3<br />

JG9 Use on-board crystal for DSP oscillator input 1-2<br />

JG10 Leave CAN bus un-terminated NC<br />

J10<br />

1<br />

Note: When running the EVM target system in a stand alone-mode from Flash, the JG2<br />

jumper must be set in the 1-2 configuration to disable the command converter parallel<br />

port interface.<br />

10-122 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

U15<br />

S3<br />

S/N<br />

RUN/STOP<br />

S4<br />

Y1<br />

U1<br />

P2<br />

J9<br />

1<br />

JG4<br />

JTAG<br />

JG4 S1<br />

JG2 JG8 J1<br />

IRQB<br />

1<br />

JG3<br />

RESET<br />

J8<br />

JG2<br />

JG9<br />

J4<br />

U6 U7<br />

JG8<br />

P3<br />

1-2<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

10.14.4 Build<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

To build this application, open the Digital_PFC.mcp project file and execute the Make command,<br />

as shown in Figure 10-91. This will build and link the Digital PFC application and all needed<br />

Metrowerks and <strong>SDK</strong> libraries.<br />

10.14.5 Execute<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 10-91. Execute Make Command<br />

To execute the Digital PFC application, choose the Program/Debug command in the CodeWarrior<br />

IDE, followed by the Run command. For more help with these commands, refer to the<br />

CodeWarrior tutorial documentation in the following file, which is located in the CodeWarrior<br />

installation directory:<br />

\CodeWarrior Documentation\PDF\Targeting_DSP56800.pdf<br />

For jumper settings, see the DSP56F803 Evaluation Module Hardware User’s Manual.<br />

To execute the Digital PFC application’s internal Flash version, choose the Program/Debug<br />

command in the CodeWarrior IDE. When loading is finished, set jumper JG2 to disable the JTAG<br />

port and jumper JG4 to enable boot from internal flash, then press the RESET button.<br />

When the application is running, the USER LED will blink at a 2Hz frequency. To enable the PFC<br />

conversion, set the RUN/STOP switch to the RUN position. If this switch was in the RUN<br />

position before the application started, switch it to the STOP position, then back to the RUN<br />

position.<br />

The USER LED should light continuously when PFC conversion is enabled. To disable the PFC<br />

conversion, the RUN/STOP switch should be moved to the STOP position (the USER LED will<br />

blink again).<br />

You should also see a lighted green LED, which indicates that the application is running. If the<br />

application is stopped, the green LED will blink at a 2Hz frequency.<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-123<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

10.15 Digital Power Factor Correction for 3-phase<br />

AC Motor V/Hz Open Loop<br />

This application demonstrates how to integrate the Power Factor Correction with a Motor Control<br />

application. It is based on the 3-phase AC Motor V/Hz Open Loop application and performs the<br />

same functionality. Only the power supply was changed in the current implementation. The<br />

application uses the DSP56F803EVM board, Optoisolation board, and 3-phase AC/BLDC<br />

High-Voltage power stage board.<br />

10.15.1 Files<br />

The Digital Power Factor Correction for 3-Phase AC Motor V/Hz Open Loop Application is<br />

found in the directory:<br />

..\src\dsp56803evm\nos\applications\3ph_AC_VHz_OpenLoop_PFC\<br />

and is composed of the following files:<br />

• 3ph_AC_VHz_OpenLoop_PFC.mcp, application project file<br />

• dpfc.h, application header file<br />

• dpfc.c, main application program<br />

• appconst.c, application constants placed in data Flash<br />

• appconst.h, header file for appconst.c<br />

• ConfigExtRam\appconfig.c, application configuration file for External RAM<br />

• ConfigExtRam\appconfig.h, application configuration file for External RAM<br />

• ConfigExtRam\linker.cmd, linker command file used for RAM<br />

• ConfigFlash\appconfig.c, application configuration file for Flash<br />

• ConfigFlash\appconfig.h, application configuration file for Flash<br />

• ConfigFlash\linker.cmd, linker command file used for Flash<br />

These files are located in the <strong>SDK</strong> installation directory. The targeting for DSP56F803EVM has<br />

some specific lines in the dpfc.c C-source file. The following lines indicate which pin will be used<br />

to provide the PFC inhibit output functionality:<br />

/* Uncomment one of the following lines */<br />

// #define DSP56F805EVM<br />

#define DSP56F803EVM<br />

The DSP56F803EVM uses a GPIO pin to provide the PFC inhibit output, so the following timer<br />

channel configuration line, required for DSP56F805EVM, must be removed from the appconfig.h<br />

file:<br />

// #define INCLUDE_USER_TIMER_C_0 0<br />

10.15.2 Specification<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The Digital PFC for 3-phase AC Motor V/Hz Open Loop application performs power factor<br />

correction for the 3-phase AC/BLDC High-Voltage Power Stage hardware with a 3-phase<br />

induction motor drive. It evaluates how to integrate the PFC control software with a Motor<br />

Control application for current hardware implementation. The application allows target memory<br />

10-124 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

configurations of both RAM and Flash. The input power line must meet the following<br />

requirements:<br />

• Input voltage value of 115 or 220 volts<br />

• Input voltage frequency of 50 or 60Hz<br />

The Digital PFC for the 3-phase AC Motor V/Hz Open Loop application allows execution in the<br />

manual and PC master software modes, described in Section 10.12.<br />

10.15.3 Set-up<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 10-92 illustrates the hardware set-up for the Digital PFC for 3-phase AC Motor V/Hz Open<br />

Loop application. The configuration is basically the same as the 3-phase AC Motor V/Hz Open<br />

Loop application, with this difference:<br />

The AC/BLDC High-Voltage Power Stage board contains the JP201 jumper, which selects the<br />

power supply device. The 2-3 pins of the JP201 connection correspond to a simple<br />

rectifier-capacitor power stage. The PFC hardware set-up requires the 1-2 pins of JP201<br />

connection.<br />

Figure 10-92. Set-up of the Digital PFC for 3-phase AC Motor V/Hz Open Loop Application<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-125<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The correct order of phases (phase A, phase B, phase C) for the AC induction motor shown in<br />

Figure 10-92 is:<br />

• phase A = red wire<br />

• phase B = white wire<br />

• phase C = black wire<br />

When facing a motor shaft, if the phase order is: phase A, phase B, phase C, the motor shaft<br />

should rotate clockwise (i.e., positive direction, positive speed).<br />

10.15.3.1 EVM Jumper Settings<br />

To execute the Digital PFC 3-phase AC Motor V/Hz Open Loop application, the DSP56803 board<br />

requires the same strap settings as the 3-phase AC Motor V/Hz Open Loop application; see<br />

Section 10.12.<br />

10.15.4 Build<br />

To build this application, open the 3ph_AC_VHz_OpenLoop_PFC.mcp project file and follow the<br />

directions in Section 10.12.<br />

10.15.5 Execute<br />

To execute the Digital PFC for the 3-phase AC Motor V/Hz Open Loop application, follow the<br />

directions in Section 10.12.<br />

10.16 Serial Bootloader<br />

The Serial Bootloader has been developed to load and run a proprietary user application presented<br />

as an S-Record file into the Program and Data memory. The Serial Bootloader is located in the<br />

dedicated Program Memory region, called Boot Flash. The Serial Bootloader supports the<br />

simplest serial protocol, so a standard serial terminal program can be used on the host PC.<br />

10.16.1 Files<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The Serial Bootloader application includes the following files:<br />

• ..\nos\applications\serial_bootloader\bootloader.mcp, project file<br />

• ..\nos\applications\serial_bootloader\bootloader.c, main program<br />

• ..\nos\applications\serial_bootloader\bootloader.h, header file with common parameters<br />

• ..\nos\applications\serial_bootloader\com.c, communication module<br />

• ..\nos\applications\serial_bootloader\com.h, header for communication module<br />

• ..\nos\applications\serial_bootloader\sparser.c, S-Record format parser module<br />

• ..\nos\applications\serial_bootloader\sparser.h, header for S-Record parser module<br />

• ..\nos\applications\serial_bootloader\prog.c, flash programming module<br />

10-126 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

• ..\nos\applications\serial_bootloader\prog.h, header for flash programming module<br />

• ..\nos\applications\serial_bootloader\bootstart.c, startup module<br />

• ..\nos\applications\serial_bootloader\constdata.asm, description of strings data<br />

• ..\nos\applications\serial_bootloader\resetvector.asm, Reset and COP Reset interrupt<br />

vectors description<br />

• ..\nos\applications\serial_bootloader\TargetDirectives, Board name definition<br />

• ..\nos\applications\serial_bootloader\config\linker.cmd, linker command file used for<br />

Boot Flash<br />

• ..\nos\applications\serial_bootloader\config\flash.cfg, Metrowerks CodeWarrior<br />

configuration file to work with Flash<br />

These files are located in the <strong>SDK</strong> installation directory. The Bootloader application does not use<br />

any other <strong>SDK</strong> files except port.h, arch.h and periph.h from the ..\nos\include directory. It can be<br />

compiled and used without other parts of the <strong>SDK</strong>.<br />

10.16.2 Specification<br />

The Serial Bootloader application reads the S-Record file of a user application (for example,<br />

generated by CodeWarrior) via serial interface, parses this S-Record file, and stores needed data<br />

in Program and Data flash memory. When the processing of the S-Record file is finished, the<br />

Bootloader launches the loaded application. If any error occurs while loading the S-Record file,<br />

the Bootloader outputs an error message with an error number via the serial line and resets the<br />

processor.<br />

10.16.3 Set-up<br />

To use the Bootloader, it must be programmed into boot flash; the EVM P3 socket must be<br />

connected by serial cable with the host PC’s COM serial port; and jumpers on the EVM must be<br />

set with usage of internal memory without debug interface.<br />

10.16.3.1 EVM Jumper Settings<br />

To load the Bootloader into the DSP56F803 board, the following jumper settings are required:<br />

• Set jumper JG4, “Select DSP’s Mode 0 operation upon exit from reset”<br />

• Remove jumper JG2, “Enable on-board Parallel JTAG Host Target Interface”<br />

To start a previously-loaded Bootloader on the DSP56F803 board, the following jumper settings<br />

are required:<br />

• Set jumper JG4, “Select DSP’s Mode 0 operation upon exit from reset”<br />

• Set jumper JG2, “Enable on-board Parallel JTAG Host Target Interface”<br />

10.16.4 Build<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

To build the Serial Bootloader, open the bootloader.mcp project file in the CodeWarrior IDE and<br />

execute the Project/Make command. This will build and link the Serial Bootloader application.<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-127<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

10.16.4.1 Download into Boot Flash<br />

To download, build the Bootloader from Codewarrior and load it into board by choosing the<br />

Project/Debug command in the CodeWarrior IDE. Make sure that jumpers are set for loading as<br />

described in Section 10.16.3.1.<br />

10.16.4.2 Host Terminal Program Set-up<br />

A host terminal program is used to communicate with Bootloader. The terminal must be<br />

configured to the following mode:<br />

Baud rate<br />

The following description assumes that Microsoft Windows HyperTerminal program is used. To<br />

configure Microsoft HyperTerminal to communicate with Bootloader, the PC user should start<br />

HyperTerminal and create a new connection. Select the COM port previously connected to EVM<br />

and set Baud rate at 115200 bps; Data bits equal to 8, Parity none, Stop bits 1; and Flow control as<br />

Xon/Xoff. The Hyperterminal can now display Bootloader messages.<br />

10.16.5 Execute<br />

To execute the Serial Bootloader application after loading it into Flash, set jumpers as described<br />

in Section 10.16.3.1. and push the RESET button.<br />

If the terminal program is properly set up and the EVM and the Host PC are properly connected,<br />

the terminal program will display a Bootloader startup message:<br />

"(c) 2000-2001 Motorola Inc. S-Record loader. Version 1.1"<br />

To load the S-Record file, select the Transfer/Send text file from the HyperTerminal menu and<br />

select a file. When the S-Record file is loaded and the application is started, the terminal windows<br />

displays a message similar to this:<br />

"(c) 2000-2001 Motorola Inc. S-Record loader. Version 1.1<br />

Loaded 0x044d Program and 0x000a Data words.<br />

Application started."<br />

The download rate is about 7660 bytes of S-Record file per second loaded from the terminal or<br />

about 1740 words of program or data memory stored into Flash per second.<br />

If an error is detected while loading the S-Record file, the Bootloader displays the error message<br />

and resets the processor. For example, if an S-record file contains a character that is not permitted<br />

for S-Records, the following message is displayed:<br />

"(c) 2000-2001 Motorola Inc. S-Record loader. Version 1.1<br />

Error # 0002<br />

Resetting the processor."<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

115200 bps<br />

8N1 8 data bits, no parity, 1 stop bit character format<br />

Flow control protocol Xon / Xoff<br />

10-128 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Common Hardware Configuration for Motor Control Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

After this message, the Bootloader resets the processor and waits for the S-Record file again.<br />

Other loading errors are described in Table 10-28.<br />

Error<br />

Code<br />

Table 10-28. Error Codes for the Serial Bootloader Application<br />

Error Title Possible Reasons What to Do<br />

1 Data Receive Error •Any SCI error except Noise Error<br />

(Overrun, Frame Error, Parity<br />

Error)<br />

2 Invalid Character •Received character is not "S" or<br />

any hexadecimal digit<br />

3 Invalid S-Record<br />

Format<br />

4 Wrong S-Record<br />

Checksum<br />

If an application previously loaded via the Bootloader uses the <strong>SDK</strong> variable<br />

BSP_BOOTLOADER_DELAY, (see Section 10.16.6), the Bootloader waits for the S-Record file<br />

only until the required time-out expires, then launches the application. When this happens, the<br />

terminal window contains a message similar to this:<br />

"(c) 2000-2001 Motorola Inc. S-Record loader. Version 1.1<br />

Application started."<br />

•Invalid record type; permitted<br />

type is 0,3,7<br />

•S-Record length is less than<br />

address plus checksum length<br />

•Checksum calculated around<br />

received S-Record did not match<br />

with received one.<br />

10.16.6 Requirements for a Loaded Program<br />

•Check connections with Host PC and<br />

settings for host terminal program<br />

•Verify that S-Record file does not contain any<br />

invalid characters<br />

•Check connections and send mode in the<br />

terminal program<br />

•Verify S-Record file<br />

•Check S-Record file<br />

•Check connections and send mode in<br />

terminal program<br />

5 Buffer Overrun •Internal data buffer was full •Terminal program did not stop after receiving<br />

Xoff character<br />

•Confirm that the terminal program supports<br />

Xon / Xoff flow control protocol<br />

6 Flash<br />

Programming Error<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

•After programming word into<br />

Flash,the programmed word read<br />

back is not equal to expected<br />

value<br />

•The Bootloader tries to program Flash only<br />

once and perfroms a read back / verify of the<br />

value<br />

7 Internal Error •Bootloader data corrupte. •Try to reload Bootloader via CodeWarrior<br />

If the application is loaded via the Bootloader, it must meet the following requirements:<br />

• Particular start address for application - The entry point for the loaded application must<br />

be located at address 0x0080 in Program memory, i.e., immediately after the interrupt table.<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-129<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

• Application COP vector - To use COP interrupt vector in an application loaded via<br />

Bootloader, the entry point for the COP ISR must be located at address 0x0082 in Program<br />

memory.<br />

• Application start delay variable must be set at address 0x0085 in Program Flash - The<br />

<strong>SDK</strong> provides a configuration variable for this purpose. For details on managing the<br />

Bootloader without <strong>SDK</strong> support, see file config\vector.c in the <strong>SDK</strong>.<br />

• Restricted resources use - The application cannot occupy Reset and COP interrupt<br />

vectors, and cannot place code into Boot Flash memory area. There is no way to place any<br />

initialized variable from the application into internal data RAM while loading. This<br />

memory area is used by Bootloader. All data from the S-Record file that address to the<br />

restricted area will be ignored. External Program memory is unavailable while loading the<br />

application because the Bootloader is performed in DSP Mode 0A memory map.<br />

All applications built with the <strong>SDK</strong> can be loaded via the Serial Bootloader. The <strong>SDK</strong> provides a<br />

fixed address for application entry point; redirection for the application COP vector and has a<br />

configuration variable (BSP_BOOTLOADER_DELAY) for the appconfig.h file that determines<br />

the application’s start delay time-out.<br />

Possible values of BSP_BOOTLOADER_DELAY:<br />

0 Disable the Bootloader, start the application<br />

immediately. After loading the application with this<br />

setting, there are only two ways to re-enter Bootloader:<br />

0 - 254<br />

255<br />

If there is no BSP_BOOTLOADER_DELAY set in the appconfig.h file, the default value for<br />

time-out is 30 seconds.<br />

10.16.7 DSP Peripheral Usage<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

• Reload the Bootloader from Metrowerks<br />

CodeWarrior into Boot Flash<br />

• Reprogram the value of the start delay variable<br />

located at address 0x0083 in the Program Flash to<br />

zero value (0x0000) in the loaded application<br />

Set waiting time for the start of the S-Record file for<br />

0-255 seconds before the start of a previously-loaded<br />

application<br />

Set waiting time to infinity. After reset, the Bootloader<br />

waits for the S-Record file without counting down any<br />

time-out<br />

The DSP is used in a single chip mode; the Bootloader uses only internal data RAM for data<br />

buffering.<br />

The Bootloader does not initialize any DSP peripheral except SCI 0, Port E and PLL unitization.<br />

The PLL multiplier is set to18, which equals the DSP’s operational frequency of 72MHz. Before<br />

starting the application, SCI 0 is disabled, but PLL does not reprogram to its initial state.<br />

10-130 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

ADC Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The Bootloader uses a statically-calculated SCI baud rate value. This value was calculated with<br />

the assumption that the external Oscillator Frequency is 8MHz.<br />

10.17 ADC Application<br />

For details on building and executing this application, see Section 5.4.6.<br />

10.18 COP Driver Application<br />

Refer to Section 5.10.3 for information on building and executing the Computer Operating<br />

Properly Driver Application.<br />

10.19 PWM Application<br />

See Section 5.8.6 for more information on building and executing the PWM Driver Application.<br />

10.20 Quad Timer Application<br />

To learn more about building and executing this application, refer to Section 5.5.6.<br />

10.21 SCI Application<br />

Section 5.3.6 contains details on building and executing the SCI Driver Application.<br />

10.22 Timer Application<br />

This application exercises the Timer peripheral located on the DSP56F8xx processor.<br />

10.22.1 Files<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The Timer application is composed of the following files:<br />

• ...\dsp568xxevm\nos\applications\timers\timers.c, main program<br />

• ...\dsp568xxevm\nos\applications\timers\timers.mcp, application project file<br />

• ...\dsp568xxevm\nos\applications\timers\Config\appconfig.c, application configuration<br />

file<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-131<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

• ...\dsp568xxevm\nos\applications\timers\Config\appconfig.h, application configuration<br />

file<br />

• ...\dsp568xxevm\nos\applications\timers\Config\linker.cmd, linker command file<br />

These files are located in the <strong>SDK</strong> installation directory.<br />

10.22.2 Specifications<br />

This application exercises Timer0, Timer1, and Timer2 peripherals located in the DSP56F8xx<br />

processor. It initializes Timer1 using clock ID CLOCK_AUX1 to 250ms with a reload value of<br />

250ms. Timer2 is initialized using clock ID CLOCK_AUX2 to 125ms with a reload value of<br />

125ms. When these timers expire, the application changes the On/Off state of the yellow and red<br />

LEDs. The net effect of this is that the yellow LED will come On once every 0.5 seconds, and the<br />

red LED will come On once every 0.25 seconds.<br />

For interaction with Timer0, the application uses the <strong>SDK</strong> timer services. The <strong>SDK</strong> timer services<br />

reserve Timer0 with clock ID CLOCK_REALTIME, and utilizes this timer for nanosleep<br />

functionality. This application calls the nanosleep interface with a time-out value of 0.5 seconds<br />

in a tight loop. The net effect of this call will be suspension of the main function execution for 0.5<br />

seconds.<br />

10.22.3 Set-up<br />

Jumper Settings:<br />

Use the default jumper settings for the DSP56F803EVM board. See the DSP56F803 Evaluation<br />

Module Hardware User’s Manual for more information on jumper settings.<br />

10.22.4 Build<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

To make this application, open the timers.mcp project file and execute the Make command as<br />

shown in Figure 10-93. This will build and link the Timer application and all needed Metrowerks<br />

and <strong>SDK</strong> libraries.<br />

10-132 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

10.22.5 Execute<br />

Figure 10-93. Execute Make Command<br />

To execute the Timer application, choose the Program/Debug command in the CodeWarrior IDE,<br />

followed by the Run command. For more help with these commands, refer to the CodeWarrior<br />

tutorial documentation in the following file, located in the CodeWarrior installation directory:<br />

\CodeWarrior Documentation\PDF\Targeting_DSP56800.pdf<br />

Once the application is running, you should see the green LED come On every 1 second, the<br />

yellow LED come On every 0.5 seconds , and the red LED come On every 0.25 seconds.<br />

10.23 CAN<br />

The Motorola Scalable Controller Area Network (MSCAN) driver is described in more detail in<br />

the DSP56800/MSCAN Driver User’s Manual.<br />

10.24 Flash Application<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

For information on how to build and execute this application, see Section 5.2.6.<br />

CAN<br />

MOTOROLA DSP56F803 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

10-133<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

DSP56F803 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

10-134 Targeting Motorola DSP5680X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Chapter 11<br />

DSP56F805 Applications<br />

11.1 Common Hardware Configuration for Motor<br />

Control Applications<br />

11.1.1 Settings for EVM Trimpots<br />

Settings for the DSP56F805 board’s required fault trimpots are shown in Figure 11-1, Table 11-1,<br />

Table 11-2, Table 11-3:<br />

GND - pin TP1<br />

Figure 11-1. Trimpot Pins (Top view)<br />

Table 11-1. Trimpot Settings for EVM Motor Board BLDC Motor Control Application<br />

Trim Pot Comment Voltage POT - Pin 2 to GND<br />

R71 Overvoltage Fault Detection Primary UNI-3 3.3V<br />

R116 Overcurrent Fault Detection Primary UNI-3 3.3V<br />

Table 11-2. Trimpot Settings for Low-Voltage BLDC Motor Control Application<br />

Trim Pot Comment Voltage POT - Pin 2 to GND<br />

R71 Overvoltage Fault Detection Primary UNI-3 3.3V<br />

R116 Overcurrent Fault Detection Primary UNI-3 3.3V<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-1<br />

2<br />

POT<br />

1 3<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

11.1.2 Communication Port Settings<br />

When utilizing the PC master software debugging tool, a communication port on a PC requires the<br />

following settings:<br />

11.2 BLDC Motor Control Application with Hall<br />

Sensors<br />

This application exercises simple control of the BLDC motor with Hall Sensors on the<br />

DSP56F805EVM board and the EVM Motor Kit.<br />

11.2.1 Files<br />

Table 11-3. Trim Pot Settings for High-Voltage BLDC Motor Control Application<br />

Trim Pot Comment Voltage POT -Pin 2 to GND<br />

R71 Overvoltage Fault Detection Primary UNI-3 3.3V<br />

R116 Overcurrent Fault Detection Primary UNI-3 3.3V<br />

Baud Rate 9600<br />

Data Bits 8<br />

Parity None<br />

Stop Bit: 1<br />

Flow Control None<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The BLDC Motor Control application is composed of the following files:<br />

• ...\dsp56805evm\nos\applications\bldc_sensor\bldc_sensor.c, main program<br />

• ...\dsp56805evm\nos\applications\bldc_sensor\bldc_sensor.mcp, application project file<br />

• ...\dsp56805evm\nos\applications\bldc_sensor\configextram\appconfig.c, application<br />

configuration file for external RAM<br />

• ...\dsp56805evm\nos\applications\bldc_sensor\configflash\appconfig.c, application<br />

configuration file for Flash<br />

• ...\dsp56805evm\nos\applications\bldc_sensor\configextram\appconfig.h, application<br />

configuration file for external RAM<br />

• ...\dsp56805evm\nos\applications\bldc_sensor\configflash\appconfig.h, application<br />

configuration file for Flash<br />

• ...\dsp56805evm\nos\applications\bldc_sensor\configextram\linker.cmd, linker<br />

command file for external RAM<br />

• ...\dsp56805evm\nos\applications\bldc_sensor\configflash\linker.cmd, linker command<br />

file for Flash<br />

11-2 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

BLDC Motor Control Application with Hall Sensors<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

• ...\dsp56805evm\nos\applications\bldc_sensor\configflash\flash.cfg, configuration file<br />

for Flash<br />

• ...\dsp56805evm\nos\applications\bldc_sensor\PCMaster\BLDC demo.pmp,<br />

PCMaster file<br />

These files are located in the <strong>SDK</strong> installation directory.<br />

11.2.2 Specifications<br />

This application performs simple control of a BLDC motor with Hall Sensors and close loop<br />

control on the DSP56F805 processor. In the application, the PWM module is set to<br />

complementary mode with a 16kHz switching frequency. The state of the Hall Sensors is read<br />

from the Input Monitor Register of the Quadrature Decoder. The masking and swapping of the<br />

PWM channels is controlled by the PWM Channel Control Register. The content of this register is<br />

derived from Hall Sensors signals. The commutation is done with each new edge of the Hall<br />

Sensors’ signals. The required voltage is set independently on the commutation by the speed PI<br />

controller. The speed is measured by the quad timer. The allowable range of speed for this motor<br />

application is from 400 rpm to 1000 rpm in both directions.<br />

The application can run on:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

• External RAM or Flash<br />

This BLDC Motor Control Application with Hall Sensors can operate in two modes:<br />

1. Manual Operating Mode<br />

The drive is controlled by the RUN/STOP switch (S6). The motor speed is set by the<br />

UP (S2-IRQB) and DOWN (S1-IRQA) push buttons; see Figure 11-2. If the<br />

application runs and motor spinning is disabled (i.e., the system is ready) the USER<br />

LED (LED3, shown in Figure 11-3) will blink. When motor spinning is enabled, the<br />

USER LED is On. Refer to Table 11-4 for application states.<br />

Figure 11-2. RUN/STOP Switch and UP/DOWN Buttons<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-3<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 11-3. USER and PWM LEDs<br />

Table 11-4. Motor Application States<br />

Application State Motor State Green LED State<br />

Stopped Stopped Blinking at a frequency of 2Hz<br />

Running Spinning On<br />

Fault Stopped Blinking at a frequency of 8Hz<br />

2. PC master software (Remote) Operating Mode<br />

The drive is controlled remotely from a PC through the SCI communication channel<br />

of the DSP device via an RS-232 physical interface. The drive is enabled by the<br />

RUN/STOP switch, which can be used to safely stop the application at any time.<br />

11-4 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

BLDC Motor Control Application with Hall Sensors<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The following control actions are supported:<br />

• Set the Required Speed of the motor<br />

PC master software displays the following information:<br />

• Applied Voltage<br />

• Required Voltage<br />

• Speed<br />

• RUN/STOP Switch Status<br />

• Application Mode<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Projects files for the PC master software are located in:<br />

..\nos\applications\bldc_sensors\PC_Master\bldc demo.pmp<br />

Start the PC master software window’s application, BLDC Demo.pmp. Figure 11-4 illustrates the<br />

PC master software control window after this project has been launched.<br />

Note: If the PC master software project (.pmp file) is unable to control the application, it is<br />

possible that the wrong load map (.elf file) has been selected. PC master software uses<br />

the load map to determine addresses for global variables being monitored. Once the<br />

PC master software project has been launched, this option may be selected in the PC<br />

master software window under Project/Select Other Map FileReload.<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-5<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 11-4. PC Master Software Control Window<br />

11-6 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

11.2.3 Set-up<br />

BLDC Motor Control Application with Hall Sensors<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 11-5 illustrates the hardware set-up for the BLDC Motor Control Application with Hall<br />

Sensors.<br />

Figure 11-5. Set-up of the BLDC Motor Control Application<br />

For detailed information, see the DSP56F805 Evaluation Module Hardware Reference<br />

Manual. The serial cable is needed for the PC master software debugging tool only.<br />

11.2.3.1 EVM Jumper Settings<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

To execute the BLCD Motor Control with Hall Sensors, the DSP56F805 board requires the strap<br />

settings shown in Figure 11-6 and Table 11-5.<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-7<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

JG6<br />

3 1<br />

JG1<br />

JG2<br />

JG15<br />

1<br />

3<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

1<br />

3<br />

1<br />

3<br />

9 7<br />

6 4<br />

3 1<br />

JG10<br />

JG14<br />

JG9<br />

JG15 JG1 JG2<br />

1<br />

JG9<br />

JG3<br />

1<br />

LED3<br />

P3 IRQA<br />

JG3<br />

1 2<br />

7 8<br />

S/N<br />

U1<br />

DSP56F805EVM<br />

3<br />

2<br />

1<br />

JG13<br />

Figure 11-6. DSP56F805EVM Jumper Reference<br />

Table 11-5. DSP56F805EVM Jumper Settings<br />

Jumper Group Comment Connections<br />

JG1 PD0 input selected as a high 1-2<br />

JG2 PD1 input selected as a high 1-2<br />

JG3 Primary UNI-3 serial selected 1-2, 3-4, 5-6, 7-8<br />

JG4 Secondary UNI-3 serial selected 1-2, 3-4, 5-6, 7-8<br />

JG5 Enable on-board parallel JTAG Command Converter Interface NC<br />

JG6 Use on-board crystal for DSP oscillator input 2-3<br />

JG7 Select DSP’s Mode 0 operation upon exit from reset 1-2<br />

JG8 Enable on-board SRAM 1-2<br />

JG9 Enable RS-232 output 1-2<br />

JG10 Secondary UNI-3 Analog temperature input unused NC<br />

JG11 Use Host power for Host target interface 1-2<br />

JG12 Primary Encoder input selected for Hall Sensor signals 2-3, 5-6, 8-9<br />

JG13 Secondary Encoder input selected 2-3, 5-6, 8-9<br />

11-8 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

JTAG<br />

U15<br />

S4 S5 S6<br />

JG7<br />

1<br />

JG5<br />

GP1<br />

S1<br />

GP2<br />

S2<br />

RUN/STOP<br />

S3<br />

JG11<br />

P1<br />

U9 U10<br />

IRQB<br />

3<br />

2<br />

1<br />

JG12<br />

USER<br />

9 7<br />

J23 J24<br />

6 4<br />

3<br />

JG10<br />

PWM<br />

1<br />

1 3<br />

JG14 2<br />

JG17 1<br />

JG6 JG12<br />

1<br />

Y1<br />

3<br />

2<br />

1<br />

JG13<br />

JG18<br />

RESET<br />

JG18<br />

1<br />

JG16<br />

JG17<br />

J29<br />

JG8<br />

1<br />

JG4<br />

P1<br />

3 1<br />

JG11<br />

8<br />

2<br />

JG4<br />

JG8<br />

7<br />

1<br />

3 1<br />

JG16<br />

JG5<br />

JG7<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

BLDC Motor Control Application with Hall Sensors<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 11-5. DSP56F805EVM Jumper Settings<br />

Jumper Group Comment Connections<br />

JG14 Primary UNI-3 3-Phase Current Sense selected as Analog Inputs 2-3, 5-6, 8-9<br />

JG15 Secondary UNI-3 Phase A Overcurrent selected for FAULTA1 1-2<br />

JG16 Secondary UNI-3 Phase B Overcurrent selected for FAULTB1 1-2<br />

JG17 CAN termination unselected NC<br />

JG18 Use on-board crystal for DSP oscillator input 1-2<br />

Note: When running the EVM target system in a stand-alone mode from Flash, the JG5<br />

jumper must be set in the 1-2 configuration to disable the command converter parallel<br />

port interface.<br />

11.2.4 Build<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

When building the BLDC Motor Control Application with Hall Sensors, the user can create an<br />

application that runs from internal Flash or External RAM. To select the type of application to<br />

build, open the bldc_sensor.mcp project and select the target build type, as shown in Figure 11-7.<br />

Selecting Build All will create all application build types. A definition of the projects associated<br />

with these target build types may be viewed under the Targets tab of the project window.<br />

Figure 11-7. Target Build Selection<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-9<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The project may now be built by executing the Make command, as shown in Figure 11-8. This will<br />

build and link the BLDC Motor Control Application with Hall Sensors and all needed<br />

Metrowerks and <strong>SDK</strong> libraries.<br />

11.2.5 Execute<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 11-8. Execute Make Command<br />

To execute the BLDC Motor Control application, select Project\Debug in the CodeWarrior IDE,<br />

followed by the Run command. For more help with these commands, refer to the CodeWarrior<br />

tutorial documentation in the following file located in the CodeWarrior installation directory:<br />

\CodeWarrior Documentation\PDF\Targeting_DSP56800.pdf<br />

If the Flash target is selected, CodeWarrior will automatically program the internal Flash of the<br />

DSP with the executable generated during Build. If the External RAM target is selected, the<br />

executable will be loaded to off-chip RAM.<br />

Once Flash has been programmed with the executable, the EVM target system may be run in a<br />

stand-alone mode from Flash. To do this, set the JG5 jumper in the 1-2 configuration to disable<br />

the parallel port, and press the RESET button.<br />

Once the application is running, move the RUN/STOP switch to the RUN position and set the<br />

required speed using the UP/DOWN push buttons. Pressing the UP/DOWN buttons should<br />

incrementally increase the motor speed until it reaches maximum speed. If successful, the BLDC<br />

motor will be spinning.<br />

Note: If the RUN/STOP switch is set to the RUN position when the application starts, toggle<br />

the RUN/STOP switch between the STOP and RUN positions to enable motor<br />

spinning. This is a protection feature that prevents the motor from starting when the<br />

application is executed from CodeWarrior.<br />

You should also see a lighted green LED, which indicates that the application is running. If the<br />

application is stopped, the green LED will blink at a 2Hz frequency. If an Undervoltage fault<br />

occurs, the green LED will blink at a frequency of 8Hz.<br />

11-10 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

BLDC Motor Control Application with Quadrature Encoder<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

11.3 BLDC Motor Control Application with<br />

Quadrature Encoder<br />

This application exercises simple control of the BLDC motor with the Quadrature Encoder on the<br />

DSP56F805EVM board and the EVM Motor Kit.<br />

11.3.1 Files<br />

The BLDC Motor Control Application with Quadrature Encoder is composed of the following<br />

files:<br />

• ...\dsp56805evm\nos\applications\bldc_encoder\bldc_encoder.c, main program<br />

• ...\dsp56805evm\nos\applications\bldc_encoder\bldc_encoder.mcp, application project<br />

file<br />

• ...\dsp56805evm\nos\applications\bldc_encoder\configextram\appconfig.c, application<br />

configuration file for external RAM<br />

• ...\dsp56805evm\nos\applications\bldc_encoder\configflash\appconfig.c, application<br />

configuration file for Flash<br />

• ...\dsp56805evm\nos\applications\bldc_encoder\configextram\appconfig.h,<br />

application configuration file for external RAM<br />

• ...\dsp56805evm\nos\applications\bldc_encoder\configflash\appconfig.h, application<br />

configuration file for Flash<br />

• ...\dsp56805evm\nos\applications\bldc_encoder\configextram\linker.cmd, linker<br />

command file for external RAM<br />

• ...\dsp56805evm\nos\applications\bldc_encoder\configflash\linker.cmd, linker<br />

command file for Flash<br />

• ...\dsp56805evm\nos\applications\bldc_encoder\configflash\flash.cfg, configuration<br />

file for Flash<br />

• ...\dsp56805evm\nos\applications\bldc_encoder\PCMaster\BLDC_Encoder_demo.pmp,<br />

PCMaster file<br />

These files are located in the <strong>SDK</strong> installation directory.<br />

11.3.2 Specifications<br />

This application performs simple control of the BLDC motor with the Quadrature Encoder and<br />

close loop speed control on the DSP56F805 processor. In the application, the PWM module is set<br />

to complementary mode with a 16kHz switching frequency. The masking and swapping of PWM<br />

channels is controlled by the PWM Channel Control Register. The content of this register is<br />

derived from Quadrature Encoder signals. The required voltage is set independently on the<br />

commutation by the speed PI controller. The speed is measured by the quad timer. The<br />

RUN/STOP switch enables/disables motor spinning. The allowable range of speed is from 50 rpm<br />

to 1000 rpm in both directions.<br />

The application can run on:<br />

• External RAM or Flash<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-11<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The BLDC Motor Control Application with Hall Sensors can operate in two modes:<br />

1. Manual Operating Mode<br />

The drive is controlled by the RUN/STOP switch (S6). The motor speed is set by the<br />

UP (S2-IRQB) and DOWN (S1-IRQA) push buttons; Figure 11-9. If the application<br />

runs and motor spinning is disabled (i.e., the system is ready) the USER LED (LED3,<br />

shown in Figure 11-10) will blink. When motor spinning is enabled, the USER LED<br />

is On. Refer to Table 11-6 below for application states.<br />

Figure 11-9. RUN/STOP Switch and UP/DOWN Buttons<br />

11-12 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

BLDC Motor Control Application with Quadrature Encoder<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 11-10. USER and PWM LEDs<br />

Table 11-6. Motor Application States<br />

Application State Motor State Green LED State<br />

Stopped Stopped Blinking at a frequency of 2Hz<br />

Running Spinning On<br />

Fault Stopped Blinking at a frequency of 8Hz<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-13<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

2. PC master software (Remote) Operating Mode<br />

The drive is controlled remotely from a PC through the SCI communication channel<br />

of the DSP device via an RS-232 physical interface. The drive is enabled by the<br />

RUN/STOP switch, which can be used to safely stop the application at any time.<br />

The following control actions are supported:<br />

• Set the Required Speed of the motor<br />

PC master software displays the following information:<br />

• Required Speed<br />

• Actual Speed<br />

• Applied Voltage<br />

• DCBus Voltage<br />

• RUN/STOP Switch Status<br />

• Application Mode<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Project files for the PC master software are located in:<br />

..\nos\applications\bldc_encoder\PC_Master\BLDC Encoder Demo.pmp<br />

Start the PC master software window’s application, BLDC Encoder Demo.pmp. Figure 11-11<br />

illustrates the PC master software control window after this project has been launched.<br />

Figure 11-11. PC Master Software Control Window<br />

11-14 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

11.3.3 Set-up<br />

BLDC Motor Control Application with Quadrature Encoder<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 11-12 illustrates the hardware set-up for the BLDC Motor Control Application with<br />

Quadrature Encoder.<br />

Figure 11-12. Set-up of the BLDC Motor Control Application<br />

For detailed information, see the DSP56F805 Evaluation Module Hardware Reference<br />

Manual. The serial cable is needed for the PC master software debugging tool only.<br />

11.3.3.1 EVM Jumper Settings<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

To Execute the BLDC Motor Control Application with Quadrature Encoder, the DSP56F805<br />

board requires the strap settings shown in Figure 11-13 and Table 11-7.<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-15<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

JG6<br />

3 1<br />

JG1<br />

JG2<br />

JG15<br />

1<br />

3<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

1<br />

3<br />

1<br />

3<br />

9 7<br />

6 4<br />

3 1<br />

JG10<br />

JG14<br />

JG9<br />

JG15 JG1 JG2<br />

1<br />

JG9<br />

JG3<br />

1<br />

LED3<br />

U1<br />

DSP56F805EVM<br />

3<br />

2<br />

1<br />

JG13<br />

Figure 11-13. DSP56F805EVM Jumper Reference<br />

Table 11-7. DSP56F805EVM Jumper settings<br />

Jumper Group Comment Connections<br />

JG1 PD0 input selected as a high 1-2<br />

JG2 PD1 input selected as a high 1-2<br />

JG3 Primary UNI-3 serial selected 1-2, 3-4, 5-6, 7-8<br />

JG4 Secondary UNI-3 serial selected 1-2, 3-4, 5-6, 7-8<br />

JG5 Enable on-board parallel JTAG Command Converter Interface NC<br />

JG6 Use on-board crystal for DSP oscillator input 2-3<br />

JG7 Select DSP’s Mode 0 operation upon exit from reset 1-2<br />

JG8 Enable on-board SRAM 1-2<br />

JG9 Enable RS-232 output 1-2<br />

JG10 Secondary UNI-3 Analog temperature input unused NC<br />

JG11 Use Host power for Host target interface 1-2<br />

JG12 Primary Encoder input selected for Quadrature Encoder signals 2-3, 5-6, 8-9<br />

JG13 Secondary Encoder input selected 2-3, 5-6, 8-9<br />

11-16 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

JTAG<br />

JG8<br />

S/N<br />

U15<br />

S4 S5 S6<br />

JG7<br />

1<br />

JG5<br />

GP1 GP2 RUN/STOP<br />

U9 U10<br />

JG11<br />

S1 S2 S3<br />

P1<br />

P3 IRQA IRQB RESET<br />

JG3<br />

1 2<br />

7 8<br />

3<br />

2<br />

1<br />

JG12<br />

USER<br />

9 7<br />

J23 J24<br />

6 4<br />

3<br />

JG10<br />

PWM<br />

1<br />

1 3<br />

JG14 2<br />

JG17 1<br />

JG6 JG12<br />

1<br />

Y1<br />

3<br />

2<br />

1<br />

JG13<br />

JG18<br />

JG18<br />

1<br />

JG16<br />

JG17<br />

J29<br />

1<br />

JG4<br />

P1<br />

3 1<br />

JG11<br />

8<br />

2<br />

JG4<br />

JG8<br />

7<br />

1<br />

3 1<br />

JG16<br />

JG5<br />

JG7<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

BLDC Motor Control Application with Quadrature Encoder<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 11-7. DSP56F805EVM Jumper settings (Continued)<br />

Jumper Group Comment Connections<br />

JG14 Primary UNI-3 3-Phase Current Sense selected as Analog Inputs 2-3, 5-6, 8-9<br />

JG15 Secondary UNI-3 Phase A Overcurrent selected for FAULTA1 1-2<br />

JG16 Secondary UNI-3 Phase B Overcurrent selected for FAULTB1 1-2<br />

JG17 CAN termination unselected NC<br />

JG18 Use on-board crystal for DSP oscillator input 1-2<br />

Note: When running the EVM target system in a stand-alone mode from Flash, the JG5<br />

jumper must be set in the 1-2 configuration to disable the command converter parallel<br />

port interface.<br />

11.3.4 Build<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

When building the BLDC Motor Control Application with Quadrature Encoder, the user can<br />

create an application that runs from internal Flash or External RAM. To select the type of<br />

application to build, open the bldc_encoder.mcp project and choose the target build type; see<br />

Figure 11-14. Selecting Build All will build all application build types. A definition of the projects<br />

associated with these target build types may be viewed under the Targets tab of the project<br />

window.<br />

Figure 11-14. Target Build Selection<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-17<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The project may now be built by executing the Make command, as shown in Figure 11-15. This<br />

will build and link the BLDC Motor Control Application with Quadrature Encoder and all needed<br />

Metrowerks and <strong>SDK</strong> libraries.<br />

11.3.5 Execute<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 11-15. Execute Make Command<br />

To execute the BLDC Motor Control Application with Quadrature Encoder, select the<br />

Project\Debug command in the CodeWarrior IDE, followed by the Run command. For more help<br />

with these commands, refer to the CodeWarrior tutorial documentation in the following file<br />

located in the CodeWarrior installation directory:<br />

\CodeWarrior Documentation\PDF\Targeting_DSP56800.pdf<br />

If the Flash target is selected, CodeWarrior will automatically program the internal Flash of the<br />

DSP with the executable generated during Build. If the External RAM target is selected, the<br />

executable will be loaded to off-chip RAM.<br />

Once Flash has been programmed with the executable, the EVM target system may be run in a<br />

stand-alone mode from Flash. To do this, set the JG5 jumper in the 1-2 configuration to disable<br />

the parallel port, and press the RESET button.<br />

Once the application is running, move the RUN/STOP switch to the RUN position, and set the<br />

required speed with the UP/DOWN push buttons. Pressing the UP/DOWN buttons should<br />

incrementally increase the motor speed until it reaches maximum speed. If successful, the BLDC<br />

motor will be spinning.<br />

Note: If the RUN/STOP switch is set to the RUN position when the application starts, toggle<br />

the RUN/STOP switch between the STOP and RUN positions to enable motor<br />

spinning. This is a protection feature that prevents the motor from starting when the<br />

application is executed from CodeWarrior.<br />

You should also see a lighted green LED, which indicates that the application is running. If the<br />

application is stopped, the green LED will blink with a 2Hz frequency. If an Undervoltage fault<br />

occurs, the green LED will blink at a frequency of 8Hz.<br />

11-18 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Synchro PM Motor Control Application with Quadrature Encoder<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

11.4 Synchro PM Motor Control Application with<br />

Quadrature Encoder<br />

This application exercises simple control of the Synchro PM Motor with the Quadrature Encoder<br />

on the DSP56F805EVM board and the EVM Motor Kit.<br />

11.4.1 Files<br />

Synchro PM Motor Control application is composed of the following files:<br />

• ...\dsp56805evm\nos\applications\bldc_synchro1\bldc_synchro1.c, main program<br />

• ...\dsp56805evm\nos\applications\bldc_synchro1\bldc_synchro1.mcp, application<br />

project file<br />

• ...\dsp56805evm\nos\applications\bldc_synchro1\configextram\appconfig.c,<br />

application configuration file for external RAM<br />

• ...\dsp56805evm\nos\applications\bldc_synchro1\configflash\appconfig.c, application<br />

configuration file for Flash<br />

• ...\dsp56805evm\nos\applications\bldc_synchro1\configextram\appconfig.h,<br />

application configuration file for external RAM<br />

• ...\dsp56805evm\nos\applications\bldc_synchro1\configflash\appconfig.h, application<br />

configuration file for Flash<br />

• ...\dsp56805evm\nos\applications\bldc_synchro1\configextram\linker.cmd, linker<br />

command file for external RAM<br />

• ...\dsp56805evm\nos\applications\bldc_synchro1\configflash\linker.cmd, linker<br />

command file for Flash<br />

• ...\dsp56805evm\nos\applications\bldc_synchro1\configflash\flash.cfg, configuration<br />

file for Flash<br />

• ...\dsp56805evm\nos\applications\bldc_synchro1\PCMaster\BLDC Synchro<br />

demo.pmp, PCMaster file<br />

These files are located in the <strong>SDK</strong> installation directory.<br />

11.4.2 Specifications<br />

This application performs simple control of the Synchro PM motor with the Quadrature Encoder<br />

and speed close loop on the DSP56F805 processor. In the application, the PWM module is set to<br />

complementary mode with a 16kHz switching frequency. The masking and swapping of PWM<br />

channels is controlled by the PWM Channel Control Register. The content of this register is<br />

derived from Quadrature Encoder signals. The required voltage is set independently on the<br />

commutation by the speed PI controller. The speed is measured by the quad timer. The allowable<br />

range of speed is from 50 rpm to 1000 rpm in both directions.<br />

The application can run on:<br />

• External RAM or Flash<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-19<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The Synchro PM Motor Control Application with Quadrature Encoder can operate in two<br />

modes:<br />

1. Manual Operating Mode<br />

The drive is controlled by the RUN/STOP switch (S6). The motor speed is set by the<br />

UP (S2-IRQB) and DOWN (S1-IRQA) push buttons; see Figure 11-16. If the<br />

application runs and motor spinning is disabled (i.e., the system is ready), the USER<br />

LED (LED3, shown in Figure 11-17) will blink. When motor spinning is enabled, the<br />

USER LED is On. Refer to Table 11-8 for application states.<br />

Figure 11-16. RUN/STOP Switch and UP/DOWN Buttons<br />

11-20 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Synchro PM Motor Control Application with Quadrature Encoder<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 11-17. USER and PWM LEDs<br />

Table 11-8. Motor Application States<br />

Application State Motor State Green LED State<br />

Stopped Stopped Blinking at a frequency of 2Hz<br />

Running Spinning On<br />

Fault Stopped Blinking at a frequency of 8Hz<br />

2. PC master software (Remote) Operating Mode<br />

The drive is controlled remotely from a PC through the SCI communication channel<br />

of the DSP device via an RS-232 physical interface. The drive is enabled by the<br />

RUN/STOP switch, which can be used to safely stop the application at any time.<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-21<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The following control actions are supported:<br />

• Set the Required Speed of the motor<br />

PC master software displays the following information:<br />

• Required Speed<br />

• Actual Speed<br />

• Amplitude<br />

• DCBus Voltage<br />

• RUN/STOP Switch Status<br />

• Application Mode<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Project files for the PC master software are located in:<br />

..\nos\applications\bldc_synchro1\PC_Master\BLDC Synchro Demo.pmp<br />

Start the PC master software window’s application, BLDC Synchro Demo.pmp. Figure 11-18<br />

illustrates the PC master software control window after this project has been launched.<br />

Note: If the PC master software project (.pmp file) is unable to control the application, it is<br />

possible that the wrong load map (.elf file) has been selected. PC master software uses<br />

the load map to determine addresses for global variables being monitored. Once the<br />

PC master software project has been launched, this option may be selected in the PC<br />

master software window under Project/Select Other Map FileReload.<br />

11-22 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Synchro PM Motor Control Application with Quadrature Encoder<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 11-18. PC Master Software Control Window<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-23<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

11.4.3 Set-up<br />

Figure 11-19 illustrates the hardware set-up for the Synchro PM Motor Control Application with<br />

Quadrature Encoder.<br />

Figure 11-19. Synchro PM Motor Control Application Set-up<br />

For detailed information, see the DSP56F805 Evaluation Module Hardware Reference<br />

Manual. The serial cable is needed for the PC master software debugging tool only.<br />

11.4.3.1 PM Synchronous Motor versus BLDC Motor<br />

The application SW is targeted for PM Synchronous motor with sine-wave Back-EMF shape. In<br />

this particular demo application the BLDC motor is used instead. This is due to the availability of<br />

the BLDC motor supplied as ECMTREVAL. Although the Back-EMF shape of this motor is not<br />

ideally sine-wave, it can be controlled by the application SW. The drive parameters will be even<br />

better when PMSM motor with exactly sine-wave Back-EMF shape is used.<br />

11.4.3.2 EVM Jumper Settings<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

To execute the Synchro PM Motor Control Application with Quadrature Encoder, the DSP56F805<br />

board requires the strap settings shown in Figure 11-20 and Table 11-9.<br />

11-24 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

JG6<br />

Synchro PM Motor Control Application with Quadrature Encoder<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3 1<br />

JG1<br />

JG2<br />

JG15<br />

1<br />

3<br />

1<br />

3<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

1<br />

3<br />

9 7<br />

6 4<br />

3 1<br />

JG10<br />

JG14<br />

JG9<br />

JG15 JG1 JG2<br />

1<br />

JG9<br />

JG3<br />

1<br />

LED3<br />

U1<br />

DSP56F805EVM<br />

3<br />

2<br />

1<br />

JG13<br />

Figure 11-20. DSP56F805EVM Jumper Reference<br />

Table 11-9. DSP56F805EVM Jumper settings<br />

Jumper Group Comment Connections<br />

JG1 PD0 input selected as a high 1-2<br />

JG2 PD1 input selected as a high 1-2<br />

JG3 Primary UNI-3 serial selected 1-2, 3-4, 5-6, 7-8<br />

JG4 Secondary UNI-3 serial selected 1-2, 3-4, 5-6, 7-8<br />

JG5 Enable on-board parallel JTAG Command Converter Interface NC<br />

JG6 Use on-board crystal for DSP oscillator input 2-3<br />

JG7 Select DSP’s Mode 0 operation upon exit from reset 1-2<br />

JG8 Enable on-board SRAM 1-2<br />

JG9 Enable RS-232 output 1-2<br />

JG10 Secondary UNI-3 Analog temperature input unused NC<br />

JG11 Use Host power for Host target interface 1-2<br />

JG12 Primary Encoder input selected for Quadrature encoder signals 2-3, 5-6, 8-9<br />

JG13 Secondary Encoder input selected 2-3, 5-6, 8-9<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-25<br />

JTAG<br />

JG8<br />

S/N<br />

U15<br />

S4 S5 S6<br />

JG7<br />

1<br />

JG5<br />

GP1 GP2 RUN/STOP<br />

U9 U10<br />

JG11<br />

S1 S2 S3<br />

P1<br />

P3 IRQA IRQB RESET<br />

JG3<br />

1 2<br />

7 8<br />

3<br />

2<br />

1<br />

JG12<br />

USER<br />

9 7<br />

J23 J24<br />

6 4<br />

3<br />

JG10<br />

PWM<br />

1<br />

1 3<br />

JG14 2<br />

JG17 1<br />

JG6 JG12<br />

1<br />

Y1<br />

3<br />

2<br />

1<br />

JG13<br />

JG18<br />

JG18<br />

1<br />

JG16<br />

JG17<br />

J29<br />

1<br />

JG4<br />

P1<br />

3 1<br />

JG11<br />

8<br />

2<br />

JG4<br />

JG8<br />

7<br />

1<br />

3 1<br />

JG16<br />

JG5<br />

JG7<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 11-9. DSP56F805EVM Jumper settings<br />

Jumper Group Comment Connections<br />

JG14 Primary UNI-3 3-Phase Current Sense selected as Analog Inputs. 2-3, 5-6, 8-9<br />

JG15 Secondary UNI-3 Phase A Overcurrent selected for FAULTA1 1-2<br />

JG16 Secondary UNI-3 Phase B Overcurrent selected for FAULTB1 1-2<br />

JG17 CAN termination unselected NC<br />

JG18 Use on-board crystal for DSP oscillator input 1-2<br />

Note: When running the EVM target system in a stand-alone mode from Flash, the JG5<br />

jumper must be set in the 1-2 configuration to disable the command converter parallel<br />

port interface.<br />

11.4.4 Build<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

When building the Synchro PM Motor Control Application with Quadrature Encoder, the user can<br />

create an application that runs from internal Flash or External RAM. To select the type of<br />

application to build, open the bldc_synchro1.mcp project and choose the target build type; see<br />

Figure 11-21. Selecting Build All will create all application build types. A definition of the projects<br />

associated with these target build types may be viewed under the Targets tab of the project<br />

window<br />

Figure 11-21. Target Build Selection<br />

11-26 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Synchro PM Motor Control Application with Quadrature Encoder<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The project may now be built by executing the Make command, as shown in Figure 11-22. This<br />

will build and link the Synchro PM Motor Control Application with Quadrature Encoder and all<br />

needed Metrowerks and <strong>SDK</strong> libraries.<br />

11.4.5 Execute<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 11-22. Execute Make Command<br />

To execute the Synchro PM Motor Control Application with Quadrature Encoder, select<br />

Project\Debug in the CodeWarrior IDE, followed by the Run command. For more help with these<br />

commands, refer to the CodeWarrior tutorial documentation in the following file located in the<br />

CodeWarrior installation directory:<br />

\CodeWarrior Documentation\PDF\Targeting_DSP56800.pdf<br />

If the Flash target is selected, CodeWarrior will automatically program the DSP’s internal Flash<br />

with the executable generated during Build. If the External RAM target is selected, the executable<br />

will be loaded to off-chip RAM.<br />

Once Flash has been programmed with the executable, the EVM target system may be run in a<br />

stand-alone mode from Flash. To do this, set the JG5 jumper in the 1-2 configuration to disable<br />

the parallel port, and press the RESET button.<br />

Once the application is running, move the RUN/STOP switch to the RUN position, and set the<br />

required speed with the UP/DOWN push buttons. Pressing the UP/DOWN buttons should<br />

incrementally increase the motor speed until it reaches maximum speed. If successful, the<br />

Synchro PM motor should be spinning.<br />

Note: If the RUN/STOP switch is set to the RUN position when the application starts, toggle<br />

the RUN/STOP switch between the STOP and RUN positions to enable motor<br />

spinning. This is a protection feature that prevents the motor from starting when the<br />

application is executed from CodeWarrior.<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-27<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

You should also see a lighted green LED, which indicates that the application is running. If the<br />

application is stopped, the green LED will blink at a 2Hz frequency. If an Undervoltage fault<br />

occurs, the green LED will blink at a frequency of 8Hz.<br />

11.5 BLDC Sensorless with Back-EMF Zero<br />

Crossing Application<br />

This application exercises sensorless control of the BLDC motor on the DSP56F805EVM board<br />

and the EVM Motor Kit.<br />

11.5.1 Files<br />

The BLDC Sensorless with B-EMF Zero Crossing Application is composed of the following<br />

files:<br />

• ...\dsp56805evm\nos\applications\bldc_zerocross\bldczcapplication.c, main program<br />

• ...\dsp56805evm\nos\applications\bldc_zerocross\bldczcdefines.h, main program<br />

definitions<br />

• ...\dsp56805evm\nos\applications\bldc_zerocross\bldc_zerocross.mcp, application<br />

project file<br />

• ...\dsp56805evm\nos\applications\bldc_zerocross\configextram\appconfig.c,<br />

application configuration file for external RAM<br />

• ...\dsp56805evm\nos\applications\bldc_zerocross\configflash\appconfig.c, application<br />

configuration file for Flash<br />

• ...\dsp56805evm\nos\applications\bldc_zerocross\configextram\appconfig.h,<br />

application configuration file for external RAM<br />

• ...\dsp56805evm\nos\applications\bldc_zerocross\configflash\appconfig.h, application<br />

configuration file for Flash<br />

• ...\dsp56805evm\nos\applications\bldc_zerocross\configextram\linker.cmd, linker<br />

command file for external RAM<br />

• ...\dsp56805evm\nos\applications\bldc_zerocross\configflash\linker.cmd, linker<br />

command file for Flash<br />

• ...\dsp56805evm\nos\applications\bldc_zerocross\configflash\flash.cfg, configuration<br />

file for Flash<br />

• ...\dsp56805evm\nos\applications\bldc_zerocross\PCMaster\BLDC demo.pmp,<br />

PCMaster file<br />

These files are located in the <strong>SDK</strong> installation directory.<br />

11.5.2 Specifications<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

This application performs a sensorless control of the BLDC motor on the DSP56F805 processor<br />

with close loop speed control. In the application, the PWM module is set to independent mode<br />

with a 14.4kHz switching frequency. The state of the zero crossing signals are read from the Input<br />

Monitor Register of the Quadrature Encoder. The masking of PWM channels is controlled by the<br />

11-28 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

BLDC Sensorless with Back-EMF Zero Crossing Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

PWM Channel Control Register. The content of this register is derived from Back-EMF zero<br />

crossing signals.<br />

The application can run on:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

• External RAM or Flash<br />

• EVM Motor Board: 3-Phase AC/BLDC High-Voltage Power Stage or 3-Phase AC/BLDC<br />

Low-Voltage Power Stage<br />

• Manual or PC master software Operating Mode<br />

• 115 or 230V AC Supply<br />

The correct power stage is identified automatically and the appropriate constants are set.<br />

This BLDC sensorless motor control application can operate in two modes:<br />

1. Manual Operating Mode<br />

The drive is controlled by the RUN/STOP switch and the required speed is set<br />

independently on the commutation by the UP/DOWN buttons; see Figure 11-23. The<br />

RUN/STOP switch enables/disables motor spinning. If the application runs and<br />

motor spinning is disabled, the green user LED will blink; see Figure 11-24. When<br />

motor spinning is enabled, the green user LED lights. If Overcurrent,or Overvoltage<br />

occur, or if the wrong pcb is identified, the internal fault logic is asserted and the<br />

application enters a fault state (indicated by a red LED).This state can be exited only<br />

by an application RESET. It is strongly recommended that you inspect the entire<br />

application to locate the source of the fault before starting it again.<br />

Figure 11-23. RUN/STOP Switch and UP/DOWN Buttons<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-29<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 11-24. USER and PWM LEDs<br />

2. PC master software (Remote) Operating Mode<br />

The drive is controlled remotely from a PC through the SCI communication channel<br />

of the DSP device via an RS-232 physical interface. The drive is enabled by the<br />

RUN/STOP switch, which can be used to safely stop the application at any time.<br />

The following control actions are supported:<br />

• Start the motor (by setting the required speed on the bar graph)<br />

• Stop the motor (by setting the Zero speed on the bar graph)<br />

• Set the Required Speed of the motor<br />

PC master software displays the following information:<br />

• Required Speed of the motor<br />

• Actual Speed of the motor<br />

• DCBus voltage<br />

• DCBus current<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

11-30 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

BLDC Sensorless with Back-EMF Zero Crossing Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

• Temperature of the power stage<br />

• Fault status (No Fault, Overvoltage, Undervoltage, Overcurrents in phases, Overcurrent in<br />

DCBus, Overheating)<br />

• Motor status - Running/Stand-by<br />

If the Fault Status is different from the No Faults of Overcurrent, Overvoltage or Undervoltage<br />

conditions, or if the wrong pcb is used, the red LED lights and the motor is stopped. This state can<br />

be exited by application RESET. It is strongly recommended that you inspect the entire<br />

application to locate the source of fault before starting it again.<br />

Project files for the PC master software are located in:<br />

...\dsp56805evm\nos\applications\bldc_zerocross\PC_Master\bldc_demo.pmp<br />

Start the PC master software window’s application, bldc_demo.pmp. Figure 11-25 illustrates the<br />

PC master software control window after this project has been launched.<br />

Note: If the PC master software project (.pmp file) is unable to control the application, it is<br />

possible that the wrong load map (.elf file) has been selected. PC master software uses<br />

the load map to determine addresses for global variables being monitored. Once the<br />

PC master software project has been launched, this option may be selected in the PC<br />

master software window under Project/Select Other Map FileReload.<br />

Figure 11-25. PC Master Software Control Window<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-31<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

11.5.3 Set-up<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 11-26 illustrates the hardware set-up for the BLDC Sensorless with B-EMF Zero Crossing<br />

Application when using an EVM motor board.<br />

NOT NEEDED<br />

Figure 11-26. Set-up of the EVM Motor Board BLDC Motor Control Application<br />

For detailed information, see the DSP56F805 Evaluation Module Hardware Reference<br />

Manual. The serial cable is needed for the PC master software debugging tool only.<br />

Thanks to automatic board identification, the software can also be run on:<br />

• 3-Phase AC/BLDC Low-Voltage Power Stage; see Figure 11-27<br />

• 3-Phase AC/BLDC High-Voltage Power Stage; see Figure 11-28<br />

11-32 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

BLDC Sensorless with Back-EMF Zero Crossing Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 11-27. Set-up of the Low-Voltage BLDC Motor Control Application<br />

The correct order of phases (phase A, phase B, phase C) for the BLDC motor is:<br />

• phase A = white wire<br />

• phase B = red wire<br />

• phase C = black wire<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

When facing a motor shaft, if the phase order is: phase A, phase B, phase C, the motor shaft<br />

should rotate clockwise (i.e., positive direction, positive speed).<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-33<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 11-28. Set-up of the High-Voltage BLDC Motor Control Application<br />

The correct order of phases (phase A, phase B, phase C) for the BLDC motor is:<br />

• phase A = white wire<br />

• phase B = red wire<br />

• phase C = black wire<br />

When facing a motor shaft, if the phase order is: phase A, phase B, phase C, the motor shaft<br />

should rotate clockwise (i.e., positive direction, positive speed).<br />

11.5.3.1 EVM Jumper Settings<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

To execute the BLDC Sensorless with B-EMF Zero Crossing application, the DSP56F805 board<br />

requires the strap settings shown in Figure 11-29 and Table 11-10.<br />

11-34 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

JG6<br />

BLDC Sensorless with Back-EMF Zero Crossing Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3 1<br />

JG1<br />

JG2<br />

JG15<br />

1<br />

3<br />

1<br />

3<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

1<br />

3<br />

9 7<br />

6 4<br />

3 1<br />

JG10<br />

JG14<br />

JG9<br />

JG15 JG1 JG2<br />

1<br />

JG9<br />

JG3<br />

1<br />

LED3<br />

P3 IRQA<br />

JG3<br />

1 2<br />

7 8<br />

S/N<br />

U1<br />

DSP56F805EVM<br />

3<br />

2<br />

1<br />

JG13<br />

Figure 11-29. DSP56F805EVM Jumper Reference<br />

Table 11-10. DSP56F805EVM Jumper Settings<br />

Jumper Group Comment Connections<br />

JG1 PD0 input selected as a high 1-2<br />

JG2 PD1 input selected as a high 1-2<br />

JG3 Primary UNI-3 serial selected 1-2, 3-4, 5-6, 7-8<br />

JG4 Secondary UNI-3 serial selected 1-2, 3-4, 5-6, 7-8<br />

JG5 Enable on-board parallel JTAG Command Converter Interface NC<br />

JG6 Use on-board crystal for DSP oscillator input 2-3<br />

JG7 Select DSP’s Mode 0 operation upon exit from reset 1-2<br />

JG8 Enable on-board SRAM 1-2<br />

JG9 Enable RS-232 output 1-2<br />

JG10 Secondary UNI-3 Analog temperature input unused NC<br />

JG11 Use Host power for Host target interface 1-2<br />

JG12 Primary Encoder input selected Zero Crossing signals 1-2, 4-5, 7-8<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-35<br />

JTAG<br />

U15<br />

S4 S5 S6<br />

JG7<br />

1<br />

JG5<br />

GP1<br />

S1<br />

GP2<br />

S2<br />

RUN/STOP<br />

S3<br />

JG11<br />

P1<br />

U9 U10<br />

IRQB<br />

3<br />

2<br />

1<br />

JG12<br />

USER<br />

9 7<br />

J23 J24<br />

6 4<br />

3<br />

JG10<br />

PWM<br />

1<br />

1 3<br />

JG14 2<br />

JG17 1<br />

JG6 JG12<br />

1<br />

Y1<br />

3<br />

2<br />

1<br />

JG13<br />

JG18<br />

RESET<br />

JG18<br />

1<br />

JG16<br />

JG17<br />

J29<br />

JG8<br />

1<br />

JG4<br />

P1<br />

3 1<br />

JG11<br />

8<br />

2<br />

JG4<br />

JG8<br />

7<br />

1<br />

3 1<br />

JG16<br />

JG5<br />

JG7<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 11-10. DSP56F805EVM Jumper Settings (Continued)<br />

Jumper Group Comment Connections<br />

JG13 Secondary Encoder input selected 2-3, 5-6, 8-9<br />

JG14 Primary UNI-3 3-Phase Current Sense selected as Analog Inputs 2-3, 5-6, 8-9<br />

JG15 Primary UNI-3 DCBus Overcurrent selected FAULTA1 2-3<br />

JG16 Secondary UNI-3 Phase A Overcurrent selected for FAULTB1 1-2<br />

JG17 CAN termination unselected NC<br />

JG18 Use on-board crystal for DSP oscillator input 1-2<br />

Note: When running the EVM target system in a stand-alone mode from Flash, the JG5<br />

jumper must be set in the 1-2 configuration to disable the command converter parallel<br />

port interface.<br />

11.5.4 Build<br />

To build the BLDC Sensorless with B-EMF Zero Crossing Application, open the<br />

bldc_zerocross.mcp project file and execute the Make command, as shown in Figure 11-30. This<br />

will build and link the application and all needed Metrowerks and <strong>SDK</strong> libraries.<br />

11.5.5 Execute<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 11-30. Execute Make Command<br />

To execute the BLDC Sensorless with B-EMF Zero Crossing application, choose the<br />

Program/Debug command in the CodeWarrior IDE, followed by the Run command. For more<br />

help with these commands, refer to the CodeWarrior tutorial documentation in the following file<br />

located in the CodeWarrior installation directory:<br />

\CodeWarrior Documentation\PDF\Targeting_DSP56800.pdf<br />

11-36 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

BLDC Sensorless with Back-EMF Zero Crossing Using AD Converter Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Once the application is running, move the RUN/STOP switch to the RUN position and set the<br />

required voltage with the UP/DOWN push buttons. Pressing the UP/DOWN buttons should<br />

incrementally increase the motor speed until it reaches maximum speed. If successful, the BLDC<br />

motor will be spinning.<br />

Note: If the RUN/STOP switch is set to the RUN position when the application starts, toggle<br />

the RUN/STOP switch between the STOP and RUN positions to enable motor<br />

spinning. This is a protection feature that prevents the motor from starting when the<br />

application is executed from CodeWarrior.<br />

11.6 BLDC Sensorless with Back-EMF Zero<br />

Crossing Using AD Converter Application<br />

This application exercises sensorless control of the BLDC motor on the DSP56F805EVM board<br />

and the EVM Motor Kit using the ADC module to check for phase zero crossing.<br />

11.6.1 Files<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The BLDC Sensorless with B-EMF Zero Crossing Using AD Converter Application is composed<br />

of the following files:<br />

• ...\dsp56805evm\nos\applications\bldc_adc_zerocross\bldcadczcapplication.c, main<br />

program<br />

• ...\dsp56805evm\nos\applications\bldc_adc_zerocross\bldcadczcdefines.h, main<br />

program definitions<br />

• ...\dsp56805evm\nos\applications\bldc_adc_zerocross\bldc_adc_zerocross.mcp,<br />

application project file<br />

• ...\dsp56805evm\nos\applications\bldc_adc_zerocross\configextram\appconfig.c,<br />

application configuration file for external RAM<br />

• ...\dsp56805evm\nos\applications\bldc_adc_zerocross\configflash\appconfig.c,<br />

application configuration file for Flash<br />

• ...\dsp56805evm\nos\applications\bldc_adc_zerocross\configextram\appconfig.h,<br />

application configuration file for external RAM<br />

• ...\dsp56805evm\nos\applications\bldc_adc_zerocross\configflash\appconfig.h,<br />

application configuration file for Flash<br />

• ...\dsp56805evm\nos\applications\bldc_adc_zerocross\configextram\linker.cmd,<br />

linker command file for external RAM<br />

• ...\dsp56805evm\nos\applications\bldc_adc_zerocross\configflash\linker.cmd, linker<br />

command file for Flash<br />

• ...\dsp56805evm\nos\applications\bldc_adc_zerocross\configflash\flash.cfg,<br />

configuration file for Flash<br />

• ...\dsp56805evm\nos\applications\bldc_adc_zerocross\PCMaster\BLDC demo.pmp,<br />

PCMaster file<br />

These files are located in the <strong>SDK</strong> installation directory.<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-37<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

11.6.2 Specifications<br />

This application performs sensorless control of the BLDC motor on the DSP56F805 processor<br />

with close loop speed control. In the application, the PWM module is set to independent mode<br />

with a 10.0kHz switching frequency. The state of the zero crossing signals are read from the Input<br />

Monitor Register of the Quadrature Encoder. The masking of PWM channels is controlled by the<br />

PWM Channel Control Register. The content of this register is derived from the Back-EMF zero<br />

crossing signals.<br />

The application can run on:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

• External RAM or Flash<br />

• EVM Motor Board; 3-Phase AC/BLDC High-Voltage Power Stage; or 3-Phase AC/BLDC<br />

Low-Voltage Power Stage<br />

• Manual or PC Mster Operating Mode<br />

• 115 or 230V AC Power Supply<br />

The correct power stage is identified automatically and the appropriate constants are set.<br />

The BLDC sensorless with B-EMF Zero Crossing using ADC Application can operate in two<br />

modes:<br />

1. Manual Operating Mode<br />

The drive is controlled by the RUN/STOP switch, which enables/disables motor<br />

spinning. The required speed is set independently on the commutation by the<br />

UP/DOWN buttons; see Figure 11-31. If the application runs and motor spinning is<br />

disabled, the green user LED (see Figure 11-32) will blink. When motor spinning is<br />

enabled, the green user LED lights. If Overcurrent or Overvoltage occur, or if the<br />

wrong pcb is identified, internal fault logic is asserted and the application enters a<br />

fault state (indicated by the red LED). This state can be exited only by an application<br />

RESET. It is strongly recommended that you inspect the entire application to locate<br />

the source of the fault before starting it again.<br />

Figure 11-31. RUN/STOP Switch and UP/DOWN Buttons<br />

11-38 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

BLDC Sensorless with Back-EMF Zero Crossing Using AD Converter Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 11-32. USER and PWM LEDs<br />

2. PC master software (Remote) Operating Mode<br />

The drive is controlled remotely from a PC through the SCI communication channel<br />

of the DSP device via an RS-232 physical interface. The drive is enabled by the<br />

RUN/STOP switch, which can be used to safely stop the application at any time.<br />

The following control actions are supported:<br />

• Start the motor (by setting the required speed on the bar graph)<br />

• Stop the motor (by setting the Zero speed on the bar graph)<br />

• Set the Required Speed of the motor<br />

PC master software displays the following information:<br />

• Required Speed of the motor<br />

• Actual Speed of the motor<br />

• DCBus voltage<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-39<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

• DCBus current<br />

• Temperature of power stage<br />

• Fault status (No Fault, Overvoltage, Undervoltage, Overcurrents in phases, Overcurrent in<br />

DCBus, Overheating)<br />

• Motor status - Running/Stand-by<br />

If the Fault Status is different from the No Fault of Overcurrent, Overvoltage or Undervoltage<br />

conditions, or if the wrong pcb is used, the red LED lights and the motor is stopped.This state can<br />

be exited by an application RESET. It is strongly recommended that you inspect the entire<br />

application to locate the source of the fault before starting it again.<br />

Project files for the PC master software are located in:<br />

...nos\applications\bldc_adc_zerocross\PC_Master\bldc_demo.pmp<br />

Start the PC master software window’s application, bldc_demo.pmp. Figure 11-33 shows the PC<br />

master software control window after this project has been launched.<br />

Note: If the PC master software project (.pmp file) is unable to control the application, it is<br />

possible that the wrong load map (.elf file) has been selected. PC master software uses<br />

the load map to determine addresses for global variables being monitored. Once the<br />

PC master software project has been launched, this option may be selected in the PC<br />

master software window under Project/Select Other Map FileReload.<br />

Figure 11-33. PC Master Software Control Window<br />

11-40 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

11.6.3 Set-up<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

BLDC Sensorless with Back-EMF Zero Crossing Using AD Converter Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 11-34 illustrates the hardware set-up for the BLDC Sensorless with B-EMF Zero Crossing<br />

Using ADC Application when using an EVM motor board.<br />

NOT NEEDED<br />

Figure 11-34. EVM Motor Board BLDC Motor Control Application Set-up<br />

For detailed information see the DSP56F805 Evaluation Module Hardware Reference<br />

Manual. The serial cable is needed for the PC master software debugging tool only.<br />

Thanks to automatic board identification, the software can also be run on:<br />

• 3-Phase AC/BLDC Low-Voltage Power Stage; see Figure 11-35<br />

• 3-Phase AC/BLDC High-Voltage Power Stage; See Figure 11-36<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-41<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 11-35. Low-Voltage BLDC Motor Control Application Set-up<br />

The correct orderof phases (phase A, phase B, phase C) for the BLDC motor is :<br />

• phase A = white wire<br />

• phase B = red wire<br />

• phase C = black wire<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

When facing a motor shaft, if the phase order is: phase A, phase B, phase C, the motor shaft<br />

should rotate clockwise (i.e., positive direction, positive speed).<br />

11-42 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

BLDC Sensorless with Back-EMF Zero Crossing Using AD Converter Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 11-36. High-Voltage BLDC Motor Control Application Set-up<br />

The correct order of phases (phase A, phase B, phase C) for the BLDC motor is:<br />

• phase A = white wire<br />

• phase B = red wire<br />

• phase C = black wire<br />

When facing a motor shaft, if the phase order is: phase A, phase B, phase C, the motor shaft<br />

should rotate clockwise (i.e., positive direction, positive speed).<br />

11.6.3.1 EVM Jumper Settings<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

To execute the BLDC Sensorless with B-EMF Zero Crossing using ADC application, the<br />

DSP56F805 board requires the strap settings shown in Figure 11-37 and Table 11-19.<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-43<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

JG6<br />

3 1<br />

JG1<br />

JG2<br />

JG15<br />

1<br />

3<br />

1<br />

3<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

1<br />

3<br />

9 7<br />

6 4<br />

3 1<br />

JG10<br />

JG14<br />

JG9<br />

JG15 JG1 JG2<br />

1<br />

JG9<br />

JG3<br />

1<br />

LED3<br />

P3 IRQA<br />

JG3<br />

1 2<br />

7 8<br />

S/N<br />

U1<br />

DSP56F805EVM<br />

3<br />

2<br />

1<br />

JG13<br />

Figure 11-37. DSP56F805EVM Jumper Reference<br />

Table 11-11. DSP56F805EVM Jumper Settings<br />

Jumper Group Comment Connections<br />

JG1 PD0 input selected as a high 1-2<br />

JG2 PD1 input selected as a high 1-2<br />

JG3 Primary UNI-3 serial selected 1-2, 3-4, 5-6, 7-8<br />

JG4 Secondary UNI-3 serial selected 1-2, 3-4, 5-6, 7-8<br />

JG5 Enable on-board parallel JTAG Command Converter Interface NC<br />

JG6 Use on-board crystal for DSP oscillator input 2-3<br />

JG7 Select DSP’s Mode 0 operation upon exit from reset 1-2<br />

JG8 Enable on-board SRAM 1-2<br />

JG9 Enable RS-232 output 1-2<br />

JG10 Secondary UNI-3 Analog temperature input unused NC<br />

JG11 Use Host power for Host target interface 1-2<br />

JG12 Primary Encoder input selected Zero Crossing signals 1-2, 4-5, 7-8<br />

JG13 Secondary Encoder input selected 2-3, 5-6, 8-9<br />

11-44 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

JTAG<br />

U15<br />

S4 S5 S6<br />

JG7<br />

1<br />

JG5<br />

GP1<br />

S1<br />

GP2<br />

S2<br />

RUN/STOP<br />

S3<br />

JG11<br />

P1<br />

U9 U10<br />

IRQB<br />

3<br />

2<br />

1<br />

JG12<br />

USER<br />

9 7<br />

J23 J24<br />

6 4<br />

3<br />

JG10<br />

PWM<br />

1<br />

1 3<br />

JG14 2<br />

JG17 1<br />

JG6 JG12<br />

1<br />

Y1<br />

3<br />

2<br />

1<br />

JG13<br />

JG18<br />

RESET<br />

JG18<br />

1<br />

JG16<br />

JG17<br />

J29<br />

JG8<br />

1<br />

JG4<br />

P1<br />

3 1<br />

JG11<br />

8<br />

2<br />

JG4<br />

JG8<br />

7<br />

1<br />

3 1<br />

JG16<br />

JG5<br />

JG7<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

BLDC Sensorless with Back-EMF Zero Crossing Using AD Converter Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 11-11. DSP56F805EVM Jumper Settings<br />

Jumper Group Comment Connections<br />

JG14 Primary UNI-3 3-Phase B-EMF Voltage selected as Analog Inputs 1-2, 4-5, 7-8<br />

JG15 Primary UNI-3 DCBus Overcurrent selected for FAULTA1 2-3<br />

JG16 Secondary UNI-3 Phase A Overcurrent selected for FAULTB1 1-2<br />

JG17 CAN termination unselected NC<br />

JG18 Use on-board crystal for DSP oscillator input 1-2<br />

Note: When running the EVM target system in a stand-alone mode from Flash, the JG5<br />

jumper must be set in the 1-2 configuration to disable the command converter parallel<br />

port interface.<br />

11.6.4 Build<br />

To build the BLDC Sensorless with B-EMF Zero Crossing using ADC Application, open the<br />

bldc_adc_zerocross.mcp project file and execute the Make command, as shown in Figure 11-38.<br />

This will build and link the BLDC Motor Control application and all needed Metrowerks and<br />

<strong>SDK</strong> libraries.<br />

11.6.5 Execute<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 11-38. Execute Make Command<br />

To execute the BLDC Sensorless with B-EMF Zero Crossing using ADC Application, choose the<br />

Program/Debug command in the CodeWarrior IDE, followed by the Run command. For more<br />

help with these commands, refer to the CodeWarrior tutorial documentation in the following file<br />

located in the CodeWarrior installation directory:<br />

\CodeWarrior Documentation\PDF\Targeting_DSP56800.pdf<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-45<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Once the application is running, move the RUN/STOP switch to the RUN position and set the<br />

required voltage with the UP/DOWN push buttons. Pressing the UP/DOWN buttons should<br />

incrementally increase the motor speed until it reaches maximum speed. If successful, the BLDC<br />

motor will be spinning.<br />

Note: If the RUN/STOP switch is set to the RUN position when the application starts, toggle<br />

the RUN/STOP switch between the STOP and RUN positions to enable motor<br />

spinning. This is a protection feature that prevents the motor from starting when the<br />

application is executed from CodeWarrior.<br />

11.7 3-Phase PM Synchronous Motor Vector Control<br />

This application exercises vector control of the 3-Phase Permanent Magnet (PM) synchronous<br />

motor on the DSP56F805EVM board and 3-phase AC/BLDC High-Voltage power stage.<br />

11.7.1 Files<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The 3-Phase PM synchronous Motor Control application is composed of the following files:<br />

• ...\dsp56805evm\nos\applications\3ph_PMSM_VectorControl\3ph_PMSM_VectorControl.c,<br />

main program<br />

• ...\dsp56805evm\nos\applications\3ph_PMSM_VectorControl\3ph_PMSM_VectorControl.h,<br />

main header file of the program used for storing application references and defined<br />

constants that are required by the 3ph_PMSM_VectorControl.c file.<br />

• ...\dsp56805evm\nos\applications\3ph_PMSM_VectorControl\appconst.c, application<br />

constants for Data flash<br />

• ...\dsp56805evm\nos\applications\3ph_PMSM_VectorControl\appconst.h, header file to<br />

store the external references and defined constants related to the appconst.c file<br />

• ...\dsp56805evm\nos\applications\3ph_PMSM_VectorControl\3ph_PMSM_VectorControl.mcp<br />

application project file<br />

• ...\dsp56805evm\nos\applications\3ph_PMSM_VectorControl\configextram\appconfig.c,<br />

application configuration file for external RAM<br />

• ...\dsp56805evm\nos\applications\3ph_PMSM_VectorControl\configflash\appconfig.c,<br />

application configuration file for Flash<br />

• ...\dsp56805evm\nos\applications\3ph_PMSM_VectorControl\configextram\appconfig.h,<br />

application configuration header file for external RAM<br />

• ...\dsp56805evm\nos\applications\3ph_PMSM_VectorControl\configflash\appconfig.h,<br />

application configuration header file for Flash<br />

• ...\dsp56805evm\nos\applications\3ph_PMSM_VectorControl\configextram\linker.cmd,<br />

linker command file for external RAM<br />

• ...\dsp56805evm\nos\applications\3ph_PMSM_VectorControl\configflash\linker.cmd, linker<br />

command file for Flash<br />

• ...\dsp56805evm\nos\applications\3ph_PMSM_VectorControl\configflash\flash.cfg,<br />

configuration file for Flash<br />

These files are located in the <strong>SDK</strong> installation directory.<br />

11-46 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

11.7.2 Specifications<br />

3-Phase PM Synchronous Motor Vector Control<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The 3-Phase PM Synchronous Motor Vector Control Application demonstrates the Permanent<br />

Magnet Synchronous Motor Control application using field-oriented theory on the DSP56F805<br />

processor.<br />

System Outline<br />

The application has the following specifications:<br />

• Vector control technique used for Permanent Magnet (PM) synchronous motor control<br />

• Speed control loop<br />

• Targeted for DSP56F805EVM<br />

• Running on 3-phase Permanent Magnet (PM) synchronous motor control development<br />

platform at variable line voltage 115V AC and 230V AC (range -15% to +10%)<br />

• Motor mode<br />

• Generator mode<br />

• DCBus brake<br />

• Minimum speed 50 rpm<br />

• Maximum speed 3000 rpm at input power line 230V AC<br />

• Maximum speed 1500 rpm at input power line 115V AC<br />

• Power stage and optoisolation board identification<br />

• Fault protection<br />

• Manual interface (RUN/STOP switch; UP/DOWN push buttons control; LED indication)<br />

• PC master software remote control interface (START MOTOR/STOP MOTOR push<br />

buttons, speed set-up)<br />

• PC master software remote monitor<br />

• PC master software monitor interface (required speed; actual motor speed; PC master<br />

software mode; START MOTOR/STOP MOTOR controls; drive fault status; DCBus<br />

voltage level; identified power stage boards; drive status; mains detection)<br />

• PC master software speed scope (observes actual and desired speed)<br />

Application Description<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The vector control algorithm is calculated on the Motorola DSP56F805. The algorithm generates<br />

the 3-phase PWM signals for Permanent Magnet (PM) synchronous motor inverter according to<br />

the user-required inputs, measured and calculated signals.<br />

The concept of the PMSM drive incorporates the following hardware components:<br />

• BLDC motor--brake set<br />

• 3-phase AC/BLDC high voltage power stage<br />

• DSP56F805EVM boards<br />

• ECOPTINL - In-line optoisolation box, which is connected between the host computer and<br />

the DSP56F805EVM<br />

The BLDC motor--brake set incorporates a 3-phase BLDC motor and attached BLDC motor<br />

brake. The BLDC motor has six poles. The incremental position sensor (encoder) is coupled on<br />

the motor shaft and position Hall Sensors are mounted between the motor and the brake. They<br />

allow to position sensing if required by the control algorithm. The detailed motor--brake<br />

specifications are listed in Table 11-12.<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-47<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The following software tools are needed for compiling, debugging, loading to the EVM, remote<br />

control and monitoring:<br />

• Metrowerks CodeWarrior 4.0<br />

• PC master software<br />

• <strong>SDK</strong> 2.4<br />

The drive can be controlled in two different operating modes:<br />

• Manual operating mode - the required speed is set by UP/DOWN push buttons and the<br />

drive is started and stopped by the RUN/STOP switch on the EVM board.<br />

• PC master software operating mode - the required speed is set by the PC master software<br />

active bar graph and the drive is started and stopped by the START MOTOR and STOP<br />

MOTOR controls.<br />

Measured quantities:<br />

• DCBus voltage<br />

• Phase currents (phase A, phase B, phase C)<br />

• Power module temperature<br />

• Rotor speed<br />

The faults used for drive protection:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Table 11-12. Motor--Brake Specifications<br />

Motor Characteristics Motor Type 6 poles, 3-phase, star connected,<br />

BLDC motor<br />

Speed Range 2500 rpm (at 310V)<br />

Max. Electrical Power 150 W<br />

Phase Voltage 3*220V<br />

Phase Current 0.55A<br />

Drive Characteristics Speed Range < 2500 rpm<br />

Input Voltage 310V DC<br />

Max DCBus Voltage 380 V<br />

Control Algorithm Speed Closed Loop Control<br />

Optoisolation Required<br />

Motor Characteristics Motor Type 6 poles,3-phase, star connected,<br />

BLDC motor<br />

Speed Range 2500 rpm (at 310V)<br />

Max. Electrical Power 150 W<br />

• Overvoltage (PC master software error message = Overvoltage fault)<br />

• Undervoltage (PC master software error message = Undervoltage fault)<br />

• Overcurrent (PC master software error message = Overcurrent fault)<br />

• Overheating (PC master software error message = Overheating fault)<br />

• Wrong-hardware (PC master software error message = Wrong HW used)<br />

11-48 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3-Phase PM Synchronous Motor Vector Control<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

States of the application state machine; see Table 11-13:<br />

• INIT - application initialization; operating mode changing<br />

• STOP - PWM outputs disabled; operating mode changing<br />

• RUN - PWM outputs enabled; motor running<br />

• FAULT - PWM outputs disabled; waiting for manual fault acknowledgement<br />

Control Process<br />

After RESET, the drive enters the INIT state in manual operation mode.When the RUN/STOP<br />

switch is detected in the STOP position and there are no faults pending, the STOP application<br />

state is entered. Otherwise, the drive waits in the INIT state or if faults are detected, the drive goes<br />

to the FAULT state. In the INIT and STOP states, the operation mode can be changed from PC<br />

master software. In the manual operational mode, the application is operated by the RUN/STOP<br />

switch and UP/DOWN buttons; in the PCMaster remote mode, the application is operated<br />

remotely by PCMaster.<br />

When the Start command is accepted (using the RUN/STOP Switch or PC master software<br />

command), the rotor position is aligned to a predefined position to obtain a known rotor position.<br />

The rotor alignment is done at the first start command only. Required speed is then calculated<br />

according to UP/DOWN push buttons or PC master software commands (if in PC master software<br />

remote mode). The required speed goes through an acceleration/deceleration ramp. The<br />

comparison between the actual speed command and the measured speed generates a speed error.<br />

Based on the error, the speed controller generates a stator current Is_qReq, which corresponds to<br />

torque. A second part of the stator current Is_dReq, which corresponds to flux, is given by the<br />

Field Weakening Controller. Simultaneously, the stator currents Is_a, Is_b and Is_c are measured<br />

and transformed from instantaneous values to the stationary reference frame α, β and<br />

consecutively to the rotary reference frame d-q (Clarke-Park transformation). Based on the errors<br />

between required and actual currents in the rotary reference frame, the current controllers<br />

generate output voltages Us_q and Us_d (in the rotary reference frame d-q). The voltages Us_q<br />

and Us_d are transformed back to the stationary reference frame α, β and, after DCBus ripple<br />

elimination, are recalculated to the 3-phase voltage system which is applied on the motor.<br />

Drive Protection<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The DCBus voltage, DCBus current and power stage temperature are measured during the control<br />

process. They protect the drive from Overvoltage, Undervoltage, Overcurrent and overheating.<br />

The Undervoltage and overheating protection is performed by software, while the Overcurrent<br />

and Overvoltage fault signal utilizes a fault input of the DSP. The power stage is identified using<br />

board identification. If the correct power stage is not identified, the fault "Wrong Power Stage"<br />

disables the drive operation. Line voltage is measured during application initialization and the<br />

application automatically adjusts itself to run at either 115V AC or 230V AC, depending on the<br />

measured value.<br />

If any of the above-mentioned faults occur, the motor control PWM outputs are disabled to<br />

protect the drive, and the application enters the FAULT state. The FAULT state can be left only<br />

when the fault conditions disappear and the RUN/STOP switch is moved to the STOP positionin<br />

manual mode and by the PC master software in the PC master software remote mode.<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-49<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The application can run on:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

• External RAM or Flash<br />

• 3-Phase AC/BLDC High-Voltage Power Stage powered by 115V AC or 230V AC<br />

• Manual or PC master software Operating Mode<br />

The correct power stage and voltage level is identified automatically and the appropriate<br />

constants are set.<br />

The 3-phase PM synchronous motor control application can operate in two modes:<br />

1. Manual Operating Mode<br />

The drive is controlled by the RUN/STOP switch. The motor speed is set by the UP<br />

and DOWN push buttons (see Figure 11-39). The actual state of the application is<br />

indicated by the user LEDs (see Figure 11-40). If the application runs and motor<br />

spinning is disabled (i.e., the system is ready), the GREEN user LED will flash at a<br />

frequency of 2Hz. When motor spinning is enabled, the GREEN user LED will be<br />

On. If a fault occurs on the power stage, the GREEN user LED will flash at a<br />

frequency of 8Hz. The actual state of the PWM outputs are indicated by PWM output<br />

LEDs.<br />

Figure 11-39. RUN/STOP Switch and UP/DOWN Buttons<br />

11-50 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

3-Phase PM Synchronous Motor Vector Control<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 11-40. USER and PWM LEDs<br />

Table 11-13. Application States<br />

Application State Motor State Green LED State<br />

INIT Stopped Blinking at a frequency of 2Hz (slow)<br />

STOP Stopped Blinking at a frequency of 2Hz (slow)<br />

RUN Spinning On<br />

FAULT Stopped Blinking at a frequency of 8Hz (fast)<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-51<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

2. PC master software (Remote) Operating Mode<br />

The drive is controlled remotely from a PC through the SCI communication channel<br />

of the DSP device via an RS-232 physical interface. The PC master software control<br />

can be taken over only if the RUN/STOP switch is in the STOP position; until then,<br />

the push buttons and RUN/STOP switch have no effect on the application control.<br />

The following PC master software control actions are supported:<br />

• Set PC master software Mode of the motor control system<br />

• Set Manual Mode of the motor control system<br />

• Start the motor<br />

• Stop the motor<br />

• Set the Required Speed of the motor<br />

PC master software displays the following information:<br />

• Required Speed of the motor<br />

• Actual Speed of the motor<br />

• Application status - Init/Stop/Run/Fault<br />

• DCBus voltage level<br />

• Identified line voltage<br />

• Fault Status - No_Fault/Overvoltage/Overcurrent/Undervoltage/Overheating<br />

• Identified Power Stage<br />

Project files for the PC master software are located in:<br />

...\nos\applications\3ph_PMSM_VectorControl\PC_Master\3ph_PMSM_VectorControl.pmp<br />

Start the PC master software window’s application, 3ph_PMSM_VectorControl.pmp. Figure 11-41<br />

shows the PC master software control window after this project has been launched.<br />

Note: If the PC master software project (.pmp file) is unable to control the application, it is<br />

possible that the wrong load map (.elf file) has been selected. PC master software uses<br />

the load map to determine addresses for global variables being monitored. Once the<br />

PC master software project has been launched, this option may be selected in the PC<br />

master software window under Project/Select Other Map File.<br />

11-52 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

11.7.3 Set-up<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

3-Phase PM Synchronous Motor Vector Control<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 11-41. PC Master Software Control Window<br />

Figure 11-42 illustrates the hardware set-up for the 3-phase PM Synchronous Motor Control<br />

application. The EVM board, power stage and motor are mounted into a suitcase for<br />

demonstration purposes.<br />

WARNING:<br />

Danger, high-voltage--risk of electric shock!<br />

The application PCB modules and serial interface (connector,<br />

cable) are not electrically isolated from the mains voltage--they<br />

are live.<br />

Use the In-line Optoisolation Box (ECOPTINL) between the<br />

PC and DSP56805 EVM as protection from dangerous voltage<br />

on the PC-user side, and to prevent damage to the PC and other<br />

hardware.<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-53<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Do not touch any part of the EVM or the serial cable between<br />

the EVM and the In-line Optoisolation Box unless you are<br />

using an insulation transformer. The application is designed to<br />

be fully controllable only from PC master software.<br />

To avoid inadvertently touching live parts, use plastic covers.<br />

In the rest of this application, the description supposes use of the insulation transformer.<br />

Figure 11-42. Set-up of the 3-phase PM Synchronous Motor Control Application<br />

The correct order of phases (phase A, phase B, phase C) for the PM Synchronous motor is:<br />

• phase A = white wire<br />

• phase B = red wire<br />

• phase C = black wire<br />

11-54 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3-Phase PM Synchronous Motor Vector Control<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

When facing a motor shaft, if the phase order is: phase A, phase B, phase C, the motor shaft<br />

should rotate clockwise (i.e., positive direction, positive speed).<br />

For detailed information, see the DSP56F805 Evaluation Module Hardware Reference<br />

Manual. The serial cable is needed for the PC master software debugging/control.<br />

11.7.3.1 PM Synchronous Motor Versus BLDC Motor<br />

The application software is targeted for PM Synchronous motor with sine-wave Back-EMF<br />

shape. In this particular demo application, the BLDC motor is used instead, due to the availability<br />

of the BLDC motor--Brake SM40V+SG40N, supplied as ECMTRHIVBLDC. Although the<br />

Back-EMF shape of this motor is not ideally sine-wave, it can be controlled by the application<br />

software. The drive parameters will be improved when a PMSM motor with an exact sine-wave<br />

Back-EMF shape is used.<br />

11.7.3.2 EVM Jumper Settings<br />

To execute 3-Phase PM Synchronous Motor Vector Control application, the DSP56F805 board<br />

requires the strap settings shown in Figure 11-43 and Table 11-14.<br />

JG6<br />

3 1<br />

JG1<br />

JG2<br />

JG15<br />

1<br />

3<br />

1<br />

3<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

1<br />

3<br />

9 7<br />

6 4<br />

3 1<br />

JG10<br />

JG14<br />

JG9<br />

JG15 JG1 JG2<br />

1<br />

JG9<br />

JG3<br />

1<br />

LED3<br />

P3 IRQA<br />

JG3<br />

1 2<br />

7 8<br />

S/N<br />

U1<br />

DSP56F805EVM<br />

Figure 11-43. DSP56F805EVM Jumper Reference<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-55<br />

JTAG<br />

U15<br />

S4 S5 S6<br />

JG7<br />

1<br />

JG5<br />

GP1<br />

S1<br />

GP2<br />

S2<br />

RUN/STOP<br />

S3<br />

JG11<br />

P1<br />

U9 U10<br />

IRQB<br />

3<br />

2<br />

1<br />

JG12<br />

USER<br />

9 7<br />

J23 J24<br />

6 4<br />

3<br />

JG10<br />

PWM<br />

1<br />

1 3<br />

JG14 2<br />

JG17 1<br />

JG6 JG12<br />

1<br />

Y1<br />

3<br />

2<br />

1<br />

JG13<br />

JG18<br />

RESET<br />

JG18<br />

1<br />

JG16<br />

JG17<br />

3<br />

2<br />

1<br />

JG13<br />

J29<br />

JG8<br />

1<br />

JG4<br />

P1<br />

3 1<br />

JG11<br />

8<br />

2<br />

JG4<br />

JG8<br />

7<br />

1<br />

3 1<br />

JG16<br />

JG5<br />

JG7<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Note: When running the EVM target system in a stand-alone mode from Flash, the JG5<br />

jumper must be set in the 1-2 configuration to disable the command converter parallel<br />

port interface. For this application this is set as short-connected permanently.<br />

11.7.4 Build<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Table 11-14. DSP56F805EVM Jumper Settings<br />

Jumper Group Comment Connections<br />

JG1 PD0 input selected as a high 1-2<br />

JG2 PD1 input selected as a high 1-2<br />

JG3 Primary UNI-3 serial selected 1-2, 3-4, 5-6, 7-8<br />

JG4 Secondary UNI-3 serial selected 1-2, 3-4, 5-6, 7-8<br />

JG5 Enable on-board parallel JTAG Command Converter Interface 1-2<br />

JG6 Use on-board crystal for DSP oscillator input 2-3<br />

JG7 Select DSP’s Mode 0 operation upon exit from reset 1-2<br />

JG8 Enable on-board SRAM 1-2<br />

JG9 Enable RS-232 output 1-2<br />

JG10 Secondary UNI-3 Analog temperature input unused NC<br />

JG11 Use Host power for Host target interface 1-2<br />

JG12 Primary Encoder input selected Zero Crossing signals 2-3, 5-6, 8-9<br />

JG13 Secondary Encoder input selected 2-3, 5-6, 8-9<br />

JG14 Primary UNI-3 3-Phase B-EMF Voltage selected as Analog Inputs 2-3, 5-6, 8-9<br />

JG15 Primary UNI-3 DCBus Overcurrent selected for FAULTA1 2-3<br />

JG16 Secondary UNI-3 Phase A Overcurrent selected for FAULTB1 1-2<br />

JG17 CAN termination unselected NC<br />

JG18 Use on-board crystal for DSP oscillator input 1-2<br />

When building this application, the user can create an application that runs from internal Flash or<br />

External RAM. To select the type of application to build, open the<br />

3ph_PMSM_VectorControl.mcp project and select the target build type; see Figure 11-44.<br />

Selecting Build All will build all application build types. A definition of the projects associated<br />

with these target build types may be viewed under the Targets tab of the project window.<br />

11-56 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3-Phase PM Synchronous Motor Vector Control<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 11-44. Target Build Selection<br />

To make this application, open the 3ph_PMSM_VectorControl.mcp project file and execute the<br />

Make command, shown in Figure 11-45. This will build and link the 3-phase PM Synchronous<br />

Motor Control application and all needed Metrowerks and <strong>SDK</strong> libraries<br />

11.7.5 Execute<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 11-45. Execute Make Command<br />

To execute the 3-phase PM Synchronous Motor Control application, choose the Program/Debug<br />

command in the CodeWarrior IDE, followed by the Run command. For more help with these<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-57<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

commands, refer to the CodeWarrior tutorial documentation in the following file located in the<br />

CodeWarrior installation directory:<br />

\CodeWarrior Documentation\PDF\Targeting_DSP56800.pdf<br />

If the Flash target is selected, CodeWarrior will automatically program the DSP’s internal Flash<br />

with the executable generated during Build. If the External RAM target is selected, the executable<br />

will be loaded to off-chip RAM.<br />

Once Flash has been programmed with the executable, the EVM target system may be run in a<br />

stand-alone mode from Flash. When loading is finished, the JG7 jumper must be connected to<br />

boot from internal Flash and the RESET button pushed.<br />

Once the application is executing, the motor can be started. When the switch is moved from the<br />

STOP position to the RUN position, the motor will start. The speed can be changed by the<br />

UP/DOWN buttons. Pressing the UP/DOWN buttons should incrementally increase the motor<br />

speed until it reaches aximum speed.<br />

Note: If the RUN/STOP switch is set to the RUN position when the application starts, toggle<br />

the RUN/STOP switch between the STOP and RUN positions to enable motor<br />

spinning. This is a protection feature that prevents the motor from starting when the<br />

application is executed from CodeWarrior.<br />

You should also see blinking or lighted LEDs, which indicate the application’s status.<br />

11.7.6 PC Master Software<br />

To run the application from Flash or ExtRAM, perform the following steps to set the PC master<br />

software control:<br />

• The RUN/STOP switch must be in the STOP position<br />

• Check the PC master software mode on the PC master software Control page<br />

• The motor can be started by pushing the Start PC master software Push Button and stopped<br />

by pushing the Stop PC master software Push Button<br />

• The speed can be set by the bar graph<br />

When the RUN/STOP switch on the EVM is in the STOP position, the manual mode can be set<br />

again by unchecking the PC master software mode on the PC master software Control page<br />

The application can be monitored in PC master software during the PC master software mode and<br />

during manual mode.<br />

PC master software displays the following information:<br />

• Operation mode<br />

• Application state<br />

• Start/Stop switch state<br />

• Change operation mode request<br />

• PC master software Start/Stop<br />

• Mains<br />

• Fault status<br />

• Actual speed<br />

• Required speed<br />

• PC master software required speed<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

11-58 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

• Power stage temperature<br />

• Identified power stage<br />

The following windows are available:<br />

Speed Scope monitors:<br />

• Required Speed<br />

• Actual Speed<br />

• Desired Id Current<br />

• Desired Iq Current<br />

Speed Recorder monitors:<br />

• Required Speed<br />

• Actual Speed<br />

• Desired Id Current<br />

• Desired Iq Current<br />

3-Phase SR Motor Control Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The recorder can be used only when the application is running from External RAM due to the<br />

limited on-chip memory. The length of the recorded window may be set in “Recorder Properties”<br />

=> bookmark “Main” => “Recorded Samples”. It is limited by the dedicated memory space in the<br />

appconfig.h file. The recorder samples are taken every 125 µsec.<br />

11.8 3-Phase SR Motor Control Application<br />

This application exercises principal control of the 3-Phase Switched Reluctance (SR) motor with<br />

the Hall Sensors on the DSP56F805EVM board, Optoisolation board, and 3-phase SR<br />

High-Voltage power stage.<br />

11.8.1 Files<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The 3-Phase SR Motor Control application is composed of the following files:<br />

• ...\dsp56805evm\nos\applications\3ph_SRM_Hall_Sensor_Type1\3ph_SRM_Hall_Sen-sor_Type1.c,<br />

main program<br />

• ...\dsp56805evm\nos\applications\3ph_SRM_Hall_Sensor_Type1\3ph_SRM_Hall_Sen-sor_Type1.mcp, a<br />

pplication project file<br />

• ...\dsp56805evm\nos\applications\3ph_SRM_Hall_Sensor_Type1\configextram\appcon-fig.c,<br />

application configuration file for external RAM<br />

• ...\dsp56805evm\nos\applications\3ph_SRM_Hall_Sensor_Type1\configflash\appconfig.c,<br />

application configuration file for Flash<br />

• ...\dsp56805evm\nos\applications\3ph_SRM_Hall_Sensor_Type1\configextram\appconfig.h,<br />

application configuration file for external RAM<br />

• ...\dsp56805evm\nos\applications\3ph_SRM_Hall_Sensor_Type1\configflash\appconfig.h,<br />

application configuration file for Flash<br />

• ...\dsp56805evm\nos\applications\3ph_SRM_Hall_Sensor_Type1\configextram\linker.cmd, linker<br />

command file for external RAM<br />

• ...\dsp56805evm\nos\applications\3ph_SRM_Hall_Sensor_Type1\configflash\linker.cmd, linker<br />

command file for Flash<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-59<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

• ...\dsp56805evm\nos\applications\3ph_SRM_Hall_Sensor_Type1\configflash\flash.cfg, configuration<br />

file for Flash<br />

These files are located in the <strong>SDK</strong> installation directory.<br />

11.8.2 Specifications<br />

The 3-Phase SR Motor Control Application performs principal control of the 3-phase SR motor<br />

with Hall Sensors on the DSP56F805 processor. The control technique sets the motor speed<br />

([rpm]) to the required value using the speed closed loop with Hall Position Sensors to derive the<br />

proper commutation action/moment. Protection against drive faults Overcurrent, Overvoltage,<br />

Undervoltage, and overheating is provided.<br />

The application can run on:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

• External RAM or Flash<br />

• 3-Phase SR High-Voltage Power Stage powered by 115 or 230V AC<br />

• 3-Phase SR Low-Voltage Power Stage powered by 12V DC<br />

• Manual or PC master software Operating Mode<br />

The correct power stage and voltage level is identified automatically and the appropriate<br />

constants are set.<br />

The 3-phase SR motor control application can operate in two modes:<br />

1. Manual Operating Mode<br />

The drive is controlled by the RUN/STOP switch. The motor speed is set by the UP<br />

and DOWN push buttons (see Figure 11-46). The actual state of the application is<br />

indicated by the user LEDs, shown in Figure 10-41. If the application runs and motor<br />

spinning is disabled (i.e., the system is ready), the GREEN user LED will flash at a<br />

frequency of 4Hz. When motor spinning is enabled, the GREEN user LED will be<br />

On. If a fault occurs on the power stage, the GREEN user LED will blink at a<br />

frequency of 8Hz. If the wrong power board is identified, the GREEN user LED will<br />

blink at a frequency of 1Hz. The actual state of the PWM outputs are indicated by<br />

PWM output LEDs (see Figure 11-47).<br />

11-60 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

3-Phase SR Motor Control Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 11-46. RUN/STOP Switch and UP/DOWN Buttons<br />

Figure 11-47. USER and PWM LEDs<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-61<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

2. PC master software (Remote) Operating Mode<br />

The drive is controlled remotely from a PC through the SCI communication channel<br />

of the DSP device via an RS-232 physical interface. The drive is enabled by the<br />

RUN/STOP switch, which can be used to stop the application safely at any time.<br />

The following control actions are supported:<br />

• Set PC master software Mode of the motor control system<br />

• Set Manual Mode of the motor control system<br />

• Start the motor<br />

• Stop the motor<br />

• Set the Required Speed of the motor<br />

PC master software displays the following information:<br />

• Required Speed of the motor<br />

• Actual Speed of the motor<br />

• Motor status - Running/Stand-by<br />

• Fault Status<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Project files for the PC master software are located in:<br />

...\nos\applications\3ph_srn_hall_sensor_type1\PC_Master\3ph_sr_drive.pmp<br />

Start the PC master software window’s application, 3ph_SR_sensor.pmp. Figure 11-48 shows the<br />

PC master software control window after this project has been launched.<br />

Note: If the PC master software project (.pmp file) is unable to control the application, it is<br />

possible that the wrong load map (.elf file) has been selected. PC master software uses<br />

the load map to determine addresses for global variables being monitored. Once the<br />

PC master software project has been launched, this option may be selected in the PC<br />

master software window under Project/Select Other Map FileReload.<br />

11-62 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

11.8.3 Set-up<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

3-Phase SR Motor Control Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 11-48. PC Master Software Control Window<br />

Figure 11-49 and Figure 11-50 illustrate the hardware set-ups for the 3-phase SR Motor Control<br />

applications. The motor’s Hall Sensors connector must be attached to connector J23 on the EVM<br />

Board.<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-63<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 11-49. Setup of the 3-phase HV SR Motor Control Application Set-up<br />

11-64 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3-Phase SR Motor Control Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 11-50. Set-up of the 3-phase LV SR Motor Control Application<br />

The correct order of phases (phase A, phase B, phase C) for the SR motor is:<br />

• phase A = white wire<br />

• phase B = red wire<br />

• phase C = black wire<br />

When facing a motor shaft, the motor shaft should rotate clockwise (i.e,. positive direction,<br />

positive speed).<br />

For detailed information, see the DSP56F805 Evaluation Module Hardware Reference<br />

Manual. The serial cable is needed for the PC master software debugging tool only.<br />

11.8.3.1 EVM Jumper Settings<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

To execute the 3-phase SR Motor Control Application, the DSP56F805 board requires the strap<br />

settings shown in Figure 11-51 and Table 11-15.<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-65<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

JG6<br />

3 1<br />

JG1<br />

JG2<br />

JG15<br />

1<br />

3<br />

1<br />

3<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

1<br />

3<br />

9 7<br />

6 4<br />

3 1<br />

JG10<br />

JG14<br />

JG9<br />

JG15 JG1 JG2<br />

1<br />

JG9<br />

JG3<br />

1<br />

LED3<br />

P3 IRQA<br />

JG3<br />

1 2<br />

7 8<br />

S/N<br />

U1<br />

DSP56F805EVM<br />

3<br />

2<br />

1<br />

JG13<br />

Figure 11-51. DSP56F805EVM Jumper Reference<br />

Table 11-15. DSP56F805EVM Jumper Settings<br />

Jumper Group Comment Connections<br />

JG1 PD0 input selected as a high 1-2<br />

JG2 PD1 input selected as a high 1-2<br />

JG3 Primary UNI-3 serial selected 1-2, 3-4, 5-6, 7-8<br />

JG4 Secondary UNI-3 serial selected 1-2, 3-4, 5-6, 7-8<br />

JG5 Enable on-board parallel JTAG Command Converter Interface NC<br />

JG6 Use on-board crystal for DSP oscillator input 2-3<br />

JG7 Select DSP’s Mode 0 operation upon exit from reset 1-2<br />

JG8 Enable on-board SRAM 1-2<br />

JG9 Enable RS-232 output 1-2<br />

JG10 Secondary UNI-3 Analog temperature input unused NC<br />

JG11 Use Host power for Host target interface 1-2<br />

JG12 Primary Encoder input selected for Hall Sensor signals 2-3, 5-6, 8-9<br />

11-66 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

JTAG<br />

U15<br />

S4 S5 S6<br />

JG7<br />

1<br />

JG5<br />

GP1<br />

S1<br />

GP2<br />

S2<br />

RUN/STOP<br />

S3<br />

JG11<br />

P1<br />

U9 U10<br />

IRQB<br />

3<br />

2<br />

1<br />

JG12<br />

USER<br />

9 7<br />

J23 J24<br />

6 4<br />

3<br />

JG10<br />

PWM<br />

1<br />

1 3<br />

JG14 2<br />

JG17 1<br />

JG6 JG12<br />

1<br />

Y1<br />

3<br />

2<br />

1<br />

JG13<br />

JG18<br />

RESET<br />

JG18<br />

1<br />

JG16<br />

JG17<br />

J29<br />

JG8<br />

1<br />

JG4<br />

P1<br />

3 1<br />

JG11<br />

8<br />

2<br />

JG4<br />

JG8<br />

7<br />

1<br />

3 1<br />

JG16<br />

JG5<br />

JG7<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3-Phase SR Motor Control Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 11-15. DSP56F805EVM Jumper Settings<br />

Jumper Group Comment Connections<br />

JG13 Secondary Encoder input selected 2-3, 5-6, 8-9<br />

JG14 Primary UNI-3 3-Phase Current Sense selected as Analog Inputs 2-3, 5-6, 8-9<br />

JG15 Primary UNI-3 DCBus Overcurrent selected for FAULTA1 2-3<br />

JG16 Secondary UNI-3 Phase B Overcurrent selected for FAULTB1 1-2<br />

JG17 CAN termination unselected NC<br />

JG18 Use on-board crystal for DSP oscillator input 1-2<br />

Note: When running the EVM target system in a stand-alone mode from Flash, the JG5<br />

jumper must be set in the 1-2 configuration to disable the command converter parallel<br />

port interface.<br />

11.8.4 Build<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

When building this application, the user can create an application that runs from internal Flash or<br />

External RAM. To select the type of application to build, open the<br />

3ph_SRM_Hall_Sensor_Type1.mcp project and select the target build type as shown in<br />

Figure 11-52. Selecting Build All will create all application build types. A definition of the projects<br />

associated with these target build types may be viewed under the Targets tab of the project<br />

window.<br />

Figure 11-52. Target Build Selection<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-67<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

To make this application, open the 3ph_SRM_Hall_Sensor_Type1.mcp project file and execute<br />

the Make command, as shown in Figure 11-53. This will build and link the 3-phase SR Motor<br />

Control application and all needed Metrowerks and <strong>SDK</strong> libraries.<br />

11.8.5 Execute<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 11-53. Execute Make Command<br />

To execute the 3-phase SR Motor Control application, choose the Program/Debug command in<br />

the CodeWarrior IDE, followed by the Run command. For more help with these commands, refer<br />

to the CodeWarrior tutorial documentation in the following file located in the CodeWarrior<br />

installation directory:<br />

\CodeWarrior Documentation\PDF\Targeting_DSP56800.pdf<br />

If the Flash target is selected, CodeWarrior will automatically program the DSP’s internal Flash<br />

with the executable generated during Build. If the External RAM target is selected, the executable<br />

will be loaded to off-chip RAM.<br />

Once Flash has been programmed with the executable, the EVM target system may be run in a<br />

stand-alone mode from Flash. To do this, set the JG5 jumper in the 1-2 configuration to disable<br />

the parallel port and press the RESET button.<br />

Once the application is executing, the motor can be started. When the switch is moved from the<br />

STOP position to the RUN position, the motor will start. The speed can be changed by the<br />

UP/DOWN buttons. Pressing the UP/DOWN buttons should incrementally increase the motor<br />

speed until it reaches maximum speed.<br />

Note: If the RUN/STOP switch is set to the RUN position when the application starts, toggle<br />

the RUN/STOP switch between the STOP and RUN positions to enable motor<br />

spinning. This is a protection feature that prevents the motor from starting when the<br />

application is executed from CodeWarrior.<br />

You should also see blinking or lighted LEDs, which indicate the application’s status.<br />

11-68 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3-Phase SR Sensorless Motor Control Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The application can be monitored in PC master software during the manual mode.<br />

PC Master Software Mode Control<br />

Perform the following steps to set the PC master software control:<br />

• The RUN/STOP switch must be in the STOP position<br />

• Check the PC master software mode on the PC master software control page<br />

• The application can be enabled by setting the RUN/STOP switch to the RUN position<br />

• The motor can be started by pushing the Start PC master software Push Button and stopped<br />

by pressing the Stop PC master software Push Button<br />

• The speed can be set by the bar graph<br />

• The motor can be stopped any time by the RUN/STOP switch on the EVM<br />

• When the RUN/STOP switch on the EVM is in the STOP position, the manual mode can<br />

be set again by unchecking the PC master software mode on the PC master software control<br />

page<br />

11.9 3-Phase SR Sensorless Motor Control<br />

Application<br />

This application exercises sensorless control of the 3-Phase Switched Reluctance (SR) motor on<br />

the DSP56F805EVM board, Optoisolation board, and 3-phase SR High-Voltage power stage.<br />

11.9.1 Files<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The 3-Phase SR Motor Control application is composed of the following files:<br />

• ...\dsp56805evm\nos\applications\3ph_srm_sensorless\3ph_srm_sensorless.c, main<br />

program<br />

• ...\dsp56805evm\nos\applications\3ph_srm_sensorless\3ph_srm_sensorless.h, main<br />

header file of the program used for storing application references and defined constants that<br />

are required by the 3ph_srm_sensorless.c file.<br />

• ...\dsp56805evm\nos\applications\3ph_srm_sensorless\appconst.c, application<br />

constants for Data flash<br />

• ...\dsp56805evm\nos\applications\3ph_srm_sensorless\appconst.h, header file to store<br />

the external references and defined constants related to the appconst.c file<br />

• ...\dsp56805evm\nos\applications\3ph_srm_sensorless\3ph_srm_sensorless.mcp,<br />

application project file<br />

• ...\dsp56805evm\nos\applications\3ph_srm_sensorless\configextram\appconfig.c,<br />

application configuration file for external RAM<br />

• ...\dsp56805evm\nos\applications\3ph_srm_sensorless\configflash\appconfig.c,<br />

application configuration file for Flash<br />

• ...\dsp56805evm\nos\applications\3ph_srm_sensorless\configextram\appconfig.h,<br />

application configuration header file for external RAM<br />

• ...\dsp56805evm\nos\applications\3ph_srm_sensorless\configflash\appconfig.h,<br />

application configuration header file for Flash<br />

• ...\dsp56805evm\nos\applications\3ph_srm_sensorless\configextram\linker.cmd,<br />

linker command file for external RAM<br />

• ...\dsp56805evm\nos\applications\3ph_srm_sensorless\configflash\linker.cmd, linker<br />

command file for Flash<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-69<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

• ...\dsp56805evm\nos\applications\3ph_srm_sensorless\configflash\flash.cfg,<br />

configuration file for Flash<br />

These files are located in the <strong>SDK</strong> installation directory.<br />

11.9.2 Specifications<br />

The 3-Phase SR Sensorless Motor Control Application demonstrates the sensorless Switched<br />

Reluctance Motor Control application using the flux linkage position estimation on the<br />

DSP56F805 processor. An estimation of the phase resistance for low speed range is included.<br />

Control Process<br />

After RESET, the drive enters the INIT state in manual mode.When the RUN/STOP switch is<br />

detected in the STOP position (using the RUN/STOP Switch or the PC master software<br />

command) and there are no faults pending, the STOP application state is entered. When the start<br />

command is detected (using the RUN/STOP switch or the PC master software Start button), the<br />

drive enters the RUN application state; the motor is started. The following start-up sequence with<br />

the rotor alignment is provided:<br />

• MOTOR_STOPPED Motor stopped<br />

• ALIGNMENT_COMMAND Alignment command accepted<br />

• ALIGNMENT_STAGE_ONE Alignment in progress; phases B and C switched on<br />

• ALIGNMENT_STAGE_TWO Alignment in progress; phase B switched on<br />

• START_UP_COMMAND Alignment finalized; start the motor<br />

• START_UP_FINISHED Motor running; start-up finalised<br />

The rotor position is evaluated using the sensorless flux linkage estimation algorithm. The actual<br />

flux linkage is calculated using the PWM frequency rate and compared with the reference flux<br />

linkage for the given commutation angle. The commutation angle is calculated according to the<br />

desired speed, current and actual DCBus voltage. When the actual flux linkage exceeds the<br />

reference flux linkage, the commutation of the phases in the desired rotation direction is done.<br />

The flux linkage error is used for the phase resistance estimation in low speeds (US Patent<br />

Pending). The commutation instances are used for actual motor speed calculation. According to<br />

the control signals (RUN/STOP switch, UP/DOWN push buttons) and PC master software<br />

commands (during PC master software control), the reference speed command is calculated using<br />

an acceleration/deceleration ramp. The comparison between the actual speed command and the<br />

measured speed generates a speed error. Based on the error, the speed controller generates the<br />

desired phase current. When the phase is commutated, it is turned on with duty cycle 100 percent<br />

(or Output_duty_cycle_startup during motor start-up). Then during each PWM cycle, the actual<br />

phase current is compared with the desired current. As soon as the actual current exceeds the<br />

command current, the current controller is turned on. The procedure is repeated for each<br />

commutation cycle of the motor. The current controller generates the desired duty cycle. Finally,<br />

the 3-phase PWM SR Motor Control signals are generated.<br />

Drive Protection<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The DCBus voltage, DCBus current and power stage temperature are measured during the control<br />

process. They protect the drive from Overvoltage, Undervoltage, Overcurrent and Overheating.<br />

The Undervoltage and Overheating protection is performed by software, while the Overcurrent<br />

and Overvoltage fault signal utilizes a fault input of the DSP. The power stage is identified using<br />

11-70 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3-Phase SR Sensorless Motor Control Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

board identification. If the correct power stage is not identified, the fault "Wrong Power Stage"<br />

disables the drive operation. Line voltage is measured during application initialization and the<br />

application automatically adjusts itself to run at either 115V AC or 230V AC, depending on the<br />

measured value. If the line voltage is detected to be out of the -15% to +10% of nominal voltage,<br />

the fault "Out of the Mains Limit" disables the drive operation.<br />

If any of the above-mentioned faults occur, the motor control PWM outputs are disabled in order<br />

to protect the drive and the application enters the FAULT state. The FAULT state can be left only<br />

when the fault conditions disappear and the RUN/STOP switch is moved to the STOP position<br />

The application can run on:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

• External RAM or Flash<br />

• 3-Phase SR High-Voltage Power Stage powered by 115V AC or 230V AC<br />

• Manual or PC master software Operating Mode<br />

The correct power stage and voltage level is identified automatically and the appropriate<br />

constants are set.<br />

The 3-phase SR motor control application can operate in two modes:<br />

1. Manual Operating Mode<br />

The drive is controlled by the RUN/STOP switch. The motor speed is set by the UP<br />

and DOWN push buttons (see Figure 11-54). The actual state of the application is<br />

indicated by the user LEDs (see Figure 11-55). If the application runs and motor<br />

spinning is disabled (i.e., the system is ready), the GREEN user LED will flash at a<br />

frequency of 2Hz. When motor spinning is enabled, the GREEN user LED will be<br />

On. If a fault occurs on the power stage, the GREEN user LED will flash at a<br />

frequency of 8Hz. The actual state of the PWM outputs are indicated by PWM output<br />

LEDs.<br />

Figure 11-54. RUN/STOP Switch and UP/DOWN Buttons<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-71<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 11-55. USER and PWM LEDs<br />

2. PC master software (Remote) Operating Mode<br />

The drive is controlled remotely from a PC through the SCI communication channel<br />

of the DSP device via an RS-232 physical interface. The PC master software control<br />

can be taken over only if the RUN/STOP switch is in STOP position. Then the push<br />

buttons and RUN/STOP switch have no effect on the application control.<br />

The following PC master software control actions are supported:<br />

• Set PC master software Mode of the motor control system<br />

• Set Manual Mode of the motor control system<br />

• Start the motor<br />

• Stop the motor<br />

• Set the Required Speed of the motor<br />

11-72 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

3-Phase SR Sensorless Motor Control Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

PC master software displays the following information:<br />

• Required Speed of the motor<br />

• Actual Speed of the motor<br />

• Application status - Init/Stop/Run/Fault<br />

• DCBus voltage level<br />

• Identified line voltage<br />

• Fault Status - No_Fault/Overvoltage/Overcurrent/Undervoltage/Overheating<br />

• Identified Power Stage<br />

Project files for the PC master software are located in:<br />

...\nos\applications\3ph_srm_sensorless\PC_Master\3ph_srm_sensorless.pmp<br />

Start the PC master software window’s application, 3ph_srm_sensorless.pmp. Figure 11-56 shows<br />

the PC master software control window after this project has been launched.<br />

Note: If the PC master software project (.pmp file) is unable to control the application, it is<br />

possible that the wrong load map (.elf file) has been selected. PC master software uses<br />

the load map to determine addresses for global variables being monitored. Once the<br />

PC master software project has been launched, this option may be selected in the PC<br />

master software window under Project/Select Other Map File.<br />

Figure 11-56. PC Master Software Control Window<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-73<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

11.9.3 Set-up<br />

Figure 11-57 illustrates the hardware set-ups for the 3-phase SR Motor Control applications. The<br />

motor’s Encoder connector attached to connector J23 on the EVM Board is not required for the<br />

motor operation. It serves only for PC master software position reference.<br />

Figure 11-57. Setup of the 3-phase HV SR Sensorless Motor Control Application Set-up<br />

The correct order of phases (phase A, phase B, phase C) for the SR motor is:<br />

• phase A = white wire<br />

• phase B = red wire<br />

• phase C = black wire<br />

When facing a motor shaft, the motor shaft should rotate clockwise (i.e., positive direction,<br />

positive speed).<br />

For detailed information, see the DSP56F805 Evaluation Module Hardware Reference<br />

Manual. The serial cable is needed for the PC master software debugging/control.<br />

11.9.3.1 EVM Jumper Settings<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

To execute the 3-phase SR Sensorless Motor Control Application, the DSP56F805 board requires<br />

the strap settings shown in Figure 11-58 and Table 11-16.<br />

11-74 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

JG6<br />

3-Phase SR Sensorless Motor Control Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3 1<br />

JG1<br />

JG2<br />

JG15<br />

1<br />

3<br />

1<br />

3<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

1<br />

3<br />

9 7<br />

6 4<br />

3 1<br />

JG10<br />

JG14<br />

JG9<br />

JG15 JG1 JG2<br />

1<br />

JG9<br />

JG3<br />

1<br />

LED3<br />

P3 IRQA<br />

JG3<br />

1 2<br />

7 8<br />

S/N<br />

U1<br />

DSP56F805EVM<br />

3<br />

2<br />

1<br />

JG13<br />

Figure 11-58. DSP56F805EVM Jumper Reference<br />

Table 11-16. DSP56F805EVM Jumper Settings<br />

Jumper Group Comment Connections<br />

JG1 PD0 input selected as a high 1-2<br />

JG2 PD1 input selected as a high 1-2<br />

JG3 Primary UNI-3 serial selected 1-2, 3-4, 5-6, 7-8<br />

JG4 Secondary UNI-3 serial selected 1-2, 3-4, 5-6, 7-8<br />

JG5 Enable on-board parallel JTAG Command Converter Interface NC<br />

JG6 Use on-board crystal for DSP oscillator input 2-3<br />

JG7 Select DSP’s Mode 0 operation upon exit from reset 1-2<br />

JG8 Enable on-board SRAM 1-2<br />

JG9 Enable RS-232 output 1-2<br />

JG10 Secondary UNI-3 Analog temperature input unused NC<br />

JG11 Use Host power for Host target interface 1-2<br />

JG12 Primary Encoder input selected for Hall Sensor signals 2-3, 5-6, 8-9<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-75<br />

JTAG<br />

U15<br />

S4 S5 S6<br />

JG7<br />

1<br />

JG5<br />

GP1<br />

S1<br />

GP2<br />

S2<br />

RUN/STOP<br />

S3<br />

JG11<br />

P1<br />

U9 U10<br />

IRQB<br />

3<br />

2<br />

1<br />

JG12<br />

USER<br />

9 7<br />

J23 J24<br />

6 4<br />

3<br />

JG10<br />

PWM<br />

1<br />

1 3<br />

JG14 2<br />

JG17 1<br />

JG6 JG12<br />

1<br />

Y1<br />

3<br />

2<br />

1<br />

JG13<br />

JG18<br />

RESET<br />

JG18<br />

1<br />

JG16<br />

JG17<br />

J29<br />

JG8<br />

1<br />

JG4<br />

P1<br />

3 1<br />

JG11<br />

8<br />

2<br />

JG4<br />

JG8<br />

7<br />

1<br />

3 1<br />

JG16<br />

JG5<br />

JG7<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 11-16. DSP56F805EVM Jumper Settings<br />

Jumper Group Comment Connections<br />

JG13 Secondary Encoder input selected 2-3, 5-6, 8-9<br />

JG14 Primary UNI-3 3-Phase Current Sense selected as Analog Inputs 2-3, 5-6, 8-9<br />

JG15 Primary UNI-3 DCBus Overcurrent selected for FAULTA1 2-3<br />

JG16 Secondary UNI-3 Phase B Overcurrent selected for FAULTB1 1-2<br />

JG17 CAN termination unselected NC<br />

JG18 Use on-board crystal for DSP oscillator input 1-2<br />

Note: When running the EVM target system in a stand-alone mode from Flash, the JG5<br />

jumper must be set in the 1-2 configuration to disable the command converter parallel<br />

port interface.<br />

11.9.4 Build<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

When building this application, the user can create an application that runs from internal Flash or<br />

External RAM. To select the type of application to build, open the 3ph_srm_sensorless.mcp<br />

project and select the target build type as shown in Figure 11-59. Selecting Build All will create all<br />

application build types. A definition of the projects associated with these target build types may<br />

be viewed under the Targets tab of the project window.<br />

Figure 11-59. Target Build Selection<br />

11-76 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3-Phase SR Sensorless Motor Control Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

To make this application, open the 3ph_srm_sensorless.mcp project file and execute the Make<br />

command, as shown in Figure 11-60. This will build and link the 3-phase SR Sensorless Motor<br />

Control application and all needed Metrowerks and <strong>SDK</strong> libraries.<br />

11.9.5 Execute<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 11-60. Execute Make Command<br />

To execute the 3-phase SR Motor Control application, choose the Program/Debug command in<br />

the CodeWarrior IDE, followed by the Run command. For more help with these commands, refer<br />

to the CodeWarrior tutorial documentation in the following file located in the CodeWarrior<br />

installation directory:<br />

\CodeWarrior Documentation\PDF\Targeting_DSP56800.pdf<br />

If the Flash target is selected, CodeWarrior will automatically program the DSP’s internal Flash<br />

with the executable generated during Build. If the External RAM target is selected, the executable<br />

will be loaded to off-chip RAM.<br />

Once Flash has been programmed with the executable, the EVM target system may be run in a<br />

stand-alone mode from Flash. To do this, set the JG5 jumper in the 1-2 configuration to disable<br />

the parallel port and press the RESET button.<br />

Once the application is executing, the motor can be started. When the switch is moved from the<br />

STOP position to the RUN position, the motor will start. The speed can be changed by the<br />

UP/DOWN buttons. Pressing the UP/DOWN buttons should incrementally increase the motor<br />

speed until it reaches maximum speed.<br />

Note: If the RUN/STOP switch is set to the RUN position when the application starts, toggle<br />

the RUN/STOP switch between the STOP and RUN positions to enable motor<br />

spinning. This is a protection feature that prevents the motor from starting when the<br />

application is executed from CodeWarrior.<br />

You should also see blinking or lighted LEDs, which indicate the application’s status.<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-77<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

11.9.6 PC Master Software<br />

Perform the following steps to set the PC master software control:<br />

• The RUN/STOP switch must be in the STOP position<br />

• Check the PC master software mode on the PC master software control page<br />

• The motor can be started by pushing the Start PC master software Push Button and stopped<br />

by pushing the Stop PC master software Push Button<br />

• The speed can be set by the bar graph<br />

When the RUN/STOP switch on the EVM is in the STOP position, the manual mode can be set<br />

again by unchecking the PC master software mode on the PC master software control page<br />

The application can be monitored in PC master software during the PC master software mode and<br />

during manual mode.<br />

The following windows are available:<br />

Speed Scope monitors:<br />

• Required Speed<br />

• Actual Speed<br />

• Desired Phase Current<br />

Start-up Recorder captures:<br />

• Desired Phase Current<br />

• Active Phase Current<br />

• Reference Flux Linkage<br />

• Active Flux Linkage<br />

• Output Duty Cycle<br />

• Encoder Position Reference<br />

Start-up Recorder is initiated with motor start only.<br />

Flux Linkage Recorder captures:<br />

• Active Phase Current<br />

• Discharge Phase Current<br />

• Active Flux Linkage<br />

• Discharge Flux Linkage<br />

• Reference Flux Linkage<br />

• Encoder Position Reference<br />

Flux Linkage Recorder may be initiated any time during the motor run.<br />

Current Controller Recorder captures:<br />

• Desired Phase Current<br />

• Active Phase Current<br />

• Output Duty Cycle<br />

• Encoder Position Reference<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Current Controller Recorder may be initiated any time during the motor run.<br />

Note: The recorder can be used only when the application is running from External RAM<br />

due to limited on-chip memory. The length of the recorded window may be set in<br />

11-78 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3-Phase SR Motor Control with Encoder Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

“Recorder Properties” => bookmark “Main” => “Recorded Samples”. It is limited by<br />

the dedicated memory space in the appconfig.h file. The recorder samples are taken<br />

every 64.5 µsec.<br />

11.10 3-Phase SR Motor Control with Encoder<br />

Application<br />

This application exercises control of the 3-Phase Switched Reluctance (SR) motor with encoder<br />

position sensor on the DSP56F805EVM board, Optoisolation board, and 3-phase SR<br />

High-Voltage power stage.<br />

11.10.1 Files<br />

he 3-Phase SR Motor Control application is composed of the following files:<br />

• ...\dsp56805evm\nos\applications\3ph_srm_Encoder\3ph_srm_Encoder.c, main<br />

program<br />

• ...\dsp56805evm\nos\applications\3ph_srm_Encoder\3ph_srm_Encoder.h, main<br />

header file of the program used for storing application references and defined constants that<br />

are required by the 3ph_srm_Encoder.c file.<br />

• ...\dsp56805evm\nos\applications\3ph_srm_Encoder\appconst.c, application constants<br />

for Data flash<br />

• ...\dsp56805evm\nos\applications\3ph_srm_Encoder\appconst.h, header file to store<br />

the external references and defined constants related to the appconst.c file<br />

• ...\dsp56805evm\nos\applications\3ph_srm_Encoder\3ph_srm_Encoder..mcp,<br />

application project file<br />

• ...\dsp56805evm\nos\applications\3ph_srm_Encoder\configextram\appconfig.c,<br />

application configuration file for external RAM<br />

• ...\dsp56805evm\nos\applications\3ph_srm_Encoder\configflash\appconfig.c,<br />

application configuration file for Flash<br />

• ...\dsp56805evm\nos\applications\3ph_srm_Encoder\configextram\appconfig.h,<br />

application configuration header file for external RAM<br />

• ...\dsp56805evm\nos\applications\3ph_srm_Encoder\configflash\appconfig.h,<br />

application configuration header file for Flash<br />

• ...\dsp56805evm\nos\applications\3ph_srm_Encoder\configextram\linker.cmd, linker<br />

command file for external RAM<br />

• ...\dsp56805evm\nos\applications\3ph_srm_Encoder\configflash\linker.cmd, linker<br />

command file for Flash<br />

• ...\dsp56805evm\nos\applications\3ph_srm_Encoder\configflash\flash.cfg,<br />

configuration file for Flash<br />

These files are located in the <strong>SDK</strong> installation directory.<br />

11.10.2 Specifications<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The 3-Phase SR Motor Control with Encoder Application demonstrates the Switched Reluctance<br />

Motor Control application using position sensor on the DSP56F805 processor.<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-79<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Control Process<br />

After RESET the drives enters the INIT state in MANUAL mode.When the start/stop switch is<br />

detected (using Start/Stop Switch or PC master software command) in STOP position and there<br />

are no faults pending the STOP application state is entered. When the start command is detected<br />

(using Start/Stop switch or PC master software Start button), the drive enters RUN application<br />

state - motor is started. The following start-up sequence with the rotor alignment is provided:<br />

• MOTOR_STOPPED, Motor stopped<br />

• ALIGNMENT_COMMAND, Alignment command accepted<br />

• ALIGNMENT_STAGE_ONE, Alignment in progress - phases B&C switched on<br />

• ALIGNMENT_STAGE_TWO, Alignment in progress - phase B switched on<br />

• START_UP_FINISHED Alignment finalized, motor running, start-up finalized<br />

The rotor position is evaluated with encoder position sensor through timer module A of channel 0,<br />

which is set into quadrature mode.Channel 1 of the same module performs commutation call<br />

under successful comapring of CMP2. Every commutation occurrence the CMP2 is anew loaded<br />

with recently calculated value, which is adjusted by advance angle routine considering actual<br />

speed, desired current and applied voltage across corresponding phase. The individual phase is<br />

supposed to be switched on before overlapping rotor and stator teeth.<br />

According to the control signals (Start/Stop switch, Up/Down push buttons) and PC master<br />

software commands (in case of PC master software control) the reference speed command is<br />

calculated using an acceleration/deceleration ramp. The comparison between the actual speed<br />

command and the measured speed generates a speed error. Base on the error the speed controller<br />

generates desired phase current. When the phase is commutated, it is turned-on with duty cycle<br />

100% (or Output_duty_cycle_startup during motor start-up). Then during each PWM cycle the<br />

actual phase current is compared with the desired current. As soon as the actual current exceeds<br />

the command one, the current controller is turned-on. The procedure is repeated for each<br />

commutation cycle of the motor. The current controller generates the desired duty cycle Finally<br />

the 3-phase PWM SR Motor Control signals are generated.<br />

Drive Protection<br />

The DCBus voltage, DCBus current and power stage temperature are measured during the control<br />

process. They are used for overvoltage, undervoltage, overcurrent and overtemperature protection<br />

of the drive. The undervoltage and overtemperature protection is performed by software while the<br />

overcurrent and overvoltage fault signal utilizes a Fault inputs of the DSP. The power stage is<br />

identified using board identification. If the correct power stage is not identified, the fault "Wrong<br />

Power Stage" disables the drive operation. The line voltage is measured during application<br />

initialization. According the detected level the 115VAC or 230VAC mains is set. If the line<br />

voltage out of the -15% .. +10% of nominal voltage is detected, the fault "Out of the Mains Limit"<br />

disables the drive operation.<br />

If any of the above mentioned faults occur, the motor control PWM outputs are disabled in order<br />

to protect the drive and the application enters the FAULT state. The FAULT state can be left only<br />

when the fault conditions disappear and the start/stop switch is moved to the STOP position<br />

The application can run on:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

• External RAM or Flash<br />

• 3-Phase SR High-Voltage Power Stage powered by 115V AC or 230V AC<br />

• Manual or PC master software Operating Mode<br />

11-80 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

3-Phase SR Motor Control with Encoder Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The correct power stage and voltage level is identified automatically and the appropriate<br />

constants are set.<br />

The 3-phase SR motor control application can operate in two modes:<br />

1. Manual Operating Mode<br />

The drive is controlled by the RUN/STOP switch. The motor speed is set by the UP<br />

and DOWN push buttons (see Figure 11-54). The actual state of the application is<br />

indicated by the user LEDs (see Figure 11-55). If the application runs and motor<br />

spinning is disabled (i.e., the system is ready), the GREEN user LED will flash at a<br />

frequency of 2Hz. When motor spinning is enabled, the GREEN user LED will be<br />

On. If a fault occurs on the power stage, the GREEN user LED will flash at a<br />

frequency of 8Hz. The actual state of the PWM outputs are indicated by PWM output<br />

LEDs.<br />

Figure 11-61. RUN/STOP Switch and UP/DOWN Buttons<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-81<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 11-62. USER and PWM LEDs<br />

2. PC master software (Remote) Operating Mode<br />

The drive is controlled remotely from a PC through the SCI communication channel<br />

of the DSP device via an RS-232 physical interface. The PC master software control<br />

can be taken over only if the RUN/STOP switch is in STOP position. Then the push<br />

buttons and start/stop switch has no effect to the application control.<br />

The following PC master software control actions are supported:<br />

• Set PC master software Mode of the motor control system<br />

• Set Manual Mode of the motor control system<br />

• Start the motor<br />

• Stop the motor<br />

• Set the Required Speed of the motor<br />

11-82 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

3-Phase SR Motor Control with Encoder Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

PC master software displays the following information:<br />

• Required Speed of the motor<br />

• Actual Speed of the motor<br />

• Application status - Init/Stop/Run/Fault<br />

• DCBus voltage level<br />

• Identified line voltage<br />

• Fault Status - No_Fault/Overvoltage/Overcurrent/Undervoltage/Overheating<br />

• Identified Power Stage<br />

Project files for the PC master software are located in:<br />

...\nos\applications\3ph_srm_Encoder\PC_Master\3ph_srm_Encoder.pmp<br />

Start the PC master software window’s application, 3ph_srm_Encoder.pmp. Figure 11-56 shows<br />

the PC master software control window after this project has been launched.<br />

Note: If the PC master software project (.pmp file) is unable to control the application, it is<br />

possible that the wrong load map (.elf file) has been selected. PC master software uses<br />

the load map to determine addresses for global variables being monitored. Once the<br />

PC master software project has been launched, this option may be selected in the PC<br />

master software window under Project/Select Other Map File.<br />

Figure 11-63. PC Master Software Control Window<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-83<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

11.10.3 Set-up<br />

Figure 11-57 illustrates the hardware set-ups for the 3-phase SR Motor Control applications. The<br />

motor’s Encoder connector attached to connector J23 on the EVM Board is not required for the<br />

motor operation. It serves only for PC master software position reference.<br />

Figure 11-64. Setup of the 3-phase HV SR Sensorless Motor Control Application Set-up<br />

The correct phase order (phase A, phase B, phase C) for SR motor is as follows:<br />

• Phase A = white wire<br />

• Phase B = red wire<br />

• Phase C = black wire<br />

If you look at a motor shaft (face to shaft) the motor shaft should rotate in clockwise direction (i.e.<br />

positive direction, positive speed).<br />

For detailed information, see the DSP56F805 Evaluation Module Hardware Reference<br />

Manual. The serial cable is needed for the PC master software debugging/control.<br />

11.10.3.1 EVM Jumper Settings<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

To execute the 3-phase SR Motor Control Application, the DSP56F805 board requires the strap<br />

settings shown in Figure 11-58 and Table 11-16.<br />

11-84 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

JG6<br />

3-Phase SR Motor Control with Encoder Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3 1<br />

JG1<br />

JG2<br />

JG15<br />

1<br />

3<br />

1<br />

3<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

1<br />

3<br />

9 7<br />

6 4<br />

3 1<br />

JG10<br />

JG14<br />

JG9<br />

JG15 JG1 JG2<br />

1<br />

JG9<br />

JG3<br />

1<br />

LED3<br />

P3 IRQA<br />

JG3<br />

1 2<br />

7 8<br />

S/N<br />

U1<br />

DSP56F805EVM<br />

3<br />

2<br />

1<br />

JG13<br />

Figure 11-65. DSP56F805EVM Jumper Reference<br />

Table 11-17. DSP56F805EVM Jumper Settings<br />

Jumper Group Comment Connections<br />

JG1 PD0 input selected as a high 1-2<br />

JG2 PD1 input selected as a high 1-2<br />

JG3 Primary UNI-3 serial selected 1-2, 3-4, 5-6, 7-8<br />

JG4 Secondary UNI-3 serial selected 1-2, 3-4, 5-6, 7-8<br />

JG5 Enable on-board parallel JTAG Command Converter Interface NC<br />

JG6 Use on-board crystal for DSP oscillator input 2-3<br />

JG7 Select DSP’s Mode 0 operation upon exit from reset 1-2<br />

JG8 Enable on-board SRAM 1-2<br />

JG9 Enable RS-232 output 1-2<br />

JG10 Secondary UNI-3 Analog temperature input unused NC<br />

JG11 Use Host power for Host target interface 1-2<br />

JG12 Primary Encoder input selected 2-3, 5-6, 8-9<br />

JG13 Secondary Encoder input selected 2-3, 5-6, 8-9<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-85<br />

JTAG<br />

U15<br />

S4 S5 S6<br />

JG7<br />

1<br />

JG5<br />

GP1<br />

S1<br />

GP2<br />

S2<br />

RUN/STOP<br />

S3<br />

JG11<br />

P1<br />

U9 U10<br />

IRQB<br />

3<br />

2<br />

1<br />

JG12<br />

USER<br />

9 7<br />

J23 J24<br />

6 4<br />

3<br />

JG10<br />

PWM<br />

1<br />

1 3<br />

JG14 2<br />

JG17 1<br />

JG6 JG12<br />

1<br />

Y1<br />

3<br />

2<br />

1<br />

JG13<br />

JG18<br />

RESET<br />

JG18<br />

1<br />

JG16<br />

JG17<br />

J29<br />

JG8<br />

1<br />

JG4<br />

P1<br />

3 1<br />

JG11<br />

8<br />

2<br />

JG4<br />

JG8<br />

7<br />

1<br />

3 1<br />

JG16<br />

JG5<br />

JG7<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 11-17. DSP56F805EVM Jumper Settings<br />

Jumper Group Comment Connections<br />

JG14 Primary UNI-3 3-Phase Current Sense selected as Analog Inputs 2-3, 5-6, 8-9<br />

JG15 Primary UNI-3 DCBus Over-Current selected for FAULTA1 2-3<br />

JG16 Secondary UNI-3 Phase B Over-Current selected for FAULTB1 1-2<br />

JG17 CAN termination unselected NC<br />

JG18 Use on-board crystal for DSP oscillator input 1-2<br />

Note: When running the EVM target system in a stand-alone mode from Flash, the JG5<br />

jumper must be set in the 1-2 configuration to disable the command converter parallel<br />

port interface.<br />

11.10.4 Build<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

When building this application, the user can create an application that runs from internal Flash or<br />

External RAM. To select the type of application to build, open the 3ph_srm_Encoder.mcp project<br />

and select the target build type as shown in Figure 11-59. Selecting Build All will create all<br />

application build types. A definition of the projects associated with these target build types may<br />

be viewed under the Targets tab of the project window.<br />

Figure 11-66. Target Build Selection<br />

11-86 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3-Phase SR Motor Control with Encoder Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

To make this application, open the 3ph_srm_Encoder.mcp project file and execute the Make<br />

command, as shown in Figure 11-60. This will build and link the 3-phase SR Sensorless Motor<br />

Control application and all needed Metrowerks and <strong>SDK</strong> libraries.<br />

11.10.5 Execute<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 11-67. Execute Make Command<br />

To execute the 3-phase SR Motor Control application, choose the Program/Debug command in<br />

the CodeWarrior IDE, followed by the Run command. For more help with these commands, refer<br />

to the CodeWarrior tutorial documentation in the following file located in the CodeWarrior<br />

installation directory:<br />

\CodeWarrior Documentation\PDF\Targeting_DSP56800.pdf<br />

If the Flash target is selected, CodeWarrior will automatically program the DSP’s internal Flash<br />

with the executable generated during Build. If the External RAM target is selected, the executable<br />

will be loaded to off-chip RAM.<br />

Once Flash has been programmed with the executable, the EVM target system may be run in a<br />

stand-alone mode from Flash. To do this, set the JG5 jumper in the 1-2 configuration to disable<br />

the parallel port and press the RESET button.<br />

Once the application is executing, the motor can be started. When the switch is moved from the<br />

STOP position to the RUN position, the motor will start. The speed can be changed by the<br />

UP/DOWN buttons. Pressing the Up/Down buttons should cause to incrementally increase the<br />

speed of the motor until it reaches a maximum speed.<br />

Note: If the RUN/STOP switch is set to the RUN position when the application starts, toggle<br />

the RUN/STOP switch between the STOP and RUN positions to enable motor<br />

spinning. This is a protection feature that prevents the motor from starting when the<br />

application is executed from CodeWarrior.<br />

You should also see blinking or lighted LEDs which indicate the application’s status.<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-87<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

11.10.6 PC Master Software<br />

Perform the following steps to set the PC master software control:<br />

• The RUN/STOP switch must be in the STOP position<br />

• Check the PC master software mode on the PC master software control page<br />

• The motor can be started by pushing the Start PC master software Push Button and stopped<br />

by pushing the Stop PC master software Push Button<br />

• The speed can be set by the bar graph<br />

When the RUN/STOP switch on the EVM is in the STOP position, the manual mode can be set<br />

again by unchecking the PC master software mode on the PC master software control page<br />

The application can be monitored in PC master software during the PC master software mode as<br />

well as manual mode.<br />

The following windows are available:<br />

Speed Scope monitors:<br />

• Required Speed<br />

• Actual Speed<br />

Current Controller Recorder captures:<br />

• Desired Phase Current<br />

• Active Phase Current<br />

• Output Duty Cycle<br />

Current Controller Recorder may be initiated any time during the motor run.<br />

Note: The Recorder can be used ONLY when the application is running from External<br />

RAM due to the limited on-chip memory. The length of the recorded window may be<br />

set in “Recorder Properties” => bookmark “Main” => “Recorded Samples”. It is<br />

limited by the dedicated memory space in appconfig.h file. The recorder samples are<br />

taken each 100 µsec.<br />

11.11 3-Phase AC Induction Motor Control V/Hz<br />

Application - Open Loop<br />

This application demonstrates a principal of the V/Hz control of the 3-Phase AC Induction motor<br />

using the DSP56F805EVM board, Optoisolation board, and 3-phase AC BLDC High Voltage<br />

power stage.<br />

11.11.1 Files<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The 3-Phase AC Induction Motor Control V/Hz Application - Open Loop is found in directory:<br />

..\src\dsp56805evm\nos\applications\3ph_AC_VHz_OpenLoop\<br />

11-88 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

and is composed of the following files:<br />

3-Phase AC Induction Motor Control V/Hz Application - Open Loop<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

• 3ph_AC_VHz_OL.c, Open Loop main application program<br />

• 3ph_AC_VHz_OL.h, Open Loop application header file<br />

• 3ph_AC_VHz_OL.mcp, Open Loop project file<br />

• ConfigExtRam\appconfig.c, application configuration file for External RAM<br />

• ConfigExtRam\appconfig.h, application configuration file for External RAM<br />

• ConfigExtRam\linker.cmd, linker command file used for RAM<br />

• ConfigFlash\appconfig.c, application configuration file for Flash<br />

• ConfigFlash\appconfig.h, application configuration file for Flash<br />

• ConfigFlash\linker.cmd, linker command file used for Flash<br />

• appconst.c, application constants placed in data Flash<br />

• appconst.h, header file for appconst.c<br />

These files are located in the <strong>SDK</strong> installation directory.<br />

11.11.2 Specification<br />

This application performs principal control of the 3-phase AC induction motor using the<br />

DSP56F805 processor. The control technique sets the speed ([rpm], [Hz]) of the magnetic field<br />

and calculates the phase voltage amplitude according to a V/Hz table. This table is private to the<br />

application and reflects the AC induction motor parameters Base Voltage/frequency; Boost<br />

Voltage/frequency; and DC Boost Voltage. The incremental encoder is used to derive the actual<br />

rotor speed. Protection against drive faults Overcurrent, Overvoltage, Undervoltage, and<br />

Overheating is provided.<br />

System Outline<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The system is designed to drive a 3-phase AC induction motor (ACIM). The application has the<br />

following specifications:<br />

• Volt per Hertz control technique used for ACIM control<br />

• Targeted for DSP56F805EVM<br />

• Running on 3-phase AC induction motor control development platform at variable line<br />

voltage 115V AC and 230V AC (range -15% to +10%)<br />

• Motor mode<br />

• Generator mode<br />

• DCBus brake<br />

• Minimum speed 50 rpm<br />

• Maximum speed 2250 rpm at input power line 230V AC<br />

• Maximum speed 1200 rpm at input power line 115V AC<br />

• Power stage and optoisolation board identification<br />

• Fault protection<br />

• Manual interface (RUN/STOP switch; UP/DOWN push buttons control; LED indication)<br />

• PC master software remote control interface (speed set-up)<br />

• PC master software remote monitor<br />

— PC master software monitor interface (required speed; actual motor speed; drive fault status;<br />

DCBus voltage level; identified power stage boards)<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-89<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Application Description<br />

The Volt per Hertz control algorithm is calculated on the Motorola DSP56F805. The algorithm<br />

generates the 3-phase PWM signals for AC induction motor inverter according to the<br />

user-required inputs, measured and calculated signals.<br />

The concept of the ACIM drive incorporates the following hardware components:<br />

• AC induction motor--brake set<br />

• 3-phase AC/BLDC high voltage power stage<br />

• DSP56F805EVM boards<br />

• Optoisolation box which is connected between the Power stage board and the<br />

DSP56F805EVM<br />

The AC induction motor--brake set incorporates a 3-phase AC induction motor and attached<br />

BLDC motor brake. The AC induction motor has four poles. The incremental position sensor<br />

(encoder) is coupled on the motor shaft. The detailed motor--brake specifications are listed in<br />

Table 11-18.<br />

The software tools needed for compiling, debugging, loading to the EVM, remote control and<br />

monitoring:<br />

• Metrowerks CodeWarrior 4.0<br />

• PC master software<br />

• <strong>SDK</strong> 2.4 or later<br />

Table 11-18. Motor--Brake Specifications<br />

Set Manufactured EM Brno, Czech Republic<br />

Motor Specification Motor Type AM40V<br />

3-Phase AC Induction Motor<br />

Brake Specification<br />

Position Sensor (Encoder)<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Pole-Number 4<br />

Nominal Speed 1300 rpm<br />

Nominal Voltage 3 x 200V<br />

Nominal Current: 0.88A<br />

Brake Type<br />

SG40N<br />

3-Phase BLDC Motor<br />

Pole-Number 6<br />

Nominal Speed 1500rpm<br />

Nominal Voltage 3 x 27V<br />

Nominal Current 2.6 A<br />

Type<br />

Baumer Electric<br />

BHK 16.05A 1024-12-5<br />

Pulses per revolution 1024<br />

11-90 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Measured quantities:<br />

• DCBus voltage<br />

• Power module temperature<br />

• Rotor speed<br />

The faults used for drive protection:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

3-Phase AC Induction Motor Control V/Hz Application - Open Loop<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

• Overvoltage (PC master software error message - Overvoltage fault)<br />

• Undervoltage (PC master software error message - Undervoltage fault)<br />

• Overcurrent (PC master software error message - Overcurrent fault)<br />

• Overheating (PC master software error message - Overheating fault)<br />

• Wrong-hardware (PC master software error message - Wrong HW used)<br />

The 3-phase AC Induction Motor Control V/Hz Application can operate in two modes:<br />

1. Manual Operating Mode<br />

The drive is controlled by the RUN/STOP switch (S6). The motor speed is set by the<br />

UP (S2-IRQB) and DOWN (S1-IRQA) push buttons (refer to Figure 11-68). If the<br />

application runs and motor spinning is disabled (i.e., the system is ready), the green<br />

user LED (LED3; see Figure 11-69) will blink. When motor spinning is enabled, the<br />

green user LED will be On and the actual state of the PWM outputs are indicated by<br />

PWM output LEDs. If Overcurrent, Overvoltage or Overheating occur, or if the<br />

wrong system board is identified, the green user LED starts to flash quickly and the<br />

PC master software signals the identified fault. This state can be exited only by an<br />

application RESET. It is strongly recommended that you inspect the entire<br />

application to locate the source of the fault before starting it again. Refer to<br />

Table 11-19 for application states.<br />

Figure 11-68. RUN/STOP Switch and UP/DOWN Buttons<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-91<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 11-69. USER and PWM LEDs<br />

Table 11-19. Motor Application States<br />

Application State Motor State Green LED State<br />

Stopped Stopped Blinking at a frequency of 2Hz<br />

Running Spinning On<br />

Fault Stopped Blinking at a frequency of 8Hz<br />

2. PC master software (Remote) Operating Mode<br />

The drive is controlled remotely from a PC through the SCI communication channel<br />

of the DSP device via an RS-232 physical interface. The drive is enabled by the<br />

RUN/STOP switch, which can be used to safely stop the application at any time.<br />

11-92 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3-Phase AC Induction Motor Control V/Hz Application - Open Loop<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The following control actions are supported:<br />

• Set the Required Speed of the motor<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

PC master software displays the following information:<br />

• Actual and Required Speed of the motor<br />

• Phase voltage amplitude (related to given DCBus voltage)<br />

• Application mode - RUN/STOP<br />

• DCBus voltage, temperature of power module<br />

• Drive Fault status<br />

• Identified hardware<br />

If Overcurrent, Overvoltage, Undervoltage, or Overheating occur , the internal fault logic is<br />

asserted and the application enters a fault state (the user LED will start to flash quickly). This state<br />

can be exited only by an application RESET. It is strongly recommended that you inspect the<br />

entire application to locate the source of the fault before starting it again.<br />

Project files for the PC master software are located in :<br />

..\nos\applications\3ph_AC_VHz_OpenLoop\PC_Master\3ph_AC_VHz_Flash.pmp, which<br />

uses Map file for running in Flash<br />

..\nos\applications\3ph_AC_VHz_OpenLoop\PC_Master\3ph_AC_VHz_ExtRam.pmp,<br />

which uses Map file for running in External Memory<br />

Start the PC master software window’s application and choose the PC master software project for<br />

the desired PC master software Operating Mode. Figure 11-70 shows the PC master software<br />

control window for 3ph_AC_vHz/ExtRam.pmp.<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-93<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

11.11.3 Set-up<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 11-70. PC Master Software Control Window<br />

Figure 11-71 illustrates the hardware set-up for the 3-phase AC Motor Control Application - Open<br />

Loop.<br />

11-94 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3-Phase AC Induction Motor Control V/Hz Application - Open Loop<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 11-71. Set-up of the 3-phase AC Ind. Motor Control Application Open Loop<br />

The correct order of phases (phase A, phase B, phase C) for the AC induction motor shown in<br />

Figure 11-71 is:<br />

• phase A = red wire<br />

• phase B = white wire<br />

• phase C = black wire<br />

When facing a motor shaft, if the phase order is: phase A, phase B, phase C, the motor shaft<br />

should rotate clockwise (i.e., positive direction, positive speed).<br />

For detailed information, see the DSP56F805 Evaluation Module Hardware Reference<br />

Manual. The serial cable is needed only for the PC master software debugging tool.<br />

11.11.3.1 EVM Jumper Settings<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

To execute the 3-Phase AC Induction Motorl Control V/Hz Application - Open Loop, the<br />

DSP56F805 board requires the strap settings shown in Figure 11-72 and Table 11-20.<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-95<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

JG6<br />

3 1<br />

JG1<br />

JG2<br />

JG15<br />

1<br />

3<br />

1<br />

3<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

1<br />

3<br />

9 7<br />

6 4<br />

3 1<br />

JG10<br />

JG14<br />

JG9<br />

JG15 JG1 JG2<br />

1<br />

JG9<br />

JG3<br />

1<br />

LED3<br />

P3 IRQA<br />

JG3<br />

1 2<br />

7 8<br />

S/N<br />

U1<br />

DSP56F805EVM<br />

3<br />

2<br />

1<br />

JG13<br />

Figure 11-72. DSP56F805EVM Jumper Reference<br />

Table 11-20. DSP56F805EVM Jumper Settings<br />

Jumper Group Comment Connections<br />

JG1 PD0 input selected as a high 1-2<br />

JG2 PD1 input selected as a high 1-2<br />

JG3 Primary UNI-3 serial selected 1-2, 3-4, 5-6, 7-8<br />

JG4 Secondary UNI-3 serial selected 1-2, 3-4, 5-6, 7-8<br />

JG5 Enable on-board parallel JTAG Command Converter Interface NC<br />

JG6 Use on-board crystal for DSP oscillator input 2-3<br />

JG7 Select DSP’s Mode 0 operation upon exit from reset 1-2<br />

JG8 Enable on-board SRAM 1-2<br />

JG9 Enable RS-232 output 1-2<br />

JG10 Secondary UNI-3 Analog temperature input unused NC<br />

JG11 Use Host power for Host target interface 1-2<br />

JG12 Primary Encoder input selected for incremental encoder signals 2-3, 5-6, 8-9<br />

11-96 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

JTAG<br />

U15<br />

S4 S5 S6<br />

JG7<br />

1<br />

JG5<br />

GP1<br />

S1<br />

GP2<br />

S2<br />

RUN/STOP<br />

S3<br />

JG11<br />

P1<br />

U9 U10<br />

IRQB<br />

3<br />

2<br />

1<br />

JG12<br />

USER<br />

9 7<br />

J23 J24<br />

6 4<br />

3<br />

JG10<br />

PWM<br />

1<br />

1 3<br />

JG14 2<br />

JG17 1<br />

JG6 JG12<br />

1<br />

Y1<br />

3<br />

2<br />

1<br />

JG13<br />

JG18<br />

RESET<br />

JG18<br />

1<br />

JG16<br />

JG17<br />

J29<br />

JG8<br />

1<br />

JG4<br />

P1<br />

3 1<br />

JG11<br />

8<br />

2<br />

JG4<br />

JG8<br />

7<br />

1<br />

3 1<br />

JG16<br />

JG5<br />

JG7<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3-Phase AC Induction Motor Control V/Hz Application - Open Loop<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 11-20. DSP56F805EVM Jumper Settings<br />

Jumper Group Comment Connections<br />

JG13 Secondary Encoder input selected 2-3, 5-6, 8-9<br />

JG14 Primary UNI-3 3-Phase Current Sense selected as Analog Inputs 2-3, 5-6, 8-9<br />

JG15 Secondary UNI-3 Bus Overcurrent selected for FAULTA1 2-3<br />

JG16 Secondary UNI-3 Phase B Overcurrent selected for FAULTB1 1-2<br />

JG17 CAN termination unselected NC<br />

JG18 Use on-board crystal for DSP oscillator input 1-2<br />

Note: When running the EVM target system in a stand-alone mode from Flash, the JG5<br />

jumper must be set in the 1-2 configuration to disable the command converter parallel<br />

port interface.<br />

11.11.4 Build<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

To build this application, open the 3ph_AC_VHz_OL.mcp project file and execute the Make<br />

command; see Figure 11-73. This will build and link 3-phase AC V/Hz Motor Control application<br />

and all needed Metrowerks and <strong>SDK</strong> libraries.<br />

Figure 11-73. Execute Make Command<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-97<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

11.11.5 Execute<br />

To execute the 3-phase AC V/Hz Motor Control application, choose the Program/Debug<br />

command in the CodeWarrior IDE, followed by the Run command.<br />

To execute the 3-phase AC V/Hz Motor Control application’s internal Flash version, choose the<br />

Program/Debug command in the CodeWarrior IDE. When loading is finished, set jumper JG5 to<br />

disable the JTAG port; JG7 to enable boot from internal Flash; and push the RESET button.<br />

For more help with these commands, refer to the CodeWarrior tutorial documentation in the<br />

following file located in the CodeWarrior installation directory:<br />

\CodeWarrior Documentation\PDF\Targeting_DSP56800.pdf<br />

For jumper settings, see the DSP56F805 Evaluation Module Hardware User’s Manual.<br />

Once the application is running, move the RUN/STOP switch to the RUN position and set the<br />

required speed with the UP/DOWN push buttons. Pressing the UP/DOWN buttons should<br />

incrementally increase the motor speed until it reaches maximum speed. If successful, the 3-phase<br />

AC Induction motor will be spinning.<br />

Note: If the RUN/STOP switch is set to the RUN position when the application starts, toggle<br />

the RUN/STOP switch between the STOP and RUN positions to enable motor<br />

spinning. This is a protection feature that prevents the motor from starting when the<br />

application is executed from CodeWarrior.<br />

You should also see a lighted green LED which indicates that the application is running. If the<br />

application is stopped, the green LED will blink at a 2Hz frequency.<br />

11.12 3-Phase AC Induction Motor Control V/Hz<br />

Application - Closed Loop<br />

This application demonstrates a principal of the V/Hz control of the 3-Phase AC Induction motor<br />

in closed loop using the DSP56F805EVM board, Optoisolation board, and 3-phase AC BLDC<br />

High-Voltage power stage.<br />

11.12.1 Files<br />

The 3-Phase AC Induction Motor Control V/Hz Application - Closed Loop is found in directory:<br />

..\src\dsp56805evm\nos\applications\3ph_AC_VHz_CloseLoop\<br />

and is composed of the following files:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

• 3ph_AC_VHz_CL.c, Closed Loop main application program<br />

• 3ph_AC_VHz_CL.h, Closed Loop application header file<br />

• 3ph_AC_VHz_CL.mcp, Closed Loop project file<br />

• ConfigExtRam\appconfig.c, application configuration file for External RAM<br />

• ConfigExtRam\appconfig.h, application configuration file for External RAM<br />

• ConfigExtRam\linker.cmd, linker command file used for RAM<br />

11-98 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3-Phase AC Induction Motor Control V/Hz Application - Closed Loop<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

• ConfigFlash\appconfig.c, application configuration file for Flash<br />

• ConfigFlash\appconfig.h, application configuration file for Flash<br />

• ConfigFlash\linker.cmd, linker command file used for Flash<br />

• appconst.c, application constants placed in data Flash<br />

• appconst.h, header file for appconst.c<br />

These files are located in the <strong>SDK</strong> installation directory.<br />

11.12.2 Specification<br />

This application performs a principal control of the 3-phase AC Induction motor using the<br />

DSP56F805 processor. The control technique sets the speed ([rpm], [Hz]) of the magnetic field<br />

and calculates the phase voltage amplitude according to a V/Hz table. This table is private to the<br />

application and reflects AC induction motor parameters (Base Voltage/frequency; Boost<br />

Voltage/frequency; DC Boost Voltage).The incremental encoder is used to derive the actual rotor<br />

speed.<br />

The closed loop system is characterized by a feedback signal (Actual speed), derived from a<br />

quadrature decoder in the controlled system. This signal monitors the actual behavior of the<br />

system, and is compared with the reference signal (Required Speed). The magnitude and polarity<br />

of the resulting error signal are directly related to the difference between required and actual<br />

values of the controlled variable, which may be the speed of a motor. The error signal is amplified<br />

by the controller, and the controller output makes a correction to the controlled system, reducing<br />

the error signal.<br />

Protection against drive faults Overcurrent, Overvoltage, Undervoltage, and Overheating is<br />

provided.<br />

System Outline<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The system is designed to drive a 3-phase AC induction motor (ACIM). The application has the<br />

following specifications:<br />

• Volt per Hertz control technique used for ACIM control<br />

• Close loop control<br />

• Targeted for DSP56F805EVM<br />

• Running on 3-phase AC induction motor control development platform at variable line<br />

voltage 115V AC and 230V AC (range -15% to +10%)<br />

• Motor mode<br />

• Generator mode<br />

• DCBus brake<br />

• Minimum speed 50 rpm<br />

• Maximum speed 2250 rpm at input power line 230V AC<br />

• Maximum speed 1200 rpm at input power line 115V AC<br />

• Power stage and optoisolation board identification<br />

• Fault protection<br />

• Manual interface (RUN/STOP switch; UP/DOWN push buttons control; LED indication)<br />

• PC master software remote control interface (speed set-up)<br />

• PC master software remote monitor<br />

— PC master software monitor interface (required speed; actual motor speed; drive fault status;<br />

DCBus voltage level; identified power stage boards)<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-99<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Application Description<br />

The Volt per Hertz control algorithm is calculated on the Motorola DSP56F805. The algorithm<br />

generates the 3-phase PWM signals for AC induction motor inverter according to the<br />

user-required inputs, measured and calculated signals.<br />

The concept of the ACIM drive incorporates the following hardware components:<br />

• AC induction motor--brake set<br />

• 3-phase AC/BLDC high voltage power stage<br />

• DSP56F805EVM boards<br />

• Optoisolation box, which is connected between the power stage board and the<br />

DSP56F805EVM<br />

The AC induction motor--brake set incorporates a 3-phase AC induction motor and attached<br />

BLDC motor brake. The AC induction motor has four poles. The incremental position sensor<br />

(encoder) is coupled on the motor shaft. The detailed motor - brake specifications are listed in<br />

Table 11-21.<br />

The following software tools are needed for compiling, debugging, loading to the EVM, remote<br />

control and monitoring:<br />

• Metrowerks CodeWarrior 4.0<br />

• PC master software<br />

• <strong>SDK</strong> 2.4<br />

Table 11-21. Motor--Brake Specifications<br />

Set Manufactured EM Brno, Czech Republic<br />

Motor Specification eMotor Type AM40V<br />

3-Phase AC Induction Motor<br />

Brake Specification<br />

Position Sensor (Encoder)<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Pole-Number 4<br />

Nominal Speed 1300 rpm<br />

Nominal Voltage 3 x 200V<br />

Nominal Current: 0.88A<br />

Brake Type<br />

SG40N<br />

3-Phase BLDC Motor<br />

Pole-Number 6<br />

Nominal Speed 1500rpm<br />

Nominal Voltage 3 x 27V<br />

Nominal Current 2.6 A<br />

Type<br />

Baumer Electric<br />

BHK 16.05A 1024-12-5<br />

Pulses per revolution 1024<br />

11-100 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Measured quantities include:<br />

• DCBus voltage<br />

• Power module temperature<br />

• Rotor speed<br />

The faults used for drive protection:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

3-Phase AC Induction Motor Control V/Hz Application - Closed Loop<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

• Overvoltage (PC master software error message = Overvoltage fault)<br />

• Undervoltage (PC master software error message = Undervoltage fault)<br />

• Overcurrent (PC master software error message = Overcurrent fault)<br />

• Overheating (PC master software error message = Overheating fault)<br />

• Wrong-hardware (PC master software error message = Wrong HW used)<br />

The 3-phase AC Induction Motor V/Hz application can operate in two modes:<br />

1. Manual Operating Mode<br />

The drive is controlled by the RUN/STOP switch (S6). The motor speed is set by the<br />

UP (S2-IRQB) and DOWN (S1-IRQA) push buttons (Figure 11-74). If the<br />

application runs and motor spinning is disabled (i.e., the system is ready), the green<br />

user LED (LED3; see Figure 11-75) will blink. When motor spinning is enabled, the<br />

green user LED will be On and the actual state of the PWM outputs are indicated by<br />

PWM output LEDs. If Overcurrent, Overvoltage or Overheating occur, or if the<br />

wrong system board is identified, the green user LED starts to flash quickly and the<br />

PC master software signals the identified type of fault. This state can be exited only<br />

by an application RESET. It is strongly recommended that you inspect the entire<br />

application to locate the source of the fault before starting it again. Refer to<br />

Table 11-22 for application states.<br />

Figure 11-74. RUN/STOP Switch and UP/DOWN Buttons<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-101<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 11-75. USER and PWM LEDs<br />

Table 11-22. Motor Application States<br />

Application State Motor State Green LED State<br />

Stopped Stopped Blinking with a frequency of 2 Hz<br />

Running Running On<br />

Fault Stopped Blinking with a frequency of 8 Hz<br />

2. PC master software (Remote) Operating Mode<br />

The drive is controlled remotely from a PC through the SCI communication channel<br />

of the DSP device via an RS-232 physical interface. The drive is enabled by the<br />

RUN/STOP switch, which can be used to safely stop the application at any time.<br />

11-102 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3-Phase AC Induction Motor Control V/Hz Application - Closed Loop<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The following control actions are supported:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

• Set the Required Speed of the motor<br />

• Set Close/Open loop by checking/unchecking the “Close Loop” checkbox; see<br />

Figure 11-76.<br />

PC master software displays the following information:<br />

• Actual and Required Speed of the motor<br />

• Phase voltage amplitude (related to given DCBus voltage)<br />

• Application mode - RUN/STOP<br />

• DCBus voltage and temperature of power module<br />

• Drive Fault status<br />

• Identified hardware<br />

If Overcurrent, Overvoltage, Undervoltage or Overheating occur, the internal fault logic is<br />

asserted and the application enters a fault state (the user LED will flash quickly). This state can be<br />

exited only by an application RESET. It is strongly recommended that you inspect the entire<br />

application to locate the source of fault before starting it again.<br />

Project files for the PC master software are located in:<br />

..\nos\applications\3ph_AC_VHz_CloseLoop\PC_Master\3ph_AC_VHz_Flash.pmp, uses<br />

Map file for running in Flash<br />

..\nos\applications\3ph_AC_VHz_CloseLoop\PC_Master\3ph_AC_VHz_ExtRam.pmp, uses<br />

Map file for running in External Memory<br />

Start the PC master software window’s application and choose the PC master software project for<br />

the desired PC master software Operating Mode. Figure 11-76 shows the PC master software<br />

control window for 3ph_AC_VHz_Flash.pmp.<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-103<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

11.12.3 Set-up<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 11-76. PC Master Software Control Window<br />

Figure 11-77 illustrates the hardware set-up for the 3-phase AC Induction Motor Control V/Hz A<br />

Application - Closed Loop.<br />

11-104 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3-Phase AC Induction Motor Control V/Hz Application - Closed Loop<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 11-77. Set-up of the 3-phase AC Induction Motor Control Application - Closed Loop<br />

The correct order of phases (phase A, phase B, phase C) for the AC induction motor shown in<br />

Figure 11-77 is:<br />

• phase A = red wire<br />

• phase B = white wire<br />

• phase C = black wire<br />

When facing a motor shaft, the phase order is: phase A, phase B, phase C, the motor shaft should<br />

rotate clockwise (i.e., positive direction, positive speed).<br />

For detailed information, see the DSP56F805 Evaluation Module Hardware Reference<br />

Manual. The serial cable is needed for the PC master software debugging tool only.<br />

11.12.3.1 EVM Jumper Settings<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

To execute the 3-phase AC Induction Motor Control V/Hz Application - Closed Loop, the<br />

DSP56F805 board requires the strap settings shown in Figure 11-78 and Table 11-23.<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-105<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

JG6<br />

3 1<br />

JG1<br />

JG2<br />

JG15<br />

1<br />

3<br />

1<br />

3<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

1<br />

3<br />

9 7<br />

6 4<br />

3 1<br />

JG10<br />

JG14<br />

JG9<br />

JG15 JG1 JG2<br />

1<br />

JG9<br />

JG3<br />

1<br />

LED3<br />

P3 IRQA<br />

JG3<br />

1 2<br />

7 8<br />

S/N<br />

U1<br />

DSP56F805EVM<br />

3<br />

2<br />

1<br />

JG13<br />

Figure 11-78. DSP56F805EVM Jumper Reference<br />

Table 11-23. DSP56F805EVM Jumper Settings<br />

Jumper Group Comment Connections<br />

JG1 PD0 input selected as a high 1-2<br />

JG2 PD1 input selected as a high 1-2<br />

JG3 Primary UNI-3 serial selected 1-2, 3-4, 5-6, 7-8<br />

JG4 Secondary UNI-3 serial selected 1-2, 3-4, 5-6, 7-8<br />

JG5 Enable on-board parallel JTAG Command Converter Interface NC<br />

JG6 Use on-board crystal for DSP oscillator input 2-3<br />

JG7 Select DSP’s Mode 0 operation upon exit from reset 1-2<br />

JG8 Enable on-board SRAM 1-2<br />

JG9 Enable RS-232 output 1-2<br />

JG10 Secondary UNI-3 Analog temperature input unused NC<br />

JG11 Use Host power for Host target interface 1-2<br />

JG12 Primary Encoder input selected for incremental encoder signals 2-3, 5-6, 8-9<br />

11-106 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

JTAG<br />

U15<br />

S4 S5 S6<br />

JG7<br />

1<br />

JG5<br />

GP1<br />

S1<br />

GP2<br />

S2<br />

RUN/STOP<br />

S3<br />

JG11<br />

P1<br />

U9 U10<br />

IRQB<br />

3<br />

2<br />

1<br />

JG12<br />

USER<br />

9 7<br />

J23 J24<br />

6 4<br />

3<br />

JG10<br />

PWM<br />

1<br />

1 3<br />

JG14 2<br />

JG17 1<br />

JG6 JG12<br />

1<br />

Y1<br />

3<br />

2<br />

1<br />

JG13<br />

JG18<br />

RESET<br />

JG18<br />

1<br />

JG16<br />

JG17<br />

J29<br />

JG8<br />

1<br />

JG4<br />

P1<br />

3 1<br />

JG11<br />

8<br />

2<br />

JG4<br />

JG8<br />

7<br />

1<br />

3 1<br />

JG16<br />

JG5<br />

JG7<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3-Phase AC Induction Motor Control V/Hz Application - Closed Loop<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 11-23. DSP56F805EVM Jumper Settings<br />

Jumper Group Comment Connections<br />

JG13 Secondary Encoder input selected 2-3, 5-6, 8-9<br />

JG14 Primary UNI-3 3-Phase Current Sense selected as Analog Inputs 2-3, 5-6, 8-9<br />

JG15 Secondary UNI-3 Phase A Overcurrent selected for FAULTA1 2-3<br />

JG16 Secondary UNI-3 Phase B Overcurrent selected for FAULTB1 1-2<br />

JG17 CAN termination unselected NC<br />

JG18 Use on-board crystal for DSP oscillator input 1-2<br />

Note: When running the EVM target system in a stand-alone mode from Flash, the JG5<br />

jumper must be set in the 1-2 configuration to disable the command converter parallel<br />

port interface.<br />

11.12.4 Build<br />

To build this application, open the 3ph_AC_VHz_CL.mcp project file and execute the Make<br />

command, as shown in Figure 11-79. This will build and link the 3-phase AC V/Hz Motor Control<br />

application and all needed Metrowerks and <strong>SDK</strong> libraries.<br />

11.12.5 Execute<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 11-79. Execute Make Command<br />

To execute the 3-phase AC V/Hz Motor Control application, choose the Program/Debug<br />

command in the CodeWarrior IDE, followed by the Run command.<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-107<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

To execute the 3-phase AC V/Hz Motor Control application’s internal Flash version, choose the<br />

Program/Debug command in the CodeWarrior IDE. When loading is finished, set jumper JG5 to<br />

disable the JTAG port and JG7 to enable boot from internal Flash, then push the RESET button.<br />

For more help with these commands, refer to the CodeWarrior tutorial documentation in the<br />

following file located in the CodeWarrior installation directory:<br />

\CodeWarrior Documentation\PDF\Targeting_DSP56800.pdf<br />

For jumper settings, see DSP56F805 Evaluation Module Hardware User’s Manual.<br />

Once the application is running, move the RUN/STOP switch to the RUN position and set the<br />

required speed with the UP/DOWN push buttons. Pressing the UP/DOWN buttons should<br />

incrementally increase the motor speed until it reaches maximum speed. If successful, the 3-phase<br />

AC Induction motor will be spinning.<br />

Note: If the RUN/STOP switch is set to the RUN position when the application starts, toggle<br />

the RUN/STOP switch between the STOP and RUN positions to enable motor<br />

spinning. This is a protection feature that prevents the motor from starting when the<br />

application is executed from CodeWarrior.<br />

You should also see a lighted green LED, which indicates that the application is running. If the<br />

application stops, the green LED blinks at a frequency of 2Hz.<br />

11.13 3-Phase ACIM Vector ControlApplication<br />

This application demonstrates a principle of the vector control of the 3-phase AC Induction Motor<br />

(ACIM) using the DSP56F805EVM board, the In-line optoisolation box, and the 3-phase AC<br />

BLDC high voltage power stage.<br />

11.13.1 Files<br />

The 3-phase ACIM vector control application can be found in the <strong>SDK</strong> installation directory:<br />

..\src\dsp56805evm\nos\applications\3ph_ACIM_VectorControl\<br />

and is composed of the following files:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

• 3ph_ACIM_VectorControl.c, main application program<br />

• 3ph_ACIM_VectorControl.h, application header file<br />

• 3ph_ACIM_VectorControl.mcp, application project file<br />

• ConfigExtRam\appconfig.c, application configuration file for External RAM<br />

• ConfigExtRam\appconfig.h, application configuration file for External RAM<br />

• ConfigExtRam\linker.cmd, linker command file used for RAM<br />

• ConfigFlash\appconfig.c, application configuration file for Flash<br />

• ConfigFlash\appconfig.h, application configuration header file for Flash<br />

• ConfigFlash\linker.cmd, linker command file used for Flash<br />

• ConfigFlash\flash.cfg, configuration file for Flash<br />

• appconst.c, application constants placed in data Flash<br />

• appconst.h, header file for appconst.c<br />

11-108 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

11.13.2 Specification<br />

System Outline<br />

3-Phase ACIM Vector Control Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The system is designed to drive a 3-phase AC induction motor (ACIM). The application has the<br />

following specifications:<br />

• Vector control technique used for ACIM control<br />

• Speed control loop<br />

• Targeted for DSP56F805EVM<br />

• Running on 3-phase AC induction motor control development platform at variable line<br />

voltage 115V AC and 230V AC (range -15% to +10%)<br />

• Motor mode<br />

• Generator mode<br />

• DCBus brake<br />

• Minimum speed 50 rpm<br />

• Maximum speed 2500 rpm at input power line 230V AC<br />

• Maximum speed 1100 rpm at input power line 115V AC<br />

• Power stage and optoisolation board identification<br />

• Fault protection<br />

• Manual interface (RUN/STOP switch; UP/DOWN push buttons control; LED indication)<br />

• PC master software remote control interface (START MOTOR/STOP MOTOR push<br />

buttons; speed set-up)<br />

• PC master software remote monitor<br />

— PC master software monitor interface (required speed; actual motor speed; PC master<br />

software mode; START MOTOR/STOP MOTOR controls; drive fault status; DCBus voltage<br />

level; identified power stage boards; drive status; mains detection)<br />

— PC master software speed scope (observes actual and desired speed)<br />

Application Description<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The vector control algorithm is calculated on the Motorola DSP56F805. The algorithm generates<br />

the 3-phase PWM signals for AC induction motor inverter according to the user-required inputs,<br />

measured and calculated signals.<br />

The concept of the ACIM drive incorporates the following hardware components:<br />

• AC induction motor--brake set<br />

• 3-phase AC/BLDC high voltage power stage<br />

• DSP56F805EVM boards<br />

• ECOPTINL - In-line optoisolation box, which is connected between the host computer and<br />

the DSP56F805EVM<br />

The AC induction motor-brake set incorporates a 3-phase AC induction motor and attached<br />

BLDC motor brake. The AC induction motor has four poles. The incremental position sensor<br />

(encoder) is coupled on the motor shaft and position Hall sensors are mounted between motor and<br />

brake. They allow to sense the position if it is required by the control algorithm. The detailed<br />

motor - brake specifications are listed in Table 11-24.<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-109<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The following software tools are needed for compiling, debugging, loading to the EVM, remote<br />

control and monitoring:<br />

• Metrowerks CodeWarrior 4.0<br />

• PC master software<br />

• <strong>SDK</strong> 2.4 or later<br />

The drive can be controlled in two different operating modes:<br />

• Manual operating mode - the required speed is set by the UP/DOWN push buttons and the<br />

drive is started and stopped by the RUN/STOP switch on the EVM board<br />

• PC master software operating mode - the required speed is set by the PC master software<br />

active bar graph and the drive is started and stopped by the START MOTOR and STOP<br />

MOTOR controls<br />

Measured quantities:<br />

• DCBus voltage<br />

• Phase currents (phase A, phase B, phase C)<br />

• Power module temperature<br />

• Rotor speed<br />

The faults used for drive protection:<br />

Table 11-24. Motor--Brake Specifications<br />

Set Manufactured EM Brno, Czech Republic<br />

Motor Specification Motor Type AM40V<br />

3-Phase AC Induction Motor<br />

Brake Specification<br />

Position Sensor (Encoder)<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Pole-Number 4<br />

Nominal Speed 1300 rpm<br />

Nominal Voltage 3 x 200V<br />

Nominal Current: 0.88A<br />

Brake Type<br />

SG40N<br />

3-Phase BLDC Motor<br />

Pole-Number 6<br />

Nominal Speed 1500rpm<br />

Nominal Voltage 3 x 27V<br />

Nominal Current 2.6 A<br />

Type<br />

Baumer Electric<br />

BHK 16.05A 1024-12-5<br />

Pulses per revolution 1024<br />

• Overvoltage (PC master software error message = Overvoltage fault)<br />

• Undervoltage (PC master software error message = Undervoltage fault)<br />

• Overcurrent (PC master software error message = Overcurrent fault)<br />

• Overheating (PC master software error message = Overheating fault)<br />

11-110 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3-Phase ACIM Vector Control Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

• Wrong-mains (PC master software error message = Mains out of range)<br />

• Wrong-hardware (PC master software error message = Wrong HW used)<br />

• Overload (PC master software error message - Overload) An informative message; actual<br />

application state is not changed to FAULT state<br />

States of the application state machine see Table 11-25:<br />

• INIT - application initialization; operating mode changing<br />

• STOP - PWM outputs disabled; operating mode changing<br />

• RUN - PWM outputs enabled; motor running<br />

• FAULT - PWM outputs disabled; waiting for manual fault acknowledgement<br />

Control Process<br />

After reset, the drive is in the INIT state and in the Manual operating mode.When the RUN/STOP<br />

switch is detected in the STOP position and there are no faults pending, the INIT state is changed<br />

to the STOP state. Otherwise, the drive waits in the INIT state. If faults occur, the drive goes to<br />

the FAULT state. In INIT and STOP states, the operation mode can be changed from PC master<br />

software. In the Manual operating mode, the application is controlled by the RUN/STOP switch<br />

and UP/DOWN buttons; in the PC master software remote control , the application is controlled<br />

by the PC master software environment.<br />

When the start command is accepted (using the RUN/STOP switch or the PC master software<br />

command), the STOP state is changed to the RUN state. Required speed is then calculated from<br />

the UP/DOWN push buttons or PC master software commands (if in PC master software remote<br />

control mode). The required speed is the input into the acceleration/deceleration ramp. The<br />

difference between the actual speed and the required speed generates a speed error. Based on the<br />

error, the speed controller generates an Is_q_Req current, which corresponds to the torque<br />

component. The second Is_d_Req component of the stator current, which corresponds to rotor<br />

flux, is given by the flux controller. The field-weakening algorithm generates the required rotor<br />

flux which is compared with calculated rotor flux from the AC induction flux model calculation<br />

algorithm. The difference between required rotor flux and calculated rotor flux generates a flux<br />

error. Based on the flux error, the flux controller generates the required Is_d_Req stator current.<br />

Simultaneously, the stator currents Is_a, Is_b and Is_c (3-phase system) are measured and<br />

transformed to the stationary reference frame α, β (2-phase system) and to the d-q rotating<br />

reference frame consecutively. The decoupling algorithm generates Us_q and Us_d voltages (d-q<br />

rotating reference frame). The Us_q and Us_d voltages are transformed back to the stationary<br />

reference frame α, β and the space vector modulation generates the 3-phase voltage system which<br />

is applied on the motor.<br />

Drive Protection<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The DCBus voltage, DCbus current and power stage temperature are measured during the control<br />

process. They protect the drive from Overvoltage, Undervoltage, Overcurrent, Overheating and<br />

Wrong-mains. The Undervoltage, Overheating, Wrong-hardware and Wrong-mains protection is<br />

performed by software. The Overcurrent and Overvoltage fault signals utilize fault inputs of the<br />

DSP controlled by hardware. The power stage is identified using board identification. If the<br />

correct boards are not identified, the Wrong-hardware fault disables the drive operation. Line<br />

voltage is measured during application initialization and the application automatically adjusts<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-111<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

itself to run at either 115V AC or 230V AC, depending on the measured value. If the mains is out<br />

of range, the Wrong-mains fault is set and the drive operation is disabled.<br />

If any of the mentioned faults occur, the motor control PWM outputs are disabled to protect the<br />

drive and the application enters the FAULT state. The FAULT state can be left only when the fault<br />

conditions disappear and the RUN/STOP switch is moved to the STOP position (in PC master<br />

software remote mode, by PC master software). If the Wrong-hardware and Wrong-mains occur,<br />

the FAULT state can be left only by application reset.<br />

The 3-phase ACIM vector control application can operate in two modes:<br />

1. Manual Operating Mode<br />

The drive is controlled by the RUN/STOP switch (S6). The motor speed is set by the<br />

UP (S2-IRQB) and DOWN (S1-IRQA) push buttons (see Figure 11-80). The actual<br />

state of the application is indicated by the user LEDs (see Figure 11-81). If the<br />

application runs and motor spinning is disabled (i.e., the system is ready), the green<br />

user LED will blink at a frequency of 2Hz. When motor spinning is enabled, the<br />

green user LED will be turned on and the actual state of the PWM outputs are<br />

indicated by PWM output LEDs. If any fault occurs (Overcurrent, Overvoltage,<br />

Undervoltage, Wrong-mains, Overheating or Wrong-hardware) the green user LED<br />

will blink at a frequency of 8Hz. The PC master software control page shows the<br />

identified fault. The faults can be handled by switching the RUN/STOP switch to<br />

STOP, which acknowledges the fault state. Meanwhile, the Wrong-mains and the<br />

Wrong-hardware faults can be quit only with the application reset. It is strongly<br />

recommended that the user inspect the entire application to locate the source of the<br />

fault before starting it again. Refer to Table 11-25 for application states.<br />

Figure 11-80. RUN/STOP Switch and UP/DOWN Buttons<br />

11-112 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

3-Phase ACIM Vector Control Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 11-81. USER and PWM LEDs<br />

Table 11-25. Application States<br />

Application State Motor State Green LED State<br />

INIT Stopped Blinking at a frequency of 2Hz (slow)<br />

STOP Stopped Blinking at a frequency of 2Hz (slow)<br />

RUN Spinning On<br />

FAULT Stopped Blinking at a frequency of 8Hz (fast)<br />

2. PC master software Operating Mode<br />

The drive is controlled remotely from a PC through the SCI communication channel<br />

of the DSP device via an RS-232 physical interface. The whole application is fully<br />

controllable from the PC master software environment, regardless of the<br />

RUN/STOP switch position on the EVM board.<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-113<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The following PC master software control actions are supported:<br />

• Set PC master software mode of the motor control system<br />

• Set Manual mode of the motor control system<br />

• Start the motor<br />

• Stop the motor<br />

• Set the required speed of the motor<br />

PC master software displays the following information:<br />

• Actual and required speed of the motor<br />

• Application status - INIT/STOP/RUN/FAULT<br />

• DCBus voltage<br />

• Identified mains voltage<br />

• Identified hardware<br />

• Temperature of power module<br />

• START MOTOR and STOP MOTOR controls (active only in PC master software mode)<br />

• PC master software check-box (defines full PC master software control or full Manual<br />

control)<br />

• Fault status<br />

If any fault occurs (Overcurrent, Overvoltage, Wrong-mains, Overheating or Wrong-hardware),<br />

the green user LED will blink at a frequency of 8Hz. The PC master software control page shows<br />

the identified fault. The faults can be handled by switching the START MOTOR/STOP MOTOR<br />

icon to STOP MOTOR, which acknowledges the fault state. Meanwhile, the Wrong-mains and<br />

the Wrong-hardware faults can be quit only with the application reset. It is strongly recommended<br />

that the user inspect the entire application to locate the source of the fault before starting it again.<br />

Project files for the PC master software are located in:<br />

..\nos\applications\3ph_ACIM_VectorControl\PC_Master\3ph_ACIM_VectorControl.pmp<br />

Start the PC master software 3ph_ACIM_VectorControl.pmp application. Figure 11-82 shows the<br />

PC master software control window.<br />

Note: If the PC master software project (.pmp file) is unable to control the application, it is<br />

possible that wrong load map (.elf file) has been selected. PC master software uses the<br />

load map to determine addresses for global variables that are monitored. Once the PC<br />

master software project has been launched, this option may be selected in the PC<br />

master software menu under Project/Select Other Map File.<br />

11-114 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

11.13.3 Set-up<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

3-Phase ACIM Vector Control Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 11-82. PC Master Software Control Window<br />

Figure 11-83 illustrates the hardware set-up for the 3-phase ACIM vector control application.<br />

WARNING:<br />

Danger, high-voltage--risk of electric shock!<br />

The application PCB modules and serial interface (connector,<br />

cable) are not electrically isolated from the mains voltage--they<br />

are live.<br />

Use the In-line Optoisolation Box (ECOPTINL) between the<br />

PC and DSP56805 EVM as protection from dangerous voltage<br />

on the PC-user side, and to prevent damage to the PC and other<br />

hardware.<br />

Do not touch any part of the EVM or the serial cable between<br />

the EVM and the In-line Optoisolation Box unless you are<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-115<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

using an insulation transformer. The application is designed to<br />

be fully controllable only from PC master software.<br />

To avoid inadvertently touching live parts, use plastic covers.<br />

In the rest of this application, the description supposes the use of an insulation transformer<br />

Figure 11-83. Set-up of the 3-phase ACIM Vector Control Application<br />

The correct order of phases (phase A, phase B, phase C) for the AC induction motor shown in<br />

Figure 11-83 is:<br />

• phase A = red wire<br />

• phase B = white wire<br />

• phase C = black wire<br />

When facing a motor shaft, if the phase order is: phase A, phase B, phase C, the motor shaft<br />

should rotate clockwise (i.e., positive direction, positive speed).<br />

For detailed information, see the DSP56F805 Evaluation Module Hardware Reference<br />

Manual. The serial cable to PC is needed for the PC master software debugging tool only.<br />

11-116 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3-Phase ACIM Vector Control Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

11.13.3.1 EVM Jumper Settings<br />

To execute the 3-phase ACIM vector control application, the DSP56F805 board requires the strap<br />

settings shown in Figure 11-84 and Table 11-26.<br />

JG6<br />

3 1<br />

JG1<br />

JG2<br />

JG15<br />

1<br />

3<br />

1<br />

3<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

1<br />

3<br />

9 7<br />

6 4<br />

3 1<br />

JG10<br />

JG14<br />

JG9<br />

JG15 JG1 JG2<br />

1<br />

JG9<br />

JG3<br />

1<br />

LED3<br />

P3 IRQA<br />

JG3<br />

1 2<br />

7 8<br />

S/N<br />

U1<br />

DSP56F805EVM<br />

Figure 11-84. DSP56F805EVM Jumper Reference<br />

Table 11-26. DSP56F805EVM Jumper Settings<br />

Jumper Group Comment Connections<br />

JG1 PD0 input selected as a high 1-2<br />

JG2 PD1 input selected as a high 1-2<br />

JG3 Primary UNI-3 serial selected 1-2, 3-4, 5-6, 7-8<br />

JG4 Secondary UNI-3 serial selected 1-2, 3-4, 5-6, 7-8<br />

JG5 Enable on-board parallel JTAG Command Converter Interface 1-2<br />

JG6 Use on-board crystal for DSP oscillator input 2-3<br />

JG7 Select DSP’s Mode 0 operation upon exit from reset 1-2<br />

JG8 Enable on-board SRAM 1-2<br />

JG9 Enable RS-232 output 1-2<br />

JG10 Secondary UNI-3 Analog temperature input unused NC<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-117<br />

JTAG<br />

U15<br />

S4 S5 S6<br />

JG7<br />

1<br />

JG5<br />

GP1<br />

S1<br />

GP2<br />

S2<br />

RUN/STOP<br />

S3<br />

JG11<br />

P1<br />

U9 U10<br />

IRQB<br />

3<br />

2<br />

1<br />

JG12<br />

USER<br />

9 7<br />

J23 J24<br />

6 4<br />

3<br />

JG10<br />

PWM<br />

1<br />

1 3<br />

JG14 2<br />

JG17 1<br />

JG6 JG12<br />

1<br />

Y1<br />

3<br />

2<br />

1<br />

JG13<br />

JG18<br />

RESET<br />

JG18<br />

1<br />

JG16<br />

JG17<br />

3<br />

2<br />

1<br />

JG13<br />

J29<br />

JG8<br />

1<br />

JG4<br />

P1<br />

3 1<br />

JG11<br />

8<br />

2<br />

JG4<br />

JG8<br />

7<br />

1<br />

3 1<br />

JG16<br />

JG5<br />

JG7<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 11-26. DSP56F805EVM Jumper Settings<br />

Jumper Group Comment Connections<br />

JG11 Use Host power for Host target interface 1-2<br />

JG12 Primary Encoder input selected for incremental encoder signals 2-3, 5-6, 8-9<br />

JG13 Secondary Encoder input selected 2-3, 5-6, 8-9<br />

JG14 Primary UNI-3 3-Phase Current Sense selected as Analog Inputs 2-3, 5-6, 8-9<br />

JG15 Secondary UNI-3 Bus Overcurrent selected for FAULTA1 2-3<br />

JG16 Secondary UNI-3 Phase B Overcurrent selected for FAULTB1 1-2<br />

JG17 CAN termination unselected NC<br />

JG18 Use on-board crystal for DSP oscillator input 1-2<br />

Note: When running the EVM target system in a stand-alone mode from Flash, the JG5<br />

jumper must be set in the 1-2 configuration to disable the command converter parallel<br />

port interface. For this application this is set as short-connected permanently.<br />

11.13.4 Build<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

When building this application, the user can create an application that runs from internal Flash or<br />

External RAM, which can be selected under the File menu in the project window. To choose the<br />

desired type, open the 3ph_ACIM_VectorControl.mcp project and select the target build type; see<br />

Figure 11-85. Selecting Build All will create all application build types. Definition of the projects<br />

associated with these target build types may be viewed under the Targets tab of the project<br />

window.<br />

When the 3ph_ACIM_VectorControl.mcp project file is opened, execute the Make command or<br />

press [F7]; see Figure 11-86. This will build and link the 3-phase ACIM vector control application<br />

and all needed libraries from the Metrowerks CodeWarrior and the <strong>SDK</strong>.<br />

11-118 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

11.13.5 Execute<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

3-Phase ACIM Vector Control Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 11-85. Target Build Selection<br />

Figure 11-86. Execute Make Command<br />

To execute the 3-phase ACIM vector control application, choose the Program/Debug command in<br />

the CodeWarrior IDE, and follow with the Run command.<br />

To execute the 3-phase ACIM vector control application’s internal Flash version, choose the<br />

Program/Debug command in the CodeWarrior IDE. When loading is finished, the JG7 jumper<br />

must be connected to boot from internal Flash and the RESET button pushed.<br />

For more help with these commands, refer to the CodeWarrior tutorial documentation file, located<br />

in the CodeWarrior installation directory:<br />

\CodeWarrior Documentation\PDF\Targeting_DSP56800.pdf<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-119<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

For jumper settings, see the DSP56F805 Evaluation Module Hardware User’s Manual.<br />

Once the application is running, move the RUN/STOP switch to the RUN position and set the<br />

required speed with the UP/DOWN push buttons. Pressing the UP/DOWN buttons should<br />

incrementally increase the motor speed until it reaches maximum speed. If successful, the 3-phase<br />

ACIM will be spinning.<br />

Note: If the RUN/STOP switch is set to the RUN position when the application starts, toggle<br />

this switch back and forth to enable motor spinning. This is a protection feature that<br />

prevents the motor from starting when the application is executed from the<br />

CodeWarrior.<br />

You should also see blinking or lighted LEDs, which indicate the application’s status.<br />

11.13.6 PC Master Software Control<br />

To run the application from Flash or ExtRAM, perform the following steps to set the PC master<br />

software control:<br />

• The application must be in the STOP or INIT state, indicated on the PC master software<br />

control page<br />

• Check the PC master software mode on the PC master software control page<br />

• The motor can be started by pushing the “START MOTOR” PC master software icon and<br />

stopped by pushing the “STOP MOTOR” PC master software icon<br />

• The speed can be set by the bar graph<br />

When the application is in the STOP or INIT state, the Manual mode can be set again by<br />

unchecking the PC master software mode on the PC master software control page.<br />

The application can be monitored in PC master software during the PC master software mode and<br />

during Manual mode.<br />

The following PC master software windows are available:<br />

Speed Scope monitors:<br />

• Required Speed<br />

• Actual Speed<br />

Recorder:<br />

The recorder is prepared for fast events capture.<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Note: The Recorder should be used only when the application is running from External<br />

RAM due to limited on-chip memory. The length of the recorded window may be<br />

changed by left-clicking on the Recorder in the tree structure of the PC master<br />

software items; selecting Recorder Properties in the menu Item/Propertes; and<br />

defining the value as Recorded Samples. It is limited by the dedicated memory space<br />

in the appconfig.h file. The recorder samples are taken every 1ms.<br />

11-120 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Digital Power Factor Correction<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

11.14 Digital Power Factor Correction<br />

This application demonstrates outlines of the Power Factor Correction without motor control. A<br />

DSP56F805EVM board, Optoisolation board, and 3-phase AC/BLDC High-Voltage power stage<br />

board are used.<br />

11.14.1 Files<br />

The Digital Power Factor Correction application is found in the directory:<br />

..\src\dsp56805evm\nos\applications\Digital_PFC\<br />

and is composed of the following files:<br />

• Digital_PFC.mcp, application project file<br />

• dpfc.h, application header file<br />

• dpfc.c, main application program<br />

• appconst.c, application constants placed in data Flash<br />

• appconst.h, header file for appconst.c<br />

• ConfigExtRam\appconfig.c, application configuration file for External RAM<br />

• ConfigExtRam\appconfig.h, application configuration file for External RAM<br />

• ConfigExtRam\linker.cmd, linker command file used for RAM<br />

• ConfigFlash\appconfig.c, application configuration file for Flash<br />

• ConfigFlash\appconfig.h, application configuration file for Flash<br />

• ConfigFlash\linker.cmd, linker command file used for Flash<br />

These files are located in the <strong>SDK</strong> installation directory. The targeting for DSP56F805EVM has<br />

some specific lines in the dpfc.c C-source file. The following lines indicate which pin will be used<br />

to provide the PFC inhibit output functionality:<br />

/* Uncomment one of the following lines */<br />

#define DSP56F805EVM<br />

// #define DSP56F803EVM<br />

The DSP56F805EVM uses the timer C channel 0 output pin, so the timer channel should be<br />

defined in the appconfig.h file:<br />

#define INCLUDE_USER_TIMER_C_0 0<br />

11.14.2 Specification<br />

The Digital PFC application performs power factor correction for 3-phase AC/BLDC<br />

High-Voltage Power Stage hardware without motor drive. It is a demo that can evaluate the basic<br />

algorithm of power factor correction for the current hardware implementation. The PFC software<br />

was designed for use with motor control applications. The Digital PFC application allows target<br />

memory configuration of RAM and Flash. The input power line must meet the following<br />

requirements:<br />

• Input voltage value 115 or 220 volts<br />

• Input voltage frequency 50 or 60 Hz<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The Digital PFC application may be used in the Manual Operating Mode. The remote control<br />

functionality of the PC master software application is not implemented.<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-121<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Manual Operating Mode<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The PFC conversion is controlled by the RUN/STOP switch (S6) (see Figure 11-87). The USER<br />

LED (LED3; see Figure 11-88) indicates the application states. When the application is ready, the<br />

USER LED blinks at a 2Hz frequency.<br />

Figure 11-87. RUN/STOP Switch and UP/DOWN Buttons<br />

11-122 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Digital Power Factor Correction<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 11-88. USER and PWM LEDs<br />

The PFC conversion can be enabled after the RUN/STOP switch is moved to the RUN position.<br />

The normal PFC conversion process is indicated by the USER LED which will light continuously.<br />

To disable PFC conversion, the RUN/STOP switch must be moved to the STOP position.<br />

11.14.3 Set-up<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 11-89 illustrates the hardware set-up for the Digital PFC application, which requires a<br />

motor drive. The AC/BLDC High-Voltage Power Stage board contains the JP201 jumper that<br />

selects the power supply device. The 2-3 pins of the JP201 connection correspond to a simple<br />

rectifier-capacitor power stage. The PFC hardware set-up requires closing pins 1-2 of the JP201<br />

connection.<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-123<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

11.14.3.1 EVM Jumper Settings<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 11-89. Digital PFC Application Set-up<br />

To execute the Digital PFC application, the DSP56F805EVM board requires the strap settings<br />

shown in Figure 11-90 and Table 11-27.<br />

11-124 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

JG6<br />

Digital Power Factor Correction<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3 1<br />

JG1<br />

JG2<br />

JG15<br />

1<br />

3<br />

1<br />

3<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

1<br />

3<br />

9 7<br />

6 4<br />

3 1<br />

JG10<br />

JG14<br />

JG9<br />

JG15 JG1 JG2<br />

1<br />

JG9<br />

JG3<br />

1<br />

LED3<br />

P3 IRQA<br />

JG3<br />

1 2<br />

7 8<br />

S/N<br />

U1<br />

DSP56F805EVM<br />

3<br />

2<br />

1<br />

JG13<br />

Figure 11-90. DSP56F805EVM Jumper Reference<br />

Table 11-27. DSP56F805EVM Jumper Settings<br />

Jumper Group Comment Connections<br />

JG1 PD0 input selected as a high 1-2<br />

JG2 PD1 input selected as a high 1-2<br />

JG3 Primary UNI-3 serial selected 1-2, 3-4, 5-6, 7-8<br />

JG4 Secondary UNI-3 serial selected 1-2, 3-4, 5-6, 7-8<br />

JG5 Enable on-board parallel JTAG Command Converter Interface NC<br />

JG6 Use on-board crystal for DSP oscillator input 2-3<br />

JG7 Select DSP’s Mode 0 operation upon exit from reset 1-2<br />

JG8 Enable on-board SRAM 1-2<br />

JG9 Enable RS-232 output 1-2<br />

JG10 Secondary UNI-3 Analog temperature input unused NC<br />

JG11 Use Host power for Host target interface 1-2<br />

JG12 Primary Encoder input selected for incremental encoder signals 2-3, 5-6, 8-9<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-125<br />

JTAG<br />

U15<br />

S4 S5 S6<br />

JG7<br />

1<br />

JG5<br />

GP1<br />

S1<br />

GP2<br />

S2<br />

RUN/STOP<br />

S3<br />

JG11<br />

P1<br />

U9 U10<br />

IRQB<br />

3<br />

2<br />

1<br />

JG12<br />

USER<br />

9 7<br />

J23 J24<br />

6 4<br />

3<br />

JG10<br />

PWM<br />

1<br />

1 3<br />

JG14 2<br />

JG17 1<br />

JG6 JG12<br />

1<br />

Y1<br />

3<br />

2<br />

1<br />

JG13<br />

JG18<br />

RESET<br />

JG18<br />

1<br />

JG16<br />

JG17<br />

J29<br />

JG8<br />

1<br />

JG4<br />

P1<br />

3 1<br />

JG11<br />

8<br />

2<br />

JG4<br />

JG8<br />

7<br />

1<br />

3 1<br />

JG16<br />

JG5<br />

JG7<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 11-27. DSP56F805EVM Jumper Settings<br />

Jumper Group Comment Connections<br />

Note: When running the EVM target system in a stand-alone mode from Flash, the JG5<br />

jumper must be set in the 1-2 configuration to disable the command converter parallel<br />

port interface.<br />

Build<br />

JG13 Secondary Encoder input selected 2-3, 5-6, 8-9<br />

JG14 Primary UNI-3 3-Phase Current Sense selected as Analog Inputs 2-3, 5-6, 8-9<br />

JG15 Secondary UNI-3 Bus Overcurrent selected for FAULTA1 2-3<br />

JG16 Secondary UNI-3 Phase B Overcurrent selected for FAULTB1 1-2<br />

JG17 CAN termination unselected NC<br />

JG18 Use on-board crystal for DSP oscillator input 1-2<br />

To build this application, open the Digital_PFC.mcp project file and execute the Make command,<br />

as shown in Figure 11-91. This will build and link the Digital PFC application and all needed<br />

Metrowerks and <strong>SDK</strong> libraries.<br />

11.14.4 Execute<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 11-91. Execute Make Command<br />

To execute the Digital PFC application, choose the Program/Debug command in the CodeWarrior<br />

IDE, followed by the Run command.<br />

To execute the Digital PFC application’s internal Flash version, choose the Program/Debug<br />

command in the CodeWarrior IDE. When loading is finished, set jumper JG5 to disable the JTAG<br />

port, set jumper JG7 to enable a boot from internal Flash and push the RESET button.<br />

11-126 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Digital Power Factor Correction for 3-phase AC Motor V/Hz Open Loop<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

For more help with these commands, refer to CodeWarrior tutorial documentation in the<br />

following file located in the CodeWarrior installation directory:<br />

\CodeWarrior Documentation\PDF\Targeting_DSP56800.pdf<br />

For jumper settings, see the DSP56F805 Evaluation Module Hardware User’s Manual.<br />

When the application is running, the USER LED will blink at a 2Hz frequency. To enable the PFC<br />

conversion, set the RUN/STOP switch to the RUN position. If this switch was in the RUN<br />

position before the application started, move it to the STOP position first, then back to the RUN<br />

position. The USER LED should light continuously when the PFC conversion is enabled. To<br />

disable the PFC conversion, move the RUN/STOP switch to the STOP position, causing the<br />

USER LED to blink again.<br />

You should also see a lighted green LED which indicates that the application is running. If the<br />

application is stopped, the green LED will blink at a 2Hz frequency.<br />

11.15 Digital Power Factor Correction for 3-phase<br />

AC Motor V/Hz Open Loop<br />

This application demonstrates how to integrate the Power Factor Correction with a motor control<br />

application. It is based on the 3-phase AC Motor V/Hz Open Loop application and performs the<br />

same functionality. Only the power supply was changed in this implementation. The application<br />

uses the DSP56F805EVM board, Optoisolation board, and 3-phase AC/BLDC High-Voltage<br />

power stage board.<br />

11.15.1 Files<br />

The Digital Power Factor Correction for 3-Phase AC Motor V/Hz Open Loop Application is<br />

found in the directory:<br />

..\src\dsp56805evm\nos\applications\3ph_AC_VHz_OpenLoop_PFC\<br />

and is composed of the following files:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

• 3ph_AC_VHz_OpenLoop_PFC.mcp, application project file<br />

• dpfc.h, application header file<br />

• dpfc.c, main application program<br />

• appconst.c, application constants placed in data Flash<br />

• appconst.h, header file for appconst.c<br />

• ConfigExtRam\appconfig.c, application configuration file for External RAM<br />

• ConfigExtRam\appconfig.h, application configuration file for External RAM<br />

• ConfigExtRam\linker.cmd, linker command file used for RAM<br />

• ConfigFlash\appconfig.c, application configuration file for Flash<br />

• ConfigFlash\appconfig.h, application configuration file for Flash<br />

• ConfigFlash\linker.cmd, linker command file used for Flash<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-127<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

These files are located in the <strong>SDK</strong> installation directory. The targeting for DSP56F805EVM has<br />

some specific lines in the dpfc.c C-source file. The following lines indicate which pin will be used<br />

to provide the PFC inhibit output functionality:<br />

/* Uncomment one of the following lines */<br />

#define DSP56F805EVM<br />

// #define DSP56F803EVM<br />

The DSP56F805 EVM uses timer C channel 0 output pin to provide PFC inhibit output. The timer<br />

channel needs to be defined in the appconfig.h file:<br />

#define INCLUDE_USER_TIMER_C_0 0<br />

11.15.2 Specification<br />

The Digital PFC for the 3-phase AC Motor V/Hz Open Loop application performs power factor<br />

correction for the 3-phase AC/BLDC High-Voltage Power Stage hardware with 3-phase induction<br />

motor drive. It is a demo that evaluates how to integrate the PFC control software with a motor<br />

control application for current hardware implementation. The application allows both target’s<br />

memory configurations of RAM and Flash. The input power line must meet the following<br />

requirements:<br />

• Input voltage value of 115 or 220 volts<br />

• Input voltage frequency of 50 or 60 Hz<br />

The Digital PFC for the 3-phase AC Motor V/Hz Open Loop application can execute in manual<br />

and PC master software modes, which were described in Section 11.11.<br />

11.15.3 Set-up<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 11-92 illustrates the hardware set-up for Digital PFC for the 3-phase AC Motor V/Hz Open<br />

Loop application.<br />

11-128 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Digital Power Factor Correction for 3-phase AC Motor V/Hz Open Loop<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 11-92. Digital PFC for 3-phase AC Motor V/Hz Open Loop Application Set-up<br />

The correct order of phases (phase A, phase B, phase C) for the AC induction motor shown in<br />

Figure 11-92 is:<br />

• phase A = red wire<br />

• phase B = white wire<br />

• phase C = black wire<br />

When facing a motor shaft, if the phase order is: phase A, phase B, phase C, the motor shaft<br />

should rotate clockwise (i.e., positive direction, positive speed).<br />

The configuration for the Digital PFC is basically the same as for the 3-phase AC Motor V/Hz<br />

Open Loop application, with the following difference:<br />

The AC/BLDC High-Voltage Power Stage board contains a JP201 jumper, which selects the<br />

power supply device. The 2-3 pins of the JP201 connection correspond to a simple<br />

rectifier-capacitor power stage. The PFC hardware set-up requires the 1-2 pins of the JP201<br />

connection.<br />

11.15.3.1 EVM Jumper Settings<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

To execute the Digital PFC application, the DSP56F805 board requires the same strap settings as<br />

the 3-phase AC Motor V/Hz Open Loop application; see Section 11.11.<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-129<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

11.15.3.2 Build<br />

To build this application, open the 3ph_AC_VHz_OpenLoop_PFC.mcp project file and follow the<br />

directions given in Section 11.11.<br />

11.15.4 Execute<br />

To execute the Digital PFC for 3-phase AC Motor V/Hz Open Loop application, follow the<br />

directions in Section 11.11.<br />

11.16 Serial Bootloader<br />

The Serial Bootloader is developed to load and run a proprietary user application, presented as an<br />

S-record file, into the Program and Data memory. The Serial Bootloader is located in the<br />

dedicated Program Memory region, called Boot Flash. The Serial Bootloader supports the easiest<br />

serial protocol, so a standard serial terminal program can be used on the host PC.<br />

11.16.1 Files<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The Serial Bootloader application includes the following files:<br />

• ..\nos\applications\serial_bootloader\bootloader.mcp, project file<br />

• ..\nos\applications\serial_bootloader\bootloader.c, main program<br />

• ..\nos\applications\serial_bootloader\bootloader.h, header file with common parameters<br />

• ..\nos\applications\serial_bootloader\com.c, communication module<br />

• ..\nos\applications\serial_bootloader\com.h, header for communication module<br />

• ..\nos\applications\serial_bootloader\sparser.c, S-Record format parser module<br />

• ..\nos\applications\serial_bootloader\sparser.h, header for S-Record parser module<br />

• ..\nos\applications\serial_bootloader\bootloader.h, Flash programming module<br />

• ..\nos\applications\serial_bootloader\prog.h, header for Flash programming module<br />

• ..\nos\applications\serial_bootloader\bootstart.c, startup module<br />

• ..\nos\applications\serial_bootloader\constdata.asm, description of strings data<br />

• ..\nos\applications\serial_bootloader\resetvector.asm, Reset and COP Reset interrupt<br />

vectors description<br />

• ..\nos\applications\serial_bootloader\TargetDirectives, Board name definition<br />

• ..\nos\applications\serial_bootloader\config\linker.cmd, linker command file used for<br />

Boot Flash<br />

• ..\nos\applications\serial_bootloader\config\flash.cfg, Metrowerks CodeWarrior<br />

configuration file to work with Flash<br />

These files are located in the <strong>SDK</strong> installation directory. The Bootloader application does not use<br />

any other <strong>SDK</strong> files except port.h, arch.h and periph.h from the ..\nos\include directory. It can be<br />

compiled and used without other parts of the <strong>SDK</strong>.<br />

11-130 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

11.16.2 Specification<br />

Serial Bootloader<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The Serial Bootloader application reads the S-Record file of the user application (for example,<br />

generated by CodeWarrior) via serial interface, parses this S-Record file and stores needed data in<br />

Program and Data Flash memory. When the processing of the S-Record file is finished, the<br />

Bootloader launches the loaded application. If any error occurs during the loading of the S-Record<br />

file, the Bootloader outputs an error message with an error number via the serial line resets the<br />

processor.<br />

11.16.3 Set-up<br />

Before use, the Bootloader must be programmed into Boot Flash, the EVM P3 socket must be<br />

connected with the host PC COM serial port by serial cable, and the jumpers on the EVM must be<br />

set to use internal memory without debug interface.<br />

11.16.3.1 EVM Jumper Settings<br />

To load the Bootloader into the DSP56F805 board, the following jumper settings are needed:<br />

• Set jumper JG7, “Select DSP’s Mode 0 operation upon exit from reset”<br />

• Set jumper JG9, “Enable RS-232 output”<br />

• Remove jumper JG5, “Enable on-board Parallel JTAG Host Target Interface”<br />

To start a previously-loaded Bootloader on the DSP56F805 board, the following jumper settings<br />

are needed:<br />

• Set jumper JG7, “Select DSP’s Mode 0 operation upon exit from reset”<br />

• Set jumper JG9, “Enable RS-232 output”<br />

• Set jumper JG5, “Enable on-board Parallel JTAG Host Target Interface”<br />

11.16.4 Build<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

To build this application, open the bootloader.mcp project file in the CodeWarrior IDE and<br />

execute the Project/Make command. This will build and link the Serial Bootloader application.<br />

11.16.4.1 Download into Boot Flash<br />

To download into Boot Flash, build the Bootloader from Codewarrior and load it into the board by<br />

choosing the Project/Debug command in the CodeWarrior IDE. Make sure that jumpers were set<br />

as described for loading in Section 11.16.3.1.<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-131<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

11.16.4.2 Host Terminal Program Set-up<br />

A host terminal program is used to communicate with the Bootloader. The terminal must be<br />

configured to the following mode:<br />

The following description assumes that Microsoft Windows HyperTerminal program is used. To<br />

configure Microsoft HyperTerminal to communicate with the Bootloader, the PC user should start<br />

HyperTerminal and create a new connection. Select the COM port previously connected to the<br />

EVM, set up Baud rate at 115200 bps; Data bits equal to 8, Parity none, Stop bits 1; and Flow<br />

control as Xon/Xoff. The HyperTerminal can now display the Bootloader’s messages.<br />

11.16.5 Execute<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Baud rate 115200 bps<br />

8N1 8 data bits, no parity, 1 stop bit character format<br />

Flow control protocol Xon/Xoff<br />

To execute the Serial Bootloader application after loading it into Flash, set jumpers as described<br />

for starting the Bootloader in Section 11.16.3.1., and push the RESET button.<br />

If the terminal program and the connection between EVM and Host PC are properly set, the<br />

terminal program will display Bootloader startup message:<br />

“(c) 2000-2001 Motorola Inc. S-Record loader. Version 1.1”<br />

To load the S-Record file, select Transfer/Send text file in the HyperTerminal menu and select a<br />

file. When the S-Record file is loaded and the application is started the terminal window looks<br />

similar to:<br />

“(c) 2000-2001 Motorola Inc. S-Record loader. Version 1.1<br />

Loaded 0x044d Program and 0x000a Data words.<br />

Application started.”<br />

The download rate is about 7660 bytes of S-Record file per second loaded from terminal, or about<br />

1740 words of program or data memory stored into Flash per second.<br />

If an error is detected while loading the S-Record file, the Bootloader displays an error message<br />

and resets the processor. For example, if an S-record file contains a character that is not permitted<br />

for S-Records, the following message is displayed:<br />

“(c) 2000-2001 Motorola Inc. S-Record loader. Version 1.1<br />

Error # 0002<br />

Resetting the processor.”<br />

After this message, the Bootloader resets the processor and waits for the S-Record file again.<br />

Other loading errors are described in Table 11-28.<br />

11-132 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Error<br />

Code<br />

Serial Bootloader<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 11-28. Error Codes for the Serial Bootloader Application<br />

Error Title Possible Reasons What to Do<br />

1 Data Receive<br />

Error<br />

2 Invalid<br />

Character<br />

3 Invalid<br />

S-Record<br />

Format<br />

4 Wrong<br />

S-Record<br />

Checksum<br />

If an application previously loaded via the Bootloader uses the <strong>SDK</strong> variable<br />

BSP_BOOTLOADER_DELAY (see Section 11.16.6), the Bootloader waits for the S-Record file<br />

only until the required time-out has not expired and launches the application. The terminal<br />

window then displays this message:<br />

“(c) 2000-2001 Motorola Inc. S-Record loader. Version 1.1<br />

Application started.”<br />

•Any SCI error except Noise Error<br />

(Overrun, Frame Error, Parity Error)<br />

•Received character is not ‘S’ or any<br />

hexadecimal digit<br />

•Invalid record type. Permitted type<br />

is 0,3,7<br />

•S-Record length is less than<br />

address plus checksum length<br />

•Checksum calculated around<br />

received S-Record did not match<br />

with received one<br />

11.16.6 Requirements for a Loaded Program<br />

•Check connections with Host PC and<br />

settings for host terminal program<br />

•Verify that S-Record file does not<br />

contain inaccurate characters<br />

•Check connections and send mode in<br />

terminal program<br />

•Verify S-Record file<br />

•Check S-Record file<br />

•Check connections and send mode in<br />

terminal program<br />

5 Buffer Overrun •Internal data buffer was full •Terminal program did not stop after<br />

receiving Xoff character<br />

•Confirm that terminal program supports<br />

Xon/Xoff flow control protocol<br />

6 Flash<br />

Programming<br />

Error<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

•After programming a word into<br />

Flash, the programmed word read<br />

back is not equal to the expected<br />

value<br />

•The Bootloader tries to program Flash<br />

only once and performa a read back /<br />

verify of the value<br />

7 Internal Error •Bootloader data corrupted. •Reload Bootloader via CodeWarrior<br />

If the application is loaded via the Bootloader, it must meet these requirements:<br />

• Particular start address for the application - The entry point for a loaded application<br />

must be located at address 0x0080 in Program memory; i.e., immediately after the interrupt<br />

table.<br />

• Application COP vector - To use the COP interrupt vector in an application loaded via<br />

Bootloader, the entry point for the COP ISR must be located at address 0x0082 in Program<br />

memory.<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-133<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

• Application start delay variable must be set at address 0x0085 in Program Flash - The<br />

<strong>SDK</strong> provides a configuration variable for this purpose. For details on management of the<br />

Bootloader without <strong>SDK</strong> support, see the config\vector.c file in the <strong>SDK</strong>.<br />

• Restricted resource use - The application cannot occupy Reset and COP interrupt vectors,<br />

and cannot place code into the Boot Flash memory area. There is no way to place any<br />

initialized variable from the application into internal data RAM while loading, as this<br />

memory area is used by the Bootloader. All data from the S-Record file that addresses the<br />

restricted area will be ignored. External Program memory is unavailable while loading the<br />

application because Bootloader is performed in the DSP’s Mode 0A memory map.<br />

All applications built with the <strong>SDK</strong> can be loaded via the Serial Bootloader. The <strong>SDK</strong> provides a<br />

fixed address for an application entry point, a redirect for an application COP vector and has the<br />

configuration variable (BSP_BOOTLOADER_DELAY) for the appconfig.h file that determines<br />

the start delay time-out of the application.<br />

The possible values of BSP_BOOTLOADER_DELAY:<br />

0 Disable the Bootloader, start application immediately without waiting.<br />

After loading the application with this setting, there are only two ways<br />

to re-enter Bootloader:<br />

If BSP_BOOTLOADER_DELAY is not set in the appconfig.h file, the default value for time-out<br />

is 30 seconds.<br />

11.16.7 DSP Peripheral Usage<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

• Reload the Bootloader from Metrowerks CodeWarrior into Flash<br />

• Reprogram the value of the start delay variable located on<br />

address 0x0083 in the Program Flash to zero value (0x0000) in<br />

the loaded application<br />

0 - 254 Set the waiting time for the S-Record file’s start for 0-255 seconds<br />

before the start of the previously-loaded application<br />

255 Set waiting time to infinity. After reset, the Bootloader waits for the<br />

S-Record file without counting down any time-out<br />

The DSP is used in a single chip mode, while the Bootloader uses only internal data RAM for data<br />

buffering.<br />

The Bootloader does not initialize any DSP peripheral except SCI 0, Port E and PLL unitization.<br />

The PLL multiplier is set to 18, which equals the DSP’s 72MHz operational frequency. Before the<br />

application starts, SCI 0 is disabled but PLL does not reprogram to its initial state.<br />

The Bootloader uses a statically-calculated SCI baud rate value. This value is calculated assuming<br />

an external Oscillator Frequency of 8MHz.<br />

11-134 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

ADC Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

11.17 ADC Application<br />

For details on building and executing this application, see Section 5.4.6.<br />

11.18 COP Driver Application<br />

Refer to Section 5.10.3 for information on building and executing the Computer Operating<br />

Properly Driver Application.<br />

11.19 PWM Application<br />

See Section 5.8.6 for more information on building and executing the PWM Driver Application.<br />

11.20 Quad Timer Application<br />

To learn more about building and executing this application, refer to Section 5.5.6.<br />

11.21 SCI Application<br />

Section 5.3.6 contains details on building and executing the SCI Driver Application.<br />

11.22 Timer Application<br />

This application exercises the Timer peripheral located on the DSP56F8xx processor.<br />

11.22.1 Files<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The Timer application is composed of the following files:<br />

• ...\dsp568xxevm\nos\applications\timers\timers.c, main program<br />

• ...\dsp568xxevm\nos\applications\timers\timers.mcp, application project file<br />

• ...\dsp568xxevm\nos\applications\timers\Config\appconfig.c, application configuration<br />

file<br />

• ...\dsp568xxevm\nos\applications\timers\Config\appconfig.h, application configuration<br />

file<br />

• ...\dsp568xxevm\nos\applications\timers\Config\linker.cmd, linker command file<br />

These files are located in the <strong>SDK</strong> installation directory.<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-135<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

11.22.2 Specifications<br />

This application exercises Timer0, Timer1, and Timer2 peripherals located in the DSP56F8xx<br />

processor. It initializes Timer1 using clock ID CLOCK_AUX1 to 250ms with a reload value of<br />

250ms. Timer2 is initialized using clock ID CLOCK_AUX2 to 125ms with a reload value of<br />

125ms. When these timers expire, the application changes the On/Off state of the yellow and red<br />

LEDs. The net effect of this is that the yellow LED will come On once every 0.5 seconds, and the<br />

red LED will come On once every 0.25 seconds.<br />

For interaction with Timer0, the application uses the <strong>SDK</strong> timer services. The <strong>SDK</strong> timer services<br />

reserve Timer0 with clock ID CLOCK_REALTIME, and utilizes this timer for nanosleep<br />

functionality. This application calls the nanosleep interface with a time-out value of 0.5 seconds<br />

in a tight loop. The net effect of this call will be suspension of the main function execution for 0.5<br />

seconds.<br />

11.22.3 Set-up<br />

Jumper Settings:<br />

Use the default jumper settings for the DSP56F805EVM board. See the DSP56F805 Evaluation<br />

Module Hardware User’s Manual for more information on jumper settings.<br />

11.22.4 Build<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

To make this application, open the timers.mcp project file and execute the Make command as<br />

shown in Figure 11-93. This will build and link the Timer application and all needed Metrowerks<br />

and <strong>SDK</strong> libraries.<br />

Figure 11-93. Execute Make Command<br />

11-136 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

11.22.5 Execute<br />

To execute the Timer application, choose the Program/Debug command in the CodeWarrior IDE,<br />

followed by the Run command. For more help with these commands, refer to the CodeWarrior<br />

tutorial documentation in the following file, located in the CodeWarrior installation directory:<br />

\CodeWarrior Documentation\PDF\Targeting_DSP56800.pdf<br />

Once the application is running, you should see the green LED come On every 1 second, the<br />

yellow LED come On every 0.5 seconds , and the red LED come On every 0.25 seconds.<br />

11.23 CAN<br />

The Motorola Scalable Controller Area Network (MSCAN) driver is described in more detail in<br />

the DSP56800/MSCAN Driver User’s Manual.<br />

11.24 Flash Application<br />

For information on how to build and execute this application, see Section 5.2.6.<br />

11.25 DAC Application<br />

See Section 6.7.6 for a description of how to build and execute this application.<br />

11.26 SPI Application<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

To learn more about building and executing this application, refer to Section 5.1.6.<br />

CAN<br />

MOTOROLA DSP56F805 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

11-137<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

DSP56F805 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

11-138 Targeting Motorola DSP56F80X Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Chapter 12<br />

DSP56F807 Applications<br />

12.1 Common Hardware Configuration for Motor<br />

Control Applications<br />

12.1.1 Settings for EVM Trimpots<br />

Settings for the DSP56F807 board’s required fault trimpots are shown in Figure 12-1, Table 12-1,<br />

Table 12-2 and Table 12-3.<br />

GND - pin TP1<br />

Figure 12-1. Trimpot Pins (Top view)<br />

Table 12-1. Trimpot Settings for EVM Motor Board BLDC Motor Control Applications<br />

Trim pot Comment Voltage POT - Pin 2 to GND<br />

R111 Overvoltage Fault Detection Primary UNI-3 3.3V<br />

R36 Overcurrent Fault Detection Primary UNI-3 3.3V<br />

Table 12-2. Trimpot Settings for Low-Voltage BLDC Motor Control Applications<br />

Trim pot Comment Voltage POT - Pin 2 to GND<br />

R111 Overvoltage Fault Detection Primary UNI-3 3.3V<br />

R36 Overcurrent Fault Detection Primary UNI-3 3.3V<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-1<br />

2<br />

POT<br />

1 3<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 12-3. Trimpot Settings for High-Voltage BLDC Motor Control Applications<br />

Trim pot Comment Voltage POT - Pin 2 to GND<br />

R111 Overvoltage Fault Detection Primary UNI-3 3.3V<br />

R36 Overcurrent Fault Detection Primary UNI-3 3.3V<br />

12.1.2 Communication Port Settings<br />

When utilizing the PC master software debugging tool, a communication port on a PC requires the<br />

following settings:<br />

Baud Rate<br />

Data Bits<br />

Parity<br />

Stop Bit<br />

Flow Control<br />

12.2 BLDC Motor Control Application with Hall<br />

Sensors<br />

This application exercises simple control of the BLDC motor with Hall Sensors on the<br />

DSP56F807EVM board and the EVM Motor Kit.<br />

12.2.1 Files<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

9600<br />

8<br />

None<br />

1<br />

None<br />

The BLDC Motor Control Application with Hall Sensors is composed of the following files:<br />

• ...\dsp56807evm\nos\applications\bldc_sensors\bldc_sensor.c, main program<br />

• ...\dsp56807evm\nos\applications\bldc_sensors\bldc_sensor.mcp, application project file<br />

• ...\dsp56807evm\nos\applications\bldc_sensors\configextram\appconfig.c, application<br />

configuration file for external RAM<br />

• ...\dsp56807evm\nos\applications\bldc_sensors\configflash\appconfig.c, application<br />

configuration file for Flash<br />

• ...\dsp56807evm\nos\applications\bldc_sensors\configextram\appconfig.h, application<br />

configuration header file for external RAM<br />

• ...\dsp56807evm\nos\applications\bldc_sensors\configflash\appconfig.h, application<br />

configuration header file for Flash<br />

• ...\dsp56807evm\nos\applications\bldc_sensors\configextram\linker.cmd, linker<br />

command file for external RAM<br />

• ...\dsp56807evm\nos\applications\bldc_sensors\configflash\linker.cmd, linker command<br />

file for Flash<br />

12-2 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

BLDC Motor Control Application with Hall Sensors<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

• ...\dsp56807evm\nos\applications\bldc_sensors\configflash\flash.cfg, configuration file<br />

for Flash<br />

• ...\dsp56807evm\nos\applications\bldc_sensors\pcmaster\bldc demo.pmp, PCMaster<br />

file<br />

These files are located in the <strong>SDK</strong> installation directory.<br />

12.2.2 Specifications<br />

This application performs simple control of a BLDC motor with Hall Sensors and closed loop<br />

control on the DSP56F807 processor. In the application, the PWM module is set to<br />

complementary mode with a 16kHz switching frequency. The state of the Hall Sensors is read<br />

from the Input Monitor Register of the Quadrature Decoder. The masking and swapping of PWM<br />

channels are controlled by the PWM Channel Control Register. The content of this register is<br />

derived from Hall Sensors’ signals. The commutation is done with each new edge of the Hall<br />

Sensors’ signals. The required voltage is set independently on the commutation by the speed PI<br />

controller. The speed is measured by the quad timer. The allowable range of speed for this motor<br />

application is from 400 rpm to 1000 rpm in both directions.<br />

The application can run on:<br />

• External RAM or Flash<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The BLDC Motor Control Application with Hall Sensors can operate in two modes:<br />

1. Manual Operating Mode<br />

The drive is controlled by the RUN/STOP switch (S6). The motor speed is set by the UP<br />

(S3-IRQB) and DOWN (S2-IRQA) push buttons; refer to Figure 12-2. If the application<br />

runs and motor spinning is disabled (i.e., the system is ready), the USER LED (LED3, see<br />

Figure 12-3) will blink. When motor spinning is enabled, the USER LED is On. Refer to<br />

Table 12-4 for application states.<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-3<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 12-2. RUN/STOP Switch and UP/DOWN Buttons<br />

12-4 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

BLDC Motor Control Application with Hall Sensors<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 12-3. USER and PWM LEDs<br />

2. PC master software (remote) Operating Mode<br />

The drive is controlled remotely from a PC through the SCI communication channel<br />

of the DSP device via an RS-232 physical interface. The drive is enabled by the<br />

RUN/STOP switch, which can be used to safely stop the application at any time.<br />

The following control actions are supported:<br />

• Set the Required Speed of the motor<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Table 12-4. Motor Application States<br />

Application State Motor State Green LED State<br />

Stopped Stopped Blinking at a frequency of 2Hz<br />

Running Spinning On<br />

Fault Stopped Blinking at a frequency of 8Hz<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-5<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

PC master software displays the following information:<br />

• Applied Voltage<br />

• Required Voltage<br />

• Speed<br />

• RUN/STOP Switch Status<br />

• Application Mode<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Project files for the PC master software are located in:<br />

..\nos\applications\bldc_sensors\PC_Master\bldc demo.pmp<br />

Start the PC master software window’s application, bldc demo.pmp. Figure 12-4 shows the PC<br />

master software control window after this project has been launched.<br />

NOTE: If the PC master software project (.pmp file) is unable to control the application, it is<br />

possible that the wrong load map (.elf file) has been selected. PC master software uses<br />

the load map to determine addresses for global variables being monitored. Once the PC<br />

master software project has been launched, this option may be selected in the PC master<br />

software window under Project/Select Other Map FileReload.<br />

Figure 12-4. PC Master Software Control Window<br />

12-6 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

12.2.3 Set-up<br />

BLDC Motor Control Application with Hall Sensors<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 12-5 illustrates the hardware set-up for the BLDC Motor Control Application with Hall<br />

Sensors.<br />

Figure 12-5. Set-up of the BLDC Motor Control Application with Hall Sensors<br />

For detailed information, see the DSP56F807 Evaluation Module Hardware Reference<br />

Manual. The serial cable is needed for the PC master software debugging tool only.<br />

12.2.3.1 EVM Jumper Settings<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

To execute the BLDC Motor Control Application with Hall Sensors, the DSP56F807 board<br />

requires the strap settings shown in Figure 12-6 and Table 12-5.<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-7<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

JG15<br />

JG5<br />

2<br />

JG7<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

JG3<br />

3<br />

1<br />

8<br />

3<br />

2<br />

1<br />

JG12<br />

1<br />

JG14<br />

7<br />

1 3<br />

4<br />

7<br />

6<br />

9 JG9<br />

USER<br />

PWM<br />

J1<br />

JG15<br />

JG14<br />

1<br />

4<br />

7<br />

JG9<br />

LED3<br />

Y1<br />

JG1<br />

JG17<br />

1<br />

J4 J5<br />

3<br />

3<br />

2<br />

2<br />

1<br />

1<br />

JG12 JG17JG16<br />

JG13<br />

JG3 JG7<br />

JG6<br />

JG5<br />

3<br />

JG1<br />

DSP56F807EVM<br />

S/N<br />

S4 S5 S6<br />

GP1 GP2 RUN/STOP<br />

JG4 U9<br />

S1 S2 S3<br />

P1<br />

P3 RESET IRQA IRQB<br />

3<br />

1<br />

Figure 12-6. DSP56F807 Jumper Reference<br />

Table 12-5. BLDC Motor Control Application with Hall Sensors Jumper Settings<br />

Jumper Group Comment Connections<br />

JG1 Primary UNI-3 Phase A Overcurrent Selected for FAULTA1 1–2<br />

JG2 Secondary UNI-3 Phase A Overcurrent Selected for FAULTB1 1–2<br />

JG3 CAN termination unselected NC<br />

JG4 Enable on-board Parallel JTAG Host/Target Interface NC<br />

JG5 Use on-board EXTAL crystal input for DSP oscillator 2–3<br />

JG6 Use on-board XTAL crystal input for DSP oscillator 1–2<br />

JG7 Selects DSP’s Mode 0 operation upon exit from reset 1–2<br />

JG8 Enable on-board SRAM 1–2<br />

JG9 Enable RS-232 output NC<br />

JG10 Secondary UNI-3 3-Phase Current Sense Selected as inputs to A/D 2–3, 5–6, 8–9<br />

JG11 Secondary UNI-3 serial selected 1–2, 3–4, 5–6, 7–8<br />

JG12 Primary Encoder Input Selected 2–3, 5–6, 8–9<br />

JG13 Secondary Encoder Input Selected 2–3, 5–6, 8–9<br />

JG14 Primary UNI-3 3-Phase Current Sense Selected as inputs to A/D 2–3, 5–6, 8–9<br />

JG15 Primary UNI-3 serial selected 1–2, 3–4, 5–6, 7–8<br />

JG16 PD0 input selected as a high input 1–2<br />

JG17 PD1 input selected as a high input 1–2<br />

U1<br />

JG16<br />

1<br />

3<br />

2<br />

1<br />

JG13<br />

NOTE: When running the EVM target system in a stand-alone mode from Flash, the JG4<br />

jumper must be set in the 1-2 configuration to disable the command converter parallel<br />

port interface.<br />

12-8 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

3<br />

JG6<br />

JG8<br />

U2<br />

JG10<br />

3<br />

2<br />

1<br />

JG11<br />

JTAG<br />

JG4<br />

JG2<br />

J3<br />

P2<br />

J2<br />

3<br />

2<br />

1<br />

JG10<br />

JG2<br />

JG11<br />

1 2<br />

7 8<br />

JG8<br />

3<br />

1<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

12.2.4 Build<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

BLDC Motor Control Application with Hall Sensors<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

When building this application, the user can create an application that runs from internal Flash or<br />

External RAM. To select the type of application to build, open the bldc_sensor.mcp project and<br />

select the target build type, shown in Figure 12-7. Selecting Build All will create all application<br />

build types. A definition of the projects associated with these target build types may be viewed<br />

under the Targets tab of the project window.<br />

Figure 12-7. Target Build Selection<br />

The project may now be built by executing the Make command, as shown in Figure 12-8. This will<br />

build and link the BLDC Motor Control Application with Hall Sensors and all needed<br />

Metrowerks and <strong>SDK</strong> libraries.<br />

Figure 12-8. Execute Make Command<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-9<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

12.2.5 Execute<br />

To execute the BLDC Motor Control Application with Hall Sensors, select Project\Debug in the<br />

CodeWarrior IDE, followed by the Project\Run command. For more help with these commands,<br />

refer to the CodeWarrior tutorial documentation in the following file located in the CodeWarrior<br />

installation directory:<br />

\CodeWarrior Documentation\PDF\Targeting_DSP56800.pdf<br />

If the Flash target is selected, CodeWarrior will automatically program the DSP’s internal Flash<br />

with the executable generated during Build. If the External RAM target is selected, the executable<br />

will be loaded to off-chip RAM.<br />

Once Flash has been programmed with the executable, the EVM target system may be run in a<br />

stand-alone mode from Flash. To do this, set the JG4 jumper in the 1-2 configuration to disable<br />

the parallel port, and press the RESET button.<br />

Once the application is running, move the RUN/STOP switch to the RUN position and set the<br />

required speed with the UP/DOWN push buttons. Pressing the UP/DOWN buttons should<br />

incrementally increase the motor speed until it reaches maximum speed. If successful, the BLDC<br />

motor will be spinning.<br />

NOTE: If the RUN/STOP switch is set to the RUN position when the application starts, toggle<br />

the RUN/STOP switch between the STOP and RUN positions to enable motor<br />

spinning. This is a protection feature that prevents the motor from starting when the<br />

application is executed from CodeWarrior.<br />

You should also see a lighted green USER LED, which indicates that the application is running. If<br />

the application stops, the green USER LED will blink at a 2Hz frequency. If an Undervoltage<br />

fault occurs, the USER LED will blink at a frequency of 8Hz.<br />

12.3 BLDC Motor Control Application with<br />

Quadrature Encoder<br />

This application exercises simple control of the BLDC motor with the Quadrature Encoder on the<br />

DSP56F807EVM board and the EVM Motor Kit.<br />

12.3.1 Files<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The BLDC Motor Control Application with Quadrature Encoder is composed of the following<br />

files:<br />

• ...\dsp56807evm\nos\applications\bldc_encoder\bldc_encoder.c, main program<br />

• ...\dsp56807evm\nos\applications\bldc_encoder\bldc_encoder.mcp, application project<br />

file<br />

• ...\dsp56807evm\nos\applications\bldc_encoder\ConfigExtRam\appconfig.c,<br />

application configuration file for external RAM<br />

12-10 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

BLDC Motor Control Application with Quadrature Encoder<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

• ...\dsp56807evm\nos\applications\bldc_encoder\ConfigFlash\appconfig.c, application<br />

configuration file for Flash<br />

• ...\dsp56807evm\nos\applications\bldc_encoder\ConfigExtRam\appconfig.h,<br />

application configuration header file for external RAM<br />

• ...\dsp56807evm\nos\applications\bldc_encoder\ConfigFlash\appconfig.h, application<br />

configuration header file for Flash<br />

• ...\dsp56807evm\nos\applications\bldc_encoder\ConfigExtRam\linker.cmd, linker<br />

command file for external RAM<br />

• ...\dsp56807evm\nos\applications\bldc_encoder\ConfigFlash\linker.cmd, linker<br />

command file for Flash<br />

• ...\dsp56807evm\nos\applications\bldc_encoder\ConfigFlash\flash.cfg, configuration<br />

file for Flash<br />

• ...\dsp56807evm\nos\applications\bldc_encoder\pcmaster\BLDC Encoder<br />

Demo.pmp, PCMaster file<br />

These files are located in the <strong>SDK</strong> installation directory.<br />

12.3.2 Specifications<br />

This application performs simple control of the BLDC motor with the Quadrature Encoder and<br />

closed loop speed control on the DSP56F807 processor. In the application, the PWM module is<br />

set to complementary mode with a 16kHz switching frequency. The masking and swapping of<br />

PWM channels are controlled by the PWM Channel Control Register. The content of this register<br />

is derived from Quadrature Encoder signals. The required voltage is set independently on the<br />

commutation by the speed PI controller. The speed is measured by the quad timer. The<br />

RUN/STOP switch enables/disables motor spinning. The allowable range of speed is from 50 rpm<br />

to 1000 rpm in both directions.<br />

The application can run on:<br />

• External RAM or Flash<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The BLDC Motor Control Application with Quadrature Encoder can operate in two modes:<br />

1. Manual Operating Mode<br />

The drive is controlled by the RUN/STOP switch (S6). The motor speed is set by the UP<br />

(S3-IRQB) and DOWN (S2-IRQA) push buttons; refer to Figure 12-9. If the application<br />

runs and motor spinning is disabled (i.e., the system is ready), the green USER LED (LED3;<br />

see Figure 12-10) will blink. When motor spinning is enabled, the green USER LED is On.<br />

Refer to Table 12-6 for application states.<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-11<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 12-9. RUN/STOP Switch and UP/DOWN Buttons<br />

Figure 12-10. USER and PWM LEDs<br />

12-12 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

BLDC Motor Control Application with Quadrature Encoder<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

2. PC master software (remote) Operating Mode<br />

The drive is controlled remotely from a PC through the SCI communication channel<br />

of the DSP device via an RS-232 physical interface. The drive is enabled by the<br />

RUN/STOP switch, which can be used to safely stop the application at any time.<br />

The following control actions are supported:<br />

• Set the Required Speed of the motor<br />

PC master software displays the following information:<br />

• Required Speed<br />

• Actual Speed<br />

• Applied Voltage<br />

• DCBus Voltage<br />

• RUN/STOP Switch Status<br />

• Application Mode<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Table 12-6. Motor Application States<br />

Application State Motor State Green LED State<br />

Stopped Stopped Blinking at a frequency of 2Hz<br />

Running Spinning On<br />

Fault Stopped Blinking at a frequency of 8Hz<br />

Project files for the PC master software are located in:<br />

..\nos\applications\bldc_encoder\PC_Master\BLDC Encoder Demo.pmp<br />

Start the PC master software window’s application, BLDC Encoder Demo.pmp. Figure 12-11<br />

shows the PC master software control window after this project has been launched.<br />

NOTE: If the PC master software project (.pmp file) is unable to control the application, it is<br />

possible that the wrong load map (.elf file) has been selected. PC master software uses<br />

the load map to determine addresses for global variables being monitored. Once the PC<br />

master software project has been launched, this option may be selected in the PC master<br />

software window under Project/Select Other Map FileReload.<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-13<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 12-11. PC Master Software Control Window<br />

12-14 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

12.3.3 Set-up<br />

BLDC Motor Control Application with Quadrature Encoder<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 12-12 illustrates the hardware set-up for the BLDC Motor Control Application with<br />

Quadrature Encoder.<br />

Figure 12-12. Set-up of the BLDC Motor Control Application with Quadrature Encoder<br />

For detailed information, see the DSP56F807 Evaluation Module Hardware Reference<br />

Manual. The serial cable is needed for the PC master software debugging tool only.<br />

12.3.3.1 EVM Jumper Settings<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

To execute the BLDC Motor Control Application with Quadrature Encoder, the DSP56F807<br />

board requires the strap settings shown in Figure 12-13 and Table 12-7.<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-15<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

JG15<br />

JG5<br />

2<br />

JG7<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

JG3<br />

3<br />

1<br />

8<br />

3<br />

2<br />

1<br />

JG12<br />

1<br />

JG14<br />

7<br />

1 3<br />

4<br />

7<br />

6<br />

9 JG9<br />

USER<br />

PWM<br />

J1<br />

JG15<br />

JG14<br />

1<br />

4<br />

7<br />

JG9<br />

LED3<br />

Y1<br />

JG1<br />

JG17<br />

1<br />

J4 J5<br />

3<br />

3<br />

2<br />

2<br />

1<br />

1<br />

JG12 JG17JG16<br />

JG13<br />

JG3 JG7<br />

JG6<br />

JG5<br />

3<br />

JG1<br />

DSP56F807EVM<br />

S/N<br />

S4 S5 S6<br />

GP1 GP2 RUN/STOP<br />

JG4 U9<br />

S1 S2 S3<br />

P1<br />

P3 RESET IRQA IRQB<br />

3<br />

1<br />

Figure 12-13. DSP56F807EVM Jumper Reference<br />

Table 12-7. DSP56F807EVM Jumper Settings<br />

Jumper Group Comment Connections<br />

JG1 Primary UNI-3 Phase A Overcurrent Selected for FAULTA1 1–2<br />

JG2 Secondary UNI-3 Phase A Overcurrent Selected for FAULTB1 1–2<br />

JG3 CAN termination unselected NC<br />

JG4 Enable on-board Parallel JTAG Host/Target Interface NC<br />

JG5 Use on-board EXTAL crystal input for DSP oscillator 2–3<br />

JG6 Use on-board XTAL crystal input for DSP oscillator 1–2<br />

JG7 Selects DSP’s Mode 0 operation upon exit from reset 1–2<br />

JG8 Enable on-board SRAM 1–2<br />

JG9 Enable RS-232 output NC<br />

JG10 Secondary UNI-3 3-Phase Current Sense Selected as inputs to A/D 2–3, 5–6, 8–9<br />

JG11 Secondary UNI-3 serial selected 1–2, 3–4, 5–6, 7–8<br />

JG12 Primary Encoder Input Selected 2–3, 5–6, 8–9<br />

JG13 Secondary Encoder Input Selected 2–3, 5–6, 8–9<br />

JG14 Primary UNI-3 3-Phase Current Sense Selected as inputs to A/D 2–3, 5–6, 8–9<br />

JG15 Primary UNI-3 serial selected 1–2, 3–4, 5–6, 7–8<br />

JG16 PD0 input selected as a high input 1–2<br />

JG17 PD1 input selected as a high input 1–2<br />

U1<br />

JG16<br />

1<br />

3<br />

2<br />

1<br />

JG13<br />

NOTE: When running the EVM target system in a stand-alone mode from Flash, the JG4<br />

jumper must be set in the 1-2 configuration to disable the command converter parallel<br />

port interface.<br />

12-16 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

3<br />

JG6<br />

JG8<br />

U2<br />

JG10<br />

3<br />

2<br />

1<br />

JG11<br />

JTAG<br />

JG4<br />

JG2<br />

J3<br />

P2<br />

J2<br />

3<br />

2<br />

1<br />

JG10<br />

JG2<br />

JG11<br />

1 2<br />

7 8<br />

JG8<br />

3<br />

1<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

12.3.4 Build<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

BLDC Motor Control Application with Quadrature Encoder<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

When building this application, the user can create an application that runs from internal Flash or<br />

External RAM. To select the type of application to build, open the bldc_encoder.mcp project and<br />

select the target build type; see Figure 12-14. Selecting Build All will create all application build<br />

types. A definition of the projects associated with these target build types may be viewed under<br />

the Targets tab of the project window.<br />

Figure 12-14. Target Build Selection<br />

The project may now be built by executing the Make command, as shown in Figure 12-15. This<br />

will build and link the BLDC Motor Control Application with Quadrature Encoder and all needed<br />

Metrowerks and <strong>SDK</strong> libraries.<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-17<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

12.3.5 Execute<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 12-15. Execute Make Command<br />

To execute the BLDC Motor Control Application with Quadrature Encoder, select Project\Debug<br />

in the CodeWarrior IDE, followed by the Project\Run command. For more help with these<br />

commands, refer to the CodeWarrior tutorial documentation in the following file located in the<br />

CodeWarrior installation directory:<br />

\CodeWarrior Documentation\PDF\Targeting_DSP56800.pdf<br />

If the Flash target is selected, CodeWarrior will automatically program the DSP’s internal Flash<br />

with the executable generated during Build. If the External RAM target is selected, the executable<br />

will be loaded to off-chip RAM.<br />

Once Flash has been programmed with the executable, the EVM target system may be run in a<br />

stand-alone mode from Flash. To do this, set the JG4 jumper in the 1-2 configuration to disable<br />

the parallel port, and press the RESET button.<br />

Once the application is running, move the RUN/STOP switch to the RUN position and set the<br />

required speed with the UP/DOWN push buttons. Pressing the UP/DOWN buttons should<br />

incrementally increase the motor speed until it reaches maximum speed. If successful, the BLDC<br />

motor will be spinning.<br />

NOTE: If the RUN/STOP switch is set to the RUN position when the application starts, toggle<br />

the RUN/STOP switch between the STOP and RUN positions to enable motor<br />

spinning. This is a protection feature that prevents the motor from starting when the<br />

application is executed from CodeWarrior.<br />

You should also see a lighted green USER LED which indicates that the application is running. If<br />

the application is stopped, the green USER LED will blink at a 2Hz frequency. If an Undervoltage<br />

fault occurs, the USER LED will blink at a frequency of 8Hz.<br />

12-18 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Synchro PM Motor Control Application with Quadrature Encoder<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

12.4 Synchro PM Motor Control Application with<br />

Quadrature Encoder<br />

This application exercises simple control of the Synchro PM motor with the Quadrature Encoder<br />

on the DSP56F807EVM board and the EVM Motor Kit.<br />

12.4.1 Files<br />

The Synchro PM Motor Control application is composed of the following files:<br />

• ...\dsp56807evm\nos\applications\bldc_synchro1\bldc_synchro1.c, main program<br />

• ...\dsp56807evm\nos\applications\bldc_synchro1\bldc_synchro1.mcp, application<br />

project file<br />

• ...\dsp56807evm\nos\applications\bldc_synchro1\configextram\appconfig.c,<br />

application configuration file for external RAM<br />

• ...\dsp56807evm\nos\applications\bldc_synchro1\configflash\appconfig.c, application<br />

configuration file for Flash<br />

• ...\dsp56807evm\nos\applications\bldc_synchro1\configextram\appconfig.h,<br />

application configuration header file for external RAM<br />

• ...\dsp56807evm\nos\applications\bldc_synchro1\configflash\appconfig.h, application<br />

configuration header file for Flash<br />

• ...\dsp56807evm\nos\applications\bldc_synchro1\configextram\linker.cmd, linker<br />

command file for external RAM<br />

• ...\dsp56807evm\nos\applications\bldc_synchro1\configflash\linker.cmd, linker<br />

command file for Flash<br />

• ...\dsp56807evm\nos\applications\bldc_synchro1\configflash\flash.cfg, configuration<br />

file for Flash<br />

• ...\dsp56807evm\nos\applications\bldc_synchro1\pcmaster\BLDC Synchro<br />

Demo.pmp, PCMaster file<br />

These files are located in the <strong>SDK</strong> installation directory.<br />

12.4.2 Specifications<br />

This application performs simple control of a synchro PM motor with the Quadrature Encoder<br />

and speed closed loop on the DSP56F807 processor. In the application, the PWM module is set to<br />

complementary mode with a 16kHz switching frequency. The masking and swapping of PWM<br />

channels are controlled by the PWM Channel Control Register. The content of this register is<br />

derived from Quadrature Encoder signals. The required voltage is set independently on the<br />

commutation by the speed PI controller. The speed is measured by the quad timer. The allowable<br />

range of speed is from 50 rpm to 1000 rpm in both directions.<br />

The application can run on:<br />

• External RAM or Flash<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-19<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The Synchro PM Motor Control Application with Quadrature Encoder can operate in two<br />

modes:<br />

1. Manual Operating Mode<br />

The drive is controlled by the RUN/STOP switch (S6). The motor speed is set by the UP<br />

(S3-IRQB) and DOWN (S2-IRQA) push buttons; refer to Figure 12-16. If the application<br />

runs and motor spinning is disabled (i.e., the system is ready), the green USER LED (LED3;<br />

see Figure 12-17) will blink. When motor spinning is enabled, the green USER LED is On.<br />

Refer to Table 12-8 for application states.<br />

Figure 12-16. RUN/STOP Switch and UP/DOWN Buttons<br />

12-20 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Synchro PM Motor Control Application with Quadrature Encoder<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 12-17. USER and PWM LEDs<br />

2. PC master software (remote) Operating Mode<br />

The drive is controlled remotely from a PC through the SCI communication channel<br />

of the DSP device via an RS-232 physical interface. The drive is enabled by the<br />

RUN/STOP switch, which can be used to safely stop the application at any time.<br />

The following control actions are supported:<br />

• Set the Required Speed of the motor<br />

PC master software displays the following information:<br />

• Required Speed<br />

• Actual Speed<br />

• Amplitude<br />

• DCBus Voltage<br />

• RUN/STOP Switch Status<br />

• Application Mode<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Table 12-8. Motor Application States<br />

Application State Motor State Green LED State<br />

Stopped Stopped Blinking at a frequency of 2Hz<br />

Running Spinning On<br />

Fault Stopped Blinking at a frequency of 8Hz<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-21<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Project files for the PC master software are located in:<br />

..\nos\applications\bldc_synchro1\PC_Master\BLDC Synchro Demo.pmp<br />

Start the PC master software window’s application, BLDC Synchro Demo.pmp. Figure 12-18<br />

shows the PC master software control window after this project has been launched.<br />

NOTE: If the PC master software project (.pmp file) is unable to control the application, it is<br />

possible that the wrong load map (.elf file) has been selected. PC master software uses<br />

the load map to determine addresses for global variables being monitored. Once the PC<br />

master software project has been launched, this option may be selected in the PC master<br />

software window under Project/Select Other Map FileReload.<br />

Figure 12-18. PC Master Software Control Window<br />

12-22 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

12.4.3 Set-up<br />

Synchro PM Motor Control Application with Quadrature Encoder<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 12-19 illustrates the hardware set-up for the Synchro PM Motor Control Application with<br />

Quadrature Encoder.<br />

Figure 12-19. Set-up of the Synchro PM Motor Control Application with Quadrature Encoder<br />

For detailed information, see the DSP56F807 Evaluation Module Hardware Reference<br />

Manual. The serial cable is needed for the PC master software debugging tool only.<br />

12.4.3.1 PM Synchronous Motor versus BLDC Motor<br />

The application SW is targeted for a PM Synchronous motor with sine-wave Back-EMF shape. In<br />

this particular demo application, the BLDC motor is used instead, due to the availability of the<br />

BLDC motor supplied as ECMTREVAL. Although the Back-EMF shape of this motor is not<br />

ideally sine-wave, it can be controlled by the application software. The drive parameters will be<br />

improved when a PMSM motor with a exact sine-wave Back-EMF shape is used.<br />

12.4.3.2 EVM Jumper Settings<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

To execute the Synchro PM Motor Control Application with Quadrature Encoder, the DSP56F807<br />

board requires the strap settings shown in Figure 12-20 and Table 12-9.<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-23<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

JG15<br />

JG5<br />

2<br />

JG7<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

JG3<br />

3<br />

1<br />

8<br />

3<br />

2<br />

1<br />

JG12<br />

1<br />

JG14<br />

7<br />

1 3<br />

4<br />

7<br />

6<br />

9 JG9<br />

USER<br />

PWM<br />

J1<br />

JG15<br />

JG14<br />

1<br />

4<br />

7<br />

JG9<br />

LED3<br />

Y1<br />

JG1<br />

JG17<br />

1<br />

J4 J5<br />

3<br />

3<br />

2<br />

2<br />

1<br />

1<br />

JG12 JG17JG16<br />

JG13<br />

JG3 JG7<br />

JG6<br />

JG5<br />

3<br />

JG1<br />

DSP56F807EVM<br />

S/N<br />

S4 S5 S6<br />

GP1 GP2 RUN/STOP<br />

JG4 U9<br />

S1 S2 S3<br />

P1<br />

P3 RESET IRQA IRQB<br />

3<br />

1<br />

Figure 12-20. DSP56F807EVM Jumper Reference<br />

Table 12-9. DSP56F807EVM Jumper Settings<br />

Jumper Group Comment Connections<br />

JG1 Primary UNI-3 Phase A Overcurrent Selected for FAULTA1 1–2<br />

JG2 Secondary UNI-3 Phase A Overcurrent Selected for FAULTB1 1–2<br />

JG3 CAN termination unselected NC<br />

JG4 Enable on-board Parallel JTAG Host/Target Interface NC<br />

JG5 Use on-board EXTAL crystal input for DSP oscillator 2–3<br />

JG6 Use on-board XTAL crystal input for DSP oscillator 1–2<br />

JG7 Selects DSP’s Mode 0 operation upon exit from reset 1–2<br />

JG8 Enable on-board SRAM 1–2<br />

JG9 Enable RS-232 output NC<br />

JG10 Secondary UNI-3 3-Phase Current Sense Selected as inputs to A/D 2–3, 5–6, 8–9<br />

JG11 Secondary UNI-3 serial selected 1–2, 3–4, 5–6, 7–8<br />

JG12 Primary Encoder Input Selected 2–3, 5–6, 8–9<br />

JG13 Secondary Encoder Input Selected 2–3, 5–6, 8–9<br />

JG14 Primary UNI-3 3-Phase Current Sense Selected as inputs to A/D 2–3, 5–6, 8–9<br />

JG15 Primary UNI-3 serial selected 1–2, 3–4, 5–6, 7–8<br />

JG16 PD0 input selected as a high input 1–2<br />

JG17 PD1 input selected as a high input 1–2<br />

U1<br />

JG16<br />

1<br />

3<br />

2<br />

1<br />

JG13<br />

NOTE: When running the EVM target system in a stand-alone mode from Flash, the JG4<br />

jumper must be set in the 1-2 configuration to disable the command converter parallel<br />

port interface.<br />

12-24 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

3<br />

JG6<br />

JG8<br />

U2<br />

JG10<br />

3<br />

2<br />

1<br />

JG11<br />

JTAG<br />

JG4<br />

JG2<br />

J3<br />

P2<br />

J2<br />

3<br />

2<br />

1<br />

JG10<br />

JG2<br />

JG11<br />

1 2<br />

7 8<br />

JG8<br />

3<br />

1<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

12.4.4 Build<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Synchro PM Motor Control Application with Quadrature Encoder<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

When building this application, the user can create an application that runs from internal Flash or<br />

External RAM. To select the type of application to build, open the bldc_synchro1.mcp project and<br />

select the target build type; refer to Figure 12-21. Selecting Build All will build all application<br />

build types. A definition of the projects associated with these target build types may be viewed<br />

under the Targets tab of the project window.<br />

Figure 12-21. Target Build Selection<br />

The project may now be built by executing the Make command, as shown in Figure 12-22. This<br />

will build and link the Synchro PM Motor Control Application with Quadrature Encoder and all<br />

needed Metrowerks and <strong>SDK</strong> libraries.<br />

Figure 12-22. Execute Make Command<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-25<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

12.4.5 Execute<br />

To execute the Synchro PM Motor Control Application with Quadrature Encoder, select<br />

Project\Debug in the CodeWarrior IDE, followed by the Project\Run command. For more help<br />

with these commands, refer to the CodeWarrior tutorial documentation in the following file<br />

located in the CodeWarrior installation directory:<br />

\CodeWarrior Documentation\PDF\Targeting_DSP56800.pdf<br />

If the Flash target is selected, CodeWarrior will automatically program the DSP’s internal Flash<br />

with the executable generated during Build. If the External RAM target is selected, the executable<br />

will be loaded to off-chip RAM.<br />

Once Flash has been programmed with the executable, the EVM target system may be run in a<br />

stand-alone mode from Flash. To do this, set the JG4 jumper in the 1-2 configuration to disable<br />

the parallel port, and press the RESET button.<br />

Once the application is running, switch the RUN/STOP switch to the RUN position, and set the<br />

required speed with the UP/DOWN push buttons. Pressing the UP/DOWN buttons should<br />

incrementally increase the motor speed until it reaches maximum speed. If successful, the synchro<br />

PM motor will be spinning.<br />

NOTE: If the RUN/STOP switch is set to the RUN position when the application starts, toggle<br />

the RUN/STOP switch between the STOP and RUN positions to enable motor<br />

spinning. This is a protection feature that prevents the motor from starting when the<br />

application is executed from CodeWarrior.<br />

You should also see a lighted green USER LED which indicates that the application is running. If<br />

the application is stopped, the green USER LED will blink at a 2Hz frequency. If an Undervoltage<br />

fault occurs, the USER LED will blink at a frequency of 8Hz.<br />

12.5 BLDC Sensorless with Back-EMF Zero<br />

Crossing Application<br />

This application exercises sensorless control of the BLDC motor on the DSP56F807EVM board<br />

and the EVM Motor Kit.<br />

12.5.1 Files<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The BLDC Sensorless with Back-EMF Zero Crossing Application is composed of the following<br />

files:<br />

• ...\dsp56807evm\nos\applications\bldc_zerocross\bldczcapplication.c, main program<br />

• ...\dsp56807evm\nos\applications\bldc_zerocross\bldczcdefines.h, main program<br />

definitions<br />

• ...\dsp56807evm\nos\applications\bldc_zerocross\bldc_zerocross.mcp,m application<br />

project file<br />

12-26 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

BLDC Sensorless with Back-EMF Zero Crossing Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

• ...\dsp56807evm\nos\applications\bldc_zerocross\configextram\appconfig.c,<br />

application configuration file for external RAM<br />

• ...\dsp56807evm\nos\applications\bldc_zerocross\configflash\appconfig.c, application<br />

configuration file for Flash<br />

• ...\dsp56807evm\nos\applications\bldc_zerocross\configextram\appconfig.h,<br />

application configuration header file for external RAM<br />

• ...\dsp56807evm\nos\applications\bldc_zerocross\configflash\appconfig.h, application<br />

configuration header file for Flash<br />

• ...\dsp56807evm\nos\applications\bldc_zerocross\configextram\linker.cmd, linker<br />

command file for external RAM<br />

• ...\dsp56807evm\nos\applications\bldc_zerocross\configflash\linker.cmd, linker<br />

command file for Flash<br />

• ...\dsp56807evm\nos\applications\bldc_zerocross\configflash\flash.cfg, configuration<br />

file for Flash<br />

• ...\dsp56807evm\nos\applications\bldc_zerocross\pcmaster\bldc_demo.pmp,<br />

PCMaster file<br />

These files are located in the <strong>SDK</strong> installation directory.<br />

12.5.2 Specifications<br />

This application performs a sensorless control of the BLDC motor on the DSP56F807 processor<br />

with closed loop speed control. In the application, the PWM module is set to independent mode<br />

with a 14.4kHz switching frequency. The state of the zero crossing signals are read from the Input<br />

Monitor Register of the Quadrature Encoder. The masking of PWM channels is controlled by the<br />

PWM Channel Control Register. The content of this register is derived from Back-EMF zero<br />

crossing signals.<br />

The application can run on:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

• External RAM or Flash<br />

• EVM Motor Board, 3-Phase AC/BLDC High-Voltage Power Stage or 3-Phase AC/BLDC<br />

Low-Voltage Power Stage<br />

• Powered by 115 or 230V AC Power Supply<br />

The correct power stage is identified automatically and the appropriate constants are set.<br />

The BLDC Sensorless with Back-EMF Zero Crossing Application can operate in two modes:<br />

1. Manual Operating Mode<br />

The drive is controlled by the RUN/STOP switch (S6), which enables/disables motor<br />

spinning. The required speed is set independently on the commutation by the UP (S3-IRQB)<br />

and DOWN (S2-IRQA) push buttons (see Figure 12-23). If the application runs and motor<br />

spinning is disabled, the green USER LED (LED3; see Figure 12-24) will blink. When<br />

motor spinning is enabled, the green USER LED lights. If Overcurrent or Overvoltage occur,<br />

or if the wrong pcb is identified, the internal fault logic is asserted and the application enters<br />

a fault state (indicated by the red USER LED). This state can be exited only by an application<br />

RESET. It is strongly recommended that you inspect the entire application to locate the<br />

source of the fault before starting it again.<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-27<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 12-23. RUN/STOP Switch and UP/DOWN Buttons<br />

Figure 12-24. USER and PWM LEDs<br />

12-28 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

BLDC Sensorless with Back-EMF Zero Crossing Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

2. PC master software (remote) Operating Mode<br />

The drive is controlled remotely from a PC through the SCI communication channel<br />

of the DSP device via an RS-232 physical interface. The drive is enabled by the<br />

RUN/STOP switch, which can be used to safely stop the application at any time.<br />

The following control actions are supported:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

• Start the motor (by setting the required speed on the bar graph)<br />

• Stop the motor (by setting the Zero speed on the bar graph)<br />

• Set the Required Speed of the motor<br />

PC master software displays the following information:<br />

• Required Speed of the motor<br />

• Actual Speed of the motor<br />

• DCBus voltage<br />

• DCBus current<br />

• Temperature of the power stage<br />

• Fault status (No Fault, Overvoltage, Undervoltage, Overcurrents in phases, Overcurrent in<br />

DCBus, Overheating)<br />

• Motor status - Running/Stand-by<br />

If the Fault Status is different from the No Faults of Overcurrent, Overvoltage or Undervoltage<br />

conditions, or if the wrong pcb is used, the red USER LED lights and the motor is stopped. This<br />

state can be exited by application RESET. It is strongly recommended that you inspect the entire<br />

application to locate the source of fault before starting it again.<br />

Project files for the PC master software are located in:<br />

...\nos\applications\bldc_zerocross\PC_Master\bldc_demo.pmp<br />

Start the PC master software window’s application, bldc_demo.pmp. Figure 12-25 shows the PC<br />

master software control window after this project has been launched.<br />

NOTE: If the PC master software project (.pmp file) is unable to control the application, it is<br />

possible that the wrong load map (.elf file) has been selected. PC master software uses<br />

the load map to determine addresses for global variables being monitored. Once the PC<br />

master software project has been launched, this option may be selected in the PC master<br />

software window under Project/Select Other Map FileReload.<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-29<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

12.5.3 Set-up<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 12-25. PC Master Software Control Window<br />

Figure 12-26 illustrates the hardware set-up for the BLDC Sensorless with Back-EMF Zero<br />

Crossing Application when using an EVM Motor Board.<br />

12-30 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

BLDC Sensorless with Back-EMF Zero Crossing Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

NOT NEEDED<br />

Figure 12-26. Set-up of the BLDC Sensorless with Back-EMF Zero Crossing Application EVM<br />

Motor Board<br />

For detailed information, see the DSP56F807 Evaluation Module Hardware Reference<br />

Manual. The serial cable is needed for the PC master software debugging tool only.<br />

Thanks to automatic board identification, the software can also be run on:<br />

• 3-Phase AC/BLDC Low-Voltage Power Stage; see Figure 12-27<br />

• 3-Phase AC/BLDC High-Voltage Power Stage; see Figure 12-28<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-31<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 12-27. Set-up of BLDC Sensorless with Back-EMF Zero Crossing Application Low-Voltage<br />

The correct order of phases (phase A, phase B, phase C) for the BLDC motor is:<br />

• phase A = white wire<br />

• phase B = red wire<br />

• phase C = black wire<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

When facing a motor shaft, if the phase order is: phase A, phase B, phase C, the motor shaft<br />

should rotate clockwise (i.e., positive direction, positive speed).<br />

12-32 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

BLDC Sensorless with Back-EMF Zero Crossing Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 12-28. Set-up of BLDC Sensorless with Back-EMF Zero Crossing Application High-Voltage<br />

The correct order of phases (phase A, phase B, phase C) for the BLDC motor is:<br />

• phase A = white wire<br />

• phase B = red wire<br />

• phase C = black wire<br />

When facing a motor shaft, if the phase order is: phase A, phase B, phase C, the motor shaft<br />

should rotate clockwise (i.e., positive direction, positive speed).<br />

12.5.3.1 EVM Jumper Settings<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

To execute the BLDC Sensorless with Back-EMF Zero Crossing Application, the DSP56F807<br />

board requires the strap settings shown in Figure 12-29 and Table 12-10.<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-33<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

JG15<br />

JG5<br />

2<br />

1<br />

JG7<br />

JG3<br />

3<br />

1<br />

8<br />

7<br />

3<br />

2<br />

1<br />

JG12<br />

JG14<br />

1 3<br />

4<br />

7<br />

6<br />

9 JG9<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

USER<br />

PWM<br />

J1<br />

JG15<br />

JG14<br />

1<br />

4<br />

7<br />

JG9<br />

LED3<br />

Y1<br />

J4 J5<br />

3<br />

3<br />

2<br />

2<br />

1<br />

1<br />

JG12 JG17JG16 JG13<br />

JG3 JG7<br />

JG6<br />

JG5<br />

JG1<br />

JG1<br />

JG17<br />

1<br />

3<br />

U1<br />

DSP56F807EVM<br />

S4 S5 S6<br />

GP1<br />

S1<br />

GP2<br />

S2<br />

RUN/STOP<br />

S3<br />

P1<br />

JG4 U9<br />

P3 RESET IRQA IRQB<br />

3<br />

1<br />

JG16<br />

1<br />

Figure 12-29. DSP56F807EVM Jumper Reference<br />

Table 12-10. DSP56F807EVM Jumper Settings<br />

Jumper Group Comment Connections<br />

JG1 Primary UNI-3 Phase A Overcurrent Selected for FAULTA1 2–3<br />

JG2 Secondary UNI-3 Phase A Overcurrent Selected for FAULTB1 1–2<br />

JG3 CAN termination unselected NC<br />

JG4 Enable on-board Parallel JTAG Host/Target Interface NC<br />

JG5 Use on-board EXTAL crystal input for DSP oscillator 2–3<br />

JG6 Use on-board XTAL crystal input for DSP oscillator 1–2<br />

JG7 Selects DSP’s Mode 0 operation upon exit from reset 1–2<br />

JG8 Enable on-board SRAM 1–2<br />

JG9 Enable RS-232 output NC<br />

JG10 Secondary UNI-3 3-Phase Current Sense Selected as inputs to A/D 2–3, 5–6, 8–9<br />

JG11 Secondary UNI-3 serial selected 1–2, 3–4, 5–6, 7–8<br />

JG12 Primary Encoder Input Selected 1–2, 4–5, 7–8<br />

JG13 Secondary Encoder Input Selected 2–3, 5–6, 8–9<br />

JG14 Primary UNI-3 3-Phase Current Sense Selected as inputs to A/D 1–2, 4–5, 7–8<br />

12-34 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

3<br />

S/N<br />

JG6<br />

U2<br />

3<br />

2<br />

1<br />

JG13<br />

JG8<br />

JG10<br />

3<br />

2<br />

1<br />

JG11<br />

JTAG<br />

JG4<br />

J3<br />

JG2<br />

P2<br />

J2<br />

3<br />

2<br />

1<br />

JG10<br />

JG2<br />

JG11<br />

1 2<br />

7 8<br />

JG8<br />

3<br />

1<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

BLDC Sensorless with Back-EMF Zero Crossing Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 12-10. DSP56F807EVM Jumper Settings (Continued)<br />

Jumper Group Comment Connections<br />

JG15 Primary UNI-3 serial selected 1–2, 3–4, 5–6, 7–8<br />

JG16 PD0 input selected as a high input 1–2<br />

JG17 PD1 input selected as a high input 1–2<br />

NOTE: When running the EVM target system in a stand-alone mode from Flash, the JG4<br />

jumper must be set in the 1-2 configuration to disable the command converter parallel<br />

port interface.<br />

12.5.4 Build<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

When building this application, the user can create an application that runs from internal Flash or<br />

External RAM. To select the type of application to build, open the bldc_zerocross.mcp project and<br />

select the target build type; see Figure 12-30. Selecting Build All will create all application build<br />

types. A definition of the projects associated with these target build types may be viewed under<br />

the Targets tab of the project window.<br />

Figure 12-30. Target Build Selection<br />

The project may now be built by executing the Make command, as shown in Figure 12-31. This<br />

will build and link the BLDC Sensorless with Back-EMF Zero Crossing Application and all<br />

needed Metrowerks and <strong>SDK</strong> libraries.<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-35<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

12.5.5 Execute<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 12-31. Execute Make Command<br />

To execute the BLDC Sensorless with Back-EMF Zero Crossing Application, select<br />

Project\Debug in the CodeWarrior IDE, followed by the Project\Run command. For more help<br />

with these commands, refer to the CodeWarrior tutorial documentation in the following file<br />

located in the CodeWarrior installation directory:<br />

\CodeWarrior Documentation\PDF\Targeting_DSP56800.pdf<br />

If the Flash target is selected, CodeWarrior will automatically program the DSP’s internal Flash<br />

with the executable generated during Build. If the External RAM target is selected, the executable<br />

will be loaded to off-chip RAM.<br />

Once Flash has been programmed with the executable, the EVM target system may be run in a<br />

stand-alone mode from Flash. To do this, set the JG4 jumper in the 1-2 configuration to disable<br />

the parallel port, and press the RESET button.<br />

Once the application is running, move the RUN/STOP switch to the RUN position, and set the<br />

required speed with the UP/DOWN push buttons. Pressing the UP/DOWN buttons should<br />

incrementally increase the motor speed until it reaches maximum speed. If successful, the BLDC<br />

motor will be spinning.<br />

NOTE: If the RUN/STOP switch is set to the RUN position when the application starts, toggle<br />

the RUN/STOP switch between the STOP and RUN positions to enable motor<br />

spinning. This is a protection feature that prevents the motor from starting when the<br />

application is executed from CodeWarrior.<br />

You should also see a lighted green USER LED which indicates that the application is running. If<br />

the application is stopped, the green USER LED will blink at a frequency of 2Hz. If an<br />

Undervoltage fault occurs, the USER LED will blink at a frequency of 8Hz.<br />

12-36 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

BLDC Sensorless with Back-EMF Zero Crossing Using AD Converter Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

12.6 BLDC Sensorless with Back-EMF Zero<br />

Crossing Using AD Converter Application<br />

This application exercises sensorless control of the BLDC motor on the DSP56F807EVM board<br />

and the EVM Motor Kit using the ADC module to check for phase zero crossing.<br />

12.6.1 Files<br />

The BLDC Sensorless with Back-EMF Zero Crossing using AD Converter Application is<br />

composed of the following files:<br />

• ...\dsp56807evm\nos\applications\bldc_adc_zerocross\bldcadczcapplication.c, main<br />

program<br />

• ...\dsp56807evm\nos\applications\bldc_adc_zerocross\bldcadczcdefines.h, main<br />

program definitions<br />

• ...\dsp56807evm\nos\applications\bldc_adc_zerocross\bldc_adc_zerocross.mcp,<br />

application project file<br />

• ...\dsp56807evm\nos\applications\bldc_adc_zerocross\ConfigExtRam\appconfig.c,<br />

application configuration file for external RAM<br />

• ...\dsp56807evm\nos\applications\bldc_adc_zerocross\ConfigFlash\appconfig.c,<br />

application configuration file for Flash<br />

• ...\dsp56807evm\nos\applications\bldc_adc_zerocross\ConfigExtRam\appconfig.h,<br />

application configuration header file for external RAM<br />

• ...\dsp56807evm\nos\applications\bldc_adc_zerocross\ConfigFlash\appconfig.h,<br />

application configuration header file for Flash<br />

• ...\dsp56807evm\nos\applications\bldc_adc_zerocross\ConfigExtRam\linker.cmd,<br />

linker command file for external RAM<br />

• ...\dsp56807evm\nos\applications\bldc_adc_zerocross\ConfigFlash\linker.cmd, linker<br />

command file for Flash<br />

• ...\dsp56807evm\nos\applications\bldc_adc_zerocross\ConfigFlash\flash.cfg<br />

configuration file for Flash<br />

• ...\dsp56807evm\nos\applications\bldc_adc_zerocross\pcmaster\bldc_demo.pmp,<br />

PCMaster file<br />

These files are located in the <strong>SDK</strong> installation directory.<br />

12.6.2 Specifications<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

This application performs sensorless control of the BLDC motor on the DSP56F807 processor<br />

with closed loop speed control. In the application, the PWM module is set to independent mode<br />

with a 10kHz switching frequency. The state of the zero crossing signals is read from the Input<br />

Monitor Register of the Quadrature Encoder. The masking of PWM channels is controlled by the<br />

PWM Channel Control Register. The content of this register is derived from the Back-EMF zero<br />

crossing signals.<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-37<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The application can run on:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

• External RAM or Flash<br />

• EVM Motor Board; 3-Phase AC/BLDC High-Voltage Power Stage; or 3-Phase AC/BLDC<br />

Low-Voltage Power Stage<br />

• 115 or 230V AC Power Supply<br />

The correct power stage is identified automatically and the appropriate constants are set.<br />

The BLDC Sensorless with Back-EMF Zero Crossing using AD Converter Application can<br />

operate in two modes:<br />

1. Manual Operating Mode<br />

The drive is controlled by the RUN/STOP switch (S6), which enables/disables motor<br />

spinning. The required speed is set independently on the commutation by the UP (S3-IRQB)<br />

and DOWN (S2-IRQA) push buttons (see Figure 12-32). If the application runs and motor<br />

spinning is disabled, the green USER LED (LED3; refer to Figure 12-33) will blink. When<br />

motor spinning is enabled, the green USER LED lights. If Overcurrent or Overvoltage occur,<br />

or if the wrong pcb is identified, the internal fault logic is asserted and the application enters<br />

a fault state (indicated by the red USER LED). This state can be exited only by an application<br />

RESET. It is strongly recommended that you inspect the entire application to locate the<br />

source of the fault before starting it again.<br />

Figure 12-32. RUN/STOP Switch and UP/DOWN Buttons<br />

12-38 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

BLDC Sensorless with Back-EMF Zero Crossing Using AD Converter Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 12-33. USER and PWM LEDs<br />

2. PC master software (remote) Operating Mode<br />

The drive is controlled remotely from a PC through the SCI communication channel<br />

of the DSP device via an RS-232 physical interface. The drive is enabled by the<br />

RUN/STOP switch, which can be used to safely stop the application at any time.<br />

The following control actions are supported:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

• Start the motor (by setting the required speed on the bar graph)<br />

• Stop the motor (by setting the Zero speed on the bar graph)<br />

• Set the Required Speed of the motor<br />

PC master software displays the following information:<br />

• Required Speed of the motor<br />

• Actual Speed of the motor<br />

• DCBus voltage<br />

• DCBus current<br />

• Temperature of power stage<br />

• Fault status (No Fault, Overvoltage, Undervoltage, Overcurrents in phases, Overcurrent in<br />

DCBus, Overheating)<br />

• Motor status - Running/Stand-by<br />

If the Fault Status is different from the No Fault of Overcurrent, Overvoltage or Undervoltage<br />

conditions, or if the wrong pcb is used, the red USER LED lights and the motor is stopped. This<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-39<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

state can be exited by an application RESET. It is strongly recommended that you inspect the<br />

entire application to locate the source of the fault before starting it again.<br />

Project files for the PC master software are located in:<br />

...\nos\applications\bldc_adc_zerocross\PC_Master\bldc_demo.pmp<br />

Start the PC master software window’s application, bldc_demo.pmp. Figure 12-34 shows the PC<br />

master software control window after this project has been launched.<br />

NOTE: If the PC master software project (.pmp file) is unable to control the application, it is<br />

possible that the wrong load map (.elf file) has been selected. PC master software uses<br />

the load map to determine addresses for global variables being monitored. Once the PC<br />

master software project has been launched, this option may be selected in the PC master<br />

software window under Project/Select Other Map FileReload.<br />

12.6.3 Set-up<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 12-34. PC Master Software Control Window<br />

Figure 12-35 illustrates the hardware set-up for the BLDC Sensorless with Back-EMF Zero<br />

Crossing using AD Converter Application when using an EVM Motor Board.<br />

12-40 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

BLDC Sensorless with Back-EMF Zero Crossing Using AD Converter Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

NOT NEEDED<br />

Figure 12-35. Set-up of the BLDC Sensorless with Back-EMF Zero Crossing using AD Converter<br />

Application EVM Motor Board<br />

For detailed information, see the DSP56F807 Evaluation Module Hardware Reference<br />

Manual. The serial cable is needed for the PC master software debugging tool only.<br />

Thanks to automatic board identification, the software can also be run on:<br />

• 3-Phase AC/BLDC Low-Voltage Power Stage; see Figure 12-36<br />

• 3-Phase AC/BLDC High-Voltage Power Stage; see Figure 12-37<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-41<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 12-36. Set-up of the BLDC Sensorless with Back-EMF Zero Crossing using AD Converter<br />

Application Low-Voltage<br />

The correct order of phases (phase A, phase B, phase C) for the BLDC motor is:<br />

• phase A = white wire<br />

• phase B = red wire<br />

• phase C = black wire<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

When facing a motor shaft, if the phase order is: phase A, phase B, phase C, the motor shaft<br />

should rotate clockwise (i.e., positive direction, positive speed).<br />

12-42 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

BLDC Sensorless with Back-EMF Zero Crossing Using AD Converter Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 12-37. Set-up of the BLDC Sensorless with Back-EMF Zero Crossing using AD Converter<br />

Application High-Voltage<br />

The correct order of phases (phase A, phase B, phase C) for the BLDC motor is:<br />

• phase A = white wire<br />

• phase B = red wire<br />

• phase C = black wire<br />

When facing a motor shaft, if the phase order is: phase A, phase B, phase C, the motor shaft<br />

should rotate clockwise (i.e., positive direction, positive speed).<br />

12.6.3.1 EVM Jumper Settings<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

To execute the BLDC Sensorless with Back-EMF Zero Crossing using AD Converter<br />

Application, the DSP56F807 board requires the strap settings shown in Figure 12-38 and<br />

Figure 12-11.<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-43<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

JG15<br />

JG5<br />

2<br />

1<br />

JG7<br />

JG3<br />

3<br />

1<br />

8<br />

7<br />

3<br />

2<br />

1<br />

JG12<br />

JG14<br />

1 3<br />

4<br />

7<br />

6<br />

9 JG9<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

USER<br />

PWM<br />

J1<br />

JG15<br />

JG14<br />

1<br />

4<br />

7<br />

JG9<br />

LED3<br />

Y1<br />

JG1<br />

JG17<br />

1<br />

J4 J5<br />

3<br />

3<br />

2<br />

2<br />

1<br />

1<br />

JG12 JG17JG16<br />

JG13<br />

JG3 JG7<br />

JG6<br />

JG5<br />

3<br />

U1<br />

JG1<br />

DSP56F807EVM<br />

S/N<br />

S4 S5 S6<br />

GP1 GP2 RUN/STOP<br />

JG4 U9<br />

S1 S2 S3<br />

P1<br />

P3 RESET IRQA IRQB<br />

3<br />

1<br />

JG16<br />

1<br />

Figure 12-38. DSP56F807EVM Jumper Reference<br />

Table 12-11. DSP56F807EVM Jumper Settings<br />

Jumper Group Comment Connections<br />

JG1 Primary UNI-3 DCBus Overcurrent Selected for FAULTA1 2–3<br />

JG2 Secondary UNI-3 Phase A Overcurrent Selected for FAULTB1 1–2<br />

JG3 CAN termination unselected NC<br />

JG4 Enable on-board Parallel JTAG Host/Target Interface NC<br />

JG5 Use on-board EXTAL crystal input for DSP oscillator 2–3<br />

JG6 Use on-board XTAL crystal input for DSP oscillator 1–2<br />

JG7 Selects DSP’s Mode 0 operation upon exit from reset 1–2<br />

JG8 Enable on-board SRAM 1–2<br />

JG9 Enable RS-232 output NC<br />

JG10 Secondary UNI-3 3-Phase Current Sense Selected as inputs to A/D 2–3, 5–6, 8–9<br />

JG11 Secondary UNI-3 serial selected 1–2, 3–4, 5–6, 7–8<br />

JG12 Primary Encoder Input SelectedZero Crossing signals 1–2, 4–5, 7–8<br />

JG13 Secondary Encoder Input Selected 2–3, 5–6, 8–9<br />

JG14 Primary UNI-3 3-Phase Current Sense Selected as inputs to A/D 1–2, 4–5, 7–8<br />

JG15 Primary UNI-3 serial selected 1–2, 3–4, 5–6, 7–8<br />

JG16 PD0 input selected as a high input 1–2<br />

JG17 PD1 input selected as a high input 1–2<br />

12-44 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

3<br />

JG6<br />

U2<br />

3<br />

2<br />

1<br />

JG13<br />

JG8<br />

JG10<br />

3<br />

2<br />

1<br />

JG11<br />

JTAG<br />

JG4<br />

JG2<br />

J3<br />

P2<br />

J2<br />

3<br />

2<br />

1<br />

JG10<br />

JG2<br />

JG11<br />

1 2<br />

7 8<br />

JG8<br />

3<br />

1<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

BLDC Sensorless with Back-EMF Zero Crossing Using AD Converter Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

NOTE: When running the EVM target system in a stand-alone mode from Flash, the JG4<br />

jumper must be set in the 1-2 configuration to disable the command converter parallel<br />

port interface.<br />

12.6.4 Build<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

When building this application, the user can create an application that runs from internal Flash or<br />

External RAM. To select the type of application to build, open the bldc_adc_zerocross.mcp<br />

project and select the target build type; see Figure 12-39. Selecting Build All will create all<br />

application build types. A definition of the projects associated with these target build types may<br />

be viewed under the Targets tab of the project window.<br />

Figure 12-39. Target Build Selection<br />

The project may now be built by executing the Make command, as shown in Figure 12-40. This<br />

will build and link the BLDC Sensorless with Back-EMF Zero Crossing using AD Converter<br />

Application and all needed Metrowerks and <strong>SDK</strong> libraries.<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-45<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

12.6.5 Execute<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 12-40. Execute Make Command<br />

To execute the BLDC Sensorless with Back-EMF Zero Crossing using AD Converter<br />

Application, select Project\Debug in the CodeWarrior IDE, followed by the Project\Run<br />

command. For more help with these commands, refer to the CodeWarrior tutorial documentation<br />

in the following file located in the CodeWarrior installation directory:<br />

\CodeWarrior Documentation\PDF\Targeting_DSP56800.pdf<br />

If the Flash target is selected, CodeWarrior will automatically program the DSP’s internal Flash<br />

with the executable generated during Build. If the External RAM target is selected, the executable<br />

will be loaded to off-chip RAM.<br />

Once Flash has been programmed with the executable, the EVM target system may be run in a<br />

stand-alone mode from Flash. To do this, set the JG4 jumper in the 1-2 configuration to disable<br />

the parallel port, and press the RESET button.<br />

Once the application is running, move the RUN/STOP switch to the RUN position, and set the<br />

required speed with the UP/DOWN push buttons. Pressing the UP/DOWN buttons should<br />

incrementally increase the motor speed until it reaches maximum speed. If successful, the BLDC<br />

motor will be spinning.<br />

NOTE: If the RUN/STOP switch is set to the RUN position when the application starts, toggle<br />

the RUN/STOP switch between the STOP and RUN positions to enable motor<br />

spinning. This is a protection feature that prevents the motor from starting when the<br />

application is executed from CodeWarrior.<br />

You should also see a lighted green USER LED which indicates that the application is running. If<br />

the application is stopped, the green USER LED will blink at a 2Hz frequency. If an Undervoltage<br />

fault occurs, the USER LED will blink at a frequency of 8Hz.<br />

12-46 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3-Phase PM Synchronous Motor Vector Control<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

12.7 3-Phase PM Synchronous Motor Vector Control<br />

This application exercises vector control of the 3-Phase Permanent Magnet (PM) synchronous<br />

motor on the DSP56F807EVM board and 3-phase AC/BLDC High-Voltage power stage.<br />

12.7.1 Files<br />

The 3-Phase PM synchronous Motor Control application is composed of the following files:<br />

• ...\dsp56807evm\nos\applications\3ph_PMSM_VectorControl\3ph_PMSM_VectorControl.c,<br />

main program<br />

• ...\dsp56807evm\nos\applications\3ph_PMSM_VectorControl\3ph_PMSM_VectorControl.h,<br />

main header file of the program used for storing application references and defined<br />

constants that are required by the 3ph_PMSM_VectorControl.c file.<br />

• ...\dsp56807evm\nos\applications\3ph_PMSM_VectorControl\appconst.c, application<br />

constants for Data flash<br />

• ...\dsp56807evm\nos\applications\3ph_PMSM_VectorControl\appconst.h, header file to<br />

store the external references and defined constants related to the appconst.c file<br />

• ...\dsp56807evm\nos\applications\3ph_PMSM_VectorControl\3ph_PMSM_VectorControl.mcp,<br />

application project file<br />

• ...\dsp56807evm\nos\applications\3ph_PMSM_VectorControl\configextram\appconfig.c,<br />

application configuration file for external RAM<br />

• ...\dsp56807evm\nos\applications\3ph_PMSM_VectorControl\configflash\appconfig.c,<br />

application configuration file for Flash<br />

• ...\dsp56807evm\nos\applications\3ph_PMSM_VectorControl\configextram\appconfig.h,<br />

application configuration header file for external RAM<br />

• ...\dsp56807evm\nos\applications\3ph_PMSM_VectorControl\configflash\appconfig.h,<br />

application configuration header file for Flash<br />

• ...\dsp56807evm\nos\applications\3ph_PMSM_VectorControl\configextram\linker.cmd,<br />

linker command file for external RAM<br />

• ...\dsp56807evm\nos\applications\3ph_PMSM_VectorControl\configflash\linker.cmd, linker<br />

command file for Flash<br />

• ...\dsp56807evm\nos\applications\3ph_PMSM_VectorControl\configflash\flash.cfg,<br />

configuration file for Flash<br />

These files are located in the <strong>SDK</strong> installation directory.<br />

12.7.2 Specifications<br />

The 3-Phase PM Synchronous Motor Vector Control Application demonstrates the Permanent<br />

Magnet Synchronous Motor Control application using field oriented theory on the DSP56F807<br />

processor.<br />

System Outline<br />

The application has the following specifications:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

• Vector control technique used for Permanent Magnet (PM) synchronous motor control<br />

• Speed control loop<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-47<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

• Targeted for DSP56F807EVM<br />

• Running on 3-phase Permanent Magnet (PM) synchronous motor control development<br />

platform at variable line voltage 115V AC and 230V AC (range -15% to +10%)<br />

• Motor mode<br />

• Generator mode<br />

• DCBus brake<br />

• Minimum speed 50 rpm<br />

• Maximum speed 3000 rpm at input power line 230V AC<br />

• Maximum speed 1500 rpm at input power line 115V AC<br />

• Power stage and optoisolation board identification<br />

• Faults protection<br />

• Manual interface (RUN/STOP switch; UP/DOWN push buttons control; LED indication)<br />

• PC master software remote control interface (START MOTOR/STOP MOTOR push<br />

buttons; speed set-up)<br />

• PC master software remote monitor<br />

• PC master software monitor interface (required speed; actual motor speed; PC master<br />

software mode; START MOTOR/STOP MOTOR controls; drive fault status; DCBus<br />

voltage level; identified power stage boards; drive status; mains detection)<br />

• PC master software speed scope (observes actual and desired speed)<br />

Application Description<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The vector control algorithm is calculated on the Motorola DSP56F807. The algorithm generates<br />

the 3-phase PWM signals for a Permanent Magnet (PM) synchronous motor inverter according to<br />

the user-required inputs, measured and calculated signals.<br />

The concept of the PMSM drive incorporates the following hardware components:<br />

• BLDC motor-brake set<br />

• 3-phase AC/BLDC high voltage power stage<br />

• DSP56F807EVM boards<br />

• ECOPTINL - In-line optoisolation box, which is connected between the host computer and<br />

the DSP56F807EVM<br />

The BLDC motor-brake set incorporates a 3-phase BLDC motor and attached BLDC motor<br />

brake. The BLDC motor has six poles. The incremental position sensor (encoder) is coupled on<br />

the motor shaft and position Hall Sensors are mounted between the motor and brake. They allow<br />

position sensing if required by the control algorithm. The detailed motor--brake specifications are<br />

listed in Table 12-12.<br />

12-48 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3-Phase PM Synchronous Motor Vector Control<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The following software tools are needed for compiling, debugging, loading to the EVM, remote<br />

control and monitoring:<br />

• Metrowerks CodeWarrior 4.0<br />

• PC master software<br />

• <strong>SDK</strong> 2.4 or later<br />

The drive can be controlled in two different operating modes:<br />

• In manual operating mode, the required speed is set by UP/DOWN push buttons and the<br />

drive is started and stopped by the RUN/STOP switch on the EVM board<br />

• In PC master software operating mode, the required speed is set by the PC master<br />

software active bar graph and the drive is started and stopped by the START MOTOR and<br />

STOP MOTOR controls<br />

Measured quantities:<br />

• DCBus voltage<br />

• Phase currents (phase A, phase B, phase C)<br />

• Power module temperature<br />

• Rotor speed<br />

The faults used for drive protection:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Table 12-12. Motor--Brake Specifications<br />

Motor Characteristics Motor Type 6 poles, 3-phase, star connected,<br />

BLDC motor<br />

Speed Range 2500 rpm (at 310V)<br />

Max. Electrical Power 150 W<br />

Phase Voltage 3*220V<br />

Phase Current 0.55A<br />

Drive Characteristics Speed Range < 2500 rpm<br />

Input Voltage 310V DC<br />

Max DCBus Voltage 380 V<br />

Control Algorithm Speed Closed Loop Control<br />

Optoisolation Required<br />

Motor Characteristics Motor Type 6 poles, 3-phase, star connected,<br />

BLDC motor<br />

Speed Range 2500 rpm (at 310V)<br />

Max. Electrical Power 150 W<br />

• Overvoltage (PC master software error message = Overvoltage fault)<br />

• Undervoltage (PC master software error message = Undervoltage fault)<br />

• Overcurrent (PC master software error message = Overcurrent fault)<br />

• Overheating (PC master software error message = Overheating fault)<br />

• Wrong-hardware (PC master software error message = Wrong HW used)<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-49<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

States of the application state machine; see Table 12-13:<br />

• INIT - application initialization; operating mode changing<br />

• STOP - PWM outputs disabled; operating mode changing<br />

• RUN - PWM outputs enabled; motor running<br />

• FAULT - PWM outputs disabled; waiting for manual fault acknowledgement<br />

Control Process<br />

After RESET, the drive enters the INIT state in manual operation mode.When the RUN/STOP<br />

switch is detected in the STOP position and there are no faults pending, the STOP application<br />

state is entered. Otherwise, the drive waits in the INIT state or if a fault occurs, the drive goes to<br />

the FAULT state. In the INIT and STOP states, the operation mode can be changed from PC<br />

master software. In the manual operational mode, the application is operated by the RUN/STOP<br />

switch and UP/DOWN buttons; in the PC master software remote mode, the application is<br />

operated remotely by the PC master software.<br />

When the Start command is accepted (using RUN/STOP Switch or the PC master software<br />

command), the rotor position is aligned to a predefined position in order to obtain a known rotor<br />

position. The rotor alignment is done at the first Start command only. The required speed is then<br />

calculated according to the UP/DOWN push buttons in manual mode or the PC master software<br />

commands in PC master software remote mode. The required speed goes through an<br />

acceleration/deceleration ramp and as reference command is put to speed controller. The<br />

comparison between the actual speed command and the measured speed generates a speed error.<br />

Based on the error, the speed controller generates a current Is_qReq, which corresponds to torque.<br />

A second part of the stator current Is_dReq, which correspond to flux, is given by the Field<br />

Weakening Controller. Simultaneously, the stator curents Is_a, Is_b and Is_c are measured and<br />

transformed from instantaneous values to the stationary reference frame α, β and consecutively to<br />

the rotary reference frame d-q (Clarke-Park transformation). Based on the errors between required<br />

and actual currents in the rotary reference frame, the current controllers generate output voltages<br />

Us_q and Us_d (in the rotary reference frame d-q). The voltages Us_q and Us_d are transformed<br />

back to the stationary reference frame α, β and, after DCBus ripple elimination, are recalculated<br />

to the 3-phase voltage system which is applied on the motor.<br />

Drive Protection<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The DCBus voltage, DCBus current and power stage temperature are measured during the control<br />

process. They protect the drive from Overvoltage, Undervoltage, Overcurrent and Overheating.<br />

The Undervoltage and Overheating protection is performed by software, while the Overcurrent<br />

and Overvoltage fault signal utilizes a fault input of the DSP. The power stage is identified using<br />

board identification. If the correct power stage is not identified, the fault "Wrong Power Stage"<br />

disables the drive operation. The line voltage is measured during application initialization.<br />

According to the detected level, the 115VAC or 230VAC mains is set.<br />

If any of the above-mentioned faults occur, the motor control PWM outputs are disabled in order<br />

to protect the drive, and the application enters the FAULT state. The FAULT state can be left only<br />

when the fault conditions disappear and the RUN/STOP switch is moved to the STOP position in<br />

manual mode; in PCMaster remote mode, by the PCMaster).<br />

12-50 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The application can run on:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

3-Phase PM Synchronous Motor Vector Control<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

• External RAM or Flash<br />

• 3-Phase AC/BLDC High-Voltage Power Stage powered by 115V AC or 230V AC<br />

• Manual or PC master software Operating Mode<br />

The correct power stage and voltage level is identified automatically and the appropriate<br />

constants are set.<br />

The 3-phase PM synchronous motor control application can operate in two modes:<br />

1. Manual Operating Mode<br />

The drive is controlled by the RUN/STOP switch. The motor speed is set by the UP and<br />

DOWN push buttons (see Figure 12-41). The actual state of the application is indicated by<br />

the user LEDs (see Figure 12-42). If the application runs and motor spinning is disabled (i.e.,<br />

the system is ready), the GREEN user LED will flash at a frequency of 2Hz. When motor<br />

spinning is enabled, the GREEN user LED will be On. If a fault occurs on the power stage,<br />

the GREEN user LED will flash at a frequency of 8Hz. The actual state of the PWM outputs<br />

are indicated by PWM output LEDs.<br />

Figure 12-41. RUN/STOP Switch and UP/DOWN Buttons<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-51<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 12-42. USER and PWM LEDs<br />

Table 12-13. Application States<br />

Application State Motor State Green LED State<br />

INIT Stopped Blinking at a frequency of 2Hz (slow)<br />

STOP Stopped Blinking at a frequency of 2Hz (slow)<br />

RUN Spinning On<br />

FAULT Stopped Blinking at a frequency of 8Hz (fast)<br />

2. PC master software (Remote) Operating Mode<br />

The drive is controlled remotely from a PC through the SCI communication channel<br />

of the DSP device via an RS-232 physical interface. The PC master software control<br />

can be taken over only if the RUN/STOP switch is in STOP position, when the push<br />

buttons and RUN/STOP switch have no effect on the application control.<br />

The following PC master software control actions are supported:<br />

• Set PC master software Mode of the motor control system<br />

• Set Manual Mode of the motor control system<br />

• Start the motor<br />

• Stop the motor<br />

• Set the Required Speed of the motor<br />

12-52 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

3-Phase PM Synchronous Motor Vector Control<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

PC master software displays the following information:<br />

• Required Speed of the motor<br />

• Actual Speed of the motor<br />

• Application status - Init/Stop/Run/Fault<br />

• DCBus voltage level<br />

• Identified line voltage<br />

• Fault Status - No_Fault/Overvoltage/Overcurrent/Undervoltage/Overheating<br />

• Identified Power Stage<br />

Project files for the PC master software are located in:<br />

...\nos\applications\3ph_PMSM_VectorControl\PC_Master\ 3ph_PMSM_VectorControl.pmp<br />

Start the PC master software window’s application, 3ph_PMSM_VectorControl.pmp. Figure 12-43<br />

shows the PC master software Control Window after this project has been launched.<br />

Note: If the PC master software project (.pmp file) is unable to control the application, it is<br />

possible that the wrong load map (.elf file) has been selected. PC master software uses<br />

the load map to determine addresses for global variables being monitored. Once the<br />

PC master software project has been launched, this option may be selected in the PC<br />

master software window under Project/Select Other Map File.<br />

Figure 12-43. PC Master Software Control Window<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-53<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

12.7.3 Set-up<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 12-44 illustrates the hardware set-up for the 3-phase PM Synchronous Motor Control<br />

application. The EVM board, power stage and motor are mounted into a suitcase for<br />

demonstration purposes.<br />

WARNING:<br />

Danger, high-voltage--risk of electric shock!<br />

The application PCB modules and serial interface (connector,<br />

cable) are not electrically isolated from the mains voltage--they<br />

are live.<br />

Use the In-line Optoisolation Box (ECOPTINL) between the<br />

PC and DSP56807 EVM as protection from dangerous voltage<br />

on the PC-user side, and to prevent damage to the PC and other<br />

hardware.<br />

Do not touch any part of the EVM or the serial cable between<br />

the EVM and the In-line Optoisolation Box unless you are<br />

using an insulation transformer. The application is designed to<br />

be fully controllable only from PC master software.<br />

To avoid inadvertently touching live parts, use plastic covers.<br />

In the rest of this application, the description supposes use of the insulation transformer.<br />

12-54 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3-Phase PM Synchronous Motor Vector Control<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 12-44. Set-up of the 3-phase PM Synchronous Motor Control Application<br />

The correct order of phases (phase A, phase B, phase C) for the PM Synchronous motor is:<br />

• phase A = white wire<br />

• phase B = red wire<br />

• phase C = black wire<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

When facing a motor shaft, if the phase order is: phase A, phase B, phase C, the motor shaft<br />

should rotate clockwise (i.e., positive direction, positive speed).<br />

For detailed information, see the DSP56F807 Evaluation Module Hardware Reference<br />

Manual. The serial cable is needed for the PC master software debugging/control.<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-55<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

12.7.3.1 PM Synchronous Motor versus BLDC Motor<br />

The application software is targeted for a PM Synchronous motor with sine-wave Back-EMF<br />

shape. In this particular demo application, a BLDC motor is used instead, due to the availability of<br />

the BLDC motor--Brake SM40V+SG40N, supplied as ECMTRHIVBLDC. Although the<br />

Back-EMF shape of this motor is not ideally sine-wave, it can be controlled by the application<br />

software. The drive parameters will be improved when a PMSM motor with an exact sine-wave<br />

Back-EMF shape is used.<br />

12.7.3.2 EVM Jumper Settings<br />

To execute the 3-Phase PM Synchronous Motor Vector Control application, the DSP56F807<br />

board requires the strap settings shown in Figure 12-45 and Table 12-14.<br />

JG15<br />

JG5<br />

2<br />

1<br />

JG7<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

JG3<br />

3<br />

1<br />

8<br />

7<br />

3<br />

2<br />

1<br />

JG12<br />

JG14<br />

1 3<br />

4<br />

7<br />

6<br />

9 JG9<br />

USER<br />

PWM<br />

J1<br />

JG15<br />

JG14<br />

1<br />

4<br />

7<br />

JG9<br />

LED3<br />

Y1<br />

JG1<br />

JG17<br />

1<br />

J4 J5<br />

3<br />

3<br />

2<br />

2<br />

1<br />

1<br />

JG12 JG17JG16 JG13<br />

JG3 JG7<br />

JG6<br />

JG5<br />

3<br />

GP1 GP2 RUN/STOP<br />

JG4 U9<br />

S1 S2 S3<br />

P1<br />

P3 RESET IRQA IRQB<br />

Figure 12-45. DSP56F807EVM Jumper Reference<br />

Table 12-14. DSP56F807EVM Jumper Settings<br />

Jumper Group Comment Connections<br />

U1<br />

DSP56F807EVM<br />

JG1<br />

S4 S5 S6<br />

3<br />

1<br />

JG16<br />

1<br />

JG1 Primary UNI-3 DCBus Overcurrent Selected for FAULTA1 2-3<br />

JG2 Secondary UNI-3 Phase A Overcurrent Selected for FAULTB1 1–2<br />

JG3 CAN termination unselected NC<br />

JG4 Enable on-board Parallel JTAG Host/Target Interface 1-2<br />

JG5 Use on-board EXTAL crystal input for DSP oscillator 2–3<br />

JG6 Use on-board XTAL crystal input for DSP oscillator 1–2<br />

JG7 Selects DSP’s Mode 0 operation upon exit from reset 1–2<br />

JG8 Enable on-board SRAM 1–2<br />

12-56 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

3<br />

S/N<br />

JG6<br />

3<br />

2<br />

1<br />

JG13<br />

JG8<br />

U2<br />

JG10<br />

3<br />

2<br />

1<br />

JG11<br />

JTAG<br />

JG4<br />

JG2<br />

J3<br />

P2<br />

J2<br />

3<br />

2<br />

1<br />

JG10<br />

JG2<br />

JG11<br />

1 2<br />

7 8<br />

JG8<br />

3<br />

1<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3-Phase PM Synchronous Motor Vector Control<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 12-14. DSP56F807EVM Jumper Settings<br />

Jumper Group Comment Connections<br />

JG9 Enable RS-232 output NC<br />

JG10 Secondary UNI-3 3-Phase Current Sense Selected as inputs to A/D 2–3, 5–6, 8–9<br />

JG11 Secondary UNI-3 serial selected 1–2, 3–4, 5–6, 7–8<br />

JG12 Primary Encoder Input Selected 2–3, 5–6, 8–9<br />

JG13 Secondary Encoder Input Selected 2–3, 5–6, 8–9<br />

JG14 Primary UNI-3 3-Phase Current Sense Selected as inputs to A/D 2–3, 5–6, 8–9<br />

JG15 Primary UNI-3 serial selected 1–2, 3–4, 5–6, 7–8<br />

JG16 PD0 input selected as a high input 1–2<br />

JG17 PD1 input selected as a high input 1–2<br />

Note: When running the EVM target system in a stand-alone mode from Flash, the JG4<br />

jumper must be set in the 1-2 configuration to disable the command converter parallel<br />

port interface. For this application this is set as short-connected permanently.<br />

12.7.4 Build<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

When building this application, the user can create an application that runs from internal Flash or<br />

External RAM. To select the type of application to build, open the<br />

3ph_PMSM_VectorControl.mcp project and select the target build type; see Figure 12-46.<br />

Selecting Build All will build all application build types. A definition of the projects associated<br />

with these target build types may be viewed under the Targets tab of the project window.<br />

Figure 12-46. Target Build Selection<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-57<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

To make this application, open the 3ph_PMSM_VectorControl.mcp project file and execute the<br />

Make command, shown in Figure 12-47. This will build and link the 3-phase PM Synchronous<br />

Motor Control application and all needed Metrowerks and <strong>SDK</strong> libraries<br />

12.7.5 Execute<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 12-47. Execute Make Command<br />

To execute the 3-phase PM Synchronous Motor Control application, choose the Program/Debug<br />

command in the CodeWarrior IDE, followed by the Run command. For more help with these<br />

commands, refer to the CodeWarrior tutorial documentation in the following file located in the<br />

CodeWarrior installation directory:<br />

\CodeWarrior Documentation\PDF\Targeting_DSP56800.pdf<br />

If the Flash target is selected, CodeWarrior will automatically program the DSP’s internal Flash<br />

with the executable generated during Build. If the External RAM target is selected, the executable<br />

will be loaded to off-chip RAM.<br />

Once Flash has been programmed with the executable, the EVM target system may be run in a<br />

stand-alone mode from Flash. When loading is finished, the JG7 jumper must be connected to<br />

boot from internal Flash and the RESET button pushed.<br />

Once the application is executing, the motor can be started. When the switch is moved from the<br />

STOP position to the RUN position, the motor will start. The speed can be changed by the<br />

UP/DOWN buttons. Pressing the UP/DOWN buttons should incrementally increase the motor<br />

speed until it reaches maximum speed.<br />

Note: If the RUN/STOP switch is set to the RUN position when the application starts, toggle<br />

the RUN/STOP switch between the STOP and RUN positions to enable motor<br />

spinning. This is a protection feature that prevents the motor from starting when the<br />

application is executed from CodeWarrior.<br />

You should also see blinking or lighted LEDs, which indicate the application’s status.<br />

12-58 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3-Phase PM Synchronous Motor Vector Control<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

12.7.6 PC Master Software<br />

To run the application from Flash or ExtRAM, perform the following steps to set the PC master<br />

software control:<br />

• The RUN/STOP switch must be in the STOP position<br />

• Check the PC master software mode on the PC master software control page<br />

• The motor can be started by pushing the Start PC master software Push Button and stopped<br />

by pushing the Stop PC master software Push Button<br />

• The speed can be set by the bar graph<br />

When the RUN/STOP switch on the EVM is in the STOP position, the manual mode can be set<br />

again by unchecking the PC master software mode on the PC master software control page<br />

The application can be monitored in PC master software during both the PC master software<br />

mode and the manual mode.<br />

PC master software displays the following information:<br />

• Operation mode<br />

• Application state<br />

• RUN/STOP switch state<br />

• Change operation mode request<br />

• PC master software Start/Stop<br />

• Mains<br />

• Fault status<br />

• Actual speed<br />

• Required speed<br />

• PC master software required speed<br />

• Power stage temperature<br />

• Identified power stage<br />

The following windows are available:<br />

Speed Scope monitors:<br />

• Required Speed<br />

• Actual Speed<br />

• Desired Id Current<br />

• Desired Iq Current<br />

Speed Recorder monitors:<br />

• Required Speed<br />

• Actual Speed<br />

• Desired Id Current<br />

• Desired Iq Current<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The Recorder can be used only when the application is running from External RAM due to<br />

limited on-chip memory. The length of the recorded window may be set in “Recorder Properties”<br />

=> bookmark “Main” => “Recorded Samples”. It is limited by the dedicated memory space in the<br />

appconfig.h file. The recorder samples are taken every 125 µsec.<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-59<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

12.8 3-Phase SR Motor Control Application<br />

This application exercises principal control of the 3-Phase Switched Reluctance (SR) motor with<br />

Hall Sensors on the DSP56F807EVM board, Optoisolation board, and 3-phase SR High-Voltage<br />

power stage.<br />

12.8.1 Files<br />

The 3-Phase SR Motor Control Application is composed of the following files:<br />

• ...\dsp56807evm\nos\applications\3ph_srm_hall_sensor_type1\3ph_srm_hall_sensor_type1.c,<br />

main program<br />

• ...\dsp56807evm\nos\applications\3ph_srm_hall_sensor_type1\3ph_srm_hall_sensor_type1.mcp<br />

application project file<br />

• ...\dsp56807evm\nos\applications\3ph_srm_hall_sensor_type1\configextram\appconfig.c,<br />

application configuration file for external RAM<br />

• ...\dsp56807evm\nos\applications\3ph_srm_hall_sensor_type1\configflash\appconfig.c,<br />

application configuration file for Flash<br />

• ...\dsp56807evm\nos\applications\3ph_srm_hall_sensor_type1\configextram\appconfig.h,<br />

application configuration header file for external RAM<br />

• ...\dsp56807evm\nos\applications\3ph_srm_hall_sensor_type1\configflash\appconfig.h,<br />

application configuration header file for Flash<br />

• ...\dsp56807evm\nos\applications\3ph_srm_hall_sensor_type1\configextram\linker.cmd,<br />

linker command file for external RAM<br />

• ...\dsp56807evm\nos\applications\3ph_srm_hall_sensor_type1\configflash\linker.cmd,<br />

linker command file for Flash<br />

• ...\dsp56807evm\nos\applications\3ph_srm_hall_sensor_type1\configflash\flash.cfg,<br />

configuration file for Flash<br />

• ...\dsp56807evm\nos\applications\3ph_srm_hall_sensor_type1\pc_master\3ph_sr_drive.pmp,<br />

PC master software file<br />

These files are located in the <strong>SDK</strong> installation directory.<br />

12.8.2 Specifications<br />

This application performs principal control of the 3-phase SR motor with Hall Sensors on the<br />

DSP56F807 processor. The control technique sets the motor speed (rpm) to the required value<br />

using the speed closed loop with Hall Position Sensors to derive the proper commutation<br />

action/moment. Protection is provided against drive faults Overcurrent, Overvoltage,<br />

Undervoltage, and Overheating.<br />

The application can run on:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

• External RAM or Flash<br />

• 3-Phase SR High-Voltage Power Stage powered by 115 or 230V AC<br />

• 3-Phase SR Low-Voltage Power Stage powered by 12V DC<br />

The correct power stage and voltage level is identified automatically and the appropriate<br />

constants are set.<br />

12-60 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

3-Phase SR Motor Control Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

This 3-phase SR motor control application can operate in two modes:<br />

1. Manual Operating Mode<br />

The drive is controlled by the RUN/STOP switch (S6). The motor speed is set by the UP<br />

(S3-IRQB) and DOWN (S2-IRQA) push buttons (see Figure 12-48). The actual state of the<br />

application is indicated by the USER LEDs, shown in Figure 12-49. If the application runs<br />

and motor spinning is disabled (i.e., the system is ready), the green USER LED will flash at<br />

a frequency of 4Hz. When motor spinning is enabled, the green USER LED will be On. If a<br />

fault occurs on the power stage, the green USER LED will blink at a frequency of 8Hz. If the<br />

wrong power board is identified, the red USER LED will blink at a frequency of 1Hz. The<br />

actual state of PWM outputs are indicated by PWM output LEDs.<br />

Figure 12-48. RUN/STOP Switch and UP/DOWN Buttons<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-61<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 12-49. USER and PWM LEDs<br />

2. PC master software (remote) Operating Mode<br />

The drive is controlled remotely from a PC through the SCI communication channel<br />

of the DSP device via an RS-232 physical interface. The drive is enabled by the<br />

RUN/STOP switch, which can be used to stop the application safely at any time.<br />

The following control actions are supported:<br />

• Set PC master software Mode of the motor control system<br />

• Set Manual Mode of the motor control system<br />

• Start the motor<br />

• Stop the motor<br />

• Set the Required Speed of the motor<br />

PC master software displays the following information:<br />

• Required Speed of the motor<br />

• Actual Speed of the motor<br />

• Motor status - Running/Stand-by<br />

• Fault Status<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

12-62 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3-Phase SR Motor Control Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Project files for the PC master software are located in:<br />

...\nos\applications\3ph_srm_hall_sensor_type1\PC_Master\3ph_sr_drive.pmp<br />

Start the PC master software window’s application, 3ph_sr_drive.pmp. Figure 12-50 illustrates the<br />

PC master software control window after this project has been launched.<br />

NOTE: If the PC master software project (.pmp file) is unable to control the application, it is<br />

possible that the wrong load map (.elf file) has been selected. PC master software uses<br />

the load map to determine addresses for global variables being monitored. Once the PC<br />

master software project has been launched, this option may be selected in the PC master<br />

software window under Project/Select Other Map FileReload.<br />

12.8.3 Set-up<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 12-50. PC Master Software Control Window<br />

Figure 12-51 and Figure 12-52 illustrate the hardware set-ups for the 3-Phase SR Motor Control<br />

Application. The Hall Sensor connector of the motor must be attached to connector J4 on the<br />

EVM Board.<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-63<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 12-51. Set-up of the 3-Phase SR Motor Control Application High-Voltage<br />

12-64 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3-Phase SR Motor Control Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 12-52. Set-up of the 3-Phase SR Motor Control Application Low-Voltage<br />

The correct order of phases (phase A, phase B, phase C) for the SR motor is:<br />

• phase A = white wire<br />

• phase B = red wire<br />

• phase C = black wire<br />

When facing a motor shaft, the motor shaft should rotate clockwise (i.e., positive direction,<br />

positive speed).<br />

For detailed information, see the DSP56F807 Evaluation Module Hardware Reference<br />

Manual. The serial cable is needed for the PC master software debugging tool only.<br />

12.8.3.1 EVM Jumper Settings<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

To execute the 3-Phase SR Motor Control Application, the DSP56F807 board requires the strap<br />

settings shown in Figure 12-53 and Table 12-15.<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-65<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

JG15<br />

JG5<br />

2<br />

1<br />

JG7<br />

JG3<br />

3<br />

1<br />

8<br />

7<br />

3<br />

2<br />

1<br />

JG12<br />

JG14<br />

1 3<br />

4<br />

7<br />

6<br />

9 JG9<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

USER<br />

PWM<br />

J1<br />

JG15<br />

JG14<br />

1<br />

4<br />

7<br />

JG9<br />

LED3<br />

Y1<br />

JG5<br />

JG1<br />

JG17<br />

1<br />

J4 J5<br />

3<br />

3<br />

2<br />

2<br />

1<br />

1<br />

JG12 JG17JG16 JG13<br />

JG3 JG7<br />

JG6<br />

3<br />

U1<br />

JG1<br />

DSP56F807EVM<br />

S/N<br />

S4 S5 S6<br />

GP1 GP2 RUN/STOP<br />

JG4 U9<br />

S1 S2 S3<br />

P1<br />

P3 RESET IRQA IRQB<br />

3<br />

1<br />

JG16<br />

1<br />

Figure 12-53. DSP56F807EVM Jumper Reference<br />

Table 12-15. DSP56F807EVM Jumper Settings<br />

Jumper Group Comment Connections<br />

JG1 Primary UNI-3 DCBus Overcurrent Selected for FAULTA1 2–3<br />

JG2 Secondary UNI-3 Phase A Overcurrent Selected for FAULTB1 1–2<br />

JG3 CAN termination unselected NC<br />

JG4 Enable on-board Parallel JTAG Host/Target Interface NC<br />

JG5 Use on-board EXTAL crystal input for DSP oscillator 2–3<br />

JG6 Use on-board XTAL crystal input for DSP oscillator 1–2<br />

JG7 Selects DSP’s Mode 0 operation upon exit from reset 1–2<br />

JG8 Enable on-board SRAM 1–2<br />

JG9 Enable RS-232 output NC<br />

JG10 Secondary UNI-3 3-Phase Current Sense Selected as inputs to A/D 2–3, 5–6, 8–9<br />

JG11 Secondary UNI-3 serial selected 1–2, 3–4, 5–6, 7–8<br />

JG12 Primary Encoder Input Selected 2–3, 5–6, 8–9<br />

12-66 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

3<br />

JG6<br />

U2<br />

3<br />

2<br />

1<br />

JG13<br />

JG8<br />

JG10<br />

3<br />

2<br />

1<br />

JG11<br />

JTAG<br />

JG4<br />

J3<br />

JG2<br />

P2<br />

J2<br />

3<br />

2<br />

1<br />

JG10<br />

JG2<br />

JG11<br />

1 2<br />

7 8<br />

JG8<br />

3<br />

1<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3-Phase SR Motor Control Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 12-15. DSP56F807EVM Jumper Settings (Continued)<br />

Jumper Group Comment Connections<br />

JG13 Secondary Encoder Input Selected 2–3, 5–6, 8–9<br />

JG14 Primary UNI-3 3-Phase Current Sense Selected as inputs to A/D 2–3, 5–6, 8–9<br />

JG15 Primary UNI-3 serial selected 1–2, 3–4, 5–6, 7–8<br />

JG16 PD0 input selected as a high input 1–2<br />

JG17 PD1 input selected as a high input 1–2<br />

NOTE: When running the EVM target system in a stand-alone mode from Flash, the JG4<br />

jumper must be set in the 1-2 configuration to disable the command converter parallel<br />

port interface.<br />

12.8.4 Build<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

When building this application, the user can create an application that runs from internal Flash or<br />

External RAM. To select the type of application to build, open the<br />

3ph_srm_hall_sensor_type1.mcp project and select the target build type as shown in Figure 12-54.<br />

Selecting Build All will create all application build types. A definition of the projects associated<br />

with these target build types may be viewed under the Targets tab of the project window.<br />

Figure 12-54. Target Build Selection<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-67<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The project may now be built by executing the Make command; see Figure 12-55. This will build<br />

and link the 3-phase SR Motor Control Application and all needed Metrowerks and <strong>SDK</strong><br />

libraries.<br />

12.8.5 Execute<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 12-55. Execute Make Command<br />

To execute the 3-phase SR Motor Control Application, select Project\Debug in the CodeWarrior<br />

IDE, followed by the Project\Run command. For more help with these commands, refer to the<br />

CodeWarrior tutorial documentation in the following file located in the CodeWarrior installation<br />

directory:<br />

\CodeWarrior Documentation\PDF\Targeting_DSP56800.pdf<br />

If the Flash target is selected, CodeWarrior will automatically program the DSP’s internal Flash<br />

with the executable generated during Build. If the External RAM target is selected, the executable<br />

will be loaded to off-chip RAM.<br />

Once Flash has been programmed with the executable, the EVM target system may be run in a<br />

stand-alone mode from Flash. To do this, set the JG4 jumper in the 1-2 configuration to disable<br />

the parallel port, and press the RESET button.<br />

Once the application is running, move the RUN/STOP switch to the RUN position, and set the<br />

required speed with the UP/DOWN push buttons. Pressing the UP/DOWN buttons should<br />

incrementally increase the motor speed until it reaches maximum speed. If successful, the SR<br />

motor will be spinning.<br />

NOTE: If the RUN/STOP switch is set to the RUN position when the application starts, toggle<br />

the RUN/STOP switch between the STOP and RUN positions to enable motor<br />

spinning. This is a protection feature that prevents the motor from starting when the<br />

application is executed from CodeWarrior.<br />

You should also see a lighted green USER LED which indicates that the application is running. If<br />

the application is stopped, the green USER LED will blink at a 2Hz frequency. If an Undervoltage<br />

fault occurs, the USER LED will blink at a frequency of 8Hz.<br />

12-68 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3-Phase SR Sensorless Motor Control Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The application can be observed in PC master software during the manual mode.<br />

To set the PC master software control, the following steps must be performed:<br />

• The RUN/STOP switch must be in the STOP position<br />

• Check the PC master software mode on the PC master software control page<br />

• The application can be enabled by setting the RUN/STOP switch to the RUN position<br />

• The motor can be started by pushing the Start PC master software Push Button and stopped<br />

by pressing the Stop PC master software Push Button<br />

• The speed can be set by the bar graph<br />

• The motor can be stopped any time by the RUN/STOP switch on the EVM<br />

• When the RUN/STOP switch on the EVM is in STOP position, the manual mode can be set<br />

again by unchecking the PC master software mode on the PC master software control page<br />

12.9 3-Phase SR Sensorless Motor Control<br />

Application<br />

This application exercises sensorless control of the 3-Phase Switched Reluctance (SR) motor on<br />

the DSP56F807EVM board, Optoisolation board, and 3-phase SR High-Voltage power stage.<br />

12.9.1 Files<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The 3-Phase SR Motor Control application is composed of the following files:<br />

• ...\dsp56807evm\nos\applications\3ph_srm_sensorless\3ph_srm_sensorless.c, main<br />

program<br />

• ...\dsp56807evm\nos\applications\3ph_srm_sensorless\3ph_srm_sensorless.h, main<br />

header file of the program used for storing application references and defined constants that<br />

are required by the 3ph_srm_sensorless.c file.<br />

• ...\dsp56807evm\nos\applications\3ph_srm_sensorless\appconst.c, application<br />

constants for Data flash<br />

• ...\dsp56807evm\nos\applications\3ph_srm_sensorless\appconst.h, header file to store<br />

the external references and defined constants related to the appconst.c file<br />

• ...\dsp56807evm\nos\applications\3ph_srm_sensorless\3ph_srm_sensorless.mcp,<br />

application project file<br />

• ...\dsp56807evm\nos\applications\3ph_srm_sensorless\configextram\appconfig.c,<br />

application configuration file for external RAM<br />

• ...\dsp56807evm\nos\applications\3ph_srm_sensorless\configflash\appconfig.c,<br />

application configuration file for Flash<br />

• ...\dsp56807evm\nos\applications\3ph_srm_sensorless\configextram\appconfig.h,<br />

application configuration header file for external RAM<br />

• ...\dsp56807evm\nos\applications\3ph_srm_sensorless\configflash\appconfig.h,<br />

application configuration header file for Flash<br />

• ...\dsp56807evm\nos\applications\3ph_srm_sensorless\configextram\linker.cmd,<br />

linker command file for external RAM<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-69<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

• ...\dsp56807evm\nos\applications\3ph_srm_sensorless\configflash\linker.cmd, linker<br />

command file for Flash<br />

• ...\dsp56807evm\nos\applications\3ph_srm_sensorless\configflash\flash.cfg,<br />

configuration file for Flash<br />

These files are located in the <strong>SDK</strong> installation directory.<br />

12.9.2 Specifications<br />

The 3-Phase SR Sensorless Motor Control Application demonstrates the sensorless Switched<br />

Reluctance Motor Control application using flux linkage position estimation on the DSP56F807<br />

processor. An estimation of the phase resistance for low speed range is included.<br />

Control Process<br />

After RESET, the drive enters the INIT state in manual mode.When the RUN/STOP switch is<br />

detected (using the RUN/STOP Switch or the PC master software command) in the STOP<br />

position and there are no faults pending, the STOP application state is entered. When the start<br />

command is detected (using the RUN/STOP switch or the PC master software Start button), the<br />

drive enters the RUN application state; the motor is started. The following start-up sequence with<br />

the rotor alignment is provided:<br />

• MOTOR_STOPPED Motor stopped<br />

• ALIGNMENT_COMMAND Alignment command accepted<br />

• ALIGNMENT_STAGE_ONE Alignment in progress; phases B and C switched on<br />

• ALIGNMENT_STAGE_TWO Alignment in progress; phase B switched on<br />

• START_UP_COMMAND Alignment finalized; start the motor<br />

• START_UP_FINISHED Motor running; start-up finalized<br />

The rotor position is evaluated using the sensorless flux linkage estimation algorithm. The actual<br />

flux linkage is calculated using the PWM frequency rate and compared with the reference flux<br />

linkage for the given commutation angle. The commutation angle is calculated according to the<br />

desired speed, current and actual DCBus voltage. When the actual flux linkage exceeds the<br />

reference flux linkage, the commutation of the phases in the desired rotation direction is done.<br />

The flux linkage error is used for the phase resistance estimation in low speeds (US Patent<br />

Pending). The commutation instances are used for actual motor speed calculation. According to<br />

the control signals (RUN/STOP switch, UP/DOWN push buttons) in manual mode or the PC<br />

master software commands in PC master software mode, the reference speed command is<br />

calculated using an acceleration/deceleration ramp. The comparison between the actual speed<br />

command and the measured speed generates a speed error. Based on the error the speed controller<br />

generates the desired phase current. When the phase is commutated, it is turned on with duty<br />

cycle 100 percent (or Output_duty_cycle_startup during motor start-up). During each PWM<br />

cycle, the actual phase current is compared with the desired current. As soon as the actual current<br />

exceeds the command current, the current controller is turned on. The procedure is repeated for<br />

each commutation cycle of the motor. The current controller generates the desired duty cycle.<br />

Finally, the 3-phase PWM SR Motor Control signals are generated.<br />

Drive Protection<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The DCBus voltage, DCBus current and power stage temperature are measured during the control<br />

process. They protect the drive from Overvoltage, Undervoltage, Overcurrent and Overheating.<br />

12-70 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3-Phase SR Sensorless Motor Control Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The Undervoltage and Overheating protection is performed by software, while the Overcurrent<br />

and Overvoltage fault signal utilizes a fault input of the DSP. The power stage is identified using<br />

board identification. If the correct power stage is not identified, the fault "Wrong Power Stage"<br />

disables the drive operation. Line voltage is measured during application initialization. According<br />

to the detected level, the 115VAC or 230VAC mains is set. If the line voltage is detected to be out<br />

of the -15% to +10% of nominal voltage, the fault "Out of the Mains Limit" disables the drive<br />

operation.<br />

If any of the above-mentioned faults occur, the motor control PWM outputs are disabled in order<br />

to protect the drive, and the application enters the FAULT state. The FAULT state can be left only<br />

when the fault conditions disappear and the RUN/STOP switch is moved to the STOP position<br />

The application can run on:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

• External RAM or Flash<br />

• 3-Phase SR High-Voltage Power Stage powered by 115V AC or 230V AC<br />

• Manual or PC master software Operating Mode<br />

The correct power stage and voltage level is identified automatically and the appropriate<br />

constants are set.<br />

The 3-phase SR motor control application can operate in two modes:<br />

1. Manual Operating Mode<br />

The drive is controlled by the RUN/STOP switch. The motor speed is set by the UP and<br />

DOWN push buttons (see Figure 12-56). The actual state of the application is indicated by<br />

the user LEDs (see Figure 12-57). If the application runs and motor spinning is disabled (i.e.,<br />

the system is ready), the GREEN user LED will flash at a frequency of 2Hz. When motor<br />

spinning is enabled, the GREEN user LED will be On. If a fault occurs on the power stage,<br />

the GREEN user LED will flash at a frequency of 8Hz. The actual state of the PWM outputs<br />

are indicated by PWM output LEDs.<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-71<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 12-56. RUN/STOP Switch and UP/DOWN Buttons<br />

12-72 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3-Phase SR Sensorless Motor Control Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 12-57. USER and PWM LEDs<br />

2. PC master software (Remote) Operating Mode<br />

The drive is controlled remotely from a PC through the SCI communication channel<br />

of the DSP device via an RS-232 physical interface. The PC master software control<br />

can be taken over only if the RUN/STOP switch is in STOP position, when the push<br />

buttons and RUN/STOP switch have no effect on the application control.<br />

The following PC master software control actions are supported:<br />

• Set PC master software Mode of the motor control system<br />

• Set Manual Mode of the motor control system<br />

• Start the motor<br />

• Stop the motor<br />

• Set the Required Speed of the motor<br />

PC master software displays the following information:<br />

• Required Speed of the motor<br />

• Actual Speed of the motor<br />

• Application status - Init/Stop/Run/Fault<br />

• DCBus voltage level<br />

• Identified line voltage<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-73<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

• Fault Status - No_Fault/Overvoltage/Overcurrent/Undervoltage/Overheating<br />

• Identified Power Stage<br />

Project files for the PC master software are located in:<br />

...\nos\applications\3ph_srm_sensorless\PC_Master\3ph_srm_sensorless.pmp<br />

Start the PC master software window’s application, 3ph_srm_sensorless.pmp. Figure 12-58 shows<br />

the PC master software control window after this project has been launched.<br />

Note: If the PC master software project (.pmp file) is unable to control the application, it is<br />

possible that the wrong load map (.elf file) has been selected. PC master software uses<br />

the load map to determine addresses for global variables being monitored. Once the<br />

PC master software project has been launched, this option may be selected in the PC<br />

master software window under Project/Select Other Map File.<br />

12.9.3 Set-up<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 12-58. PC Master Software Control Window<br />

Figure 12-59 illustrates the hardware set-up for the 3-phase SR Motor Control applications. The<br />

motor’s Encoder connector, attached to connector J4 on the EVM Board, is not required for the<br />

motor operation. It serves only for PC master software position reference.<br />

12-74 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3-Phase SR Sensorless Motor Control Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 12-59. Set-up of the 3-Phase SR Motor Control Application High-Voltage<br />

The correct order of phases (phase A, phase B, phase C) for the SR motor is:<br />

• phase A = white wire<br />

• phase B = red wire<br />

• phase C = black wire<br />

When facing a motor shaft, the motor shaft should rotate clockwise (i.e., positive direction,<br />

positive speed).<br />

For detailed information, see the DSP56F807 Evaluation Module Hardware Reference<br />

Manual. The serial cable is needed for the PC master software debugging/control.<br />

12.9.3.1 EVM Jumper Settings<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

To execute the 3-Phase SR sensorless Motor Control Application, the DSP56F807 board requires<br />

the strap settings shown in Figure 12-60 and Table 12-16.<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-75<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

JG15<br />

JG5<br />

2<br />

1<br />

JG7<br />

JG3<br />

3<br />

1<br />

8<br />

7<br />

3<br />

2<br />

1<br />

JG12<br />

JG14<br />

1 3<br />

4<br />

7<br />

6<br />

9 JG9<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

USER<br />

PWM<br />

J1<br />

JG15<br />

JG14<br />

1<br />

4<br />

7<br />

JG9<br />

LED3<br />

Y1<br />

JG5<br />

JG1<br />

JG17<br />

1<br />

J4 J5<br />

3<br />

3<br />

2<br />

2<br />

1<br />

1<br />

JG12 JG17JG16 JG13<br />

JG3 JG7<br />

JG6<br />

3<br />

U1<br />

JG1<br />

DSP56F807EVM<br />

S/N<br />

S4 S5 S6<br />

GP1 GP2 RUN/STOP<br />

JG4 U9<br />

S1 S2 S3<br />

P1<br />

P3 RESET IRQA IRQB<br />

3<br />

1<br />

JG16<br />

1<br />

Figure 12-60. DSP56F807EVM Jumper Reference<br />

Table 12-16. DSP56F807EVM Jumper Settings<br />

Jumper Group Comment Connections<br />

JG1 Primary UNI-3 DCBus Overcurrent Selected for FAULTA1 2–3<br />

JG2 Secondary UNI-3 Phase A Overcurrent Selected for FAULTB1 1–2<br />

JG3 CAN termination unselected NC<br />

JG4 Enable on-board Parallel JTAG Host/Target Interface NC<br />

JG5 Use on-board EXTAL crystal input for DSP oscillator 2–3<br />

JG6 Use on-board XTAL crystal input for DSP oscillator 1–2<br />

JG7 Selects DSP’s Mode 0 operation upon exit from reset 1–2<br />

JG8 Enable on-board SRAM 1–2<br />

JG9 Enable RS-232 output NC<br />

JG10 Secondary UNI-3 3-Phase Current Sense Selected as inputs to A/D 2–3, 5–6, 8–9<br />

JG11 Secondary UNI-3 serial selected 1–2, 3–4, 5–6, 7–8<br />

JG12 Primary Encoder Input Selected 2–3, 5–6, 8–9<br />

12-76 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

3<br />

JG6<br />

U2<br />

3<br />

2<br />

1<br />

JG13<br />

JG8<br />

JG10<br />

3<br />

2<br />

1<br />

JG11<br />

JTAG<br />

JG4<br />

J3<br />

JG2<br />

P2<br />

J2<br />

3<br />

2<br />

1<br />

JG10<br />

JG2<br />

JG11<br />

1 2<br />

7 8<br />

JG8<br />

3<br />

1<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3-Phase SR Sensorless Motor Control Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 12-16. DSP56F807EVM Jumper Settings (Continued)<br />

Jumper Group Comment Connections<br />

JG13 Secondary Encoder Input Selected 2–3, 5–6, 8–9<br />

JG14 Primary UNI-3 3-Phase Current Sense Selected as inputs to A/D 2–3, 5–6, 8–9<br />

JG15 Primary UNI-3 serial selected 1–2, 3–4, 5–6, 7–8<br />

JG16 PD0 input selected as a high input 1–2<br />

JG17 PD1 input selected as a high input 1–2<br />

NOTE: When running the EVM target system in a stand-alone mode from Flash, the JG4<br />

jumper must be set in the 1-2 configuration to disable the command converter parallel<br />

port interface.<br />

12.9.4 Build<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

When building this application, the user can create an application that runs from internal Flash or<br />

External RAM. To select the type of application to build, open the 3ph_srm_sensorless.mcp<br />

project and select the target build type as shown in Figure 12-61. Selecting Build All will create all<br />

application build types. A definition of the projects associated with these target build types may<br />

be viewed under the Targets tab of the project window.<br />

Figure 12-61. Target Build Selection<br />

The project may now be built by executing the Make command; see Figure 12-62. This will build<br />

and link the 3-phase SR Sensorless Motor Control Application and all needed Metrowerks and<br />

<strong>SDK</strong> libraries.<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-77<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

12.9.5 Execute<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 12-62. Execute Make Command<br />

To execute the 3-phase SR Motor Control application, choose the Program/Debug command in<br />

the CodeWarrior IDE, followed by the Run command. For more help with these commands, refer<br />

to the CodeWarrior tutorial documentation in the following file located in the CodeWarrior<br />

installation directory:<br />

\CodeWarrior Documentation\PDF\Targeting_DSP56800.pdf<br />

If the Flash target is selected, CodeWarrior will automatically program the DSP’s internal Flash<br />

with the executable generated during Build. If the External RAM target is selected, the executable<br />

will be loaded to off-chip RAM.<br />

Once Flash has been programmed with the executable, the EVM target system may be run in a<br />

stand-alone mode from Flash. To do this, set the JG4 jumper in the 1-2 configuration to disable<br />

the parallel port and press the RESET button.<br />

Once the application is executing, the motor can be started. When the switch is moved from the<br />

STOP position to the RUN position, the motor will start. The speed can be changed by the<br />

UP/DOWN buttons. Pressing the UP/DOWN buttons should incrementally increase the motor<br />

speed until it reaches maximum speed.<br />

Note: If the RUN/STOP switch is set to the RUN position when the application starts, toggle<br />

the RUN/STOP switch between the STOP and RUN positions to enable motor<br />

spinning. This is a protection feature that prevents the motor from starting when the<br />

application is executed from CodeWarrior.<br />

You should also see blinking or lighted LEDs, which indicate the application’s status.<br />

12-78 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3-Phase SR Sensorless Motor Control Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

12.9.6 PC Master Software<br />

Perform the following steps to set the PC master software control:<br />

• The RUN/STOP switch must be in the STOP position<br />

• Check the PC master software mode on the PC master software control page<br />

• The motor can be started by pushing the Start PC master software Push Button and stopped<br />

by pushing the Stop PC master software Push Button<br />

• The speed can be set by the bar graph<br />

When the RUN/STOP switch on the EVM is in the STOP position, the manual mode can be set<br />

again by unchecking the PC master software mode on the PC master software control page<br />

The application can be monitored in PC master software during the PC master software mode as<br />

well as manual mode.<br />

The following windows are available:<br />

Speed Scope monitors:<br />

• Required Speed<br />

• Actual Speed<br />

• Desired Phase Current<br />

Start-up Recorder captures:<br />

• Desired Phase Current<br />

• Active Phase Current<br />

• Reference Flux Linkage<br />

• Active Flux Linkage<br />

• Output Duty Cycle<br />

• Encoder Position Reference<br />

Start-up Recorder is initiated with the motor start only.<br />

Flux Linkage Recorder captures:<br />

• Active Phase Current<br />

• Discharge Phase Current<br />

• Active Flux Linkage<br />

• Discharge Flux Linkage<br />

• Reference Flux Linkage<br />

• Encoder Position Reference<br />

Flux Linkage Recorder may be initiated any time during the motor run.<br />

Current Controller Recorder captures:<br />

• Desired Phase Current<br />

• Active Phase Current<br />

• Output Duty Cycle<br />

• Encoder Position Reference<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Current Controller Recorder may be initiated any time during the motor run.<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-79<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Note: The Recorder can be used only when the application is running from External RAM<br />

due to limited on-chip memory. The length of the recorded window may be set in<br />

“Recorder Properties” => bookmark “Main” => “Recorded Samples”. It is limited by<br />

the dedicated memory space in appconfig.h file. The recorder samples are taken every<br />

64.5 µsec.<br />

12.10 3-Phase SR Motor Control with Encoder<br />

Application<br />

This application exercises control of the 3-Phase Switched Reluctance (SR) motor with encoder<br />

position sensor on the DSP56F807EVM board, Optoisolation board, and 3-phase SR<br />

High-Voltage power stage.<br />

12.10.1 Files<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The 3-Phase SR Motor Control application is composed of the following files:<br />

• ...\dsp56807evm\nos\applications\3ph_srm_Encoder\3ph_srm_Encoder.c, main<br />

program<br />

• ...\dsp56807evm\nos\applications\3ph_srm_Encoder\3ph_srm_Encoder.h, main<br />

header file of the program used for storing application references and defined constants that<br />

are required by the 3ph_srm_Encoder.c file.<br />

• ...\dsp56807evm\nos\applications\3ph_srm_Encoder\appconst.c, application constants<br />

for Data flash<br />

• ...\dsp56807evm\nos\applications\3ph_srm_Encoder\appconst.h, header file to store<br />

the external references and defined constants related to the appconst.c file<br />

• ...\dsp56807evm\nos\applications\3ph_srm_Encoder\3ph_srm_Encoder..mcp,<br />

application project file<br />

• ...\dsp56807evm\nos\applications\3ph_srm_Encoder\configextram\appconfig.c,<br />

application configuration file for external RAM<br />

• ...\dsp56807evm\nos\applications\3ph_srm_Encoder\configflash\appconfig.c,<br />

application configuration file for Flash<br />

• ...\dsp56807evm\nos\applications\3ph_srm_Encoder\configextram\appconfig.h,<br />

application configuration header file for external RAM<br />

• ...\dsp56807evm\nos\applications\3ph_srm_Encoder\configflash\appconfig.h,<br />

application configuration header file for Flash<br />

• ...\dsp56807evm\nos\applications\3ph_srm_Encoder\configextram\linker.cmd, linker<br />

command file for external RAM<br />

• ...\dsp56807evm\nos\applications\3ph_srm_Encoder\configflash\linker.cmd, linker<br />

command file for Flash<br />

• ...\dsp56807evm\nos\applications\3ph_srm_Encoder\configflash\flash.cfg,<br />

configuration file for Flash<br />

These files are located in the <strong>SDK</strong> installation directory.<br />

12-80 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

12.10.2 Specifications<br />

3-Phase SR Motor Control with Encoder Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The 3-Phase SR Motor Control with Encoder Application demonstrates the Switched Reluctance<br />

Motor Control application using position sensor on the DSP56F807 processor.<br />

Control Process<br />

After RESET the drives enters the INIT state in MANUAL mode.When the start/stop switch is<br />

detected (using Start/Stop Switch or PC master software command) in STOP position and there<br />

are no faults pending the STOP application state is entered. When the start command is detected<br />

(using Start/Stop switch or PC master software Start button), the drive enters RUN application<br />

state - motor is started. The following start-up sequence with the rotor alignment is provided:<br />

• MOTOR_STOPPED, Motor stopped<br />

• ALIGNMENT_COMMAND, Alignment command accepted<br />

• ALIGNMENT_STAGE_ONE, Alignment in progress - phases B&C switched on<br />

• ALIGNMENT_STAGE_TWO, Alignment in progress - phase B switched on<br />

• START_UP_FINISHED Alignment finalized, motor running, start-up finalized<br />

The rotor position is evaluated with encoder position sensor through timer module A of channel 0,<br />

which is set into quadrature mode.Channel 1 of the same module performs commutation call<br />

under successful comapring of CMP2. Every commutation occurrence the CMP2 is anew loaded<br />

with recently calculated value, which is adjusted by advance angle routine considering actual<br />

speed, desired current and applied voltage across corresponding phase. The individual phase is<br />

supposed to be switched on before overlapping rotor and stator teeth.<br />

According to the control signals (Start/Stop switch, Up/Down push buttons) and PC master<br />

software commands (in case of PC master software control) the reference speed command is<br />

calculated using an acceleration/deceleration ramp. The comparison between the actual speed<br />

command and the measured speed generates a speed error. Base on the error the speed controller<br />

generates desired phase current. When the phase is commutated, it is turned-on with duty cycle<br />

100% (or Output_duty_cycle_startup during motor start-up). Then during each PWM cycle the<br />

actual phase current is compared with the desired current. As soon as the actual current exceeds<br />

the command one, the current controller is turned-on. The procedure is repeated for each<br />

commutation cycle of the motor. The current controller generates the desired duty cycle Finally<br />

the 3-phase PWM SR Motor Control signals are generated.<br />

Drive Protection<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The DCBus voltage, DCBus current and power stage temperature are measured during the control<br />

process. They are used for overvoltage, undervoltage, overcurrent and overtemperature protection<br />

of the drive. The undervoltage and overtemperature protection is performed by software while the<br />

overcurrent and overvoltage fault signal utilizes a Fault inputs of the DSP. The power stage is<br />

identified using board identification. If the correct power stage is not identified, the fault "Wrong<br />

Power Stage" disables the drive operation. The line voltage is measured during application<br />

initialization. According the detected level the 115VAC or 230VAC mains is set. If the line<br />

voltage out of the -15% .. +10% of nominal voltage is detected, the fault "Out of the Mains Limit"<br />

disables the drive operation.<br />

If any of the above mentioned fault occurs, the motor control PWM outputs are disabled in order<br />

to protect the drive and the application enters the FAULT state. The FAULT state can be left only<br />

when the fault conditions disappear and the start/stop switch is moved to the STOP position<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-81<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The application can run on:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

• External RAM or Flash<br />

• 3-Phase SR High-Voltage Power Stage powered by 115V AC or 230V AC<br />

• Manual or PC master software Operating Mode<br />

The correct power stage and voltage level is identified automatically and the appropriate<br />

constants are set.<br />

The 3-phase SR motor control application can operate in two modes:<br />

1. Manual Operating Mode<br />

The drive is controlled by the RUN/STOP switch. The motor speed is set by the UP and<br />

DOWN push buttons (see Figure 12-56). The actual state of the application is indicated by<br />

the user LEDs (see Figure 12-57). If the application runs and motor spinning is disabled (i.e.,<br />

the system is ready), the GREEN user LED will flash at a frequency of 2Hz. When motor<br />

spinning is enabled, the GREEN user LED will be On. If a fault occurs on the power stage,<br />

the GREEN user LED will flash at a frequency of 8Hz. The actual state of the PWM outputs<br />

are indicated by PWM output LEDs.<br />

Figure 12-63. RUN/STOP Switch and UP/DOWN Buttons<br />

12-82 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3-Phase SR Motor Control with Encoder Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 12-64. USER and PWM LEDs<br />

2. PC master software (Remote) Operating Mode<br />

The drive is controlled remotely from a PC through the SCI communication channel<br />

of the DSP device via an RS-232 physical interface. The PC master software control<br />

can be taken over only if the RUN/STOP switch is in STOP position. Then the push<br />

buttons and start/stop switch has no effect to the application control.<br />

The following PC master software control actions are supported:<br />

• Set PC master software Mode of the motor control system<br />

• Set Manual Mode of the motor control system<br />

• Start the motor<br />

• Stop the motor<br />

• Set the Required Speed of the motor<br />

PC master software displays the following information:<br />

• Required Speed of the motor<br />

• Actual Speed of the motor<br />

• Application status - Init/Stop/Run/Fault<br />

• DCBus voltage level<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-83<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

• Identified line voltage<br />

• Fault Status - No_Fault/Overvoltage/Overcurrent/Undervoltage/Overheating<br />

• Identified Power Stage<br />

Project files for the PC master software are located in:<br />

...\nos\applications\3ph_srm_Encoder\PC_Master\3ph_srm_Encoder.pmp<br />

Start the PC master software window’s application, 3ph_srm_Encoder.pmp. Figure 12-58 shows<br />

the PC master software control window after this project has been launched.<br />

Note: If the PC master software project (.pmp file) is unable to control the application, it is<br />

possible that the wrong load map (.elf file) has been selected. PC master software uses<br />

the load map to determine addresses for global variables being monitored. Once the<br />

PC master software project has been launched, this option may be selected in the PC<br />

master software window under Project/Select Other Map File.<br />

Figure 12-65. PC Master Software Control Window<br />

12-84 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

12.10.3 Set-up<br />

3-Phase SR Motor Control with Encoder Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 12-59 illustrates the hardware set-ups for the 3-phase SR Motor Control applications. The<br />

motor’s Encoder connector attached to connector J4 on the EVM Board is not required for the<br />

motor operation. It serves only for PC master software position reference.<br />

Figure 12-66. Set-up of the 3-Phase SR Motor Control Application High-Voltage<br />

The correct phase order (phase A, phase B, phase C) for SR motor is as follows:<br />

• Phase A = white wire<br />

• Phase B = red wire<br />

• Phase C = black wire<br />

If you look at a motor shaft (face to shaft) the motor shaft should rotate in clockwise direction (i.e.<br />

positive direction, positive speed).<br />

For detailed information, see the DSP56F807 Evaluation Module Hardware Reference<br />

Manual. The serial cable is needed for the PC master software debugging/control.<br />

12.10.3.1 EVM Jumper Settings<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

To execute the 3-Phase SR sensorless Motor Control Application, the DSP56F807 board requires<br />

the strap settings shown in Figure 12-60 and Table 12-16.<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-85<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

JG15<br />

JG5<br />

2<br />

1<br />

JG7<br />

JG3<br />

3<br />

1<br />

8<br />

7<br />

3<br />

2<br />

1<br />

JG12<br />

JG14<br />

1 3<br />

4<br />

7<br />

6<br />

9 JG9<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

USER<br />

PWM<br />

J1<br />

JG15<br />

JG14<br />

1<br />

4<br />

7<br />

JG9<br />

LED3<br />

Y1<br />

JG5<br />

JG1<br />

JG17<br />

1<br />

J4 J5<br />

3<br />

3<br />

2<br />

2<br />

1<br />

1<br />

JG12 JG17JG16 JG13<br />

JG3 JG7<br />

JG6<br />

3<br />

U1<br />

JG1<br />

DSP56F807EVM<br />

S/N<br />

S4 S5 S6<br />

GP1 GP2 RUN/STOP<br />

JG4 U9<br />

S1 S2 S3<br />

P1<br />

P3 RESET IRQA IRQB<br />

3<br />

1<br />

JG16<br />

1<br />

Figure 12-67. DSP56F807EVM Jumper Reference<br />

Table 12-17. DSP56F807EVM Jumper Settings<br />

Jumper Group Comment Connections<br />

JG1 Primary UNI-3 DCBus Over-Current Selected for FAULTA1 2–3<br />

JG2 Secondary UNI-3 Phase A Over-Current Selected for FAULTB1 1–2<br />

JG3 CAN termination unselected NC<br />

JG4 Enable on-board Parallel JTAG Host/Target Interface NC<br />

JG5 Use on-board EXTAL crystal input for DSP oscillator 2–3<br />

JG6 Use on-board XTAL crystal input for DSP oscillator 1–2<br />

JG7 Selects DSP’s Mode 0 operation upon exit from reset 1–2<br />

JG8 Enable on-board SRAM 1–2<br />

JG9 Enable RS-232 output NC<br />

JG10 Secondary UNI-3 3-Phase Current Sense Selected as inputs to A/D 2–3, 5–6, 8–9<br />

JG11 Secondary UNI-3 serial selected 1–2, 3–4, 5–6, 7–8<br />

JG12 Primary Encoder Input Selected 2–3, 5–6, 8–9<br />

JG13 Secondary Encoder Input Selected 2–3, 5–6, 8–9<br />

12-86 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

3<br />

JG6<br />

U2<br />

3<br />

2<br />

1<br />

JG13<br />

JG8<br />

JG10<br />

3<br />

2<br />

1<br />

JG11<br />

JTAG<br />

JG4<br />

J3<br />

JG2<br />

P2<br />

J2<br />

3<br />

2<br />

1<br />

JG10<br />

JG2<br />

JG11<br />

1 2<br />

7 8<br />

JG8<br />

3<br />

1<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3-Phase SR Motor Control with Encoder Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 12-17. DSP56F807EVM Jumper Settings (Continued)<br />

Jumper Group Comment Connections<br />

JG14 Primary UNI-3 3-Phase Current Sense Selected as inputs to A/D 2–3, 5–6, 8–9<br />

JG15 Primary UNI-3 serial selected 1–2, 3–4, 5–6, 7–8<br />

JG16 PD0 input selected as a high input 1–2<br />

JG17 PD1 input selected as a high input 1–2<br />

NOTE: When running the EVM target system in a stand-alone mode from Flash, the JG4<br />

jumper must be set in the 1-2 configuration to disable the command converter parallel<br />

port interface.<br />

12.10.4 Build<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

When building this application, the user can create an application that runs from internal Flash or<br />

External RAM. To select the type of application to build, open the 3ph_srm_Encoder.mcp project<br />

and select the target build type as shown in Figure 12-61. Selecting Build All will create all<br />

application build types. A definition of the projects associated with these target build types may<br />

be viewed under the Targets tab of the project window.<br />

Figure 12-68. Target Build Selection<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-87<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The project may now be built by executing the Make command; see Figure 12-62. This will build<br />

and link the 3-phase SR Sensorless Motor Control Application and all needed Metrowerks and<br />

<strong>SDK</strong> libraries.<br />

12.10.5 Execute<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 12-69. Execute Make Command<br />

To execute the 3-phase SR Motor Control application, choose the Program/Debug command in<br />

the CodeWarrior IDE, followed by the Run command. For more help with these commands, refer<br />

to the CodeWarrior tutorial documentation in the following file located in the CodeWarrior<br />

installation directory:<br />

\CodeWarrior Documentation\PDF\Targeting_DSP56800.pdf<br />

If the Flash target is selected, CodeWarrior will automatically program the DSP’s internal Flash<br />

with the executable generated during Build. If the External RAM target is selected, the executable<br />

will be loaded to off-chip RAM.<br />

Once Flash has been programmed with the executable, the EVM target system may be run in a<br />

stand-alone mode from Flash. To do this, set the JG4 jumper in the 1-2 configuration to disable<br />

the parallel port and press the RESET button.<br />

Once the application is executing, the motor can be started. When the switch is moved from the<br />

STOP position to the RUN position, the motor will start. The speed can be changed by the<br />

UP/DOWN buttons. Pressing the Up/Down buttons should cause to incrementally increase the<br />

speed of the motor until it reaches a maximum speed.<br />

Note: If the RUN/STOP switch is set to the RUN position when the application starts, toggle<br />

the RUN/STOP switch between the STOP and RUN positions to enable motor<br />

spinning. This is a protection feature that prevents the motor from starting when the<br />

application is executed from CodeWarrior.<br />

12-88 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3-Phase AC Induction Motor Control V/Hz Application - Open Loop<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

You should also see blinking or lighted LEDs which indicate the application’s status.<br />

12.10.6 PC Master Software<br />

Perform the following steps to set the PC master software control:<br />

• The RUN/STOP switch must be in the STOP position<br />

• Check the PC master software mode on the PC master software control page<br />

• The motor can be started by pushing the Start PC master software Push Button and stopped<br />

by pushing the Stop PC master software Push Button<br />

• The speed can be set by the bar graph<br />

When the RUN/STOP switch on the EVM is in the STOP position, the manual mode can be set<br />

again by unchecking the PC master software mode on the PC master software control page<br />

The application can be monitored in PC master software during the PC master software mode as<br />

well as manual mode.<br />

The following windows are available:<br />

Speed Scope monitors:<br />

• Required Speed<br />

• Actual Speed<br />

Current Controller Recorder captures:<br />

• Desired Phase Current<br />

• Active Phase Current<br />

• Output Duty Cycle<br />

• Encoder Position Reference<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Current Controller Recorder may be initiated any time during the motor run.<br />

The Recorder can be used ONLY when the application is running from External RAM due to the<br />

limited on-chip memory. The length of the recorded window may be set in “Recorder Properties”<br />

=> bookmark “Main” => “Recorded Samples”. It is limited by the dedicated memory space in<br />

appconfig.h file. The recorder samples are taken each 100 µsec.<br />

12.11 3-Phase AC Induction Motor Control V/Hz<br />

Application - Open Loop<br />

This application demonstrates a principal of the V/Hz control of the 3-Phase AC Induction motor<br />

using the DSP56F807EVM board, Optoisolation board, and 3-phase AC BLDC High-Voltage<br />

power stage.<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-89<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

12.11.1 Files<br />

The 3-Phase AC Induction Motor Control V/Hz Application - Open Loop is found in directory:<br />

..\dsp56807evm\nos\applications\3ph_AC_VHz_OpenLoop\<br />

and is composed of the following files:<br />

• 3ph_AC_VHz_OL.c, main program<br />

• 3ph_AC_VHz_OL.h, main program header file<br />

• 3ph_AC_VHz_OL.mcp, application project file<br />

• appconst.c, application constants placed in data Flash<br />

• appconst.h, header file for appconst.c<br />

• ConfigExtRam\appconfig.c, application configuration file for External RAM<br />

• ConfigExtRam\appconfig.h, application configuration file for External RAM<br />

• ConfigExtRam\linker.cmd, linker command file for External RAM<br />

• ConfigFlash\appconfig.c, application configuration file for Flash<br />

• ConfigFlash\appconfig.h, application configuration file for Flash<br />

• ConfigFlash\linker.cmd, linker command file for Flash<br />

• ConfigFlash\flash.cfg, configuration file for Flash<br />

• PC_Master\3ph_AC_VHz_ExtRam.pmp, PC master software file for External RAM<br />

• PC_Master\3ph_AC_VHz_Flash.pmp, PC master software file for Flash<br />

These files are located in the <strong>SDK</strong> installation directory.<br />

12.11.2 Specification<br />

This application performs principal control of the 3-phase AC induction motor using the<br />

DSP56F807 processor. The control technique sets the speed ([rpm], [Hz]) of the magnetic field<br />

and calculates the phase voltage amplitude according to a V/Hz table. This table is private to the<br />

application and reflects the AC induction motor parameters (Base Voltage/frequency; Boost<br />

Voltage/frequency; and DC Boost Voltage). The incremental encoder is used to derive the actual<br />

rotor speed. Protection is provided against drive faults Overcurrent, Overvoltage, Undervoltage,<br />

and Overheating.<br />

System Outline<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The system is designed to drive a 3-phase AC induction motor (ACIM). The application has the<br />

following specifications:<br />

• Volt per Hertz control technique used for ACIM control<br />

• Targeted for DSP56F807EVM<br />

• Running on 3-phase AC induction motor control development platform at variable line<br />

voltage 115V AC and 230V AC (range -15% to +10%)<br />

• Motor mode<br />

• Generator mode<br />

• DCBus brake<br />

• Minimum speed 50 rpm<br />

• Maximum speed 2250 rpm at input power line 230V AC<br />

• Maximum speed 1200 rpm at input power line 115V AC<br />

12-90 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3-Phase AC Induction Motor Control V/Hz Application - Open Loop<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

• Power stage and optoisolation board identification<br />

• Fault protection<br />

• Manual interface (RUN/STOP switch; UP/DOWN push buttons control; LED indication)<br />

• PC master software remote control interface (speed set-up)<br />

• PC master software remote monitor<br />

— PC master software monitor interface (required speed; actual motor speed; drive fault status;<br />

DCBus voltage level; identified power stage boards)<br />

Application Description<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The Volt per Hertz control algorithm is calculated on the Motorola DSP56F807. The algorithm<br />

generates 3-phase PWM signals for an AC induction motor inverter according to the user-required<br />

inputs, measured and calculated signals.<br />

The concept of the ACIM drive incorporates the following hardware components:<br />

• AC induction motor--brake set<br />

• 3-phase AC/BLDC high voltage power stage<br />

• DSP56F807EVM boards<br />

• Optoisolation box, which is connected between the power stage board and the<br />

DSP56F807EVM<br />

The AC induction motor--brake set incorporates a 3-phase AC induction motor and attached<br />

BLDC motor brake. The AC induction motor has four poles. The incremental position sensor<br />

(encoder) is coupled on the motor shaft. The detailed motor--brake specifications are listed in<br />

Table 12-18.<br />

Table 12-18. Motor---Brake Specifications<br />

Set Manufactured EM Brno, Czech Republic<br />

Motor Specification Motor Type AM40V<br />

3-Phase AC Induction Motor<br />

Pole-Number 4<br />

Nominal Speed 1300 rpm<br />

Nominal Voltage 3 x 200V<br />

Nominal Current: 0.88A<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-91<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 12-18. Motor---Brake Specifications<br />

Brake Specification<br />

Position Sensor (Encoder)<br />

The following software tools are needed for compiling, debugging, loading to the EVM, remote<br />

control and monitoring:<br />

• Metrowerks CodeWarrior 4.0<br />

• PC master software<br />

• <strong>SDK</strong> 2.4 or later<br />

Measured quantities:<br />

• DCBus voltage<br />

• Power module temperature<br />

• Rotor speed<br />

The faults used for drive protection:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Brake Type<br />

SG40N<br />

3-Phase BLDC Motor<br />

Pole-Number 6<br />

Nominal Speed 1500rpm<br />

Nominal Voltage 3 x 27V<br />

Nominal Current 2.6 A<br />

• Overvoltage (PC master software error message = Overvoltage fault)<br />

• Undervoltage (PC master software error message = Undervoltage fault)<br />

• Overcurrent (PC master software error message = Overcurrent fault)<br />

• Overheating (PC master software error message = Overheating fault)<br />

• Wrong-hardware (PC master software error message = Wrong HW used)<br />

The 3-Phase AC Induction Motor Control V/Hz Application - Open Loop can operate in two<br />

modes:<br />

Type<br />

Baumer Electric<br />

BHK 16.05A 1024-12-5<br />

Pulses per revolution 1024<br />

1. Manual Operating Mode<br />

The drive is controlled by the RUN/STOP switch (S6). The motor speed is set by the UP<br />

(S3-IRQB) and DOWN (S2-IRQA) push buttons (see Figure 12-70). If the application runs<br />

and motor spinning is disabled (i.e., the system is ready) the green USER LED (LED3, see<br />

Figure 12-71) will blink. When motor spinning is enabled, the green USER LED will be On<br />

and the actual state of the PWM outputs are indicated by PWM output LEDs. If Overcurrent,<br />

Overvoltage or Overheating occur, or if the wrong system board is identified, the green<br />

USER LED flashes at an 8Hz frequency and the PC master software signals the identified<br />

type of fault. This state can be exited only by an application RESET. It is strongly<br />

recommended that you inspect the entire application to locate the source of the fault before<br />

starting it again. Refer to Table 12-19 for application states.<br />

12-92 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

3-Phase AC Induction Motor Control V/Hz Application - Open Loop<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 12-70. RUN/STOP Switch and UP/DOWN Buttons<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-93<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 12-71. USER and PWM LEDs<br />

2. PC master software (remote) Operating Mode<br />

The drive is controlled remotely from a PC through the SCI communication channel<br />

of the DSP device via an RS-232 physical interface. The drive is enabled by the<br />

RUN/STOP switch, which can be used to safely stop the application at any time.<br />

The following control actions are supported:<br />

• Set the Required Speed of the motor<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Table 12-19. Motor Application States<br />

Application State Motor State Green LED State<br />

Stopped Stopped Blinking at a frequency of 2Hz<br />

Running Running On<br />

Fault Stopped Blinking at a frequency of 8Hz<br />

PC master software displays the following information:<br />

• Actual and Required Speed of the motor<br />

• Phase voltage amplitude (related to given DCBus voltage)<br />

• Application mode - RUN/STOP<br />

12-94 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3-Phase AC Induction Motor Control V/Hz Application - Open Loop<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

• DCBus voltage and temperature of the power module<br />

• Drive Fault status<br />

• Identified hardware<br />

If Cvercurrent, Overvoltage, Undervoltage or Overheating occur, the internal fault logic is<br />

asserted and the application enters a fault state (the green USER LED flashes at an 8Hz<br />

frequency). This state can be exited only by an application RESET. It is strongly recommended<br />

that you inspect the entire application to locate the source of the fault before starting it again.<br />

Project files for the PC master software are located in the directory:<br />

..\nos\applications\3ph_AC_VHz_OpenLoop\PC_Master<br />

and are composed of the following files:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

• 3ph_AC_VHz_Flash.pmp, which uses Map file for running in Flash<br />

• 3ph_AC_VHz_ExtRam.pmp, which uses Map file for running in External Memory<br />

Start the PC master software window’s application and choose the right PC master software<br />

project for the desired PC master software Operating Mode. Figure 12-72 shows the PC master<br />

software control window for 3ph_AC_VHz_ExtRAM.pmp.<br />

Figure 12-72. PC Master Software Control Window<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-95<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

12.11.3 Set-up<br />

Figure 12-73 illustrates the hardware set-up for the 3-phase AC Induction Motor Control V/Hz<br />

Application - Open Loop.<br />

Figure 12-73. Set-up of the 3-phase AC Induction Motor Control V/Hz Application - Open Loop<br />

The correct order of phases (phase A, phase B, phase C) for the AC induction motor shown in<br />

Figure 12-73 is:<br />

• phase A = red wire<br />

• phase B = white wire<br />

• phase C = black wire<br />

When facing a motor shaft, if the phase order is: phase A, phase B, phase C, the motor shaft<br />

should rotate clockwise (i.e., positive direction, positive speed).<br />

For detailed information, see the DSP56F807 Evaluation Module Hardware Reference<br />

Manual. The serial cable is needed for the PC master software debugging tool only.<br />

12.11.3.1 EVM Jumper Settings<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

To execute the 3-phase AC Induction Motor Control V/Hz Application - Open Loop, the<br />

DSP56F807 board requires the strap settings shown in Figure 12-74 and Table 12-20.<br />

12-96 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

JG15<br />

JG5<br />

2<br />

1<br />

JG7<br />

JG3<br />

3<br />

1<br />

8<br />

7<br />

3-Phase AC Induction Motor Control V/Hz Application - Open Loop<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3<br />

2<br />

1<br />

JG12<br />

JG14<br />

1 3<br />

4<br />

7<br />

6<br />

9 JG9<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

USER<br />

PWM<br />

J1<br />

JG15<br />

JG14<br />

1<br />

4<br />

7<br />

JG9<br />

LED3<br />

Y1<br />

JG5<br />

JG1<br />

JG17<br />

1<br />

J4 J5<br />

3<br />

3<br />

2<br />

2<br />

1<br />

1<br />

JG12 JG17JG16 JG13<br />

JG3 JG7<br />

JG6<br />

3<br />

U1<br />

JG1<br />

DSP56F807EVM<br />

S/N<br />

S4 S5 S6<br />

GP1<br />

S1<br />

GP2<br />

S2<br />

RUN/STOP<br />

S3<br />

P1<br />

JG4 U9<br />

P3 RESET IRQA IRQB<br />

3<br />

1<br />

JG16<br />

1<br />

Figure 12-74. DSP56F807EVM Jumper Reference<br />

Table 12-20. DSP56F807EVM Jumper Settings<br />

Jumper Group Comment Connections<br />

JG1 Primary UNI-3 DCBus Overcurrent Selected for FAULTA1 2–3<br />

JG2 Secondary UNI-3 Phase A Overcurrent Selected for FAULTB1 1–2<br />

JG3 CAN termination unselected NC<br />

JG4 Enable on-board Parallel JTAG Host/Target Interface NC<br />

JG5 Use on-board EXTAL crystal input for DSP oscillator 2–3<br />

JG6 Use on-board XTAL crystal input for DSP oscillator 1–2<br />

JG7 Selects DSP’s Mode 0 operation upon exit from reset 1-2<br />

JG8 Enable on-board SRAM 1–2<br />

JG9 Enable RS-232 output NC<br />

JG10 Secondary UNI-3 3-Phase Current Sense Selected as inputs to A/D 2–3, 5–6, 8–9<br />

JG11 Secondary UNI-3 serial selected 1–2, 3–4, 5–6, 7–8<br />

JG12 Primary Encoder Input Selected 2–3, 5–6, 8–9<br />

JG13 Secondary Encoder Input Selected 2–3, 5–6, 8–9<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-97<br />

3<br />

JG6<br />

U2<br />

3<br />

2<br />

1<br />

JG13<br />

JG8<br />

JG10<br />

3<br />

2<br />

1<br />

JG11<br />

JTAG<br />

JG4<br />

J3<br />

JG2<br />

P2<br />

J2<br />

3<br />

2<br />

1<br />

JG10<br />

JG2<br />

JG11<br />

1 2<br />

7 8<br />

JG8<br />

3<br />

1<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 12-20. DSP56F807EVM Jumper Settings<br />

Jumper Group Comment Connections<br />

JG14 Primary UNI-3 3-Phase Current Sense Selected as inputs to A/D 2–3, 5–6, 8–9<br />

JG15 Primary UNI-3 serial selected 1–2, 3–4, 5–6, 7–8<br />

JG16 PD0 input selected as a high input 1–2<br />

JG17 PD1 input selected as a high input 1–2<br />

NOTE: When running the EVM target system in a stand-alone mode from Flash, the JG4<br />

jumper must be set in the 1-2 configuration to disable the command converter parallel<br />

port interface.<br />

12.11.4 Build<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

When building this application, the user can create an application that runs from internal Flash or<br />

External RAM. To select the type of application to build, open the 3ph_AC_VHz_OL.mcp project<br />

and select the target build type as shown in Figure 12-75. Selecting Build All will create all<br />

application build types. A definition of the projects associated with these target build types may<br />

be viewed under the Targets tab of the project window.<br />

Figure 12-75. Target Build Selection<br />

The project may now be built by executing the Make command; see Figure 12-76. This will build<br />

and link the 3-phase AC Induction Motor Control V/Hz Application - Open Loop and all needed<br />

Metrowerks and <strong>SDK</strong> libraries.<br />

12-98 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

12.11.5 Execute<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

3-Phase AC Induction Motor Control V/Hz Application - Open Loop<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 12-76. Execute Make Command<br />

To execute the 3-phase AC Induction Motor Control V/Hz Application - Open Loop, select<br />

Project\Debug in the CodeWarrior IDE, followed by the Project\Run command. For more help<br />

with these commands, refer to the CodeWarrior tutorial documentation in the following file<br />

located in the CodeWarrior installation directory:<br />

\CodeWarrior Documentation\PDF\Targeting_DSP56800.pdf<br />

If the Flash target is selected, CodeWarrior will automatically program the DSP’s internal Flash<br />

with the executable generated during Build. If the External RAM target is selected, the executable<br />

will be loaded to off-chip RAM.<br />

Once Flash has been programmed with the executable, the EVM target system may be run in a<br />

stand-alone mode from Flash. To do this, set the JG4 jumper in the 1-2 configuration to disable<br />

the parallel port, and press the RESET button.<br />

Once the application is running, move the RUN/STOP switch to the RUN position, and set the<br />

required speed with the UP/DOWN push buttons. Pressing the UP/DOWN buttons should<br />

incrementally increase the motor speed until it reaches maximum speed. If successful, the AC<br />

induction motor will be spinning.<br />

NOTE: If the RUN/STOP switch is set to the RUN position when the application starts, toggle<br />

the RUN/STOP switch between the STOP and RUN positions to enable motor<br />

spinning. This is a protection feature that prevents the motor from starting when the<br />

application is executed from CodeWarrior.<br />

You should also see a lighted green USER LED which indicates that the application is running. If<br />

the application is stopped, the green USER LED will blink at a 2Hz frequency. If an Undervoltage<br />

fault occurs, the USER LED will blink at a frequency of 8Hz.<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-99<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

12.12 3-Phase AC Induction Motor Control V/Hz<br />

Application - Closed Loop<br />

This application demonstrates a principal of the V/Hz control of the 3-Phase AC induction motor<br />

in closed loop using the DSP56F807EVM board, Optoisolation board, and 3-phase AC BLDC<br />

High-Voltage power stage.<br />

12.12.1 Files<br />

The 3-Phase AC Induction Motor Control V/Hz Application - Closed Loop is found in the<br />

directory:<br />

..\dsp56807evm\nos\applications\3ph_AC_VHz_CloseLoop\<br />

and is composed of the following files:<br />

• 3ph_AC_VHz_CL.c, main program<br />

• 3ph_AC_VHz_CL.h, main program header file<br />

• 3ph_AC_VHz_CL.mcp, application project file<br />

• appconst.c, application constants placed in data Flash<br />

• appconst.h, header file for appconst.c<br />

• ConfigExtRam\appconfig.c, application configuration file for External RAM<br />

• ConfigExtRam\appconfig.h, application configuration file for External RAM<br />

• ConfigExtRam\linker.cmd, linker command file for External RAM<br />

• ConfigFlash\appconfig.c, application configuration file for Flash<br />

• ConfigFlash\appconfig.h, application configuration file for Flash<br />

• ConfigFlash\linker.cmd, linker command file for Flash<br />

• ConfigFlash\flash.cfg, configuration file for Flash<br />

• PC_Master\3ph_AC_VHz_ExtRam.pmp, PC master software file for External RAM<br />

• PC_Master\3ph_AC_VHz_Flash.pmp, PC master software file for Flash<br />

These files are located in the <strong>SDK</strong> installation directory.<br />

12.12.2 Specification<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

This application performs a principal control of the 3-phase AC induction motor using the<br />

DSP56F807 processor. The control technique sets the speed ([rpm], [Hz]) of the magnetic field<br />

and calculates the phase voltage amplitude according to a V/Hz table. This table is private to the<br />

application and reflects the AC nduction motor parameters (Base Voltage/frequency; Boost<br />

Voltage/frequency; DC Boost Voltage). The incremental encoder is used to derive the actual rotor<br />

speed. Protection is provided against drive faults Overcurrent, Overvoltage, Undervoltage and<br />

Overheating.<br />

The closed loop system is characterized by a feedback signal (Actual Speed), derived from a<br />

quadrature decoder in the controlled system. This signal monitors the actual behavior of the<br />

system, and is compared with the reference signal (Required Speed). The magnitude and polarity<br />

of the resulting error signal are directly related to the difference between required and actual<br />

values of the controlled variable, which may be the speed of a motor. The error signal is amplified<br />

12-100 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3-Phase AC Induction Motor Control V/Hz Application - Closed Loop<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

by the controller, and the controller output makes a correction to the controlled system, reducing<br />

the error signal.<br />

System Outline<br />

The system is designed to drive a 3-phase AC induction motor (ACIM). The application has the<br />

following specifications:<br />

• Volt per Hertz control technique used for ACIM control<br />

• Close loop control<br />

• Targeted for DSP56F807EVM<br />

• Running on 3-phase AC induction motor control development platform at variable line<br />

voltage 115V AC and 230V AC (range -15% to +10%)<br />

• Motor mode<br />

• Generator mode<br />

• DCBus brake<br />

• Minimum speed 50 rpm<br />

• Maximum speed 2250 rpm at input power line 230V AC<br />

• Maximum speed 1200 rpm at input power line 115V AC<br />

• Power stage and optoisolation board identification<br />

• Fault protection<br />

• Manual interface (RUN/STOP switch; UP/DOWN push buttons control; LED indication)<br />

• PC master software remote control interface (speed set-up)<br />

• PC master software remote monitor<br />

— PC master software monitor interface (required speed; actual motor speed; drive fault status;<br />

DCBus voltage level; identified power stage boards)<br />

Application Description<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The Volt per Hertz control algorithm is calculated on the Motorola DSP56F807. The algorithm<br />

generates 3-phase PWM signals for an AC induction motor inverter according to the user-required<br />

inputs, measured and calculated signals.<br />

The concept of the ACIM drive incorporates the following hardware components:<br />

• AC induction motor--brake set<br />

• 3-phase AC/BLDC high voltage power stage<br />

• DSP56F807EVM boards<br />

• Optoisolation box, which is connected between the power stage board and the<br />

DSP56F807EVM<br />

The AC induction motor--brake set incorporates a 3-phase AC induction motor and attached<br />

BLDC motor brake. The AC induction motor has four poles. The incremental position sensor<br />

(encoder) is coupled on the motor shaft. The detailed motor--brake specifications are listed in<br />

Table 12-21.<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-101<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The following software tools are needed for compiling, debugging, loading to the EVM, remote<br />

control and monitoring:<br />

• Metrowerks CodeWarrior 4.0<br />

• PC master software<br />

• <strong>SDK</strong> 2.4 or later<br />

Measured quantities:<br />

• DCBus voltage<br />

• Power module temperature<br />

• Rotor speed<br />

The faults used for drive protection:<br />

Table 12-21. Motor - Brake Specifications<br />

Set Manufactured EM Brno, Czech Republic<br />

Motor Specification Motor Type AM40V<br />

3-Phase AC Induction Motor<br />

Brake Specification<br />

Position Sensor (Encoder)<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Pole-Number 4<br />

Nominal Speed 1300 rpm<br />

Nominal Voltage 3 x 200V<br />

Nominal Current: 0.88A<br />

Brake Type<br />

SG40N<br />

3-Phase BLDC Motor<br />

Pole-Number 6<br />

Nominal Speed 1500rpm<br />

Nominal Voltage 3 x 27V<br />

Nominal Current: 2.6 A<br />

Type<br />

Baumer Electric<br />

BHK 16.05A 1024-12-5<br />

Pulses per revolution 1024<br />

• Overvoltage (PC master software error message = Overvoltage fault)<br />

• Undervoltage (PC master software error message = Undervoltage fault)<br />

• Overcurrent (PC master software error message = Overcurrent fault)<br />

• Overheating (PC master software error message = Overheating fault)<br />

• Wrong-hardware (PC master software error message = Wrong HW used)<br />

The 3-Phase AC Induction Motor Control V/Hz Application - Closed Loop can operate in two<br />

modes:<br />

1. Manual Operating Mode<br />

The drive is controlled by the RUN/STOP switch (S6). The motor speed is set by the UP<br />

(S3-IRQB) and DOWN (S2-IRQA) push buttons (see Figure 12-77). If the application runs<br />

and motor spinning is disabled (i.e., the system is ready) the green USER LED (LED3, shown<br />

12-102 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

3-Phase AC Induction Motor Control V/Hz Application - Closed Loop<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

in Figure 12-78) will blink. When motor spinning is enabled, the green USER LED will be<br />

On and the actual state of the PWM outputs are indicated by PWM output LEDs. If<br />

Overcurrent, Overvoltage or Overheating occur or if the wrong system board is identified,<br />

the green USER LED flashes at an 8Hz frequency and the PC master software signals the<br />

identified type of fault. This state can be exited only by an application RESET. It is strongly<br />

recommended that you inspect the entire application to locate the source of the fault before<br />

starting it again. Refer to Table 12-22 for application states.<br />

Figure 12-77. RUN/STOPSwitch and UP/DOWN Buttons<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-103<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 12-78. USER and PWM LEDs<br />

2. PC master software (remote) Operating Mode<br />

The drive is controlled remotely from a PC through the SCI communication channel<br />

of the DSP device via an RS-232 physical interface. The drive is enabled by the<br />

RUN/STOP switch, which can be used to safely stop the application at any time.<br />

The following control actions are supported:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Table 12-22. Motor Application States<br />

Application State Motor State Green LED State<br />

Stopped Stopped Blinking at a frequency of 2Hz<br />

Running Running On<br />

Fault Stopped Blinking at a frequency of 8Hz<br />

• Set the Required Speed of the motor<br />

• Set Close/Open loop by checking/unchecking the Close Loop checkbox; see Figure 12-79<br />

12-104 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3-Phase AC Induction Motor Control V/Hz Application - Closed Loop<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

PC master software displays the following information:<br />

• Actual and Required Speed of the motor<br />

• Phase voltage amplitude (related to given DCBus voltage)<br />

• Application mode - RUN/STOP<br />

• DCBus voltage and temperature of the power module<br />

• Drive Fault status<br />

• Identified hardware<br />

If Overcurrent, Overvoltage, Undervoltage or Overheating occur, the internal fault logic is<br />

asserted and the application enters a fault state (the green USER LED flashes at an 8Hz<br />

frequency). This state can be exited only by an application RESET. It is strongly recommended<br />

that you inspect the entire application to locate the source of the fault before starting it again.<br />

Project files for the PC master software are located in the directory:<br />

..\nos\applications\3ph_AC_VHz_CloseLoop\PC_Master<br />

and are composed of the following files:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

• 3ph_AC_VHz_Flash.pmp, which uses Map file for running in Flash<br />

• 3ph_AC_VHz_ExtRam.pmp, which uses Map file for running in External Memory<br />

Start the PC master software window’s application and choose the correct PC master software<br />

project for the desired PC master software Operating Mode. Figure 12-79 shows the PC master<br />

software control window for 3ph_AZ_VHz_Flash.pmp.<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-105<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

12.12.3 Set-up<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 12-79. PC Master Software Control Window<br />

Figure 12-80 illustrates the hardware set-up for the 3-phase AC Induction Motor Control V/Hz<br />

Application - Closed Loop.<br />

12-106 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3-Phase AC Induction Motor Control V/Hz Application - Closed Loop<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 12-80. Set-up of the 3-phase AC Induction Motor Control V/Hz Application - Closed Loop<br />

The correct order of phases (phase A, phase B, phase C) for the AC induction motor shown in<br />

Figure 12-80 is:<br />

• phase A = red wire<br />

• phase B = white wire<br />

• phase C = black wire<br />

When facing a motor shaft, if the phase order is: phase A, phase B, phase C, the motor shaft<br />

should rotate clockwise (i.e., positive direction, positive speed).<br />

For detailed information, see the DSP56F807 Evaluation Module Hardware Reference<br />

Manual. The serial cable is needed for the PC master software debugging tool only.<br />

12.12.3.1 EVM Jumper Settings<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

To execute the 3-phase AC Induction Motor Control V/Hz Application - Closed Loop, the<br />

DSP56F807 board requires the strap settings shown in Figure 12-81 and Table 12-23.<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-107<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

JG15<br />

JG5<br />

2<br />

1<br />

JG7<br />

JG3<br />

3<br />

1<br />

8<br />

7<br />

3<br />

2<br />

1<br />

JG12<br />

JG14<br />

1 3<br />

4<br />

7<br />

6<br />

9 JG9<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

USER<br />

PWM<br />

J1<br />

JG15<br />

JG14<br />

1<br />

4<br />

7<br />

JG9<br />

LED3<br />

Y1<br />

J4 J5<br />

3<br />

3<br />

2<br />

2<br />

1<br />

1<br />

JG12 JG17JG16 JG13<br />

JG3 JG7<br />

JG6<br />

JG5<br />

JG1<br />

JG17<br />

1<br />

3<br />

U1<br />

JG1<br />

DSP56F807EVM<br />

S/N<br />

S4 S5 S6<br />

GP1<br />

S1<br />

GP2<br />

S2<br />

RUN/STOP<br />

S3<br />

P1<br />

JG4 U9<br />

P3 RESET IRQA IRQB<br />

3<br />

1<br />

JG16<br />

1<br />

Figure 12-81. DSP56F807EVM Jumper Reference<br />

Table 12-23. DSP56F807EVM Jumper Settings<br />

Jumper Group Comment Connections<br />

JG1 Primary UNI-3 DCBus Overcurrent Selected for FAULTA1 2–3<br />

JG2 Secondary UNI-3 Phase A Overcurrent Selected for FAULTB1 1–2<br />

JG3 CAN termination unselected NC<br />

JG4 Enable on-board Parallel JTAG Host/Target Interface NC<br />

JG5 Use on-board EXTAL crystal input for DSP oscillator 2–3<br />

JG6 Use on-board XTAL crystal input for DSP oscillator 1–2<br />

JG7 Selects DSP’s Mode 0 operation upon exit from reset 1-2<br />

JG8 Enable on-board SRAM 1–2<br />

JG9 Enable RS-232 output NC<br />

JG10 Secondary UNI-3 3-Phase Current Sense Selected as inputs to A/D 2–3, 5–6, 8–9<br />

JG11 Secondary UNI-3 serial selected 1–2, 3–4, 5–6, 7–8<br />

JG12 Primary Encoder Input Selected 2–3, 5–6, 8–9<br />

JG13 Secondary Encoder Input Selected 2–3, 5–6, 8–9<br />

12-108 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

3<br />

JG6<br />

U2<br />

3<br />

2<br />

1<br />

JG13<br />

JG8<br />

JG10<br />

3<br />

2<br />

1<br />

JG11<br />

JTAG<br />

JG4<br />

J3<br />

JG2<br />

P2<br />

J2<br />

3<br />

2<br />

1<br />

JG10<br />

JG2<br />

JG11<br />

1 2<br />

7 8<br />

JG8<br />

3<br />

1<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3-Phase AC Induction Motor Control V/Hz Application - Closed Loop<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 12-23. DSP56F807EVM Jumper Settings<br />

Jumper Group Comment Connections<br />

JG14 Primary UNI-3 3-Phase Current Sense Selected as inputs to A/D 2–3, 5–6, 8–9<br />

JG15 Primary UNI-3 serial selected 1–2, 3–4, 5–6, 7–8<br />

JG16 PD0 input selected as a high input 1–2<br />

JG17 PD1 input selected as a high input 1–2<br />

NOTE: When running the EVM target system in a stand-alone mode from Flash, the JG4<br />

jumper must be set in the 1-2 configuration to disable the command converter parallel<br />

port interface.<br />

12.12.4 Build<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

When building this application, the user can create an application that runs from internal Flash or<br />

External RAM. To select the type of application to build, open the 3ph_AC_VHz_CL.mcp project<br />

and select the target build type; see Figure 12-82. Selecting Build All will create all application<br />

build types. A definition of the projects associated with these target build types may be viewed<br />

under the Targets tab of the project window.<br />

Figure 12-82. Target Build Selection<br />

The project may now be built by executing the Make command; see Figure 12-83.This will build<br />

and link the 3-phase AC Induction Motor Control V/Hz Application - Closed Loop and all needed<br />

Metrowerks and <strong>SDK</strong> libraries.<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-109<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

12.12.5 Execute<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 12-83. Execute Make Command<br />

To execute the 3-phase AC Induction Motor Control V/Hz Application - Closed Loop, select<br />

Project\Debug in the CodeWarrior IDE, followed by the Project\Run command. For more help<br />

with these commands, refer to the CodeWarrior tutorial documentation in the following file<br />

located in the CodeWarrior installation directory:<br />

\CodeWarrior Documentation\PDF\Targeting_DSP56800.pdf<br />

If the Flash target is selected, CodeWarrior will automatically program the DSP’s internal Flash<br />

with the executable generated during Build. If the External RAM target is selected, the executable<br />

will be loaded to off-chip RAM.<br />

Once Flash has been programmed with the executable, the EVM target system may be run in a<br />

stand-alone mode from Flash. To do this, set the JG4 jumper in the 1-2 configuration to disable<br />

the parallel port, and press the RESET button.<br />

Once the application is running, move the RUN/STOP switch to the RUN position, and set the<br />

required speed with the UP/DOWN push buttons. Pressing the UP/DOWN buttons should<br />

incrementally increase the motor speed until it reaches maximum speed. If successful, the AC<br />

induction motor will be spinning.<br />

NOTE: If the RUN/STOP switch is set to the RUN position when the application starts, toggle<br />

the RUN/STOP switch between the STOP and RUN positions to enable motor<br />

spinning. This is a protection feature that prevents the motor from starting when the<br />

application is executed from CodeWarrior.<br />

12-110 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3-Phase ACIM Vector Control Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

You should also see a lighted green USER LED which indicates that the application is running. If<br />

the application is stopped, the green USER LED will blink at a 2Hz frequency. If an Undervoltage<br />

occurs, the User LED will blink at a frequency of 8Hz.<br />

12.13 3-Phase ACIM Vector ControlApplication<br />

This application demonstrates a principle of the vector control of the 3-phase AC induction motor<br />

(ACIM) using the DSP56F807EVM board, the In-line optoisolation box, and the 3-phase AC<br />

BLDC high voltage power stage.<br />

12.13.1 Files<br />

The 3-phase ACIM vector control application can be found in the <strong>SDK</strong> installation directory:<br />

..\src\dsp56807evm\nos\applications\3ph_ACIM_VectorControl\<br />

and is composed of the following files:<br />

• 3ph_ACIM_VectorControl.c, main application program<br />

• 3ph_ACIM_VectorControl.h, application header file<br />

• 3ph_ACIM_VectorControl.mcp, application project file<br />

• ConfigExtRam\appconfig.c, application configuration file for External RAM<br />

• ConfigExtRam\appconfig.h, application configuration file for External RAM<br />

• ConfigExtRam\linker.cmd, linker command file used for RAM<br />

• ConfigFlash\appconfig.c, application configuration file for Flash<br />

• ConfigFlash\appconfig.h, application configuration header file for Flash<br />

• ConfigFlash\linker.cmd, linker command file used for Flash<br />

• ConfigFlash\flash.cfg, configuration file for Flash<br />

• appconst.c, application constants placed in data Flash<br />

• appconst.h, header file for appconst.c<br />

12.13.2 Specification<br />

System Outline<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The system is designed to drive a 3-phase AC induction motor (ACIM). The application has the<br />

following specifications:<br />

• Vector control technique used for ACIM control<br />

• Speed control loop<br />

• Targeted for DSP56F807EVM<br />

• Running on 3-phase AC induction motor control development platform at variable line<br />

voltage 115V AC and 230V AC (range -15% to +10%)<br />

• Motor mode<br />

• Generator mode<br />

• DCBus brake<br />

• Minimum speed 50 rpm<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-111<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

• Maximum speed 2500 rpm at input power line 230V AC<br />

• Maximum speed 1100 rpm at input power line 115V AC<br />

• Power stage and optoisolation board identification<br />

• Fault protection<br />

• Manual interface (RUN/STOP switch; UP/DOWN push buttons control; LED indication)<br />

• PC master software remote control interface (START MOTOR/STOP MOTOR push<br />

buttons; speed set-up)<br />

• PC master software remote monitor<br />

— PC master software monitor interface (required speed; actual motor speed; PC master<br />

software mode; START MOTOR/STOP MOTOR controls; drive fault status; DCBus voltage<br />

level; identified power stage boards; drive status; mains detection)<br />

— PC master software speed scope (observes actual and desired speed)<br />

Application Description<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The vector control algorithm is calculated on the Motorola DSP56F807. The algorithm generates<br />

3-phase PWM signals for an AC induction motor inverter according to the user-required inputs,<br />

measured and calculated signals.<br />

The concept of the ACIM drive incorporates the following hardware components:<br />

• AC induction motor--brake set<br />

• 3-phase AC/BLDC high voltage power stage<br />

• DSP56F807EVM boards<br />

• ECOPTINL - In-line optoisolation box, which is connected between the host computer and<br />

the DSP56F807EVM<br />

The AC induction motor--brake set incorporates a 3-phase AC induction motor and attached<br />

BLDC motor brake. The AC induction motor has four poles. The incremental position sensor<br />

(encoder) is coupled on the motor shaft and position Hall Sensors are mounted between the motor<br />

and brake. They allow position sensing if required by the control algorithm. The detailed<br />

motor--brake specifications are listed in Table 12-24.<br />

Table 12-24. Motor - Brake Specifications<br />

Set Manufactured EM Brno, Czech Republic<br />

Motor Specification Motor Type AM40V<br />

3-Phase AC Induction Motor<br />

Pole-Number 4<br />

Nominal Speed 1300 rpm<br />

Nominal Voltage 3 x 200V<br />

Nominal Current: 0.88A<br />

12-112 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Brake Specification<br />

Position Sensor (Encoder)<br />

3-Phase ACIM Vector Control Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 12-24. Motor - Brake Specifications<br />

The following software tools are needed for compiling, debugging, loading to the EVM, remote<br />

control and monitoring:<br />

• Metrowerks CodeWarrior 4.0<br />

• PC master software<br />

• <strong>SDK</strong> 2.4 or later<br />

The drive can be controlled in two different operating modes:<br />

• In manual operating mode, the required speed is set by the UP/DOWN push buttons and<br />

drive is started and stopped by the RUN/STOP switch on the EVM board<br />

• In PC master software operating mode, the required speed is set by the PC master<br />

software active bar graph and the drive is started and stopped by the START MOTOR and<br />

STOP MOTOR controls<br />

Measured quantities:<br />

• DCBus voltage<br />

• Phase currents (phase A, phase B, phase C)<br />

• Power module temperature<br />

• Rotor speed<br />

The faults used for drive protection:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Brake Type<br />

• Overvoltage (PC master software error message = Overvoltage fault)<br />

• Undervoltage (PC master software error message = Undervoltage fault)<br />

• Overcurrent (PC master software error message = Overcurrent fault)<br />

• Overheating (PC master software error message = Overheating fault)<br />

• Wrong-mains (PC master software error message = Mains out of range)<br />

• Wrong-hardware (PC master software error message = Wrong HW used)<br />

• Overload (PC master software error message = Overload) An informative message; actual<br />

application state is not changed to FAULT state.<br />

States of the application state machine; see Table 12-25:<br />

• INIT - application initialization; operating mode changing<br />

• STOP - PWM outputs disabled; operating mode changing<br />

• RUN - PWM outputs enabled; motor running<br />

SG40N<br />

3-Phase BLDC Motor<br />

Pole-Number 6<br />

Nominal Current: 1500rpm<br />

Nominal Voltage 3 x 27V<br />

Nominal Speed 2.6 A<br />

Type<br />

Baumer Electric<br />

BHK 16.05A 1024-12-5<br />

Pulses per revolution 1024<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-113<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

• FAULT - PWM outputs disabled; waiting for manual fault acknowledgement or application<br />

reset<br />

Control Process<br />

After reset, the drive is in the INIT state and in the manual operating mode.When the RUN/STOP<br />

switch is detected in the STOP position and there are no faults pending, the INIT state is changed<br />

to the STOP state. Otherwise, the drive waits in the INIT state. If a fault occurs, the drive goes to<br />

the FAULT state. In the INIT and STOP states, the operation mode can be changed from PC<br />

master software. In the manual operating mode, the application is controlled by the RUN/STOP<br />

switch and UP/DOWN buttons; in the PC master software remote control mode, the application is<br />

controlled by the PC master software environment.<br />

When the start command is accepted (using the RUN/STOP switch or PC master software<br />

command), the STOP state is changed to the RUN state. The required speed is then calculated<br />

from the UP/DOWN push buttons in manual mode or the PC master software commands in PC<br />

master software remote control mode. The required speed is the input into the<br />

acceleration/deceleration ramp and the output is used as reference command into the speed<br />

controller. The difference between the actual speed and the required speed generates a speed error.<br />

Based on the error, the speed controller generates an Is_q_Req current, which corresponds to the<br />

torque component. The second Is_d_Req component of the stator current, which corresponds to<br />

rotor flux, is given by the flux controller. The field-weakening algorithm generates the required<br />

rotor flux, which is compared with the calculated rotor flux from the AC induction flux model<br />

calculation algorithm. The difference between the required rotor flux and the calculated rotor flux<br />

generates a flux error. Based on the flux error, the flux controller generates the required Is_d_Req<br />

stator current. Simultaneously, the stator currents Is_a, Is_b and Is_c (3-phase system) are<br />

measured and transformed to the stationary reference frame α, β (2-phase system) and to the d-q<br />

rotating reference frame consecutively. The decoupling algorithm generates Us_q and Us_d<br />

voltages (d, q rotating reference frame). The Us_q and Us_d voltages are transformed back to the<br />

stationary reference frame α, β and the space vector modulation then generates the 3-phase<br />

voltage system which is applied on the motor.<br />

Drive Protection<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The DCBus voltage, DCBus current and power stage temperature are measured during the control<br />

process. They protect the drive from Overvoltage, Undervoltage, Overcurrent, Overheating and<br />

Wrong-mains. The Undervoltage, Overheating, Wrong-hardware and Wrong-mains protection is<br />

performed by software. The Overcurrent and the Overvoltage fault signals utilize fault inputs of<br />

the DSP controlled by hardware. The power stage is identified using board identification. If the<br />

correct boards are not identified, the Wrong-hardware fault disables the drive operation. The line<br />

voltage is measured during application initialization. According to the detected voltage level, the<br />

115VAC or 230VAC mains is recognized. If the mains is out of range, the Wrong-mains fault is<br />

set and the drive operation is disabled.<br />

If any of the mentioned faults occur, the motor control PWM outputs are disabled in order to<br />

protect the drive and the application enters the FAULT state. The FAULT state can be left only<br />

when the fault conditions disappear and the RUN/STOP switch is moved to the STOP position in<br />

12-114 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

3-Phase ACIM Vector Control Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

manual mode and by the PC master software in PC master software remote mode. If the<br />

Wrong-hardware and Wrong-mains occur, the FAULT state can be left only by application reset.<br />

The 3-phase ACIM vector control application can operate in two modes:<br />

1. Manual Operating Mode<br />

The drive is controlled by the RUN/STOP switch (S6). The motor speed is set by the UP<br />

(S2-IRQB) and DOWN (S1-IRQA) push buttons (see Figure 12-84). The actual state of the<br />

application is indicated by the user LEDs (see Figure 12-85). If the application runs and<br />

motor spinning is disabled (i.e., the system is ready), the green user LED will blink at the 2Hz<br />

frequency. When motor spinning is enabled, the green user LED will be turned on and the<br />

actual state of the PWM outputs are indicated by PWM output LEDs. If any fault occurs<br />

(Overcurrent, Overvoltage, Undervoltage, Wrong-mains, Overheating or Wrong-hardware)<br />

the green user LED will blink at the 8Hz frequency. The PC master software control page<br />

shows the identified fault. The faults can be handled by switching the RUN/STOP switch to<br />

STOP state that represents acknowledging of the fault state. Meanwhile, the Wrong-mains<br />

and the Wrong-hardware faults can be quit only with the application reset. It is strongly<br />

recommended that the user inspect the entire application to locate the source of the fault<br />

before starting it again. Refer to Table 12-25 for application states.<br />

Figure 12-84. RUN/STOP Switch and UP/DOWN Buttons<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-115<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 12-85. USER and PWM LEDs<br />

Table 12-25. Motor Application States<br />

Application State Motor State Green LED State<br />

INIT Stopped Blinking at the 2Hz frequency (slow)<br />

STOP Stopped Blinking at the 2Hz frequency (slow)<br />

RUN Spinning On<br />

FAULT Stopped Blinking at the 8Hz frequency (fast)<br />

2. PC master software Operating Mode<br />

The drive is controlled remotely from a PC through the SCI communication channel<br />

of the DSP device via an RS-232 physical interface. The whole application is fully<br />

controllable from the PC master software environment regardless of the<br />

RUN/STOP switch position on the EVM board.<br />

12-116 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

3-Phase ACIM Vector Control Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The following PC master software control actions are supported:<br />

• Set PC master software mode of the motor control system<br />

• Set Manual mode of the motor control system<br />

• Start the motor<br />

• Stop the motor<br />

• Set the required speed of the motor<br />

PC master software displays the following information:<br />

• Actual and required speed of the motor<br />

• Application status - INIT/STOP/RUN/FAULT<br />

• DCBus voltage<br />

• Identified mains voltage<br />

• Identified hardware<br />

• Temperature of power module<br />

• START MOTOR and STOP MOTOR controls (active only in PC master software mode)<br />

• PC master software check-box (defines full PC master software control or full Manual<br />

control)<br />

• Fault status<br />

If any fault occurs (Overcurrent, Overvoltage, Wrong-mains, Overheating or Wrong-hardware)<br />

the green user LED will blink at the 8Hz frequency. The PC master software control page shows<br />

the identified fault. The faults can be handled by switching the START MOTOR/STOP MOTOR<br />

icon to the STOP MOTOR state, which acknowledges the fault state. Meanwhile, the<br />

Wrong-mains and the Wrong-hardware faults can be quit only with the application reset. It is<br />

strongly recommended that the user inspect the entire application to locate the source of the fault<br />

before starting it again.<br />

Project files for the PC master software are located in :<br />

..\nos\applications\3ph_ACIM_VectorControl\PC_Master\3ph_ACIM_VectorControl.pmp<br />

Start the PC master software 3ph_ACIM_VectorControl application. Figure 12-86 shows the PC<br />

master software control window.<br />

Note: If the PC master software project (.pmp file) is unable to control the application, it is<br />

possible that wrong load map (.elf file) has been selected. PC master software uses the<br />

load map to determine addresses for global variables that are monitored. Once the PC<br />

master software project has been launched, this option may be selected in the PC<br />

master software menu under Project/Select Other Map File.<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-117<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

12.13.3 Set-up<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 12-86. PC Master Software Control Window<br />

Figure 12-87 illustrates the hardware set-up for the 3-phase ACIM vector control application.<br />

WARNING:<br />

Danger, high-voltage--risk of electric shock!<br />

The application PCB modules and serial interface (connector,<br />

cable) are not electrically isolated from the mains voltage--they<br />

are live.<br />

Use the In-line Optoisolation Box (ECOPTINL) between the<br />

PC and DSP56807 EVM as protection from dangerous voltage<br />

on the PC-user side, and to prevent damage to the PC and other<br />

hardware.<br />

Do not touch any part of the EVM or the serial cable between<br />

the EVM and the In-line Optoisolation Box unless you are<br />

12-118 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3-Phase ACIM Vector Control Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

using an insulation transformer. The application is designed to<br />

be fully controllable only from PC master software.<br />

To avoid inadvertently touching live parts, use plastic covers.<br />

In the rest of this application, the description supposes use of the insulation transformer.<br />

Figure 12-87. Set-up of the 3-phase AC Ind. Vector Control Application<br />

The correct order of phases (phase A, phase B, phase C) for the AC induction motor shown in<br />

Figure 12-87 is:<br />

• phase A = red wire<br />

• phase B = white wire<br />

• phase C = black wire<br />

When facing a motor shaft, if the phase order is: phase A, phase B, phase C, the motor shaft<br />

should rotate clockwise (i.e., positive direction, positive speed).<br />

For detailed information, see the DSP56F807 Evaluation Module Hardware Reference<br />

Manual. The serial cable to PC is needed for the PC master software debugging tool only.<br />

12.13.3.1 EVM Jumper Settings<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

To execute the 3-phase ACIM vector control application, the DSP56F807 board requires the strap<br />

settings shown in Figure 12-88 and Table 12-26.<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-119<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

JG15<br />

JG5<br />

2<br />

1<br />

JG7<br />

JG3<br />

3<br />

1<br />

8<br />

7<br />

3<br />

2<br />

1<br />

JG12<br />

JG14<br />

1 3<br />

4<br />

7<br />

6<br />

9 JG9<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

USER<br />

PWM<br />

J1<br />

JG15<br />

JG14<br />

1<br />

4<br />

7<br />

JG9<br />

LED3<br />

Y1<br />

JG1<br />

JG17<br />

1<br />

J4 J5<br />

3<br />

3<br />

2<br />

2<br />

1<br />

1<br />

JG12 JG17JG16 JG13<br />

JG3 JG7<br />

JG6<br />

JG5<br />

3<br />

U1<br />

JG1<br />

DSP56F807EVM<br />

S/N<br />

S4 S5 S6<br />

GP1 GP2 RUN/STOP<br />

JG4 U9<br />

S1 S2 S3<br />

P1<br />

P3 RESET IRQA IRQB<br />

3<br />

1<br />

JG16<br />

1<br />

Figure 12-88. DSP56F807EVM Jumper Reference<br />

Table 12-26. DSP56F807EVM Jumper Settings<br />

Jumper Group Comment Connections<br />

JG1 Primary UNI-3 DCBus Overcurrent Selected for FAULTA1 2–3<br />

JG2 Secondary UNI-3 Phase A Overcurrent Selected for FAULTB1 1–2<br />

JG3 CAN termination unselected NC<br />

JG4 Enable on-board Parallel JTAG Host/Target Interface 1-2<br />

JG5 Use on-board EXTAL crystal input for DSP oscillator 2–3<br />

JG6 Use on-board XTAL crystal input for DSP oscillator 1–2<br />

JG7 Selects DSP’s Mode 0 operation upon exit from reset 1-2<br />

JG8 Enable on-board SRAM 1–2<br />

JG9 Enable RS-232 output NC<br />

JG10 Secondary UNI-3 3-Phase Current Sense Selected as inputs to A/D 2–3, 5–6, 8–9<br />

JG11 Secondary UNI-3 serial selected 1–2, 3–4, 5–6, 7–8<br />

JG12 Primary Encoder Input Selected 2–3, 5–6, 8–9<br />

JG13 Secondary Encoder Input Selected 2–3, 5–6, 8–9<br />

12-120 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

3<br />

JG6<br />

U2<br />

3<br />

2<br />

1<br />

JG13<br />

JG8<br />

JG10<br />

3<br />

2<br />

1<br />

JG11<br />

JG2<br />

JTAG<br />

JG4<br />

J3<br />

P2<br />

J2<br />

3<br />

2<br />

1<br />

JG10<br />

JG2<br />

JG11<br />

1 2<br />

7 8<br />

JG8<br />

3<br />

1<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

3-Phase ACIM Vector Control Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 12-26. DSP56F807EVM Jumper Settings<br />

Jumper Group Comment Connections<br />

JG14 Primary UNI-3 3-Phase Current Sense Selected as inputs to A/D 2–3, 5–6, 8–9<br />

JG15 Primary UNI-3 serial selected 1–2, 3–4, 5–6, 7–8<br />

JG16 PD0 input selected as a high input 1–2<br />

JG17 PD1 input selected as a high input 1–2<br />

Note: When running the EVM target system in a stand-alone mode from Flash, the JG4<br />

jumper must be set in the 1-2 configuration to disable the command converter parallel<br />

port interface. For this application this is set as short-connected permanently.<br />

12.13.4 Build<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

When building this application, the user can create an application that runs from internal Flash or<br />

External RAM, selected under the File menu in the project window. To choose the desired type,<br />

open the 3ph_ACIM_VectorControl.mcp project and select the target build type; see Figure 12-89.<br />

Selecting Build All will create all application build types. Definition of the projects associated<br />

with these target build types may be viewed under the Targets tab of the project window.<br />

When the 3ph_ACIM_VectorControl.mcp project file is opened, execute the Make command or<br />

press [F7]; see Figure 12-90. This will build and link 3-phase ACIM vector control application and<br />

all needed libraries from the Metrowerks CodeWarrior and the <strong>SDK</strong>.<br />

Figure 12-89. Target Build Selection<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-121<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

12.13.5 Execute<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 12-90. Execute Make Command<br />

To execute the 3-phase ACIM vector control application, choose the Program/Debug command in<br />

the CodeWarrior IDE, and follow with the Run command.<br />

To execute the 3-phase ACIM vector control application’s internal Flash version, choose the<br />

Program/Debug command in the CodeWarrior IDE. When loading is finished, the JG7 jumper<br />

must be connected to boot from internal Flash and the RESET button pushed.<br />

For more help with these commands, refer to the CodeWarrior tutorial documentation file located<br />

in the CodeWarrior installation directory:<br />

\CodeWarrior Documentation\PDF\Targeting_DSP56800.pdf<br />

For jumper settings, see the DSP56F807 Evaluation Module Hardware User’s Manual.<br />

Once the application is running, move the RUN/STOP switch to the RUN position and set the<br />

required speed with the UP/DOWN push buttons. Pressing the UP/DOWN buttons should<br />

incrementally increase the motor speed until it reaches maximum speed. If successful, the 3-phase<br />

ACIM will be spinning.<br />

Note: If the RUN/STOP switch is set to the RUN position when the application starts, toggle<br />

this switch back and forth to enable motor spinning. This is a protection feature that<br />

prevents the motor from starting when the application is executed from the<br />

CodeWarrior.<br />

You should also see blinking or lighted LEDs, which indicate the application’s status.<br />

12-122 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Digital Power Factor Correction Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

12.13.6 PC Master Software Control<br />

To run the application from Flash or ExtRAM, perform the following steps to set the PC master<br />

software control:<br />

• The application must be in the STOP or INIT state, which is indicated on the PC master<br />

software control page<br />

• Check the PC master software mode on the PC master software control page<br />

• The motor can be started by pushing the “START MOTOR” PC master software icon and<br />

stopped by pushing the “STOP MOTOR” PC master software icon<br />

• The speed can be set by the bar graph<br />

When the application is in the STOP or INIT state, the manual mode can be set again by<br />

unchecking the PC master software mode on the PC master software control page.<br />

The application can be monitored in PC master software during both the PC master software<br />

mode and the manual mode.<br />

The following PC master software windows are available:<br />

Speed Scope monitors:<br />

• Required Speed<br />

• Actual Speed<br />

Recorder:<br />

The recorder is prepared for fast events capture.<br />

Note: It is recomended to use the Recorder only when the application is running from<br />

External RAM due to the limited on-chip memory. The length of the recorded<br />

window may be changed by left-clicking on the Recorder in the tree structure of the<br />

PC master software items; selecting Recorder Properties in the menu Item/Properties,<br />

and defining the value as Recorded Samples. It is limited by the dedicated memory<br />

space in the appconfig.h file. The recorder samples are taken every 1ms.<br />

12.14 Digital Power Factor Correction Application<br />

This application provices an overview of the Power Factor Correction algorithm without motor<br />

control. A DSP56F807EVM board, Optoisolation board, and 3-phase AC/BLDC High-Voltage<br />

power stage board are used.<br />

12.14.1 Files<br />

The Digital Power Factor Correction Application is found in the directory:<br />

..\dsp56807evm\nos\applications\Digital_PFC\<br />

and is composed of the following files:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

• Digital_PFC.c, main program<br />

• Digital_PFC.mcp, application project file<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-123<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

• dpfc.c, digital PFC program module<br />

• dpfc.h, digital PFC header file<br />

• appconst.c, application constants placed in data Flash<br />

• appconst.h, header file for appconst.c<br />

• ConfigExtRam\appconfig.c, application configuration file for External RAM<br />

• ConfigExtRam\appconfig.h, application configuration header file for External RAM<br />

• ConfigExtRam\linker.cmd, linker command file for External RAM<br />

• ConfigFlash\appconfig.c, application configuration file for Flash<br />

• ConfigFlash\appconfig.h, application configuration header file for Flash<br />

• ConfigFlash\linker.cmd, linker command file for Flash<br />

• ConfigFlash\flash.cfg, configuration file for Flash<br />

These files are located in the <strong>SDK</strong> installation directory.<br />

The targeting for DSP56F807EVM has some specific lines in the dpfc.c C-source file. The<br />

following lines indicate which pin will be used to provide the PFC inhibit output functionality:<br />

/* Uncomment one of the following lines */<br />

// #define DSP56F803EVM<br />

#define DSP56F805EVM<br />

The hardware design of the DSP56F807EVM is the same as the DSP56F805EVM, so it uses the<br />

timer C channel 0 output pin. The timer channel should be defined in the appconfig.h file:<br />

#define INCLUDE_USER_TIMER_C_0 0<br />

12.14.2 Specification<br />

The Digital Power Factor Correction Application performs power factor correction for 3-phase<br />

AC/BLDC High-Voltage Power Stage hardware without motor drive. It is a demo that can<br />

evaluate the basic algorithm of power factor correction for the current hardware implementation.<br />

The PFC software was designed for use with motor control applications. The Digital PFC<br />

application allows target memory configuration of both RAM and Flash. The input power line<br />

must meet the following requirements:<br />

• Input voltage value of 115 or 220 volts<br />

• Input voltage frequency of 50 or 60 Hz<br />

The Digital PFC application allows usage in the Manual Operating Mode. The remote control<br />

functionality of the PC master software application is not implemented.<br />

Manual Operating Mode<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The PFC conversion is controlled by the RUN/STOP switch (S6); see Figure 12-91. The green<br />

USER LED (LED3) indicates the application states; see Figure 12-92. When the application is<br />

ready, the green USER LED blinks at a 2Hz frequency.<br />

12-124 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Digital Power Factor Correction Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 12-91. RUN/STOP Switch and UP/DOWN Buttons<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-125<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 12-92. USER and PWM LEDs<br />

The PFC conversion can be enabled after the RUN/STOP switch is moved to the RUN position.<br />

The normal PFC conversion process is indicated by the green USER LED, lighted continuously.<br />

To disable PFC conversion, the RUN/STOP switch must be moved to the STOP position.<br />

12.14.3 Set-up<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 12-93 illustrates the hardware set-up for the Digital Power Factor Correction Application,<br />

which requires a motor drive. The AC/BLDC High-Voltage Power Stage board contains the<br />

JP201 jumper that selects the power supply device. The 2-3 pins of the JP201 connection<br />

correspond to a simple rectifier-capacitor power stage. The PFC hardware set-up requires closing<br />

pins 1-2 of the JP201 connection.<br />

12-126 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Digital Power Factor Correction Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 12-93. Set-up of the Digital Power Factor Correction Application<br />

12.14.3.1 EVM Jumper Settings<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

To execute the Digital Power Factor Correction Application, the DSP56F807 board requires the<br />

strap settings shown in Figure 12-94 and Table 12-27.<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-127<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

JG15<br />

JG5<br />

2<br />

1<br />

JG7<br />

JG3<br />

3<br />

1<br />

8<br />

7<br />

JG14<br />

1 3<br />

4<br />

7<br />

6<br />

9 JG9<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

3<br />

2<br />

1<br />

JG12<br />

USER<br />

PWM<br />

J1<br />

JG15<br />

JG14<br />

1<br />

4<br />

7<br />

JG9<br />

LED3<br />

Y1<br />

JG5<br />

JG1<br />

JG17<br />

1<br />

J4 J5<br />

3<br />

3<br />

2<br />

2<br />

1<br />

1<br />

JG12 JG17JG16 JG13<br />

JG3 JG7<br />

JG6<br />

3<br />

U1<br />

JG1<br />

DSP56F807EVM<br />

S/N<br />

S4 S5 S6<br />

GP1 GP2 RUN/STOP<br />

JG4 U9<br />

S1 S2 S3<br />

P1<br />

P3 RESET IRQA IRQB<br />

3<br />

1<br />

JG16<br />

1<br />

Figure 12-94. DSP56F807EVM Jumper Reference<br />

Table 12-27. DSP56F807EVM Jumper Settings<br />

Jumper Group Comment Connections<br />

JG1 Primary UNI-3 DCBus Overcurrent Selected for FAULTA1 2–3<br />

JG2 Secondary UNI-3 Phase A Overcurrent Selected for FAULTB1 1–2<br />

JG3 CAN termination unselected NC<br />

JG4 Enable on-board Parallel JTAG Host/Target Interface NC<br />

JG5 Use on-board EXTAL crystal input for DSP oscillator 2–3<br />

JG6 Use on-board XTAL crystal input for DSP oscillator 1–2<br />

JG7 Selects DSP’s Mode 0 operation upon exit from reset 1–2<br />

JG8 Enable on-board SRAM 1–2<br />

JG9 Enable RS-232 output NC<br />

JG10 Secondary UNI-3 3-Phase Current Sense Selected as inputs to A/D 2–3, 5–6, 8–9<br />

JG11 Secondary UNI-3 serial selected 1–2, 3–4, 5–6, 7–8<br />

JG12 Primary Encoder Input Selected 2–3, 5–6, 8–9<br />

12-128 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

3<br />

JG6<br />

U2<br />

3<br />

2<br />

1<br />

JG13<br />

JG8<br />

JG10<br />

3<br />

2<br />

1<br />

JG11<br />

JTAG<br />

JG4<br />

J3<br />

JG2<br />

P2<br />

J2<br />

3<br />

2<br />

1<br />

JG10<br />

JG2<br />

JG11<br />

1 2<br />

7 8<br />

JG8<br />

3<br />

1<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Digital Power Factor Correction Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 12-27. DSP56F807EVM Jumper Settings (Continued)<br />

Jumper Group Comment Connections<br />

JG13 Secondary Encoder Input Selected 2–3, 5–6, 8–9<br />

JG14 Primary UNI-3 3-Phase Current Sense Selected as inputs to A/D 2–3, 5–6, 8–9<br />

JG15 Primary UNI-3 serial selected 1–2, 3–4, 5–6, 7–8<br />

JG16 PD0 input selected as a high input 1–2<br />

JG17 PD1 input selected as a high input 1–2<br />

NOTE: When running the EVM target system in a stand-alone mode from Flash, the JG4<br />

jumper must be set in the 1-2 configuration to disable the command converter parallel<br />

port interface.<br />

12.14.4 Build<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

When building this application, the user can create an application that runs from internal Flash or<br />

External RAM. To select the type of application to build, open the Digital_PFC.mcp project and<br />

select the target build type; see Figure 12-95. Selecting Build All will create all application build<br />

types. A definition of the projects associated with these target build types may be viewed under<br />

the Targets tab of the project window.<br />

Figure 12-95. Target Build Selection<br />

The project may now be built by executing the Make command, shown in Figure 12-96. This will<br />

build and link the Digital Power Factor Correction Application and all needed MetroWerks and<br />

<strong>SDK</strong> libraries.<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-129<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

12.14.5 Execute<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 12-96. Execute Make Command<br />

To execute the Digital Power Factor Correction Application, select Project\Debug in the<br />

CodeWarrior IDE, followed by the Project\Run command. For more help with these commands,<br />

refer to the CodeWarrior tutorial documentation in the following file located in the CodeWarrior<br />

installation directory:<br />

\CodeWarrior Documentation\PDF\Targeting_DSP56800.pdf<br />

If the Flash target is selected, CodeWarrior will automatically program the DSP’s internal Flash<br />

with the executable generated during Build. If the External RAM target is selected, the executable<br />

will be loaded to off-chip RAM.<br />

Once Flash has been programmed with the executable, the EVM target system may be run in a<br />

stand-alone mode from Flash. To do this, set the JG4 jumper in the 1-2 configuration to disable<br />

the parallel port, and press the RESET button.<br />

Once the application is running, the green USER LED blinks at a 2Hz frequency. To enable the<br />

PFC conversion, set the RUN/STOP switch to the RUN position. If this switch was in the RUN<br />

position before the application started, switch it to the STOP position, then to the RUN position.<br />

The green USER LED will light continuously when the PFC conversion is enabled. To disable the<br />

PFC conversion, the RUN/STOP switch should be moved to the STOP position (the green USER<br />

LED will blink again).<br />

You should also see a lighted green USER LED which indicates that the application is running. If<br />

the application is stopped, the green USER LED will blink at a 2Hz frequency.<br />

12-130 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Digital Power Factor Correction for 3-phase AC Motor V/Hz Open Loop Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

12.15 Digital Power Factor Correction for 3-phase<br />

AC Motor V/Hz Open Loop Application<br />

This application demonstrates integration of the Power Factor Correction with a motor control<br />

application. It is based on the 3-phase AC Motor V/Hz Open Loop application and performs the<br />

same functionality. Only the power supply was changed for the current implementation. The<br />

application uses the DSP56F807EVM board, Optoisolation board, and 3-phase AC/BLDC<br />

High-Voltage power stage board.<br />

12.15.1 Files<br />

The Digital Power Factor Correction for 3-Phase AC Motor V/Hz Open Loop application is found<br />

in the directory:<br />

..\dsp56807evm\nos\applications\3ph_AC_VHz_OpenLoop_PFC\<br />

and is composed of the following files:<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

• 3ph_AC_VHz_OpenLoop_PFC.c, main program<br />

• 3ph_AC_VHz_OpenLoop_PFC.mcp, application project file<br />

• dpfc.c, digital PFC program module<br />

• dpfc.h, digital PFC header file<br />

• appconst.c, application constants placed in data Flash<br />

• appconst.h, header file for appconst.c<br />

• ConfigExtRam\appconfig.c, application configuration file for External RAM<br />

• ConfigExtRam\appconfig.h, application configuration header file for External RAM<br />

• ConfigExtRam\linker.cmd, linker command file for External RAM<br />

• ConfigFlash\appconfig.c, application configuration file for Flash<br />

• ConfigFlash\appconfig.h, application configuration header file for Flash<br />

• ConfigFlash\linker.cmd, linker command file for Flash<br />

• ConfigFlash\flash.cfg, configuration file for Flash<br />

• PC_Master\3ph_AC_VHz_ExtRam.pmp, PCMaster file for External RAM<br />

• PC_Master\3ph_AC_VHz_Flash.pmp, PCMaster file for Flash<br />

These files are located in the <strong>SDK</strong> installation directory.<br />

The targeting for DSP56F807EVM has some specific lines in the dpfc.c C-source file. The<br />

following lines indicate which pin will be used to provide the PFC inhibit output functionality:<br />

/* Uncomment one of the following lines */<br />

#define DSP56F805EVM<br />

// #define DSP56F803EVM<br />

The hardware design of the DSP56F807EVM is identical to the DSP56F805 EVM, and uses the<br />

timer C channel 0 output pin to provide PFC inhibit output. The timer channel must be defined in<br />

the appconfig.h file:<br />

#define INCLUDE_USER_TIMER_C_0 0<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-131<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

12.15.2 Specification<br />

The Digital PFC for the 3-phase AC Motor V/Hz Open Loop application performs power factor<br />

correction for the 3-phase AC/BLDC High-Voltage Power Stage hardware with 3-phase induction<br />

motor drive. It is a demo that evaluates how to integrate the PFC control software with a motor<br />

control application for current hardware implementation. The application may be build to run<br />

from either External RAM or Flash. The input power line must meet the following requirements:<br />

• Input voltage value of 115 or 220 volts<br />

• Input voltage frequency of 50 or 60 Hz<br />

The Digital PFC for the 3-phase AC Motor V/Hz Open Loop application allows execution in<br />

either manual or PC master software mode, which were described in Section 12.11.<br />

12.15.3 Set-up<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

Figure 12-97 illustrates the hardware set-up for Digital PFC for the 3-phase AC Motor V/Hz Open<br />

Loop application. The configuration is basically the same as for the 3-phase AC Motor V/Hz<br />

Open Loop application, with the following difference:<br />

:The AC/BLDC High-Voltage Power Stage board contains a JP201 jumper which selects the<br />

power supply device. The 2-3 pins of the JP201 connection correspond to a simple<br />

rectifier-capacitor power stage. Set-up of the PFC hardware requires the 1-2 pins of JP201<br />

connection.<br />

12-132 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Digital Power Factor Correction for 3-phase AC Motor V/Hz Open Loop Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Figure 12-97. Set-up of the Digital PFC for 3-phase AC Motor V/Hz Open Loop Application<br />

The correct order of phases (phase A, phase B, phase C) for the AC induction motor shown in<br />

Figure 12-97 is:<br />

• phase A = red wire<br />

• phase B = white wire<br />

• phase C = black wire<br />

When facing a motor shaft, if the phase order is: phase A, phase B, phase C, the motor shaft<br />

should rotate clockwise (i.e., positive direction, positive speed).<br />

12.15.3.1 EVM Jumper Settings<br />

To execute the Digital PFC for the 3-phase AC Motor V/Hz Open Loop Application, the<br />

DSP56F807 board requires the same strap settings as in the 3-phase AC Motor V/Hz Open Loop<br />

application; see Section 12.11.<br />

12.15.3.2 Build<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

To build this application, open the 3ph_AC_VHz_OpenLoop_PFC.mcp project file and follow the<br />

instructions in Section 12.11.<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-133<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

12.15.4 Execute<br />

To execute the Digital PFC for 3-phase AC Motor V/Hz Open Loop application, follow the<br />

instructions in Section 12.11.<br />

12.16 Serial Bootloader<br />

The Serial Bootloader is developed to load and run a proprietary user application presented as<br />

S-record file into the Program and Data memory. The Serial Bootloader is located in the dedicated<br />

Program Memory region called Boot Flash. The Serial Bootloader supports the easiest serial<br />

protocol, so a standard serial terminal program can be used on a host PC.<br />

12.16.1 Files<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The Serial Bootloader application includes the following files:<br />

• ..\dsp56807evm\nos\applications\serial_bootloader\bootloader.mcp, project file<br />

• ..\dsp56807evm\nos\applications\serial_bootloader\bootloader.c, main program<br />

• ..\dsp56807evm\nos\applications\serial_bootloader\bootloader.h, header file with<br />

common parameters<br />

• ..\dsp56807evm\nos\applications\serial_bootloader\com.c, communication module<br />

• ..\dsp56807evm\nos\applications\serial_bootloader\com.h, header for communication<br />

module<br />

• ..\dsp56807evm\nos\applications\serial_bootloader\sparser.c, S-Record format parser<br />

module<br />

• ..\dsp56807evm\nos\applications\serial_bootloader\sparser.h, header for S-Record<br />

parser module<br />

• ..\dsp56807evm\nos\applications\serial_bootloader\prog.c, flash programming module<br />

• ..\dsp56807evm\nos\applications\serial_bootloader\prog.h, header for Flash<br />

programming module<br />

• ..\dsp56807evm\nos\applications\serial_bootloader\bootstart.c, startup module<br />

• ..\dsp56807evm\nos\applications\serial_bootloader\constdata.asm, description of<br />

strings data<br />

• ..\dsp56807evm\nos\applications\serial_bootloader\resetvector.asm, Reset and COP<br />

Reset interrupt vectors description<br />

• ..\dsp56807evm\nos\applications\serial_bootloader\TargetDirectives, Board name<br />

definition<br />

• ..\dsp56807evm\nos\applications\serial_bootloader\config\linker.cmd, linker<br />

command file used for Boot Flash<br />

• ..\dsp56807evm\nos\applications\serial_bootloader\config\flash.cfg, MetroWerks<br />

CodeWarrior configuration file to work with Flash<br />

These files are located in the <strong>SDK</strong> installation directory.<br />

The Bootloader application does not use other <strong>SDK</strong> files except port.h, arch.h and periph.h from<br />

the ..\nos\include directory. It can be compiled and used without other parts of the <strong>SDK</strong>.<br />

12-134 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

12.16.2 Specification<br />

Serial Bootloader<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

The Serial Bootloader application reads an S-Record file of a user application (for example,<br />

generated by CodeWarrior) via a serial interface, parses the S-Record file and stores needed data<br />

in Program and Data Flash memory. When the processing of the S-Record file is finished, the<br />

Bootloader launches the loaded application. If any error occurs during the loading of the S-Record<br />

file, the Bootloader outputs an error message with an error number via the serial connection and<br />

performs a processor reset.<br />

12.16.3 Set-up<br />

To use the Bootloader, it must be programmed into boot Flash; the EVM P3 socket must be<br />

connected with the host PC COM serial port by a serial cable; and jumpers on the EVM must be<br />

set for use of internal memory without debug interface.<br />

12.16.3.1 EVM Jumper Settings<br />

To load the Bootloader into the DSP56F807 board, the following jumper settings are needed:<br />

• Set jumper JG7, “Select DSP‘s Mode 0 operation upon exit from reset”<br />

• Leave jumper JG9, “Enable RS-232 output”, in its default setting (NC)<br />

• Remove jumper JG4, “Enable on-board Parallel JTAG Host Target Interface”<br />

To start a previously-loaded Bootloader on the DSP56F807 board, the following jumper settings<br />

are needed:<br />

• Set jumper JG7, “Select DSP‘s Mode 0 operation upon exit from reset”<br />

• Leave jumper JG9, “Enable RS-232 output”, in its default setting (NC)<br />

• Set jumper JG4, “Enable on-board Parallel JTAG Host Target Interface”<br />

12.16.4 Build<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

To build this application, open the bootloader.mcp project file in the CodeWarrior IDE and<br />

execute the Project\Make command. This will build and link the Serial Bootloader application.<br />

12.16.4.1 Download into Boot Flash<br />

To download, build the Bootloader from Codewarrior and load it into the board by choosing the<br />

Project\Debug command in the CodeWarrior IDE. Make sure that jumpers were set as described<br />

for loading the Bootloader in Section 12.16.3.1.<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-135<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

12.16.4.2 Host Terminal Program Set-up<br />

A host terminal program is used to communicate with the Bootloader. The terminal must be<br />

configured as follows:<br />

Baud rate<br />

8N1<br />

The following description assumes that Microsoft Windows HyperTerminal program is used. To<br />

configure Microsoft HyperTerminal to communicate with the Bootloader, the PC user should start<br />

HyperTerminal and create a new connection. Select the COM port previously connected to the<br />

EVM; set baud rate to 115200 bps; data bits equal to 8, parity none, stop bits 1; and flow control<br />

as Xon/Xoff. The Hyperterminal can now display Bootloader messages.<br />

12.16.5 Execute<br />

To execute the Serial Bootloader application after loading it into Flash, set jumpers as described<br />

in Section 12.16.3.1. to start the Bootloader and push the RESET button.<br />

If the terminal program and the connections between the EVM and the Host PC are set properly,<br />

the terminal program will display the Bootloader’s start-up message:<br />

“(c) 2000-2001 Motorola Inc. S-Record loader. Version 1.1”<br />

To load the S-Record file, select the HyperTerminal menu item Transfer/Send text file and select a<br />

file. When the S-Record file is loaded and the application is started, the terminal window will<br />

display a message similar to this:<br />

“(c) 2000-2001 Motorola Inc. S-Record loader. Version 1.1<br />

Loaded 0x044d Program and 0x000a Data words.<br />

Application started.”<br />

The download rate is about 7660 bytes of S-Record file per second loaded from the terminal, or<br />

about 1740 words of program or data memory stored into Flash per second.<br />

If any error is detected while loading the S-Record file, the Bootloader displays an error message<br />

and resets the processor. For example, if an S-record file contains a character that is not permitted<br />

for S-Records, the following message is displayed:<br />

“(c) 2000-2001 Motorola Inc. S-Record loader. Version 1.1<br />

Error # 0002<br />

Resetting the processor.”<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

115200 bps<br />

Flow control protocol Xon/Xoff<br />

8 data bits, no parity, 1 stop bit character format<br />

After delivering this message, the Bootloader resets the processor and waits for the S-Record file<br />

again. Other loading errors are described in Table 12-28.<br />

12-136 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Error<br />

Code<br />

Serial Bootloader<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Table 12-28. Error Codes for the Serial Bootloader Application<br />

Error Title Possible Reasons What to Do<br />

1 Data Receive Error •Any SCI error except Noise Error<br />

(Overrun, Frame Error, Parity<br />

Error)<br />

2 Invalid Character •Received character is not ‘S’ or<br />

any hexadecimal digit.<br />

3 Invalid S-Record<br />

Format<br />

4 Wrong S-Record<br />

Fhecksum<br />

If previously loaded via the Bootloader, an application uses the <strong>SDK</strong> variable<br />

BSP_BOOTLOADER_DELAY (see Section 12.16.6) to wait for a new S-Record file; it waits only<br />

until a required time-out expires and re-launches the application. In such cases, the terminal<br />

window displays a message similar to this:<br />

“(c) 2000-2001 Motorola Inc. S-Record loader. Version 1.1<br />

Application started.”<br />

•Invalid record type; permitted<br />

type is 0,3,7<br />

•S-Record length is less than<br />

address plus checksum length<br />

•Checksum calculated around<br />

received S-Record did not match<br />

received one<br />

12.16.6 Requirements for a Loaded Program<br />

•Check connections with Host PC and<br />

settings for host terminal program<br />

•Verify that S-Record file does not<br />

contain any inaccurate characters<br />

•Check connections and send mode in<br />

terminal program<br />

•Verify S-Record file<br />

•Check S-Record file<br />

•Check connections and send mode in<br />

terminal program<br />

5 Buffer Overrun •Internal data buffer was full •Terminal program did not stop after<br />

receiving Xoff character<br />

•Confirm the terminal program supports<br />

Xon/Xoff flow control protocol<br />

6 Flash<br />

Programming Error<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

After programming a word into<br />

Flash, the programmed word read<br />

back is not equal to the expected<br />

value<br />

•The Bootloader tries to program Flash<br />

only once and performs a read back /<br />

verify of the value<br />

7 Internal Error Bootloader data corrupted •Try to reload Bootloader via<br />

CodeWarrior<br />

If an application is loaded via the Bootloader, it must meet the following requirements:<br />

• Particular start address for application - The entry point for the loaded application must<br />

be located at address 0x0080 in Program memory; i.e., immediately after the interrupt table<br />

• Application COP vector - To use COP interrupt vector in an application loaded via<br />

Bootloader, the entry point for COP ISR must be located at address 0x0082 in Program<br />

memory<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-137<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

• Application start delay variable must be set at address 0x0085 in Program Flash - The<br />

<strong>SDK</strong> provides a configuration variable for this purpose. For details on managing the<br />

Bootloader without <strong>SDK</strong> support, see the config\vector.c file in the <strong>SDK</strong>.<br />

• Use of restricted resources - An application cannot occupy Reset and COP interrupt<br />

vectors, and cannot place code into the Boot Flash memory area. There is no way to place<br />

any initialized variable from an application into internal data RAM while loading, as this<br />

memory area is used by the Bootloader. All data from S-Record files that address to the<br />

restricted area will be ignored. External Program memory is also unavailable while loading<br />

an application, because the Bootloader utilizes the DSP’s Mode 0A memory map.<br />

All applications built with the <strong>SDK</strong> can be loaded via the Serial Bootloader. The <strong>SDK</strong> provides<br />

fixed addresses for application entry points, a redirect for an application COP vector and uses the<br />

configuration variable (BSP_BOOTLOADER_DELAY) in the appconfig.h file to specify the<br />

amount of time the Serial Bootloader will wait prior to launching the application already stored in<br />

Flash.<br />

The possible values of BSP_BOOTLOADER_DELAY:<br />

0 Disable the Bootloader and start the application immediately<br />

without waiting. After loading the application with this setting,<br />

there are only two ways to re-enter Bootloader:<br />

0 - 254<br />

255<br />

• Reload the Bootloader from Metrowerks CodeWarrior into<br />

Boot Flash again<br />

• Reprogram the value of the start delay variable located on<br />

address 0x0083 in the Program Flash into zero value<br />

(0x0000) in the loaded application<br />

Set waiting time for start of S-Record file for 0-255 seconds before<br />

starting a previously-loaded application<br />

Set waiting time to infinity. After reset, the Bootloader waits for a<br />

new S-Record file without counting down any time-out.<br />

If there is no BSP_BOOTLOADER_DELAY in the appconfig.h file, the default value for the<br />

time-out is 30 seconds.<br />

12.16.7 DSP Peripheral Usage<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

If the DSP is used in a single chip mode, the Bootloader uses only internal data RAM for data<br />

buffering.<br />

The Bootloader does not initialize any DSP peripherals except SCI 0, Port E and PLL unitization.<br />

The PLL multiplier is set to 18, which equals the DSP’s 72MHz operational frequency. Before the<br />

application starts, SCI 0 is disabled, but PLL does not reprogram to its initial state.<br />

The Bootloader uses a statically-calculated SCI baud rate value. This value is calculated assuming<br />

an external oscillator frequencyof 8MHz.<br />

12-138 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

ADC Application<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

12.17 ADC Application<br />

For details on building and executing this application, see Section 5.4.6.<br />

12.18 COP Driver Application<br />

Refer to Section 5.10.3 for information on building and executing the Computer Operating<br />

Properly Driver Application.<br />

12.19 PWM Application<br />

See Section 5.8.6 for more information on building and executing the PWM Driver Application.<br />

12.20 Quad Timer Application<br />

To learn more about building and executing this application, refer to Section 5.5.6.<br />

12.21 SCI Application<br />

Section 5.3.6 contains details on building and executing the SCI Driver Application.<br />

12.22 Timer Application<br />

This application exercises the Timer peripheral located on the DSP56F8xx processor.<br />

12.22.1 Files<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

The Timer application is composed of the following files:<br />

• ...\dsp568xxevm\nos\applications\timers\timers.c, main program<br />

• ...\dsp568xxevm\nos\applications\timers\timers.mcp, application project file<br />

• ...\dsp568xxevm\nos\applications\timers\Config\appconfig.c, application configuration<br />

file<br />

• ...\dsp568xxevm\nos\applications\timers\Config\appconfig.h, application configuration<br />

file<br />

• ...\dsp568xxevm\nos\applications\timers\Config\linker.cmd, linker command file<br />

These files are located in the <strong>SDK</strong> installation directory.<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-139<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

12.22.2 Specifications<br />

This application exercises Timer0, Timer1, and Timer2 peripherals located in the DSP56F8xx<br />

processor. It initializes Timer1 using clock ID CLOCK_AUX1 to 250ms with a reload value of<br />

250ms. Timer2 is initialized using clock ID CLOCK_AUX2 to 125ms with a reload value of<br />

125ms. When these timers expire, the application changes the On/Off state of the yellow and red<br />

LEDs. The net effect of this is that the yellow LED will come On once every 0.5 seconds, and the<br />

red LED will come On once every 0.25 seconds.<br />

For interaction with Timer0, the application uses the <strong>SDK</strong> timer services. The <strong>SDK</strong> timer services<br />

reserve Timer0 with clock ID CLOCK_REALTIME, and utilizes this timer for nanosleep<br />

functionality. This application calls the nanosleep interface with a time-out value of 0.5 seconds<br />

in a tight loop. The net effect of this call will be suspension of the main function execution for 0.5<br />

seconds.<br />

12.22.3 Set-up<br />

Jumper Settings:<br />

Use the default jumper settings for the DSP56F807EVM board. See the DSP56F807 Evaluation<br />

Module Hardware User’s Manual for more information on jumper settings.<br />

12.22.4 Build<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

To make this application, open the timers.mcp project file and execute the Make command as<br />

shown in Figure 12-98. This will build and link the Timer application and all needed Metrowerks<br />

and <strong>SDK</strong> libraries.<br />

Figure 12-98. Execute Make Command<br />

12-140 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

12.22.5 Execute<br />

To execute the Timer application, choose the Program/Debug command in the CodeWarrior IDE,<br />

followed by the Run command. For more help with these commands, refer to the CodeWarrior<br />

tutorial documentation in the following file, located in the CodeWarrior installation directory:<br />

\CodeWarrior Documentation\PDF\Targeting_DSP56800.pdf<br />

Once the application is running, you should see the green LED come On every 1 second, the<br />

yellow LED come On every 0.5 seconds , and the red LED come On every 0.25 seconds.<br />

12.23 CAN<br />

The Motorola Scalable Controller Area Network (MSCAN) driver is described in more detail in<br />

the DSP56800/MSCAN Driver User’s Manual.<br />

12.24 Flash Application<br />

For information on how to build and execute this application, see Section 5.2.6.<br />

12.25 DAC Application<br />

Section 6.7.6 describes how to build and execute this application.<br />

12.26 SPI Application<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

To learn more about building and executing this application, refer to Section 5.1.6.<br />

CAN<br />

MOTOROLA DSP56F807 Applications<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

12-141<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

DSP56F807 Applications<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

12-142 Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Index<br />

Numerics<br />

3DES 7-16<br />

3-phase AC Ind. motor<br />

specification 11-99, 12-100<br />

3-Phase AC Induction (AC Ind.) 11-98, 12-100<br />

3-phase AC Motor Control<br />

setup 11-104<br />

3-phase AC V/Hz<br />

execution 11-108<br />

3-Phase SR<br />

High Voltage Power Stage 10-48, 10-58, 10-69,<br />

10-80, 11-50, 11-60, 11-71, 11-80, 12-51,<br />

12-60, 12-71, 12-82<br />

Low Voltage Power Stage 10-58, 11-60, 12-60<br />

3-phase SR<br />

specification 11-60, 12-60<br />

3-phase SR Motor<br />

execution 10-56, 10-76, 10-86, 11-57, 11-68,<br />

11-77, 11-87, 12-58, 12-68, 12-78, 12-88<br />

A<br />

ADC Data Structure 5-35, 5-39<br />

ADC Driver 5-35<br />

ADC Ioctl Commands 5-44<br />

Answering modem 7-11<br />

Application<br />

closed loop 11-98, 12-100<br />

open loop 9-7, 10-106, 11-88, 11-108, 12-89,<br />

12-111<br />

Applications<br />

3-Phase SR Motor Control 11-59, 12-60<br />

autoCorr Performance 7-3<br />

B<br />

Back-EMF Zero Crossing Application 10-27<br />

BLDC<br />

Motor Control 11-45<br />

specifications 11-28, 11-38, 12-27, 12-37<br />

BLDC Motor Control<br />

execution 11-36, 11-45, 12-36, 12-46<br />

BLDC Sensorless 10-27, 10-36<br />

buildall.mcp 1-3<br />

C<br />

Calling modem 7-11<br />

CID xlix<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

CodeWarrior<br />

IDE 10-56, 10-76, 10-86, 11-57, 11-68, 11-77,<br />

11-87, 11-107, 12-58, 12-78, 12-88<br />

Registration 1-2<br />

MOTOROLA Index<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

i<br />

D<br />

DES 7-14<br />

Device Drivers 4-5<br />

Directory Structure 2-1<br />

domain specific libraries 7-1<br />

DSP xlix<br />

DSP56800 Family Manual xlix<br />

DSP5680x User’s Manual xlix<br />

DTMF Generation Library 7-21<br />

E<br />

<strong>Embedded</strong> <strong>SDK</strong> Programmer’s Guide xlix<br />

F<br />

FaultStatus 11-31, 11-40, 12-29, 12-39<br />

FFT xlix<br />

FILE I/O Driver 6-11<br />

FIR xlix<br />

Flash Driver 5-12<br />

Flash Driver Arguments 5-21<br />

Flash Ioctl Commands 5-21<br />

Flash Memory blocks 5-12<br />

G<br />

GPIO Driver 5-71<br />

GPIO Ioctl Commands 5-76<br />

I<br />

I/O xlix<br />

IDE xlix<br />

IIR xlix<br />

Install CodeWarrior 1-1<br />

Interrupt Dispatchers 4-1<br />

Interrupt Priorities 4-5<br />

J<br />

Jumper Group 9-6, 9-14, 12-8, 12-16, 12-24, 12-34,<br />

12-44, 12-56, 12-66, 12-76, 12-86, 12-128<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

L<br />

JG1 9-6, 9-14, 12-8, 12-16, 12-24, 12-35, 12-44,<br />

12-57, 12-67, 12-77, 12-87, 12-98, 12-109,<br />

12-121, 12-129<br />

JG10 12-8, 12-16, 12-24, 12-34, 12-44, 12-56,<br />

12-66, 12-76, 12-86, 12-97, 12-108, 12-120,<br />

12-128<br />

JG11 12-8, 12-16, 12-24, 12-34, 12-44, 12-57,<br />

12-66, 12-76, 12-86, 12-97, 12-108, 12-120,<br />

12-128<br />

JG12 12-8, 12-16, 12-24, 12-34, 12-44, 12-57,<br />

12-66, 12-76, 12-86, 12-97, 12-108, 12-120,<br />

12-128<br />

JG13 12-8, 12-16, 12-24, 12-34, 12-44, 12-57,<br />

12-67, 12-77, 12-86, 12-97, 12-108, 12-120,<br />

12-129<br />

JG14 12-8, 12-16, 12-24, 12-34, 12-44, 12-57,<br />

12-67, 12-77, 12-87, 12-98, 12-109, 12-121,<br />

12-129<br />

JG15 12-8, 12-16, 12-24, 12-34, 12-44, 12-56,<br />

12-66, 12-76, 12-86, 12-97, 12-108, 12-120,<br />

12-128<br />

JG16 12-8, 12-16, 12-24, 12-34, 12-44, 12-56,<br />

12-66, 12-76, 12-86, 12-97, 12-108, 12-120,<br />

12-128<br />

JG17 12-8, 12-16, 12-24, 12-34, 12-44, 12-56,<br />

12-66, 12-76, 12-86, 12-97, 12-108, 12-120,<br />

12-128<br />

JG2 9-6, 9-14, 12-8, 12-16, 12-24, 12-35, 12-44,<br />

12-57, 12-67, 12-77, 12-87, 12-98, 12-109,<br />

12-121, 12-129<br />

JG3 9-6, 9-14, 12-8, 12-16, 12-24, 12-35, 12-44,<br />

12-57, 12-67, 12-77, 12-87, 12-98, 12-109,<br />

12-121, 12-129<br />

JG4 9-6, 9-14, 12-8, 12-16, 12-24, 12-34, 12-44,<br />

12-57, 12-66, 12-76, 12-86, 12-97, 12-108,<br />

12-120, 12-128<br />

JG5 9-6, 9-14, 12-8, 12-16, 12-24, 12-34, 12-44,<br />

12-56, 12-66, 12-76, 12-86, 12-97, 12-108,<br />

12-120, 12-128<br />

JG6 9-6, 9-14, 12-8, 12-16, 12-24, 12-34, 12-44,<br />

12-56, 12-66, 12-76, 12-86, 12-97, 12-108,<br />

12-120, 12-128<br />

JG7 9-6, 9-14, 12-8, 12-16, 12-24, 12-34, 12-44,<br />

12-56, 12-66, 12-76, 12-86, 12-97, 12-108,<br />

12-120, 12-128<br />

JG8 9-6, 9-14, 12-8, 12-16, 12-24, 12-34, 12-44,<br />

12-56, 12-66, 12-76, 12-86, 12-97, 12-108,<br />

12-120, 12-128<br />

JG9 9-6, 9-14, 12-8, 12-16, 12-24, 12-34, 12-44,<br />

12-57, 12-66, 12-76, 12-86, 12-97, 12-108,<br />

12-120, 12-128<br />

LED Driver 6-1<br />

LED Driver Arguments 6-5, 6-10<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

LED Ioctl Commands 6-5<br />

license key 1-2<br />

LSB xlix<br />

ii Targeting Motorola DSP56F80x Platform<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

MOTOROLA<br />

M<br />

MAC xlix<br />

Metrowerks 11-36, 11-45<br />

Metrowerks CodeWarrior 1-1<br />

MIPS xlix<br />

MSB xlix<br />

N<br />

Nested Interrupts 4-3<br />

O<br />

OCCS<br />

Block Diagram 5-124<br />

OMR xlix<br />

OnCE xlix<br />

Operating Mode<br />

Manual<br />

3-phase AC Ind 10-3, 10-11, 10-19, 11-3,<br />

11-12, 11-20, 12-3, 12-11, 12-20, 12-102<br />

3-phase SR motor control 10-49, 10-69,<br />

10-80, 11-50, 11-60, 11-71, 11-81,<br />

12-51, 12-61, 12-71, 12-82<br />

BLDC sensorless motor control 11-29, 11-38,<br />

12-27, 12-38<br />

Remote<br />

3-phase AC Ind 10-5, 10-13, 10-21, 11-4,<br />

11-14, 11-21, 12-5, 12-13, 12-21, 12-104<br />

3-phase SR motor control 10-50, 10-71,<br />

10-81, 11-52, 11-62, 11-72, 11-82,<br />

12-52, 12-62, 12-73, 12-83<br />

BLDC sensorless motor control 11-30, 11-39,<br />

12-29, 12-39<br />

Optoisolation board 10-45, 10-67, 10-78, 11-46, 11-59,<br />

11-69, 11-79, 12-47, 12-60, 12-69, 12-80<br />

P<br />

PC xlix<br />

PC Master SCI Communication Driver 6-20<br />

PCM 7-26<br />

Program/Debug 11-107<br />

3-phase SR motor control 10-56, 10-76, 10-86,<br />

11-57, 11-68, 11-77, 11-87, 12-58, 12-78,<br />

12-88<br />

BLDC motor control 11-36, 12-36<br />

PWM Driver 5-101<br />

PWM Driver Arguments 5-109<br />

Q<br />

Quadrature Decoder Driver 5-83<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Quadrature Timer Driver 5-53<br />

Quick Start 1-1<br />

R<br />

Register CodeWarrior 1-2<br />

S<br />

SCI Driver 5-22<br />

SCI Driver Arguments 5-31<br />

SCI Ioctl Commands 5-31<br />

<strong>SDK</strong> xlix<br />

SP xlix<br />

SPI xlix<br />

SPI Data Structure 5-2<br />

SPI Driver 5-1<br />

SPI Driver Arguments 5-8<br />

SPI Ioctl Commands 5-8<br />

SR xlix<br />

SRC xlix<br />

Switch Driver 6-29<br />

Switched Reluctance (SR) 10-45, 10-67, 10-78, 11-46,<br />

11-59, 11-69, 11-79, 12-47, 12-60, 12-69, 12-80<br />

T<br />

Timer Application 9-21, 10-131, 11-135, 12-139<br />

Timer Drive 5-151<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

MOTOROLA Index<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

iii<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E


<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc...<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

Motorola reserves the right to make changes without further notice to any products herein. Motorola makes no warranty, representation or guarantee regarding the<br />

suitability of its products for any particular purpose, nor does Motorola assume any liability arising out of the application or use of any product or circuit, and<br />

specifically disclaims any and all liability, including without limitation consequential or incidental damages. “Typical” parameters which may be provided in Motorola<br />

data sheets and/or specifications can and do vary in different applications and actual performance may vary over time. All operating parameters, including<br />

“Typicals” must be validated for each customer application by customer’s technical experts. Motorola does not convey any license under its patent rights nor the<br />

rights of others. Motorola products are not designed, intended, or authorized for use as components in systems intended for surgical implant into the body, or other<br />

applications intended to support or sustain life, or for any other application in which the failure of the Motorola product could create a situation where personal injury<br />

or death may occur. Should Buyer purchase or use Motorola products for any such unintended or unauthorized application, Buyer shall indemnify and hold Motorola<br />

and its officers, employees, subsidiaries, affiliates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney fees<br />

arising out of, directly or indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if such claim alleges that<br />

Motorola was negligent regarding the design or manufacture of the part. Motorola and the Stylized M Logo are registered trademarks of Motorola, Inc. Motorola,<br />

Inc. is an Equal Opportunity/Affirmative Action Employer.<br />

MOTOROLA and the Stylized M Logo are registered in the US Patent & Trademark Office. All other product or service names are the property of their<br />

respective owners. © Motorola, Inc. 2003.<br />

How to reach us:<br />

USA/EUROPE/Locations Not Listed: Motorola Literature Distribution; P.O. Box 5405, Denver, Colorado 80217. 1–303–675–2140 or 1–800–441–2447<br />

JAPAN: Motorola Japan Ltd.; SPS, Technical Information Center, 3–20–1, Minami–Azabu. Minato–ku, Tokyo 106–8573 Japan. 81–3–3440–3569<br />

ASIA/PACIFIC: Motorola <strong>Semiconductor</strong>s H.K. Ltd.; Silicon Harbour Centre, 2 Dai King Street, Tai Po Industrial Estate, Tai Po, N.T., Hong Kong. 852–26668334<br />

Technical Information Center: 1–800–521–6274<br />

HOME PAGE: http://www.motorola.com/semiconductors/<br />

<strong>Freescale</strong> <strong>Semiconductor</strong>, Inc.<br />

ARCHIVED BY FREESCALE SEMICONDUCTOR, INC. 2005<br />

For More Information On This Product,<br />

Go to: www.freescale.com<br />

<strong>SDK</strong>126/D<br />

Because of an order from the United States International Trade Commission, BGA-packaged product lines and part numbers indicated here currently are not<br />

available from <strong>Freescale</strong> for import or sale in the United States prior to September 2010: DSP56F807VF80, DSP56F807VF80E

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!