Home
UM 78K0R-SPINIT - Renesas Electronics
Contents
1. 00000 0 ee 12 Chapter A Quick Start Procedure for Motor Operation and Control EE 15 4 1 DLanGalone Mod ed pisses hie gcse eae ound whine ead BEE ee We Re T9 4 2 engl e te TEE 16 Chapter 5 Drive and Motor Protection 0 00 00 00000 17 Chapter GUI Operaton ee 18 6 1 Starter Kit Virtual UART for USB Installation 18 6 2 GUI Software Installation 22 6 3 TO use ET Ee NEE 23 6 4 Set the Serial Port Number 0 000 ccc eee cee e cere ce ee seen wees eeeuners 25 6 5 Run the Motor Using Speed Control Mode 26 6 6 Change the PID Settings eventer enteek anoa de a ap a a a dane 26 6 7 Change the Setup Settings 28 6 8 Change the Startup Settings ananuna eee eee eee e ee ee ene ne eeeeeas 29 Chapter 7 Flash Programming the 78KOR SPINIT Kit USB 31 7 1 78KOR SPINIT Switch Settings 31 7 2 Establish the Comm Port 31 7 3 Start the WriteEZ4 Application 33 7 4 WriteEZ4 Device Setup 2 Get AE SCENE cee bk ehh Raman he ENEE Pea NEE eww ede 34 7 5 WriteEZ4 Hex File Selection tg Eege ee aca neat eee tes 36 Chapter 8 Flash Programming with a Flash Programmer 39 8 1 Download the Following Files 39 8 2 Save and Uncompress the IAR Workbench Project 0 0000 e eee eee eee 40 8 3 Switch Settings and connecting the MINICUBE2 40 Chapter 9 Using the IAR Embedded Workbench 46 9 1 S ftware INStallaliOn EE 46 9 2 78KOR SPINIT Setu
2. 2009 0430 15 4239 Chksum 4347h PASS AutoProcedure E py PASS Area OOOO00h 00260 3h A File Device Help Programmer UD Programmer V3 23 Firmware YA 05 File checksum Type Chksum Area Connection to device Fort JART chu Pulse 0 Speed 1Mbps Range Chip Freg Internal OSC e Multiply 1 00 S Ready MUM a QB Programmer AutoProcedure The Verify Chip operation is enabled by setting the Read Verify after Program option in the Advanced Tab of the Device Setup Window The 78KORIE3 device has now been reprogrammed with the example program which is suitable for both standalone operation and remote operation using the GUI Please make a backup copy of the original hex file before programming or running the compiler User s Manual U19823EE1VOUMOO 45 46 Chapter 9 Using the IAR Embedded Workbench 9 1 The example software for use with the 78KOR SPINIT kit is for a HALL Sensored BLDC with 120 degree trapezoidal control for standalone GUI operation The kit is supplied with the 78KOR SPINIT pre programmed The complete example project program for the IAR 78K Embedded Workbench development tool environment can be downloaded from the motor contro web site as detailed in starter kit package i e where this manual was downloaded The software is supplied in source format and can be modified as required The following sections
3. Send Gains to ul Get Gains from ul Figure 6 15 GUI PID Gains Settings To read back the current PID settings from the 78KOR SPINIT click on the Get Gains from uC button and the GUI will be updated Changes can be made in this view and sent down to the 78KOR SPINIT Simply make the appropriate changes and click on the Send Gains to uC To make the changes permanent the user will have to modify the initialised values in the original IAR project files main_mcio c and then rebuild the project This requires a licensed version of either IAR Embedded Workbench Full Version or IAR Embedded Workbench Kick Start Version Find the function calls in the file main_mcio c and change the values that are passed to the functions Set these parameters to the values shown in the Tuning Window of the GUI Motor_SetSpeedKp 0 150 Motor_SetSpeedkKi 0 005 Motor_SetSpeedkd 0 001 Please note that only Speed Control Mode is described in this manual The full version of the NEC GUI manual Motor Control Graphical User Interface Users User s Manual U19823EE1VOUMOO 27 Chapter 6 28 GUI Operation Manual will further discuss all other operational modes and settings While the other control modes shown in the GUI will operate the motor this operation and subsequent performance cannot be guaranteed The term Motor Tuning is defined as the adjustment of motor start values motor stop values and the PID values i
4. File Device Help Om e 7 wie Se Device Setup paoe OB Frogrammer startup Command standby standard Advanced gt Parameter File Reads Success Read Foon ii eT s gt l gt Device Setup Look in C PRM 78F1235_ 1006 sl EI rk ES Sg Cancel Device Setup A Kc 78F1201 prm E ZGELZ23 prm ER fOF 1203 prin FOF 1224 prm Parameter file 78F1211 prm 78F1225 prm al 7eF1213 prm EH 78F1233 prm a Load file S 78F12Z14 prm E 78F1234 prm Il 78F1215 prm File checksum Filename F8F1235 prm Files of ype PRM Eise PRM d Cancel eee i OF Cancel OSC Multiply 1 00 b Aoa Ready NUM wt Parameter File Read Then press the OK button to return to the main menu system The text in the main screen should read gt Device Setup Parameter File Read Pass gt Next press the select the HEX file to be programmed from the Menu File gt Load Or press the Load File symbol in the ICON taskbar The following screen should open User s Manual U19823EE1VOUMOO 43 Chapter 8 44 Figure 8 8 Flash Programming with a Flash Programmer 5 x x QB Programmer Fie Device Help Programmer gt DH Programmer startup gt Command standby GB Programmer WP 22 gt Parameter File Read Firre sr MA UD Success Read Pac BIS All gt l gt Device Setup Look irs IC Ese ao ep PS Device Parameter File Read F
5. intel extended T Format variant Mone UK Cancel Figure 9 20 Linker Options Secondary File Output Options for node BLDC_HALL120_78K0RIE3 SS x Category Factory Settings General Options Chc Compiler Assembler Custom Build Output Extra Output define Diagnostics List Config Proce 41 KI Build Actions Always generate output Range checks e Generate errors Debugger M Segment overlap warnings IE 78 Generate warnings IECUBE No global type checking C Disabled A ial wWamnngs Erors Simulator Ce i l Tk 73 Uppress all warnings Suppress these diagnostics Treat these as warnings Treat these ag errors Cancel Figure 9 21 Linker Options Diagnostic settings 60 User s Manual U19823EE1VOUMOO Using the IAR Embedded Workbench Chapter 9 Options for node BLDC_HALL120_7 amp 8KORIE3 Category Factory Settings General Options Chl Compiler 45sembler Custom Build Output Extra Output Hdefine Diagnostics List Config Proce 3 A Build Actions G Jh Generate linker listing Debugger h Segment map File format IE 78 Symbals fe Text IECUBE C None HTML MINTCUBE C Symbol listing Simulator IT Lines page 80 aes f Module map ee Jh Module summary Include suppressed entries M Static overlay map Figure 9 22 Linker Options Generate MAP File Output Options for node BLDC_HALL120_76KORIE3 S D x Category
6. 12 08 Novena Square Singapore 307684 Tel 6253 8311 http www sg necel com NEC Electronics Korea Ltd 11F Samik Lavied or Bldg 720 2 Yeoksam Dong Kangnam Ku Seoul 135 080 Korea Tel 02 558 3737 http www kr necel com Readers Purpose Organization Legend Note Caution Numeric Notation Prefixes Preface This manual is intended for users who want to understand the functions of the 78KOR SPINIT for motor control This manual presents the hardware manual of the 78KOR SPINIT for motor control This system specification describes the following sections e Jumper Descriptions Hardware Setup e Schematics Symbols and notation are used as follows e Weight in data notation Left is high order column right is low order column e Active low notation xxx pin or signal name is over scored or xxx slash before signal name Memory map address High order at high stage and low order at low stage Additional remark or tip Item deserving extra attention Binary xXxxx or xxxB Decimal xxxx e Hexadecimal xxxxH or Ox xxxx representing powers of 2 address space memory capacity e K kilo 210 1024 e M mega 220 10242 1 048 576 e G giga 230 10243 1 073 741 824 User s Manual U19823EE1VOUMOO Table of Contents Chapter 1 Introduction 0000000000000 eee 10 Chapter 2 78KOR SPINIT Kit Contents 11 Chapter 3 Hardware Setup
7. f lock board Glock board Deia External fe External C System C Sustem Fallsahe break F View setup None MHz None kHz Target power off Permit Ce Not Permit Target connect oo Target Flash programming Ce Permit Not Permit Pin mask IT wall T TARGET RESET Cu T INTERNAL RESET C Cormect Wot Gonnect Memory map Start address Type og Internal ROM F O00000 Os0FFFF InternalAOM 64 Kbytes UvEE 200 OFFEFF Internal RAM 3072 bytes Remove Remove All Figure 9 28 Debugging Initial Hardware Setup Ensure that the settings are as defined above Notes 1 Ifthe Main Clock shows the Clock board detected then ensure that this is selected 2 If debugging with a motor connected check the A timer box in the Peripheral break settings as shown above to avoid damaging the motor driver devices fuse or motor Checking this box will force all timer output pins to a high impedance state during break conditions User s Manual U19823EE1VOUMOO 65 Chapter 9 Using the IAR Embedded Workbench LAP Embedded Workbench IDE Fle ER Yew Poet Oebug findetor Tools Widow Heb Csugetae ssf FSS er eae CH Se a a res 3 BrE SAAE eure eee Seinen E i BLDC _HALLI29_ 7SKORIE3 Debug v g Ha 2 GUI supportc gmmenoeeeeggeeeregegmgeeeebetegereen Ha ER initelise_herdware c Ha interrupt hevidiars c sorca code start CG Dram macc Ha R sub_rac
8. Factory Settings General Options Cic Compiler Assembler Custor Build Output Extra Output Hdefine Diagnostics List Contig Proce gt Build Actions Linker command file i Override default Dh LEIT_DIRESCONFIGS Ink OT 223 DA o al Debugger JE 20 TE _UBE MINT_UBE Simulator Override default program entry TK 78 GG Ertudabel programstart Defined by application Search paths one per line TOOLEIT_ DIR ESLIB Raw binary image File Symbol Segment Align E I i rea Figure 9 23 Linker Options Linker Command File Selection User s Manual U19823EE1VOUMOO 61 Chapter 9 Using the IAR Embedded Workbench Note The Linker Control File must match the device selected The remainder of the Linker setup can be left as the default setting 9 9 Integrated Debugger Selection Caution The MINICUBE debugger must be selected when using the MINICUBE2 and when using the onboard USB interface DO NOT SELECT THE TK 78 debugger option Options for node BLDC_HALL120_78KORIE3 ES Category Factor Settings General Options Cil Compiler Assembler Custom Build Setup Extra Options Plugins Build Actions Linker Driver MINICLIBE QB 7SK OMIM GB 9SK0SeeeMINL OB MIBI2 TE 5 hd Run te IECUBE MINICUBE main Simulator TK 7o Setup macros Use macro file Device descriptions Override default TOOLEIT_DIRSSCONFIGSO
9. connector Seeeeeegir pees BIEN ey weeeees 6 fa e Seggegeegeix 4 e eeeeee ei st Y A r TE D mn v bel F emgeet amp D s D SUN 0 S 5 REWER vi FORRAR RPM Operation Speed display controls dial 78KOR SPINIT Controller Board Layout To connect the motor attach the phase terminals to connector CN1 and the Hall sensor terminals to connector J5 as shown in Table 3 3 below Other low voltage BLDC motors with similar characteristics may be used Consult the motor specifications and make appropriate changes including software if necessary based your own assessment Motor Connections Motor Terminals 78KOR Spinlt Anaheim Automation BLY171S 15V 8000 eene Je len Motor terminal connections for Anaheim Automation BLY171S 15V 8000 motor are as shown below User s Manual U19823EE1VOUMOO 13 Chapter 3 14 Figure 3 2 Hardware Setup Motor Connections Image The software to run the motor is pre programmed into the microcontroller s flash memory and it is ready to run as soon as the power supply is connected and the power switch is turned on A quick start up procedure is outlined in the chapter 4 below User s Manual U19823EE1VOUMOO Chapter 4 Quick Start Procedure for Motor 4 1 Figure 4 1 Operation and Control The operation and control of the 78KOR SPINIT starter kit and motor can be done in two ways e Standalone mode with onboard pushbuttons potentiomet
10. A Comm error fry again Figure 6 10 NEC GUI Comm error dialogue box If this occurs then simply click on OK as many times as the box appears You will be able to set the serial port number in the application software User s Manual U19823EE1VOUMOO 93 Chapter 6 GUI Operation The application will launch and you should see the main user interface as shown below HE NEC Motor Control 8KOR IE3 KIT a Oo sl File Setup Serial Port row Operation Gauges PID Gains Setup Startup Speed Control C Current Control Voltage Control Setpoint 300 Motor Speed RPM 0 1 0 2 0 3 0 40 5 0 6 0 7 0 8 0 9 1 1 1 Time Seconds Shunt Current Amps 7 U I I I I I I U 1 Get deeg La seg Tee elo oat ook atic se aig He sae DH PWM Duty Cycle oi TT ZC vU L f z k ft i oP betel God Clear Data Figure 6 11 NEC GUI Main Display View 94 User s Manual U19823EE1VOUMOO GUI Operation Chapter 6 6 4 Set the Serial Port Number The first step should be to set the serial port to the correct port number HE NEC Motor Control 78KOR IE3 KIT J S ojx File Setup Serial Fort row sl Gauges FID Gains Setup Startup Motor Speed RPM 010 2 03 040506070809 1 1 Time Seconds Shunt Current Amps PWM Duty Cycle Figure 6 12 Setting the Comm Port Number CEW W Ze OP The Speed RPM text box will display No Com
11. Disk drives E Performance Logs and Alert E i Display adapters ra Device Manager BEN DYDICD ROM drives e gt Storage tg Human Interface Devices ER Removable Storage ES IDE ATAATADI controllers Been Disk Defragmenter 0 Sa IEEE 1394 Bus host controllers Disk Management ER Infrared devices ei E Services and Applications GR Keyboards 7 z CH Mice and other pointing devices He Modems d SS Monitors Fl NECPCIF Network adapters BM 1394 Net Adapter 3 as EE HF he2300 HSDP4 Broadband Wireless Network Adapter z Hg Intel R 82566MM Gigabit Network Connection a S i InteliR Wireless WiFi Link 4965 4 m fl PCMCIA adapters aj ES Personal identification devices El a Ports COM amp LPT ien Ei Communications Port COM ECP Printer Port LPT1 NW HP hs2300 HSDPA Broadband Wireless AT Command Port COM NW HP hs2300 HSDPA Broadband Wireless CNS Port COM10 NW HP hs2300 HSDPA Broadband Wireless Data Port COM11 NW HP hs2300 HSDPA Broadband Wireless DM Port COM z y Intel Ri Active Management Technology SOL COM y Electronics Starter Kit Virtual USRT COM19 4 D e Processors Display Virtual UART Port Number in Windows Device Manager Screen The 78KOR Spinlt starter kit uses the following UART settings Baud rate 57600 Data Bits 8 Stop Bits 1 Parity None Handshake None GUI Software Installation The zip file NECGUI zip contains all the files needed to install the NEC GUI applicatio
12. Hex files TL rec a hex sl Cancel Figure 7 7 WriteEZ4 Hex File Selection E Locate the file as shown in the window from the downloaded IAR project The file will be located as follows saved directory BLDC_HALL120_78KORIE3 Debug Exe Select the file BLDC_HALL120_78KORIE3 hex and press the OPEN button This will close the LOAD file window The following should be displayed on the main screen gt Open Load File Success read Load file The Flash programming setup is now complete Now press the AUTOPROCEDURE button to start the programming sequence The following sequence should be seen User s Manual U19823EE1VOUMOO 37 Chapter 7 38 Figure 7 8 Note Flash Programming the 78KOR SPINIT Kit USB TE nx File Device View Help b gt COMMAND AutoProcedurelE py Device Flash Blank Checking Mame BACHMEN not blank then erase Flash Erasing Firm Version 1 00 chip erase finish EstCode EFO40CFOh Flash Prograrniming Start ee 10h Flash Frogramming 1027 Flash Frogramming lt 202 gt Flash Frogramming 30 Flash Frogramming lt 408 gt Flash Frogramming 50 Flash Frogramming lt 602 gt Parameter file 4 Name for 1235 Format 0419 Version E1 008 Processor Yer 0200 Flash Prograriming lt 02 gt Lo fil Flash Prograrniming lt 802 gt Name BLOC HALT A0 v0KUk Flash Frogramming Uz Date 2009 03 05 09 39 58 Flash Prograriming f
13. in semiconductor product operation and application examples The incorporation of these circuits software and information in the design of a customer s equipment shall be done under the full responsibility of the customer NEC Electronics assumes no responsibility for any losses incurred by customers or third parties arising from the use of these circuits software and information While NEC Electronics endeavors to enhance the quality reliability and safety of NEC Electronics products customers agree and acknowledge that the possibility of defects thereof cannot be eliminated entirely To minimize risks of damage to property or injury including death to persons arising from defects in NEC Electronics products customers must incorporate sufficient safety measures in their design such as redundancy fire containment and anti failure features NEC Electronics products are classified into the following three quality grades Standard Special and Specific e The Specific quality grade applies only to NEC Electronics products developed based on a customer designated quality assurance program for a specific application The recommended applications of an NEC Electronics product depend on its quality grade as indicated below Customers must check the quality grade of each NEC Electronics product before using it in a particular application Standard Computers office equipment communications equipment test and measurement
14. sub_mcio c sub_mcio h GUIs f JN Edit Configurations hh Remove sics h Create New Project Se h ge La BB initiali Add Existing Project EE 9 Ou inti jo Source Code Control gt iO Make F7 tem Rebuild Al EE a Ou i intr Batch build FS io E io Stop Build CTRL Bresk f _UartBuf RX_BUFF_5IZE UART RX buffer SA EN mo ETH _UartRkead p d read pointer La i main Debug CTRL D _UartWrite_p write pointer Lm ou Make amp Restart Debugger _UartErrStat ee UART error cod D E intrins Lu Ba iazat Figure 9 6 Project Build Options 50 User s Manual U19823EE1VOUMOO Using the IAR Embedded Workbench Chapter 9 9 5 General Options options for node BLDC HALL120 78KORIE3 Genera Options clc Compiler Assembler i Custom Build Build Actions Linker Debugger IE 78 IECUBE MINICUBE Simulator TE 78 Noof Garis ERAS A a aa ecd amp Bank sze Optes ma Dinan A Figure 9 7 General Options Setting the Target Device User s Manual U19823EE1VOUMOOQO 51 Chapter 9 Using the IAR Embedded Workbench Options for node BLDC _HALL120_78KORIE3 WE 8 P ES Category CTCt t Compiler Assembler Custom Build Target Output Library Configuration Library Options Stack Heap 4 A Build Actions Lamar Output file Debugger Ce Executable IE 78 Library TE LUBE UNI LUPE Qutput directories Simulator TTA Executables libraries Debug E xe Objec
15. system either immediately or in the future Microsoft strongly recommends that you stop this installation now and contact the hardware vendor for software that has passed Windows Logo testing Continue Anyway STOP Installation Figure 6 5 Continue to Install the Virtual UART Click on the Finish button which will complete the driver installation 20 User s Manual U19823EE1VOUMOO GUI Operation Chapter 6 Found New Hardware Wizard B xi 8 F gf Completing the Found New Hardware Wizard The wizard has finished installing the software for NEC Electronics Starker Et irtual LSAT Click Finish to close the wizard e Back ance Figure 6 6 Finish Installation and Close the Wizard Screen Please make a note of the COM Port number that windows has assigned to the virtual driver as you will need to select this port from the GUI Using your mouse Right click on My Computer and select manage From the computer management screen select Device Manager and then Ports COM amp LPT You should now see the NEC Electronics Starter Kit Virtual UART User s Manual U19823EE1VOUMOO 24 Chapter 6 22 Figure 6 7 6 2 GUI Operation ET Computer Management m File Action View Window Help e Am Eel n a xwa m Computer Management Local C S MENTOR H CH System Tools H A Batteries CG E Er Event Viewer o E49 Bluetooth Gerate E Shared Folders EFI d Computer CR Local Users and Groups D ep
16. 23EE1VOUMOO Using the IAR Embedded Workbench Chapter 9 Note All other Compiler Options settings can be remain as the default settings 9 7 Assembler Options __ oe e Options for node BLDC _HALL120_7 amp KORIE3 General Options cic Compiler E assembler Custom Build Build Actions Linker Debugger IE 78 IECUBE MINICUBE Simulator TK 78 Figure 9 16 Assembler Options Language Settings User s Manual U19823EE1VOUMOO 57 Chapter 9 Using the IAR Embedded Workbench Options for node BLDC HALL120_T8KORIES Category Factor Settings General Options Cic Compiler Custom Build Language Uuttput List Preprocessor Diagnostics Extra Options Build Actions l inalis M Generate debug information Debugger IE 78 TECUBE MINTCUBE Simulator TE Figure 9 17 Assembler Options Output set for Debug Options for node BLDC_HALL120_78KORIE3 xj Category Factory Settings General Options Cho Compiler Custom Build Language Output List Preprocessor Diagnostics Extra Options Build Actions We Linker Iw Output list file Debugger i Include header a M Include listi T Inelud r IECLIBE PCIe nsimg niclude crass reference MINICUBE Macro definitions E defines Simulator Macro expansions LC intemal symbole TK 75 Macro execution inte P Buel line spacing Assembled lines only P ines page Multiline code DU Diagnostics l Stru
17. 823EE1VOUMOO GUI Operation Chapter 6 Windows will start the Found New Hardware Wizard Select the No not this time option Found New Hardware Wizard 3 S i Welcome to the Found New Hardware Wizard Windows will search for current and updated software by looking on your computer on the hardware installation CD or on the Windows Update Web site with pour permission Head our privacy policy Can Windows connect to Windows Update to search for sottware Yes this time only C Yes now and every time connect a device f No not this time Click Next to continue 4 Back Next gt Cancel Figure 6 2 Found New Hardware Screen Once Windows has identified the hardware select the Install from a list or specific location Advanced option Found New Hardware Wizard This wizard helps you install software for NEC Electronics Starter Kit Virtual UART f If your hardware came with an installation CD lt or floppy disk insert it now What do you want the wizard to do Install the software automatically Recommended Ce Install from a list or specific location Advanced Click Next to continue Back Cancel Figure 6 3 Install From List or Specific Location Screen User s Manual U19823EE1VOUMOO 19 Chapter 6 GUI Operation Select the Search for the best driver in these locations option and select the Include this location in the search box and in the brow
18. DF oroa BA dat Figure 9 24 Integrated Debugger Selection 62 User s Manual U19823EE1VOUMOO Using the IAR Embedded Workbench Chapter 9 Options for node BLDC_HALL120_76KORIES Category Factory Settings General Options Cll Compiler 45sembler Custom Build Setup Extra Options Plugins Build Actions Linker BEEGGER embos Code Coverage Select plugins to load IE 76 IECUPE MINICUBE Simulator TE 6 Description ES awareness for SEGGER embOS Location C Program FilesI4AR Systemet Embedded Workbench Fick Originator F egger Microcontroller 5 v leme GmbH Yersior 2 0 5 0 Cancel Figure 9 25 Integrated Debugger Plug in Selection Note The Extra Option section can be ignored 9 10 Workspace and Project Setup if Not Compatible with the Installed IAR Workbench 1 Set anew workspace File gt New gt Workspace 2 Create a new Project Project gt Create New Project gt Select Empty Project gt OK Enter a project name and set the location for the project This can be the same location as the downloaded example software or a new location 3 Add the Source files to the project C Source Files Project gt Add Files Locate and select all the C source files Main_mcio c Sub_mcio c Initialise _hardware c Interrupt_handlers c Motor c GUI_support c User s Manual U19823EE1VOUMOO 63 Chapter 9 64 9 11 Figure 9 26 9 12 Figure 9 27 N
19. NEC User s Manual 78KOR SPINIT Single Board Low Voltage Motor Control Starter Kit uPD78F1235 Documen t No U19823EE1VOUMOO Date published May 2009 NEC Electronics 2009 Printed in Germany Legal Notes The information in this document is current as of May 2008 The information is subject to change without notice For actual design in refer to the latest publications of NEC Electronics data sheets or data books etc for the most up to date specifications of NEC Electronics products Not all products and or types are available in every country Please check with an NEC Electronics sales representative for availability and additional information No part of this document may be copied or reproduced in any form or by any means without the prior written consent of NEC Electronics NEC Electronics assumes no responsibility for any errors that may appear in this document NEC Electronics does not assume any liability for infringement of patents copyrights or other intellectual property rights of third parties by or arising from the use of NEC Electronics products listed in this document or any other liability arising from the use of such products No license express implied or otherwise is granted under any patents copyrights or other intellectual property rights of NEC Electronics or others e Descriptions of circuits software and other related information in this document are provided for illustrative purposes
20. Range Chip Freg Internal 0SC Multiply 1 00 m Ready mmf g MINICUBE2 Programmer GUI QB Programmer Next the device needs to be set up from the menu follow the following sequence Device gt Setup Or press the Spanner symbol in the ICON taskbar The following screen should appear Si QB Programmer e J L JD x File Device Help l Device Setup O E sl gt QB Programimer startup Programmer gt Command standby Standard Advanced Zaa Farameter File Headm 405 Success Read Paramet Sean Gelap Parameter File Ga 235 pm PRM File Read Device Cancel Device Setup gt gt Device Setup Supply Oscillator kk On Target Frequency lmtemalOSC MHz Multiply rate bo Target Device Connection Fort UART ch0 sl speed 1Mbps Operation Mode Chip Start ooo sl File checksum Block End le Show Address Connection to device Parameter file D prm Load tile UK Cancel O5C Multiply 7 00 F e m 4 QB Programmer Device Setup User s Manual U19823EE1VOUMOO Flash Programming with a Flash Programmer Chapter 8 Set the details for the COM port Speed etc as shown above Note Enter your COM port number as this will vary Figure 8 7 Next press the PRM File Read button and the following screen should appear Select the 78F1235 prm file and press the Open button CG OB Programmer sl k O x
21. T Kit USB If the user wishes to modify the program in the 78KOR SPINIT then this can be done either with the onboard USB interface or using a separate Flash Programmer This chapter will describe how to flash the microcontroller using the onboard USB interface Download the WriteEZ4 USB Flash Programming Graphical Interface from the NEC Electronics Tool download web site and install 7 1 78KOR SPINIT Switch Settings To prepare the 78KOR SPINIT for flash programming follow the steps below Power OFF the 78KOR SPINIT kit Set the DIP switch DS1 to the following e 1 8 ON e 2 7 OFF e 3 6 OFF e 4 50N Remove JP22 OPEN USB Flash Debugging mode Connect the USB cable from the PC to the 78KOR SPINIT kit Power ON the 78KOR SPINIT kit 7 2 Establish the Comm Port The WriteEZ application requires a virtual comm Port so please note the appropriate comm Port number Use Device Manager to view the ports User s Manual U19823EE1VOUMOO 31 Chapter 7 Flash Programming the 78KOR SPINIT Kit USB Ecomptermanaoemet E x m File Action View Window Help e Hm i emama m Computer Management Local C R MkN70SS H CH System Tools 9 Batteries E Event Viewer EA Bluetooth Gerdte d Computer Ea Shared Folders ER Local Users and Groups tae Disk drives Performance Logs and Alert id Display adapters ES Device Manager ex DYDICD ROM drives A Storage Ha Human Interface Devices Removable Storage fe IDE ATAJATAFI
22. UBE2 to the 78KOR SPINIT Kit User s Manual U19823EE1VOUMOO Flash Programming with a Flash Programmer Chapter 8 Copy the uPD78F 1235 Flash programming parameter file 78F1235 prm into the Installation directory for the QB programmer program or into a specific area which can be reached by the browse facility installation path QBP PRM This file is included with the IAR project download Once the Microcontroller board is configured and the programmer connected to the PC open the Flash programming Graphical interface QBP v2 22 s Internet Internet Explor E mail Lotus Notes be NEC Electronics Tools b mt Latest Version QBP 2 22 QB Programmer Ee ee OS SY eee A All Programs Start Figure 8 4 Starting the QBP V2 22 QB Programmer Graphical Interface The following Screen should appear Note the text may differ after the 1st two lines User s Manual U19823EE1VOUMOO 41 Chapter 8 Figure 8 5 Figure 8 6 42 Flash Programming with a Flash Programmer ae a Q6 Programmer File Device Help Hrog amer gt QB Programmer startup Conmmand standby gt Parameter File Reading Success Read ParameterFile A UD Programmer W222 Firmware v 05 Device Name Firmware Farameter tile Name 8F1235 prm Version E1 00a Load file File checksum Type Chksumi Area Connection to device Fort UAR T ch Pulse 0 Speed 1Mbps
23. VOUMOO 39 Chapter 8 40 8 2 8 3 Flash Programming with a Flash Programmer Download the M INICUBE2 QB programmer Flash Programming Graphical Interface Download the Appropriate IAR Work bench from the JAR web site or use the KickStart CD supplied with the MINICUBE2 The full IAR development tool can be purchased from NEC Electronics or through an NEC Electronics franchised distributor Uncompress and install the QB programmer GUI software run the SETUP application Save and Uncompress the IAR Workbench Project Uncompress the folder containing the 78KOR SPINIT project to a local folder This folder contains all the source code and IAR environment information required to build and compile both the debug files and the hex flash files Switch Settings and connecting the MINICUBE2 To prepare the 78KOR SPINIT for flash programming follow the steps below e Power OFF the 78KOR SPINIT kit e Set the DIP switch DS1 to the following e 1 8 ON e 2 7 OFF e 3 60N e 4 5 OFF Install JP22 ON MINICUBE2 flash programming mode Check that the switches on the MINICUBE2 are set as shown below e Switch M1 M2 is set to M1 e Switch 3 T 5 is set to T Locate the MINICUBE2 16 pin connector see Figure 2 and attach the MINICUBE2 programmer using the 16 pin cable Power ON the 78KOR SPINIT kit See the MINICUBE2 connected to the 78KOR SPINIT kit as shown below Figure 8 3 Connecting the MINIC
24. X and VIH MIN due to noise etc the device may malfunction Take care to prevent chattering noise from entering the device when the input level is fixed and also in the transition period when the input level passes through the area between VIL MAX and VIH MIN 2 HANDLING OF UNUSED INPUT PINS Unconnected CMOS device inputs can result in malfunction If an input pin is unconnected it is possible that an internal input level may be generated due to noise etc causing malfunction CMOS devices behave differently than Bipolar or NMOS devices Input levels of CMOS devices must be fixed high or low by using pull up or pull down circuitry Each unused pin should be connected to VDD or GND via a resistor if there is a possibility that it will be an output pin All handling related to unused pins must be judged separately for each device and according to related specifications governing the device 3 PRECAUTION AGAINST ESD A strong electric field when exposed to a MOS device can cause destruction of the gate oxide and ultimately degrade the device operation Steps must be taken to stop generation of static electricity as much as possible and to quickly dissipate it should it occur Environmental control must be adequate When it is dry a humidifier should be used It is recommended to avoid using insulators that easily build up static electricity Semiconductor devices must be stored and transported in an anti static container static shi
25. an Tel 044 43855111 http www necel com Santa Clara CA 95050 2554 U S A Tel 408 5886000 http www am necel com Europe NEC Electronics Europe GmbH Arcadiastrasse 10 40472 Dusseldorf Germany Tel 0211 65030 http www eu necel com United Kingdom Branch Cygnus House Sunrise Parkway Linford Wood Milton Keynes MK14 6NP U K Tel 01908 691133 Succursale Fran aise 9 rue Paul Dautier B P 52 78142 Velizy Villacoublay C dex France Tel 01 30675800 Tyskland Filial T by Centrum Entrance S 7th floor 18322 T by Sweden Tel 08 6387200 Filiale Italiana Via Fabio Filzi 25 A 20124 Milano Italy Tel 02 667541 Branch The Netherlands Steijgerweg 6 5616 HS Eindhoven The Netherlands Tel 040 2654010 User s Manual U19823EE1VOUMOO Asia amp Oceania NEC Electronics China Co Ltd 7th Floor Quantum Plaza No 27 ZhiChunLu Haidian District Beijing 100083 P R China Tel 010 82351155 http www cn necel com NEC Electronics Shanghai Ltd Room 2511 2512 Bank of China Tower 200 Yincheng Road Central Pudong New Area Shanghai 200120 P R China Tel 021 58885400 http www cn necel com NEC Electronics Hong Kong Ltd 12 F Cityplaza 4 12 Taikoo Wan Road Hong Kong Tel 2886 9318 http www hk necel com NEC Electronics Taiwan Ltd 7F No 363 Fu Shing North Road Taipei Taiwan R O C Tel 02 27192377 NEC Electronics Singapore Pte Ltd 238A Thomson Road
26. apter 9 F LAR Embedded Workbench IDE 1S weie p oh IRAD ae _ lt Dadga telse orkspace xi a d S DI Gerber eeh AEN ANE Zeeche eebe Aen ANDI Oa aac als Ed ISN d er ere Gd abs A SD dere alr CO RO dk Gieres eebe ELAS idee dech Ser deeg Ve iden dies Sech e Figure 9 3 IAR Workbench Opening Screen Next open the IAR Workspace by following the sequence and locating and then selecting the appropriate workspace file as shown below File gt Open gt Workspace gt BLDC_HALL120_78KORIE3 Gengas kreno Av Ube ew enne D D backup_sowce_t DD backup_sowce 02032009 ME Fie nave ELDE HALL 120_7aKGRtES ow D ps ane Watrapacefiesfewed Ceci NEE Figure 9 4 IAR Workbench Project Selection Once the Workspace open the display should look something close to that as shown in the figure below This shows the workspace where the project is located and has opened the BLDC project The display shows the following project files Left Hand side window Project File Source Header Map etc User s Manual U19823EE1VOUMOO 49 Chapter 9 Using the IAR Embedded Workbench Bottom Build Debug messages when the project is re built or the debugger is active e The main centre display shows any open files in a tabbed form The file can be viewed by selecting the relevant Tab in the wind Any of the files shown can be opened by double clicking on the file in the Project left hand side window Debugg
27. c extension based TK 70 Require prototypes Language conformance Plain char is Ce Allow ISR extensions Signed Relaxed ISOASNSI Ce Unsigned Strict SO 4451 Enable multibyte support Enable IAA migration preprocessor extensions Figure 9 11 Compiler Options Language Settings 54 User s Manual U19823EE1VOUMOO Using the IAR Embedded Workbench Chapter 9 Options for node BLDC_HALL120_78KORIE3 d a 2 x Category Factor Settings General Options Multi file Compilation Giscard Unused Publics Assembler BE Custom Build Language Optimizations Output List Preprocessor Diagnostics gt Build Actions reas ch A V Linker eve ort address work area Debugger Mone Enable work area IE 78 C Low IECUBE Vedio 20 Bytes MINTCUBE e High Balanced Simulator TK 78 Enabled transtormations Common subexpression elimination Loop unrolling Function inlining Code motion Type baged alias analysis Enable call runtime library calls Byte alignment of data Figure 9 12 Compiler Options Optimisation Options for node BLDC HALL120_T8KORIES si E S x Category Factor Settings General Options Multi file Compilation Giecard Unused Publics Assembler Custom Build Language Optimizations Output List Preprocessor Diagnostic 4 A bidule tone inker Debugger Oyeride default IE 78 f Program Module TECUBE e bray Mod
28. ce View Help gt FlashO penning Flash Open OK Mame gt gt ParameterFile Reading Success Read ParameterFile Firm Version gt gt LoadFile Reading FetCode Success read HEX file ees Name for 1235 Format 0419 Version E1 00a Processor Yer 0200 Name BLDC HALL120_ 78KOF Date 2009 03 05 09 39 58 Chksum 0247h Area O00000h 002634h Connection to device Fort COM O Speed 115200bps Range Chip Freg Internal OSC Multipl 1 00 WriteEZ4 Screen WriteEZ4 Device Setup From the WriteEZ4 main menu select Device gt Setup and the Device Setup screen will appear From the Host Connection box set the Port to the correct number to use the virtual UART port displayed under device manager see above User s Manual U19823EE1VOUMOO Flash Programming the 78KOR SPINIT Kit USB Chapter 7 FF Device Setup E x Standard amp dvance Parameter file GEN 235 Bm PAM File Read Host connection Supply oscillator Fort com20 Frequency finternal OSC HH Speed 115200bps sl Multiply rate 1 00 Operation Mode Stark non k End 063 z F Show addres Ge Chip C Block t Sea Target Reset Message UK Cancel Figure 7 4 WriteEZ4 Device Setup Standard Next ensure that the PRM file is correctly displayed In this case it should be 78F1235 prm If this is not the displayed PRM file then select the PRM File Read and select the 78F1235 prm file w
29. change the Open Loop Time RPM for Open Loop and starting PWM settings by selecting the following tab as shown below Gauges PID Gains Setup Initial Middle Final ie 0 75 1 5 sec RPM en Mo 200 Current ban ben ben m mno bo EST C Current Control fe Voltage Control Send Parameters to uC Get Parameters from uC Ensure Voltage Control is selected Figure 6 17 GUI Startup Settings To read back the current Startup settings from the 78KOR SPINIT click on the Get Parameters from uC button and the GUI will be updated Changes can be made in this view and sent down to the 78KOR SPINIT Simply make the appropriate changes and click on the Send Parameters to uC User s Manual U19823EE1VOUMOO 99 GUI Operation Chapter 6 30 Time sec start in open loop until final time is reached then switch to closed loop control Initial the length of time in seconds to run open loop up to the set RPM and PWM Middle the length of time in seconds to run open loop up to the set RPM and PWM Final the length of time in seconds to run open loop up to the set RPM and PWM RPM e The startup rom speed for each phase initial middle and final Current mA Used for current control mode not covered in this document PWM The startup max PWM for each phase initial middle and final User s Manual U19823EE1VOUMOO Chapter 7 Flash Programming the 78KOR SPINI
30. charge and can be downloaded from the NEC motor contro website In order to modify the source code the IAR development environment is required and atime limited version can be acquired directly from the IAR website or a code limited trial version is included in the MINICUBE2 On Chip debugger programmer or the full IAR development tool can be purchased from NEC or through an NEC Electronics franchised distributor Please Note If you require debugging the 78KOR SPINIT kit while using the USB serial port for system communications a MINICUBE2 will be required 78KOR SPINIT Kit Image User s Manual U19823EE1VOUMOO Chapter 2 78KOR SPINIT Kit Contents The 78KOR Spinlt KIT should contain the following items MC 78KOR IE3 single board controller containing the uPD78F1235 ASSP microcontroller BLDC motor Anaheim Automation BLY17S15V8000 15V FW75550 15 DC power supply USB Cable For information about the electrical characteristics and hardware functions of the UPD78F1235 microcontroller refer to 78KOR IE3 iPD78F 1235 User s Manual U19163EJ1VOUDOO For the instruction descriptions refer to the 78KOR 16 bit Single Chip Microcontrollers Instruction Manual U17792EJ4VOUMOO0 User s Manual U19823EE1VOUMOO 11 Chapter 3 Hardware Setup The kit is shipped with a default jumper configuration to run the motor with the following on board user interface controls as soon as the motor is connected and power is supplied
31. controllers Disk Defragmenter Ga IEEE 1394 Bus host controllers Disk Management d i Infrared devices Si G Services and Applications ge Keyboards hay Mice and other pointing devices bh Modems S a Monitors gt NECPCIF E8 Network adapters BD 1394 Net Adapter 3 4 EE HF he2300 HSDP4 Broadband Wireless Network Sdapter z Hg Intel R 82566MM Gigabit Network Connection a S i InteliR Wireless WiFi Link 4965 4 m fl PCMCIA adapters aj ES Personal identification devices EI a Ports COM amp LPT Ei Communications Port COM ECP Printer Port LPT1 iy HF hs2300 HSDPA Broadband Wireless AT Command Port COM NW HP hs2300 HSDPA Broadband Wireless CNS Port COM10 y HP hs2300 HSDPA Broadband wireless Data Port COM11 HP hs2300 HSDPA Broadband Wireless DM Port COMS Wi Intel Ri Active Management Technology SOL COM Si NEC Electronics Starter Kit Virtual UART COM19 H H H H S Figure 7 1 Display virtual UART port number in Windows Device Manager screen 32 User s Manual U19823EE1VOUMOO Flash Programming the 78KOR SPINIT Kit USB Chapter 7 7 3 Start the WriteEZ4 Application Start gt All Programs gt NEC Electronics Tools gt WriteEZ4 gt v1 02 gt WriteEZ4 t Figure 7 2 Starting WriteEZ4 User s Manual U19823EE1VOUMOOQO 33 Chapter 7 34 Figure 7 3 7 4 Flash Programming the 78KOR SPINIT Kit USB The WriteEZ4 application will launch BS WriteEz4 x File Devi
32. ctured assembly lines lab spacing Hincluded text E Cancel Figure 9 18 Assembler Options Listings 58 User s Manual U19823EE1VOUMOO Using the IAR Embedded Workbench 9 8 Linker Options Options for node BLDC_HALL120_78KORIE3 Chapter 9 Category Factory Settings General Options Chc Compiler Assembler Custom Build Output Extra Output Hdefine Diagnostics List Config Proce gt Build Actions Output file Override default Secondary output file Deb ae ELD C HALLT20 PeRORIES d2b Mone for the selected format IECUBE Format Ger oe Ce Debug information for C SPY Simulator h With runtime control modules TK 5 Je with LA emulation modules Buffered terminal output Jh Allow C SPY specific extra output file Other _ utout formats Hntel estended of Format vanant None sl Module local symbols Include all sl Cancel Figure 9 19 Linker Options Primary File Output User s Manual U19823EE1VOUMOO 59 Chapter 9 Using the IAR Embedded Workbench Options for node BLDC _HALL1270_78KORIE3 lt a 8 P ES Category Factory Settings General Options Clc Compiler Assembler Custom Build Output Extra Output tdefine Diagnostics List Contig Proce d gt Build Actions Iw Generate extra output file Debugger Output file IE 76 i Override default eee BLDC_HALL120_78KORIE3 hex MINTCUBE Simulator Beart TE 76 Output format
33. describe IAR 78K embedded Workbench development tool environment how to install it on your computer and how to rebuild and download executable code to the microcontroller s flash memory Before proceeding with the tools installation however refer to all of the documentation for the starter kit On Chip Debugger tool and the IAR Embedded Workbench Please note that a 16 Kbyte code limited version is included with the MINICUBE2 On Chip Debugger Programmer unit and can be used to run the example software Please note that a Flash Programmer On Chip debugging programming tool or IAR Embedded workbench are not included in this package These items are available from your local NEC Electronics Distributor or contact your local NEC Electronics sales office Software Installation 1 If aversion of the IAR tool is not already installed then install the IAR embedded Workbench tool as per the instructions provided by IAR 2 Ensure that if not already that the example software has been downloaded from the NEC starter kit web site and unzipped into an suitable location The example software can operate on any revision of either the IAR Kick Start or IAR Full versions However it may be necessary to define your own project and workspace This is described later in this chapter User s Manual U19823EE1VOUMOO Using the IAR Embedded Workbench Chapter 9 9 2 78KOR SPINIT Setup for On chip Debugging Using Figure 9 1 USB To prepare
34. e START STOP FORWARD REVERSE and MODE push buttons e SPEED potentiometer 7 segment LED Table 3 1 DS1 Dip Switch Settings USB Debug MINICUBE2 Flash Programming GUI Operation Debug Mode OFF USB ON MINICUBE2 JP5 o MINICUBE2 RX TX link 1 2 Reset_USB MINICUBE2 3 4 Reset_KR MINICUBE2 1 2 FLMDO_USB MINICUBE2 3 4 FLMDO_KR MINICUBE2 1 2 Comparator1 Phase U BEMF 3 4 Hall JP5 JP6 JP7 JP9 JP10 1 2 Comparator2 Phase V BEMF 3 4 Hall2 JP11 1 2 Comparator3 Phase W BEMF 3 4 Hall3 JP12 U Hi FET drive isolate JP13 V Lo FET drive isolate JP14 U Lo FET drive isolate JP15 W Hi FET drive isolate JP16 V Hi FET drive isolate JP17 W Lo FET drive isolate JP18 U phase isolate from onboard FET JP19 V phase isolate from onboard FET JP20 W phase isolate from onboard FET JP21 Motor Over current Protection Hardware Circuit Jp22 ON MINICUBE2 Debug Mode OFF USB Debug Mode 12 User s Manual U19823EE1VOUMOO Hardware Setup Figure 3 1 Note Table 3 3 Chapter 3 Motor phase Auxiliary DC Power selector 15 V power connector power lt 18V switch supply connector 4 DRAT O i TER s LA Pia Hall sensor connector k n TUJA oon U CORE LEED coe Optional meee Titan nr Mn eS ENER A AAA l l pe i KR NEC M gw V y k die Fie SS S ei e ak Food bee e ate Prototyping E s TET st CTT dajaj PERETII PERENS is 2 MINICUBE2 area weeeese sii z E re oA l ag
35. elding bag or conductive material All test and measurement tools including work benches and floors should be grounded The operator should be grounded using a wrist strap Semiconductor devices must not be touched with bare hands Similar precautions need to be taken for PW boards with mounted semiconductor devices 4 STATUS BEFORE INITIALIZATION Power on does not necessarily define the initial status of a MOS device Immediately after the power source is turned ON devices with reset functions have not yet been initialized Hence power on does not guarantee output pin levels I O settings or contents of registers A device is not initialized until the reset signal is received A reset operation must be executed immediately after power on for devices with reset functions 5 POWER ON OFF SEQUENCE In the case of a device that uses different power supplies for the internal operation and external interface as a rule switch on the external power supply after switching on the internal power supply When switching the power supply off as a rule switch off the external power supply and then the internal power supply Use of the reverse power on off sequences may result in the application of an overvoltage to the internal elements of the device causing malfunction and degradation of internal elements due to the passage of an abnormal current The correct power on off sequence must be User s Manual U19823EE1VOUMOO judged separately for each dev
36. equipment audio and visual equipment home electronic appliances machine tools personal electronic equipment and industrial robots Special Transportation equipment automobiles trains ships etc traffic control systems anti disaster systems anti crime User s Manual U19823EE1VOUMOO systems safety equipment and medical equipment not specifically designed for life support Specific Aircraft aerospace equipment submersible repeaters nuclear reactor control systems life support systems and medical equipment for life support etc The quality grade of NEC Electronics products is Standard unless otherwise expressly specified in NEC Electronics data sheets or data books etc If customers wish to use NEC Electronics products in applications not intended by NEC Electronics they must contact an NEC Electronics sales representative in advance to determine NEC Electronics willingness to support a given application Note 1 NEC Electronics as used in this statement means NEC Electronics Corporation and also includes its majority owned subsidiaries 2 NEC Electronics products means any product developed or manufactured by or for NEC Electronics as defined above User s Manual U19823EE1VOUMOO 3 Notes for CMOS Devices 1 VOLTAGE APPLICATION WAVEFORM AT INPUT PIN Waveform distortion due to input noise or a reflected wave may cause malfunction If the input of the CMOS device stays in the area between VIL MA
37. er and 7 Seg LED PC mode with a PC based GUI and the onboard USB connector Standalone Mode The motor can be operated in standalone mode right out of the box after the motor terminals and hall sensor wires are connected and power is supplied To operate in PC GUI mode a special NEC program necgui exe program has to be installed See the installation instructions and the operation in PC GUI mode in chapter 6 of this user manual To run the motor in standalone mode connect the 15VDC power supply to CN2 connector and flip SW7 power selector switch towards CN2 At this point the green POWER LED should turn on and the 7 Segment LED should display SELF This is an indication that the motor is ready to be operated from the on board pushbuttons and potentiometer Power On Message After three seconds the LED will display the reference RPM and can be set to the desired speed between 300 to 5000 RPM by the onboard potentiometer The reference RPM is identified by the decimal point lit on the units digit If the MODE button is pressed the display will toggle between reference RPM and measured or feedback RPM The measured RPM is displayed without the decimal point User s Manual U19823EE1VOUMOO 15 Chapter 4 16 Figure 4 2 Figure 4 3 4 2 Quick Start Procedure for Motor Operation and Control Indicates in Reference Speed Mode Reference RPM Display To start the motor press the START STOP pushbutton To stop
38. gt ap HALL1Z0_78KORIES_eval hex Parameter file Cancel Load File Rea prim gt Open Load File Cancel Load File Rea Load file Open Load File File checksum File name BLDC_HALL120_78KORIE3_eval hex 6 x ORS C i Files of pe S rec Hex files Trec si hel ance y e denice AO Pulse Speed 1Mbps Range Chip Freg Internal OSC Multiply 1 00 as a Ready NUM A Hex File Selection Locate the file as shown in the window from the downloaded IAR project The file will be located as follows saved directory BLDC_HALL120_78KORIE3 Debug Exe Select the file BLDC_HALL120_78KORIE3 hex and press the OPEN button This will close the LOAD file window The following should be displayed on the main screen gt Open Load File Success read Load file The Flash programming setup is now complete Now press the AUTOPROCEDURE button to start the programming sequence The following sequence should be seen User s Manual U19823EE1VOUMOO Flash Programming with a Flash Programmer Chapter 8 Figure 8 9 Note ia OB Programmer m Ioj x Pe VES Be XN gt 4uboProcedure E py Blank check Chip Not blank Erase need Erasing Erase Chip FASS Program Chip ups Device fe Name UPDV8FI235 ue SEET SIE imware 1 40a Farameter file FOX Name 8F 1235 prm LUS Version E1 00a Os aiz IR Load file eine Name BLOC HALLT20_78K0RIES F 100z Date
39. hich is included in the project file Look in E PAM 78F1235_E1004 do fe fa 78F1201 prm S 78F1223 prm el 78F1203 prm el 78F1211 prm al 78F1213 prm al 78F1214 prm al 78F1215 prm File name 78F 1224 pen 78F1225 prnn 78F1233 prr FSF 1234 pre 78F1235 prr Files of type FRM Pied PAM Cancel Z Figure 7 5 WriteEZ4 Select Parameter File Keep the advance settings as detailed below User s Manual U19823EE1VOUMOO 35 Chapter 7 Flash Programming the 78KOR SPINIT Kit USB FF Device Setup n RK X Standard Advance Command options M Blank check before Erase Wide Voltage mode Read verify after Program Security flag after Program Checksum after Program Securty flag settings aA Disable Chip Erase Reset vector Ioocopg H Disable Block Erase Boot block end OL sl Disable Program FS Block start foon M Gisable Read FS Block end 063 sl Disable Boot black cluster reprogrammir F Show Addres Target Reset Message eet _ Figure 7 6 WriteEZ4 Device Setup Advance 7 5 WriteEZ4 Hex File Selection Next press the select the HEX file to be programmed from the Menu File gt Load Or press the Load File symbol in the ICON taskbar The following window should open 36 User s Manual U19823EE1VOUMOO Flash Programming the 78KOR SPINIT Kit USB Chapter 7 l BLZ HALLiZ0 7 amp KORIES hex File name BLDC_HALL120_78KORIE3 hex Files of type S rec
40. ice and according to related specifications governing the device INPUT OF SIGNAL DURING POWER OFF STATE Do not input signals or an I O pull up power supply while the device is not powered The current injection that results from input of such a signal or I O pull up power supply may cause malfunction and the abnormal current that passes in the device at this time may cause degradation of internal elements Input of signals during the power off state must be judged separately for each device and according to related specifications governing the device User s Manual U19823EE1VOUMOO America NEC Electronics America Inc 2880 Scott Blvd Regional Information Some information contained in this document may vary from country to country Before using any NEC product in your application please contact the NEC office in your country to obtain a list of authorized representatives anddistributors They will verify Device availability Ordering information Product release schedule Availability of related technical literature Development environment specifications for example specifications for third party tools and components host computers power plugs AC supply voltages and so forth e Network requirements In addition trademarks registered trademarks export restrictions and otherlegal issues may also vary from country to country NEC Electronics Corporation 1753 Shimonumabe Nakahara ku Kawasaki Kanagawa 211 8668 Jap
41. ing windows are described later 7 TAR Embedded Workbench IDE Fie Ed Ven Project Tools Widow Help Osugarbense ORAA AAA Sih OO B D a rem 3 Kaes D S BEER TEE o EA EE EE EX inclade notor h include intrinzice h include 1976 1235_64 h include i078 1235 64 est br RexS os EE EE EE EE EE E EE EE EE E docal variables Z4 unsigned chat s_UartBut RX_BUFF_SIZE d UART BX buffer f motor char s_UertRead_p 4 sest pointer ef Emain m char s_Vart rite_p write pointer unsi Char s UaertErrStat VART error code D Output on f intrins H a jo78t KI EH io7 8 prototype functions x motor EE EE EE EE L DNzup E notor c vasigned char Get _Uart votd UART receive A unciqgned char Read VertSut iveid VART data buffer read 7 E sub_ma x unsigned char Wait _Uartivoid VART wait for new data in buffer void Send_UVart unsigned char UART send BLDC_HALL120_78KORIE3 bd ja D Reedy MMT Figure 9 5 Workspace amp Project open screen The build options for the project can then be set or changed using the following menus The build options are entered as shown in Figure 9 6 below and then ensure all the options are set according to the remaining figures below Y IAR Embedded Workbench IDE File Edit View Project Tools Window Help per DDD pe peta oT zess p S TE a Add Group EE Import File List r otor h
42. inish Chkeum 0247h Sea OOD000h 002634h Connection to device Fot UOMA Speed 175200bps Range Chip Freg Internal O5C Multiply 1 00 Ready WriteEZ4 Autoprocedure The Verify Chip operation is enabled by setting the Read Verify after Program option in the Advanced Tab of the Device Setup Window The 78KORIE3 device has now been reprogrammed with the example program which is suitable for both standalone operation and remote operation using the GUI Please make a backup copy of the original hex file before programming or running the compiler User s Manual U19823EE1VOUMOO Chapter 8 Flash Programming with a Flash Programmer This section describes the steps necessary to modify the program in the 78KOR SPINIT microcontroller using a Flash Programmer not included in the Starter Kit Two programmers are available e PG FP5 Full Programmer MINICUBE2 On Chip debugger programmer Figure 8 1 PG FP5 Programmer Figure 8 2 MINICUBE2 On Chip debugger programmer The Graphical Interface for either of these programmers can be downloaded from the NEC Electronics Development tools web site In this guide we have shown only the MINICUBE2 The interface for the microcontroller board is the same for both programmers 8 1 Download the Following Files Download the appropriate AR project folder which contains all the required source code for the application User s Manual U19823EE1
43. io c DEE ED 23 Output Ze void main woid H Hardware Set up DERU FORT M DE WUT CIRI SP DEBUG_FGRT O3 mid e FD4C13 CALL RR EEN b ie CAIL Wii init LEDPORT SED port set up 24 init TIMER interval timer 24 017D FD1D16_ CALL Nek 1 1 a A 017DB Foasi CATEL N SF ee Fe mmm mmm ememr mme mmm mmm n w Ei A 4 AE NEP Or et B S e ee me 0i 6 Ax O1L7DEF 32A041 HOVE Be set up motor defaults for standalone mode 017E2 s Pos TH C ILL NE 017E5 F CIRY AE EE EE EE EE EE EE EE EE Ep e D17E6 324040 Hovy Bc KE ee See Ee EE DL7ES 8 FDA814 CALL N D17ET 30E803 HOVE X O17EF FDA313 CAII ER if Acfined SPINIT Rot SetintervalRoa i50 ess 15 Notor SetNode MOTOR MODE SPEED 017F2 309600 NOVY AE DIER FDS714 CALL No Motor _SetCarriers 20 DLF D AE ones Notor_SetPeadtime 2 Dir DIER 22122 NOVE SC e Made gege CAA Building configuration BLOC_HALL120_78K0RIE3 Debug Updating build yee Configurator i upto date Figure 9 29 Integrated Debugger Main Window IAR Embedded Workbench IDE Kill KKK 5 Reset Stop Step Step Step Next File Edit View Project Debug Emulator Tc Dw eG A Bag gt o gt bw E w Run to Run Exit When Lit Over Into Out Statement Cursor Debugger Figure 9 30 Debugger Task Bar Icons 66 User s Manual U19823EE1VOUMOO Using the IAR Embedded Wo
44. m when communications is interrupted we ER Figure 6 13 No Comm Displayed Once communications is established then the Speed RPM text box will display the speed and the GUI can be used as normal User s Manual U19823EE1VOUMOO 25 Chapter 6 26 6 5 6 6 GUI Operation Run the Motor Using Speed Control Mode To operate the motor in Speed Control Mode select Speed Control from the Operation menu see below and use the controls in the GUI window The user has the same controls as described for the Stand Alone mode Start Stop Clockwise Anti Clockwise Speed increase decrease HE NEC Motor Control 78K0R IE3 KIT loj x File Setup SerialPort COMI ei Gauges PID Gains Setup Startup Speed RP No Comm D RE 7 Speed Control 1 1 pio KEN EE EE G L 1 i 1 1 1 1 1 1 I eier EEN P GK Motor Speed RPM d ess lc eee dn mee cee a ie eee SN Meee es D oRage Lontrol S I I I I I I I I I I ie ata RE E EE Change the PID Settings It is also possible to change the PID parameters from the GUI interface Please note that changes can only be made when the motor is stopped To change the PID parameters click on the PID Gains tab The PID Gains editor will be displayed as shown below Please use the RPM to Current Gains as this is for speed control User s Manual U19823EE1VOUMOO GUI Operation Chapter 6 Gauges PID Gains Setup Startup
45. n order to improve the motor speed tracking control during normal running 6 7 Change the Setup Settings It is also possible to change the Speed Limits Current Limits and Current A D parameters by selecting the following tab as shown below Gauges PID Gare Setup Fartup Current A D Paramet Dam D Offset 0 m ant L Offset A D 0 1023 m Current Limits Tom Man bus Min fio Max Hate am O m eec m Damg Offset A D 0 1023 Speed Limits RPM Max Jon Mm 300 Max Rate Tonn RPM sec Send Parameters to ul Get Parameters from ull Figure 6 16 GUI Setup Settings To read back the current Setup settings from the 78KOR SPINIT click on the Get Parameters from uC button and the GUI will be updated Changes can be made in this view and sent down to the 78KOR SPINIT Simply make the appropriate changes and click on the Send Parameters to uC User s Manual U19823EE1VOUMOO GUI Operation Chapter 6 Current A D Parameters Gain for current shunt value amplification Offset to correct any known constants Current Limits mA Used for current control mode not covered in this document Speed Limits RPM Max the maximum RPM speed setting for the motor Min the minimum RPM speed setting for the motor Max Rate the acceleration deceleration rate in RPM sec 6 8 Change the Startup Settings It is also possible to
46. n software Simply extract the files to a folder named NECGUI and then click on the setup exe application as shown below User s Manual U19823EE1VOUMOO GUI Operation Chapter 6 File Edit view Favorites Tools Help ae Back e gt i bh A Search ar Folders EE E x 9 Hak Address E CHNECGUI Go Date Modified SI install log 1KB Text Document pisza OF 44 S Axinterop mikeplatter d 19KB Application Extension 25 08 2006 10 09 S Interop mikeplotter d mr z SE a Interop stdFormat d fg nerguisetun S Interop VERUN dl C necgui exe if necQguisetup msi setup exe Welcome to the necguisetup Setup Wizard The installer will guide you through the steps required to install necguisetup on your computer Description Setup File versior WARNING This computer program ts protected by copyright law and international treaties Unauthorized duplication or distribution of this program or any portion of it may result in severe civil or criminal penalties and will be prosecuted to the maximum extent possible under the law Cancel 4 Back i Figure 6 8 Launch the necguiSetup Wizard Follow the instructions until the installation is complete 6 3 To use GUI Software Start the NEC GUI application software by selecting it from the programs list A Start All Programs gt Figure 6 9 To Start NEC GUI After selecting the program you may see a Comm error dialogue box appear
47. ote Using the IAR Embedded Workbench Press OPEN All these file should now appear in the Project Window Left Hand Side of the IDE as shown previously Build Rebuild the Project To build the project press the make icon in the task bar as shown below SSS Base ka Make Button The build results and any errors or warnings will be displayed in the Messages window at the bottom of the IAR Workbench window These should be corrected before moving on to the Debugging section Debugging Once the project has been built without errors the user can now start the debugging session This is done by pressing the Debug icon in the task bar Start the Debug Session The debugger will connect to the OCD unit and download the code to the Flash memory on the microcontroller board Once downloaded the debugging window will open as shown below in Figure 9 29 The IAR embedded Workbench provides an integrated debugger so the debugging window opens as part of the IDE lf the debugger is run for the first time in a new project the following set up window will open This is to set the basic function of the debugging hardware i e Mini Cube or IECube etc User s Manual U19823EE1VOUMOO Using the IAR Embedded Workbench Chapter 9 MINICUBE Hardware Setup for TOKOR f76F173564 e y e EA ID code FFFFEFFEFFEFFFFEFFEFF Erase flash before next ID check Cancel EI Mam clack Sub clock
48. p for On chip Debugging Using USB 0 47 9 3 78KOR SPINIT Setup for On chip Debugging Using MINICUBE2 48 9 4 IAR Embedded Workbench Start Up 48 9 5 General ODUONS dach Ee Eege Or dee eee aaem ee eee retin 51 9 6 Compiler Options EEN 54 9 7 Assembler Options EE Ee tee et EE 57 9 8 Linker ODUONS ire reran AE oe SERED ASS oo Rae eee E 59 9 9 Integrated Debugger Selection 0 eee eee eens 62 9 10 Workspace and Project Setup if Not Compatible with the Installed IAR Workbench 63 8 User s Manual U19823EE1VOUMOO 9 11 Build Rebuild the Project 2525 eege etapa edad ectade eae eee eo sb ateehte tabs 9 12 Debugging Chapter 10 Appendix User s Manual U19823EE1VOUMOO 10 Chapter 1 Figure 1 1 Introduction The 78KOR SPINIT kit is a complete 3 phase motor control evaluation system based on NEC Electronics uPD78F1235 microcontroller MCU a 16 bit application specific product ASSP specifically designed for motor control applications The kit contains all of the hardware and software necessary to quickly set up and run a low voltage brushless DC motor BLDCM On board hardware facilitates easy programming with either the MINICUBE2 On Chip debugger programmer or directly through the onboard USB port using a standard USB cable and source code debugging without the need for additional hardware tools The source code and project files are available free of
49. plays P C all the time and the GUI will display all fault conditions Refer to section 6 for more information On power on the 78KOR SPINIT kit will display SELF User s Manual U19823EE1VOUMOO 17 18 Chapter 6 GUI Operation 6 1 Figure 6 1 The following information covers the installation and use of the remote control GUI application software The interface for the PC GUI is already built into the example software programmed into the board so it Is not necessary to reprogram the device in order to use the GUI operation If for any reason it is necessary to reprogram the device the complete AR Embedded Workbench project can be downloaded from the Motor Control starter kit web site To reprogram the microcontroller please refer to section 7 To operate the PC GUI you will need the USB cable included in the 78KOR Spinlt starter kit and to install both the NEC Electronics Starter Kit Virtual UART driver and the NEC GUI application software Starter Kit Virtual UART for USB Installation In order to use the remote control GUI you must install the NEC Electronics Starter Kit Virtual UART First connect the USB cable to the 78KOR Spinlt as shown in Figure 6 1 below and then to the PC Prepare the 78KOR SPINIT for GUI operation as shown below and ensure that DS1 is set to MINICUBE2 GUI Operation settings see Table 3 7 4 Power supply cable USB cable Connect USB cable to 78KOR SPINIT User s Manual U19
50. r 9 E LAR Embedded Workbench IDE File Edit View Project Debug Emulator Tools Window Help Denga Ei WK Workspace 2 OlBLDC_HALL120_78K E GUI support lnitialise_hardware c E Interrupt_handlers c E main_mcia c EH motor c E sub_mcio c Ly E Output Hardware Setup Breakpoint Toggle During Run Mask opti s Pseudo Emulation Live Watch Setup race SetiD Timet Setup Edit Events Edit Sequencer Trace Function trace Live Memary Breakpoint Usage Enable Flash Self Programming Flash Programming Emulation Pta FRx Security Flags Setting Emulation Host Shield seting nokor c m DEBUG PORT MODE DEBUG PORT 0 Motor setupFunc i init LEDFORT gt init TIMER BLOC HALL120 78KORIE3 fal lal Figure 9 33 Emulator Debug Options Note The Live Watch does not operate in real time on the on chip debug unit User s Manual U19823EE1VOUMOO 69 Chapter 10 Appendix Table 10 1 Port Pin Definitions Deag D D D 3 3 KRlo a 2 7 6 P152 ANI10 Speed POT P60 78F0730 RUN LED 1 2 1 1 O T T Moro CO Ve TxD ZigBee o ZigBee Oo N CO NJ LED_segA Ex LED_segB NIO 0 0 oO LED_segF LED_segG Ga 3 2 2 2 23 NJ P141 LED_2 P75 LED_3 Schematics Schematics descriptions are attached to this document Use the Attachments tab for access lower left side of the screen 5 5 e e A A G
51. rkbench Chapter 9 IAR Embedded Workbench IDI C GC lA SES gt By Oe D h el Gly Za Ge de be A0 e Si wife Debug III III IIIT IIIT TTI ee SEN DT E 5 BLDC_Hall_ v a come Bi control c _ monitor_csi PEER EEE EEE EEE EERE EERE EEE EERE EH D Monitor_db DT 1 0 mcr 40B 40A H LAESEKCKKKKKCKEKKKKKKKEKKKEKAKKEGEKCEKASKGCEKKEE AE bo A Main Control Loop Task function Sequence Wang LL init_OSC SS system_init Set up a start_AD Start AD conversi _ enable interrupt Global Interrupts Figure 9 31 Debug Menus User s Manual U19823EE1VOUMOO 67 Chapter 9 68 Using the IAR Embedded Workbench LAR Embedded Workbench IDE File Edit View Project Debug Emulator Tools Window Help Messages Workspace Source Browser Workspace Breakpoints Disassembly Memory Symbolic Memory Register Watch Locals Statics Auto Live Watch Quick Watch Call Stack Terminal Ifo G de Coverage Brong Stack Toolbars w Status Bar IRIES De Build e Ce Se Find in Files Tool Qutput Debug Log main mei L motore rr S Find In Trace void main void d Hardware ber DEBUG PORT MODE DEBUG PORT Motor SetupFune init LEDPORT init TIMER d i Figure 9 32 Debug Views Windows User s Manual U19823EE1VOUMOO Using the IAR Embedded Workbench Chapte
52. s Pin C 70 User s Manual U19823EE1VOUMOO
53. se box point to the location of the downloaded driver folder MQB2 and click on the Next gt button Found New Hardware Wizard aw Please choose your search and installation options Ce Search for the best driver in these locations Use the check boxes below to limit or expand the default search which meludes local paths and removable media The best diver found will be installed Search removable media floppy CO ROM i Include this location in the search C Don t search will choose the driver to install Choose this option to select the device driver from a list Windows does not guarantee that the driver you choose will be the best match for your hardware Back Next gt Cancel Figure 6 4 Choose Your Search and Installation Options Screen Click on the Continue Anyway button which begins the driver installation Please choose your search and installation options Na Y OY Found New Hardware Wizard _ U Please wait while the wizard installs the software NEC Electronics Starter Kit Virtual UART Cp Ch th i Hardware Installation g B The software you are installing for this hardware NEC Electronics Starter Kit Virtual UART De ai has not passed Windows Logo testing to verify its compatibility with Windows xP Tell me why this testing is important Continuing your installation of this software may impair or destabilize the correct operation of your
54. t files Debug c by List files ID ebug List Cancel Figure 9 8 General Options Setting the Output Locations Options for node BLDC _HALL120_T8KORIES Category Cic Compiler Assembler l Custom Build Target Output Library Configuration Library Options Stack Heap 4 gt Build Actions Shes d EE Linker ibrary escription Debugger F Use the legacy C runtime library IE 78 TEC_UBE MINTCUBE Simulator TE 78 Cibran tile HTOOLKIT_DIR SLUBSCLIB Sel aknna r26 Eonhguration tle Figure 9 9 General Options Selecting the C Library 52 User s Manual U19823EE1VOUMOO Using the IAR Embedded Workbench Chapter 9 Options for node BLDC HALL1270 TSKORIES lene al WIOCOns C C Compiler Assembler Custom Build E uild Actions Linker Debugger IE 78 IECUBE MINICUBE Simulator Uer Figure 9 10 General Options Setting the Stack and Heap User s Manual U19823EE1VOUMOO 53 Chapter 9 Using the IAR Embedded Workbench 9 6 Compiler Options Options for node BLDC_HALL120_78KORIE3 we p X Category Factory Settings General Options M Multi file Compilation C C Compiler E Giscard Unused Publics Assembler Custom Build Language Optimizations Output List Preprocessor Diagnostic 4 l gt Build Actions Linker pabudaer Language IE 78 eo IECLIBE Embedded G MINICUBE Extended Embedded C Simulator C Automati
55. the 78KOR SPINIT kit for debugging using only the onboard USB interface follow the steps below e Power OFF the 78KOR SPINIT kit e Set the DIP switch DS1 to the following e 1 8 ON e 2 7 OFF e 3 6 OFF e 4 5 ON e Remove JP22 OPEN USB Flash Debugging mode e Connect the USB cable from the PC to the 78KOR SPINIT kit e Power ON the 78KOR SPINIT kit Power supply cable USB cable 78KOR SPINIT ready for USB debugging User s Manual U19823EE1VOUMOO 47 Chapter 9 Using the IAR Embedded Workbench 9 3 78KOR SPINIT Setup for On chip Debugging Using MINICUBE2 To prepare the 78KOR SPINIT kit for debugging using the MINICUBE2 follow the steps below Power OFF the 78KOR SPINIT kit Set the DIP switch DS1 to the following e 1 80N e 2 7 OFF e 3 60N e 4 5 OFF Install JP22 ON MINICUBE2 flash programming mode Check that the switches on the MINICUBE2 are set as shown below e Switch M1 M2 is set to M1 Switch 3 T 5 is set to T Locate the MINICUBE2 16 pin connector see Figure 3 1 and attach the MINICUBE2 programmer using the 16 pin cable Power ON the 78KOR SPINIT kit Figure 9 2 78KOR SPINIT Kit ready for debug with MINICUBE2 9 4 IAR Embedded Workbench Start Up Open the IAR workbench The following Screen should be opened Note The exact display may vary depending on if this is a new installation 48 User s Manual U19823EE1VOUMOO Using the IAR Embedded Workbench Ch
56. the motor press START STOP again During the motor operation the RPM can be set to the desired speed using the SPEED potentiometer Pressing MODE during operation will toggle the display between the reference RPM and the actual measured RPM Changing the direction can be done while the motor is running with the REVERSE and FORWARD push buttons The motor will ramp down and stop for a brief time and will ramp up in the opposite direction to the same set RPM Measured RPM Display PC Mode In PC Mode the motor can be operated using a special GUI Graphical User Interface which can be downloaded from NEC Electronics website See chapter 6 for the description of this mode of operation User s Manual U19823EE1VOUMOO Chapter 5 Drive and Motor Protection The starter kit and the motor are protected against unexpected events such as overload motor stall and malfunction of the Hall sensors If such faults are detected the motor stops rotating and the fault conditions are displayed on the seven segment LED For details on the protection functions implemented in hardware consult the user s manual schematics The sample code software also has built in fault detection algorithms as an extra measure of protection In standalone SELF mode the LED displays the following fault conditions e Motor over current e Motor stall fault s Hall sensor fault e Software over current In the Graphical Interface mode PC the LED dis
57. ule MINT LUPE Simulator EEN Object module name SE Jh Generate debug information OF Cancel Figure 9 13 Compiler Options Output Set for Debug User s Manual U19823EE1VOUMOO 55 Chapter 9 Using the IAR Embedded Workbench Options for node BLDC HALL1270_ 8KORIES Bes a x ES Category Factor Settings General Options T Multi file Compilation F Giscard Unused Publics Assembler Custom Build Language Optimizations Output List Preprocessor Diagnostic 4 A Build Actions Linker I Output list file Debugger Iw Assembler mnemonics IE 20 Diagnostics E Output assembler file i P ncelude source Simulator i SE EEN E include call frame infomation Cancel Figure 9 14 Compiler Options Compiler Listings Options for node BLDC_HALL120_7SKORIES a ag e x Category Factor Settings General Options Multi file Compilation F Giscard Unused Publics Assembler Custom Build Language Optimizations Output List Preprocessor Diagnostic 4 A Build Actions Linker ignore standard include directories TOOLEIT DIRSSINCS Debugger HEES IE 20 Additional mchude directones one per line IECUBE MINICUBE Simulator TE Preinclude file ee Defined symbols one per line Preprocessor output to file Preserve comments Generate Hine directives pe Figure 9 15 Compiler Options Pre Processor Settings 56 User s Manual U198
Download Pdf Manuals
Related Search
Related Contents
USER MANUAL SBC6120 User`s Manual INSTALLATION GUIDE Manuel Utilisateur AGFA ATCA-C110/1G Automobile Accessories User Manual Copyright © All rights reserved.
Failed to retrieve file