TWR-KV31F120M Quick Start Guide

Transcription

TWR-KV31F120MQuick Start GuideDevelopment Kit forKinetis KV3x FamilyTower SystemDevelopment BoardPlatform

Quick Start GuideGet to Know the TWR-KV31F120MTWR-PIExtensionConnectorKV3x PowerSelect JumperPotentiometerFXOS8700CQ6-Axis r ControlConnectorPower/OpenSDAMicro-USB portReset ButtonUARTPort SelectorJTAGConnectorUser’sLEDsFigure 1: Front side of TWR-KV31F120MTWR-KV31F120M Tower System ModuleFreescale Tower System2The TWR-KV31F120M module is part of the Freescale Tower System, amodular development platform that enables rapid prototyping and toolreuse through reconfigurable hardware. Take your design to the next leveland begin constructing your Tower System platform today.

freescale.comIntroduction to TWR-KV31F120MTower System ModuleThe TWR-KV31F120M Tower System Module is a standalone development kit thatcan be used in conjunction with the Tower System development platform and theTWR-MC-LV3PH motor control module. To watch a video on how to configure theboard, go to freescale.com/TWR-KV31F120M.This Quick Start Guide will teach you to: Easily program precompiled examples for the KV3x MCU Run an IAR Embedded Workbench project featuring an A/D conversion application Spin the 3-phase motor included in the TWR-MC-LV3PH kit with a PMSM sensorlessFOC control algorithm while monitoring the motor with the FreeMASTER toolTWR-KV31F120M Tower System Module Features KV31F512VLL12 MCU (ARM Cortex -M4 120 MHz with FPU, 512 KB flash, 96 KBRAM, 2x 16-bit ADCs, 4x FlexTimer/PWM with up to 20 ch, 2x 12-bit DACs, 100LQFP) OpenSDA(1) debug circuit with Micro USB connector and virtual serial port FXOS8700CQ 6-axis combining accelerometer and magnetometer sensors Four user LEDs Four pushbuttons for user input or interrupts One potentiometer One motor control auxiliary connector and general-purpose Tower Plug-in(TWRPI) socketTools Required IAR Embedded Workbench V7.10 or higher Freescale FreeMASTER for real-time debug monitoring and data visualization(1)Refer to the OpenSDA User Guide available at freescale.com3

Quick Start GuideSoftware Installation Instructions1Download Softwareand ToolsDownload installationsoftware and documentationunder “Jump Start YourDesign” at freescale.com/TWR-KV31F120M.2Install theSoftware and Tools Install the IDE toolchain IAREmbedded Workbench for ARM v7.10 or later, 30-day free evaluationlicense, at iar.com/Freescale. Install the PEMicro Windows USB Drivers at pemicro.com/OpenSDA.4 Install the free debug monitoringand data visualization tool FreescaleFreeMASTER v1.4, or later, atfreescale.com/FreeMASTER.

freescale.comTWR-KV31F120M Tower SystemModule Initial Configuration3Default JumperSettings4See the default jumper settings in the tablebelow. Refer to the TWR-KV31F120MUser Guide at freescale.com/TWRKV31F120M for detailed J13ONJ3ONJ14ONJ4OPENJ15ONJ1J51–3J171–2, 3–4,5–6, ENJ251–2J12ONJ261–2Verification ofJumper SettingTWR-KV31F120M comes preloaded withthe P&E OpenSDA Applications (MSDflash programmer and debug) and theaccelerometer demo. Plug in the USBcable and angle the board left or right tomake the corresponding pair ofLEDs blink.TWR-KV31F120M Jumper Map5

Quick Start GuideTWR-KV31F120M Tower System Module DemoProgram a PrecompiledExample Using theOpenSDA MSD Application51) Launch the Bootloader ModeWindows will detect a new TWR-KV31F12drive, a PEMicro OpenSDA Debugperipheral, an OpenSDA CDC Serial Portand will automatically install the requesteddrivers.Press and hold the reset (SW5) buttonwhile plugging in the USB cable; thenrelease it. Windows will detect a newBOOTLOADER drive and automaticallyinstall requested drivers.2) Load the OpenSDA P&E ApplicationsCopy and paste MSD-DEBUG-TWRKV31F120M Pemicro.SDA fromOpenSDA Applications folder in quick startpackage to the BOOTLOADER drive inmy computer/disk drive. Unplug and plugback the USB cable.plug back the USB cable. Computer willdetect a new TWR-KV10Z32 drive andautomatically install the required drivers.63) Program a Precompiled Example forthe KV3xIn the TWR-KV31F12 drive, copy anySREC file from the Precompiled Examplesfolder of the Quick Start Package. Demowill start automatically when the downloadis complete. To program a new demo,just copy any other SREC file. It is notnecessary to disconnect the USB cable.

freescale.com6Debug Your FirstIAR Project1) Load the OpenSDA P&E DebugApplicationIf you followed the previous exercise,you can jump directly to the followinginstruction; otherwise, follow section 5“Program a Precompiled Example Usingthe OpenSDA MSD Application” to loadthe OpenSDA P&E applications.2) Launch IAR EWARM and Buildthe Potentiometer lab ProjectOpen the IAR project file potentiometerdemo.eww following the path ProjectLabs\build\iar\kv31\Potentiometer lab inthe Quick Start Package.3) Run IAR EWARM, or later Debug ModeFrom the toolbar, click on Downloadand Debug.Note: If a Connection Manager window appears,check that your board is configured with theOpenSDA P&E Debug Application, then connectto the Interface OpenSDA Embedded TowerDebug-USB Port.Start the debug session by selecting theGO option from the toolbar. Rotate thepotentiometer to turn on LEDs D3, D4,D6 and D7. From the toolbar, suspend thedemo using the Break option. Select Stopto return to the Edit Mode.Clean the project before selecting theaction Rebuild All.Note: The compilation may return warningmessages without consequence.7

Quick Start GuideRunning 3-Phase PMSM Motor7TWR-KV31F120M andTWR-MC-LV3PH Set UpNote: Refer to the TWR-KV31F120M UserGuide at freescale.com/TWR-KV31F120M fordetailed jumper description.1) Load the OpenSDA P&E DebugApplicationIf you followed the previous exercise,you can jump directly to the followinginstruction; otherwise, follow Step 5 in theProgram a Precompiled Example Using theOpenSDA MSD Application section to loadthe OpenSDA P&E applications.2) Connect the boards and the motorConnect TWR-KV31F120M and TWR-MCLV3PH with the jumper setup shown in thetable below following the black and whitemarkings on the Tower System elevators.Connect the motor to the three-prongconnectors (J5) of the motor module.First, plug the 24V power supply includedin the TWR-MC-LV3PH kit into the barrelconnector (J1) of the motor module.Then, connect the USB cable to TWRKV31F120M and the computer.8TWR-MC-LV3PH: Jumper 31–2J131–2J101–2J141–2J111–2

freescale.com8Working withIAR EWARM9Monitor the Project withFreeMASTER1) Compile the PMSM Sensorless FOCDemo with IAR EWARMLaunch Freescale FreeMASTER from theWindows Start menu.Open the IAR project file PMSMSensorless FOC.eww following thepath Project Labs\build\iar\kv31\PMSM Sensorless FOC in the Quick StartPackage.Note: At first start-up, you may have an errormessage regarding the COM connection.Clean the project before selecting theaction Rebuild All.Note: The compilation may return warningmessages without consequence.2) Run IAR EWARM Debug ModeFrom the toolbar, click on Downloadand Debug.Open the FreeMASTER project file PMSMSensorless FOC.pmp following the pathProject Labs\Freemaster\PMSM SensorlessFOC in the Quick Start Package. Theapplication interface, PMSM SensorlessVector Control on Kinetis KV31, will appear inFreeMASTER. The speed, position, voltageand current consumption of the motor canbe monitored and controlled.Start the debug session by selectingthe GO option.9

Quick Start GuideIn the Project Options, set the COM portaffected to the OpenSDA -CDC Serial Port(info available in Device Manager) and setthe baud rate/speed to 19200 bps (checkthe option Do not Open Port at Startupto avoid error messages at FreeMASTERstartup).From the toolbar, select the actionFile- Start the communication.Press button SW1 of the TWRKV31F120M board to spin the motorcounterclockwise. Press the SW1 buttonagain to increase the speed of the motor.Press button SW2 to decrease the speedand stop the motor.Or, in FreeMASTER speedometer or speedselector box, select the requested speedand the motor will spin automaticallycounterclockwise or clockwise.In IAR EWARM, from the toolbar, suspendthe demo using the Break option, or selectStop to return to the Edit Mode.10

freescale.comTWR-KV31F120M Jumper Map11

Get StartedDownload installation software and documentation under“Jump Start Your Design” at freescale.com/TWR-KV31F120M.SupportVisit freescale.com/support for a list of phonenumbers within your region.WarrantyVisit freescale.com/warranty for completewarranty information.For more information, etis or freescale.com/TowerJoin the online Tower community at towergeeks.orgFreescale, the Freescale logo and Kinetis are trademarks of FreescaleSemiconductor, Inc., Reg. U.S. Pat. & Tm. Off. Tower is a trademark ofFreescale Semiconductor, Inc. ARM and Cortex are registered trademarksof ARM Limited (or its subsidiaries) in the EU and/or elsewhere. All rightsreserved. All other product or service names are the property of theirrespective owners. 2014 Freescale Semiconductor, Inc.Doc Number: KINKV3XQSG REV 2Agile Number: 926-78855 Rev B

TWR-KV31F120M Tower System Module Freescale Tower System The TWR-KV31F120M module is part of the Freescale Tower System, a modular development platform that enables rapid prototyping and tool reuse through reconfigurable hardware. Take your design to the next level and begin constructing your Tower System platform today.