SW Development Kit Description MLX81200 BLDC Motor Controller Table of contents 1. Introduction..........................................................................................................................................2 2. Contents of the MLX81200 SW Development kit ...............................................................................3 2.1. Hardware.....................................................................................................................................................3 2.2. Software .......................................................................................................................................................5 3. How to use the MLX81200 SW Development kit................................................................................6 4. The Software Kit...................................................................................................................................7 4.1. Software Evaluation flow ...........................................................................................................................7 4.2. The installation of the Software Kit ..........................................................................................................9 5. Hardware Kit ......................................................................................................................................11 5.1. Configuration ............................................................................................................................................11 5.2. General.......................................................................................................................................................12 5.3. Evaluation board.......................................................................................................................................12 6. Quick start up .....................................................................................................................................18 6.1. Using the C flow ........................................................................................................................................18 6.2. Programming a HEX file to the FLASH.................................................................................................20 7. MLX81200 Software configuration tool (SCT) ................................................................................23 7.1. General.......................................................................................................................................................23 7.2. Locate the demokit firmware sources and load the configuration .......................................................24 7.3. Configure the demokit firmware.............................................................................................................25 7.4. Save, compile and flash the firmware .....................................................................................................27 8. BLDC DemoKit PC program .............................................................................................................30 8.1. General.......................................................................................................................................................30 8.2. Main window .............................................................................................................................................31 8.3. Control Load window ...............................................................................................................................33 8.4. Control Debug window.............................................................................................................................34 8.5. PID controller and PC program ..............................................................................................................34 9. Appendix.............................................................................................................................................35 9.1. Schematics of the Evaluation Board........................................................................................................35 9.2. Schematic of the Evaluation Board – Part 2 Programmer Interface...................................................36 9.3. Schematic of the Power Board.................................................................................................................37 10. History record...................................................................................................................................38 11. Disclaimer.........................................................................................................................................39 MLX81200 SW Development kit Author: ERE Page 1/39 Rev 1.4 / 05/11/08 SW Development Kit Description MLX81200 BLDC Motor Controller 1. Introduction This document is intended to give a brief introduction of the different parts of the SW Development kit for the ASSP MLX81200. The aim of this document is to support a fast start up with this kit. Besides this document, several other important documents are necessary for a deeper understanding of more detailed development issues. The most important documents related to the MLX81200 are: MLX81200 Datasheet -detailed description of the chip with all functions and features MLX82001_Product_Specification -MelexCM Datasheet and underlying documentation of different blocks included in the MLX82001 Melexis development system -MLX Assembler, Linker, Obgen, Tabgen description GNU C-Compiler GCC -GCC User’s Manual, incl. AS, LD and Getting Started Doc Melexis emulator (flash programming SW) -description of the Emulator Melexis emulator SW Mlx16 C-Debugger -Debugger User’s Manual Mlx16 CPU Simulator -description of the Simulator Mlx16X8 Data book -explanation of the Mlx16X8 microcontroller core and the instruction set Melexis Lin Master documentation -description of the Melexis USB LIN Master MelexCM LIN API (including required SW files) -detailed description of the MelexCM LIN API MLX81200 BLDC Demo Kit firmware -MLX81200_SWDesignDescription_x.pdf AppNote_MLX81100_MLX81200_Reflashing_on_module_x.pdf ApplNote_Flash_over_pin_LIN_x.pdf MLX81200 SW Development kit Author: ERE Page 2/39 Rev 1.4 / 05/11/08 SW Development Kit Description MLX81200 BLDC Motor Controller 2. Contents of the MLX81200 SW Development kit 2.1. Hardware Part Picture MLX81200 Evaluation board Power board MLX81200 SW Development kit Author: ERE Page 3/39 Rev 1.4 / 05/11/08 SW Development Kit Description MLX81200 BLDC Motor Controller USB LIN Master Mini E-MLX Emulator BLDC Motor and hysteresis brake Hysteresis brake control board Tbl. 1 Contents Hardware MLX81200 SW Development kit Author: ERE Page 4/39 Rev 1.4 / 05/11/08 SW Development Kit Description MLX81200 BLDC Motor Controller 2.2. Software Part Function Installation file Mlx16 Simulator/Emulator Simulator/Emulator PC Software Mlx16Setup_x_xx_x.exe Mlx81200x.mmf Configuration file for Simulator/Emulator and Flash Programmer Mlx81200Conf_x_x_x.msi E-mlx MM/Mini E-MLX Emulator Emulator Software and hardware driver EmlxSetup_x_x_x.msi Mlx16 Interactive C Debugger Melexis C Debugger MDC_Setup_x_x_x.exe Flash Programmer Software for E-mlx MM and Mini E-MLX Programming software for Flash memory EMlxMMProgSetup_x_x_xx.msi Gnu Tool chain Mlx16 C Compiler and associated tools Mlx16_GCC_setup_x_xx_x.exe MLX81200 SW Platform Includes general chip operation especially the LIN feature Available on Softdist Melexis USB LIN Master Software PC software for LIN Master Comes with MLX USB LIN Master on CD MLX81200 BLDC Firmware BLDC Firmware for the Demo kit setup BLDC_DemoKit_Firmware_x.zip MLX81200 PC program PC program to control the BLDC firmware via LIN MLX81200_Demokit_PCProgram_x.exe MLX81200 SCT PC program to configure, build und flash the BLDC-Demokit firmware MLX81200_SCT_x.exe MLX81200 Software Source code BLDC Firmware sources for the BLDC Demokit BLDC_x_Demokit.zip Tbl. 2 Contents Software MLX81200 SW Development kit Author: ERE Page 5/39 Rev 1.4 / 05/11/08 SW Development Kit Description MLX81200 BLDC Motor Controller 3. How to use the MLX81200 SW Development kit The following table introduces the philosophy of the MLX SW Development kit and gives an overview about the different options for development with the kit. Task 81200 specific hardware Hardware Required software Software development in Assembler - Editor - Mlx16 Melexis Assembler Software development in C - Editor - Mlx16 GCC C Compiler Software Simulation in Assembler - PC - Mlx16 Simulator Software Simulation in C - PC - Mlx16 C Debugger In-Circuit Emulation in Assembler - PC - Mini E-MLX Emulator - Evaluation board - Mlx16 Simulator - Mlx16 Emulator - 81200x.mmf configuration file In-Circuit Emulation in C - PC - Mini E-MLX Emulator - Evaluation board - Mlx16 Simulator - Mlx16 Emulator - 81200x.mmf configuration file Quick HW Test - PC - Mini E-MLX Emulator - Evaluation board - Mlx16 Simulator - Mlx16 Emulator - 81200x.mmf configuration file - Demo Software for the Evaluation board Configure, build and program via pin LIN -PC -Mini E-Mlx Emulator or -USB-LinMaster 2.0 -Evaluation board -MLX81200 IC with loader support -Mlx16 GCC Compiler -MLX81200 SCT Tbl. 3 How to use the SW Development kit MLX81200 SW Development kit Author: ERE Page 6/39 Rev 1.4 / 05/11/08 SW Development Kit Description MLX81200 BLDC Motor Controller 4. The Software Kit 4.1. Software Evaluation flow The documentation for the development tools listed above is included with those tools and is outside the scope of this document. Despite that, a brief flow of the software development for the MLX81200 is given below in Fig. 1. Software can generally be written in Assembler or in C. 4.1.1. Software Development in Assembler language Assembler source file(s) can be written with all common non-formatting editors. The code is then compiled with a Melexis supplied assembler, which is customized for the Mlx16X8 instruction set and supports all standard features of other commercial compilers. The linker will merge the object files generated by the assembler and create a final file (*.hex, *.cod). This final *.hex file can be used in two different ways: • • for simulation purposes with the Mlx16 Simulator for in-circuit debugging/testing (programmed to Flash) Source code file (*.asm) Include file (*.h) Assembler Object file (*.obj) Other object file(s) Library Linker Final CODE file (*.cod) Hex file gen. Used for Simulation and In-Circuit Emulation Final HEX file (*.hex) Sent to E-MLX MM and used for Flash Emulation Fig. 1 Flow of the Software Development using Assembler and Melexis tools MLX81200 SW Development kit Author: ERE Page 7/39 Rev 1.4 / 05/11/08 SW Development Kit Description MLX81200 BLDC Motor Controller 4.1.2. Software Development in C language Gnu has also developed a C compiler, Assembler and Linker. This tool chain supports all known features of other common compilers. The creation of C source file(s) can be achieved with any common non-formatting editor. The code is then compiled and linked with the above mentioned Gnu tools (see Tbl. 2) With this methodology: • • • All C language based features can be used Assembler parts (previously compiled to object file level) can be included ROM and In-circuit emulation is possible on C instruction level NOTE: The object files of Gnu and Melexis supplied Assembler are not compatible. Therefore the Gnu provided Assembler must be used, in case Assembler sources should be included with a Gnu C source. Include file (*.inc) C Source code file (*.c) compiler, assembler and linker are made by Gnu and are not compatible to the Melexis assembler flow GCC C compiler Assembler source file (*.s) Assembler file (interim) Assembler Object file (*.o) Other object file(s) Library Linker Final elf file (*.elf) Used for Simulation and In-Circuit Emulation Hex file gen. Final HEX file (*.hex) Sent to E-MLX MM and use for Flash Emulation Fig. 2 MLX81200 SW Development kit Author: ERE Flow of the Software Development using the Gnu C Compiler tools Page 8/39 Rev 1.4 / 05/11/08 SW Development Kit Description MLX81200 BLDC Motor Controller 4.2. The installation of the Software Kit 4.2.1. Installation of the tools All tools run under WinXP®. Win9x, WinNT® and Win2000® are not supported. All programs use the standard windows installer of WinXP®. The following tools have to be installed: • • • • • • • • • • EmlxSetup_x_x_x.msi Mlx16Setup_x_xx_x.exe MDC_Setup_x_x_x.exe EMlxMMProgSetup_x_x_xx.msi Mlx81200Conf_x_x_x.msi Mlx16_GCC_setup_x_xx_x.exe MLXLinMaster_Setup.exe MlxLinDebug.exe MLX81200_Demokit_PCProgram_x.exe MLX81200_SCT_x.exe Emulator Software and hardware driver Mlx16 Simulator Software Mlx16 Interactive Debugger Flash Programmer Software Configuration file, consists of chip specific settings Mlx16 C Compiler USB LIN Master Software Melexis USB LIN Master PC program to control the BLDC firmware via LIN PC program to configure, build und flash the BLDCDemokit firmware x – Revision number Demo Software can be copied at any top level directory: • Software_Platform_MelexCM_x_x_x.zip • BLDC_DemoKit_Firmware_x_x.zip Software platform including the Demo Software firmware for the Evaluation setup • BLDC_x_Demokit.zip the source code of the BLDC DemoKit firmware 4.2.2. Directory structure of the Software Tools It is recommended to use the “standard” installation option. After installing with this installation option, the following path settings and directory structure appears: C:\Programs\Melexis\ E-Mlx MM\Programmer Bin Bin\Doc Emulator Simulator MDC MLX81200_DemoKit_PCprogram MLX81200 SW Development kit Author: ERE FLASH Programmer Software MLX Assembler Package MLX Assembler Development System Documentation Emulator Software and help file MLX16 Simulator/Emulator (Assembler) MLX16 Interactive C Debugger and manual MLX81200 Control Software Page 9/39 Rev 1.4 / 05/11/08 SW Development Kit Description MLX81200 BLDC Motor Controller The release of Mx16 GCC suite installs in the following directory tree: C:\mlx16-gcc\ bin contains executable files. Lib contains libgcc library and include files and compiler specs. mlx16 contains libmlx16 library and include files; start-up module; linker command files and memory map. libexec additional executable files. config configuration file and script for Mlx16 Simulator. docs documentation. examples sample programs. C:\Programs\Common Files\Melexis Shared\Config\81200 81200.mmf Configuration file for Simulator, Emulator and Flash Programmer C:\Programme\LIN Commander\LinCommander.exe LinCommander.exe a sample interface program that can be used to debug via the LIN bus when developing an application. 4.2.3. Directory structure of the Demo Software The setup works with relative paths, so it can be copied into any top level directory. NOTE: Please make sure that directory path does not contain any spaces It contains the following folders: \bin \config \doc \include \lib \mmf Utilities Makefile configurations Documentation related to general MelexCM platform software Common libraries include directory Common libraries (.a), library object files and linker files Test controller files and tools \libsrc \libsrc\lib \libsrc\LIN \libsrc\math Root of the common libraries sources Source code of the common libraries LIN library source code Math library source code \projects \projects\Examples \projects\81200 \projects\81200\include \projects\81200\src Root of the projects sources Projects which are independent from analogue chip periphery Root of the MLX81200 project The MLX81200 specific declarations (analogue port names etc.) The MLX81200 common versions of the product specific functions (analog_trimming, power_down and vectors.S) and projects LIN pin loader source code (LIN mode or standalone) \projects\LINLoader Tbl. 4 Folder description MLX81200 SW Development kit Author: ERE Page 10/39 Rev 1.4 / 05/11/08 SW Development Kit Description MLX81200 BLDC Motor Controller 5. Hardware Kit 5.1. Configuration • Evaluation board in conjunction with the Mini E-MLX Emulator • Used for In-Circuit debugging • Flash programming possible • LIN Communication possible Fig. 3 Arrangement of Evaluation board in conjunction with Power board, Mini E-MLX Emulator , BLDC motor and Melexis USB LIN Master MLX81200 SW Development kit Author: ERE Page 11/39 Rev 1.4 / 05/11/08 SW Development Kit Description MLX81200 BLDC Motor Controller 5.2. General The purpose of the HW kit is the development of software for the MLX81200 BLDC Motor Controller. Using this HW kit, the device can be evaluated in a detailed fashion. The evaluation system is composed of an evaluation board and the power board. The idea of the evaluation system is to have two stand-alone boards: • A standard board (evaluation board) is used for all possible applications. It consists of a socket for the chip, several pin headers for all signals from the chip and interface connectors to the Emulator, LIN-Bus and the application board (power board). • A customized application board (power board) has to be designed specifically for a certain application by the user. It is possible to connect this power board on 32-pin connector. The sample power board consists of 3 half Bridges with N-FET-transistors, 2 shunts for possible current supervision and interface connectors to Vbat and the BLDC-Motor. 5.3. Evaluation board 5.3.1. Evaluation board - jumper settings Fig. 4 Location of Connectors on Evaluation board MLX81200 SW Development kit Author: ERE Page 12/39 Rev 1.4 / 05/11/08 SW Development Kit Description MLX81200 BLDC Motor Controller JMP1 short open : connects Vbat to the chip. : disconnects Vbat from the chip JMP2 short open : connects CWD-pin to GND : CWD-pin of the chip is active. NOTE: the external capacitor for analog Watchdog is active. JMP3 short open : disables the external regulator NPN transistor for higher VCC loads. : enables the external regulator NPN transistor for higher VCC loads JMP5 1-2 2-3 : enable low pass filter R55/C15 and voltage divider R5/R50 for pin T : enable only the voltage divider R5/R50 for pin T JMP6 1-2 2-3 : enable low pass filter R66/C16 and voltage divider R6/R60 for pin SW5 : enable only the voltage divider R6/R60 for pin SW5 JMP7 1-2 2-3 : enable low pass filter R77/C17 and voltage divider R7/R70 for pin SW6 : enable only the voltage divider R7/R70 for pin SW6 JMP8 1-2 2-3 : enable low pass filter R88/C18 and voltage divider R8/R80 for pin SW7 : enable only the voltage divider R8/R80 for pin SW7 S2 consists of the jumper JMP9 and JMP10: JMP9 short : the connection between the chip and the emulator is split open : the connection between the chip and the emulator is established, the chip can be accessed by the emulator, if the emulator is not plugged the CPU is executing the flash program JMP10 short open : CPU does not execute the flash program : CPU is executing the flash program, if no emulator is connected and JMP9 is shorted JMP11 short +JMP12 open : the pull up resistors R21 and R22 are connected to the test interface inputs (necessary if the E-mlx MM programmer is used) : the pull up resistors are disconnected (default for the Mini E-Mlx programmer) JMP21 short open : supply the additional voltage regulators inside the Mini E-Mlx programmer (required) :disconnect VBAT from the test interface (required for the E-mlx MM programmer) NOTE: If the E-Mlx MM programmer is connected and the JMP21 is shorted the diode D4 can be destroyed. 5.3.2. Functionality of the Evaluation Board Main Power Switch S1 selects between supply connector of the evaluation board or the supply connector of the power board. IMPORTANT: If the evaluation board is supplied via the power board, the power supply connector of the Evaluation board should NOT be connected! Otherwise the board or the power supply will be damaged! The PCB only requires a DC voltage of +12…+18V which is applied via the supply connector of the evaluation board. This is valid if the evaluation board is used stand-alone without the power board. In case the board is used alongside the power board, the power board delivers the supply voltage for both PCBs. Both the evaluation board and the power board are protected against reverse polarity. MLX81200 SW Development kit Author: ERE Page 13/39 Rev 1.4 / 05/11/08 SW Development Kit Description MLX81200 BLDC Motor Controller 5.3.3. Evaluation board – Phase signal filters R55 R50 R5 C15 R13 D13 C16 R6 R66 R60 D14 R14 C17 R7 R77 R70 D15 R15 R8 C18 R88 Fig. 5 R80 Position of the filter components on the EVB The resistors R13, R14, R15 and the diodes D13, D14, D15 protect the IC against negative current and voltage from the motor coils. The resistors are increase the discharging time of the high side n-channel MOSFET transistor gates. The phase signals on the T, SW5, SW6 and SW7 pins can be reduced with the voltage dividers R5/R50, R6/R60, R7/R70 and R8/R80. With the low pass filters R55/C15, R66/C16, R77/C17 and R88/C18 fast disturbances can be filtered out. The default value for the resistor is 150 ohm and for the capacitor is 10nF. MLX81200 SW Development kit Author: ERE Page 14/39 Rev 1.4 / 05/11/08 SW Development Kit Description MLX81200 BLDC Motor Controller 5.3.4. Evaluation board - Jumper ring The jumper ring enables the user to either connect or disconnect all signal lines to the chip. By removing jumpers, the circuit from the chip to the application hardware can be disconnected e.g. for measuring current or applying external signals. All jumpers are described with the specific pin names on the board. 5.3.5. Connection between Power Board Port and Evaluation Board Connector ST1 on Evaluation board Pin Name Description 1 GND Ground 2 GND Ground 3 GND Ground 4 W IC-Pin 24 5 HS2 IC-Pin 25 6 SW0 IC-Pin 23 7 GND Ground 8 SW1 IC-Pin 22 9 V IC-Pin 31 10 HS1 IC-Pin 30 11 GND Ground 12 SW2 IC-Pin 21 13 U IC-Pin 33 14 HS0 IC-Pin 34 15 GND Ground 16A VBAT_S2 IC-Pin 40 16C VBAT_S1 IC-Pin 39 17 V5EXT IC-Pin 2 18 T IC-Pin 37 19 GND Ground 20 LS2 IC-Pin 27 21 LS1 IC-Pin 28 22 LS0 IC-Pin 36 23 GND Ground 24 EN_VS Bootstrap output from IC-Pin 15 -CLKO 25 SW3 IC-Pin 20 26 GND Ground 27 GND Ground 28 GND_S2 IC-Pin 42 29 GND_S1 IC-Pin 41 30 GND Ground 31 VBAT unprotected voltage from Power board 32 VBAT unprotected voltage from Power board Tbl. 5 Connector ST1(male) on Evaluation board MLX81200 SW Development kit Author: ERE Page 15/39 Direction Input Output Input/Output Input/Output Input Output Input/Output Input Output Input Input Output Input Output Output Output Output Input/Output Input Input Input Input Rev 1.4 / 05/11/08 SW Development Kit Description MLX81200 BLDC Motor Controller 5.3.6. Evaluation board – extension port ST3 Connector ST3 on Evaluation board Pin 1 Name V5V or V5EXT Description 5V power supply or protected switchable V5ext Protected voltage STB Wake-up interrupt signal (INH) Ground Interrupt from CAN module Ground SPI clock Ground SPI MOSI Ground SPI MISO Ground SPI chip select Ground 2 VS 3 SW3 4 SW4 5 GND 6 IO5 7 GND 8 IO4 9 GND 10 IO3 11 GND 12 IO2 13 GND 14 IO1 15 GND 16 Not used 17 Not used 18 Not used 19 Not used 20 Not used Tbl. 6 Connector ST3 on Evaluation board (for example a CAN extension board can be connected) 5.3.7. Evaluation board - Signal pin headers Connector ST5 on Evaluation board Pin Name 1 IO0 2 IO1 3 IO2 4 IO3 5 IO4 6 IO5 Tbl. 7 Connector ST5 on Evaluation board MLX81200 SW Development kit Author: ERE Description IC Pin 1 IC Pin 7 IC Pin 10 IC Pin 12 IC Pin 9 IC Pin 3 Page 16/39 Rev 1.4 / 05/11/08 SW Development Kit Description MLX81200 BLDC Motor Controller Connector ST7 on Evaluation board Pin Name 1 LS0 2 CP0 3 HS0 4 HS1 5 CP1 6 LS1 7 LS2 8 CP2 9 HS2 Tbl. 8 Connector ST7 on Evaluation board Description IC Pin 36 IC Pin 25 IC Pin 34 IC Pin 30 IC Pin 29 IC Pin 28 IC Pin 27 IC Pin 26 IC Pin 25 Connector ST9 on Evaluation board Pin Name 1 SW0 2 SW1 3 SW2 4 SW3 5 SW4 6 SW5 7 SW6 8 SW7 Tbl. 9 Connector ST9 on Evaluation board Description IC Pin 23 IC Pin 22 IC Pin 21 IC Pin 20 IC Pin 19 IC Pin 18 IC Pin 17 IC Pin 16 5.3.8. Evaluation board - Reset Resets are always active low and can be achieved by the following options: • Turning off the power switch on the Evaluation board resets all components of the Evaluation board as soon as the charge of the block capacitors falls below the reset threshold level In case of working with the Mini E-Mlx Emulator, there are two more reset options (this is valid only for the digital part of the chip, MelexCM): • • Sending a new software (*.x16 or *.elf file) to the Emulator will reset the MelexCM chip automatically Reset can also be achieved by the ‘Reset’ button of the PC Simulator/Debugger software. IMPORTANT: Reset of the whole chip including the analog part can ONLY be achieved by turning off the power switch. MLX81200 SW Development kit Author: ERE Page 17/39 Rev 1.4 / 05/11/08 SW Development Kit Description MLX81200 BLDC Motor Controller 6. Quick start up 6.1. Using the C flow Assembling/Linking: • • • • change to the .\libsrc directory open a command prompt and type: ‘gmake clean’ ‘gmake install’ change to the directory where the source code is situated, e.g. .\projects\81200\BLDC\ open a command prompt and type: ‘gmake clean’ ‘gmake all’ -> executable *.elf file is created in the same directory -> executable *.hex file is created in the same directory Simulation: • • • • Start the MLX Interactive Debugger ‘…\Melexis\MDC\MLXDBGW.exe’ Select target ‘Mlx81200’ and ‘Simulator’ from ‘Tools’ -> ‘Target & Engine’ menus as shown in Fig. 6 Load the appropriate *.elf file – ‘File’ -> ‘Open’ Run the *.elf files by pressing the ‘Go’ or ‘Step’ icon Emulation: • • • • • • • Connect the Mini EMlx Emulator to the PC via an USB cable Insert a MLX81200 chip to the appropriate socket on the Evaluation board Power up the Evaluation board and connect the Mini EMlx Emulator to the EVB Start the MLX Interactive Debugger ‘…\Melexis\MDC\MLXDBGW.exe’ Select target ‘Mlx81200’ and ‘Mini EMlx’ from ‘Tools’ ‘Target&Engine’ menus as shown in Fig. 6 Load the appropriate *.elf file – ‘File’ -> ‘Open’ Run the *.elf files by pressing the ‘Go’ or ‘Step’ icon Fig. 6 Interactive Debugger: Selecting Simulator or Emulator mode MLX81200 SW Development kit Author: ERE Page 18/39 Rev 1.4 / 05/11/08 SW Development Kit Description MLX81200 BLDC Motor Controller Fig. 7 Melexis Interactive Debugger session MLX81200 SW Development kit Author: ERE Page 19/39 Rev 1.4 / 05/11/08 SW Development Kit Description MLX81200 BLDC Motor Controller 6.2. Programming a HEX file to the FLASH • • • • • Connect the Mini E-MLX Emulator to the PC via an USB cable Insert a MLX81200 chip into the socket and power up the EVB Connect the Mini E-MLX Emulator (programmer) to the EVB Start the programmer software ‘...\Programmer\EMlxMMProg.exe’ Select File\Open… to open the Mlx81200 mmf file installed by Mlx81200Conf_x_x_x.msi Fig. 8 • E-Mlx MM Programmer: Path to the Mlx81200.mmf file Select ‘Tools\Options\Programming’ tick checkbox ‘Keep Supply between patterns’ Fig. 9 E-Mlx MM Programmer: Option “keep supply between pattern” MLX81200 SW Development kit Author: ERE Page 20/39 Rev 1.4 / 05/11/08 SW Development Kit Description MLX81200 BLDC Motor Controller • Select tab ‘Programmer’, choose from pull-down menu ‘Mini E-mlx’ on ‘Autodetect’ Fig. 10 • E-Mlx MM Programmer: Chose the Mini EMlx Push the ‘Diagnose’ button -> This message should appear : >>> Info : Hardware successfully checked! Fig. 11 E-Mlx MM Programmer: checking connected emulator MLX81200 SW Development kit Author: ERE Page 21/39 Rev 1.4 / 05/11/08 SW Development Kit Description MLX81200 BLDC Motor Controller • • Select tab ‘Pattern’ and go to pattern ‘POWER_ON’ Push the ‘Execute’ button -> in addition to D3 “Power on” D20 “E-MLX on” should light up Fig. 12 • • • • E-Mlx MM Programmer: enable programmer interface Select ‘Flash’ from the tab ‘Memories’ sections Select the ‘Program using HEX file’ radio button Load a *.hex file and push the ‘Execute’ button Verify the programmed file by pushing the ‘Compare Dump to HEX file’ radio button and press ‘Execute’ again Fig. 13 E-Mlx MM Programmer: programming the flash MLX81200 SW Development kit Author: ERE Page 22/39 Rev 1.4 / 05/11/08 SW Development Kit Description MLX81200 BLDC Motor Controller • • • Before disconnecting the Mini EMLX select tab ‘Pattern’ -> ‘POWER_OFF’ Push the ‘Execute’ button D20 “E-MLX on” should now be turned of Fig. 14 • • E-Mlx MM Programmer: disable programmer interface The evaluation board can now be switched off Mini E-MLX Emulator can now be safely removed For generating *.hex code please refer to 6.1 7. MLX81200 Software configuration tool (SCT) 7.1. General The Software configuration tool can be used to configure, compile and flash the BLDC-Demokit firmware version 2.0. The Software configuration tool is not suitable to write a complete application. If the file structure is changed or the source files are modified, the tool will not work correctly. Note: The save function will overwrite the files motorctrl.h, sysdef.h, ramppar.c, .\config\chip.mk and the application Makefile with a defined content. That means any modification will be lost. The Software configuration tool does NOT include any source code for the MLX81200. The required firmware source files package BLDC_V2.0_DemoKit can be found on the Melexis Softdist server. The firmware needs to be unpacked to a local folder on the PC. Please make sure that directory path does not contain any spaces. The SCT is divided into three major parts. Part 1: locate the demokit firmware sources Part 2: configure the motor control parameters Part 3: compile the firmware and flash the firmware into the IC via the pin LIN A working loader inside the IC is necessary for a successful flash process. Melexis will deliver preprogrammed devices, which include an initial working loader code. If the preprogrammed loader code was destroyed, the first step must be always the programming of the loader software via test interface. This step can only be executed via the programmer software or debugger using Emlx Emulator. MLX81200 SW Development kit Author: ERE Page 23/39 Rev 1.4 / 05/11/08 SW Development Kit Description MLX81200 BLDC Motor Controller For programming a HEX file to the flash via the test interface please refer to chapter 6.2 For further information please see: - the description for the MLX81200 BLDC Demo Kit firmware - Application Note how to program on module - Application Note how to flash over pin LIN 7.2. Locate the demokit firmware sources and load the configuration 1 2 3 4 5 6 Fig. 15 1 2 3 4 5 6 MLX81200 SCT chose the path and load the configuration Button “Browse” Project selector Project name Edit field “Target name” Button “read parameter” Log Window MLX81200 SW Development kit Author: ERE the path to BLDC firmware source the current project name must be selected shows the current project name the name of the firmware the configuration will be read from the chosen directory each operation is shown in this window Page 24/39 Rev 1.4 / 05/11/08 SW Development Kit Description MLX81200 BLDC Motor Controller 7.3. Configure the demokit firmware 7.3.1. Test pulse configuration 8 7 9 10 12 11 Fig. 16 7 8 9 10 11 12 MLX81200 SCT – modify the parameter of the BLDC-demo kit Parameter set “motor operation” Parameter set “System setting” Parameter set “Communication Interface settings” Parameter set “Speed regulator settings” Parameter set “Test pulse settings” Parameter set “Motor start up test pulses” MLX81200 SW Development kit Author: ERE Page 25/39 Rev 1.4 / 05/11/08 SW Development Kit Description MLX81200 BLDC Motor Controller 7.3.2. Ramp configuration 8 7 9 10 13 Fig. 17 MLX81200 SCT – modify the parameter of the BLDC-demo kit 7 8 9 10 13 Parameter set “motor operation” Parameter set “System setting” Parameter set “Communication Interface settings” Parameter set “Speed regulator settings” Parameter set “Motor start up Ramp” MLX81200 SW Development kit Author: ERE Page 26/39 Rev 1.4 / 05/11/08 SW Development Kit Description MLX81200 BLDC Motor Controller 7.4. Save, compile and program the firmware 7.4.1. Configure the hardware in use 14 15 Fig. 18 MX81200 SCT – configure the hardware in use 14 Main menu item “Configuration” the SCT can be configured in this menu 15 Menu item “use Mini E-Mlx” and “use LINMas..” the USB LINMaster or the Mini E-MLX can be chosen MLX81200 SW Development kit Author: ERE Page 27/39 Rev 1.4 / 05/11/08 SW Development Kit Description MLX81200 BLDC Motor Controller 7.4.2. Build process 16 17 18 19 20 21 22 Fig. 19 MX81200 SCT – screenshot running compile process of the BLDC-demo kit firmware 16 17 18 19 20 21 Button “Save configuration” Button “Build firmware” Checkbox “Remove objects, Hex- and Elf-files” Checkbox “Compile MelexCM libraries” Checkbox “Compile Loader” Button “Load Firmware into the IC” 22 Log window “Compile process window” MLX81200 SW Development kit Author: ERE the configuration will be saved into the files start the compile process remove the old object and firmware files compile the complete MelexCM libraries build the loader firmware from current configuration start the programmer tool and load the actual firmware into the MLX81200 via pin LIN The compile log messages are shown inside Page 28/39 Rev 1.4 / 05/11/08 SW Development Kit Description MLX81200 BLDC Motor Controller 7.4.3. Upload the firmware • Disconnect all other devices from the LIN bus • Connect the USB-LIN master version 2.0 or the Mini E-Mlx emulator to the pin LIN and to the PC • Press the Button “Load Firmware into the IC” - The programmer tool is started and will be configured for the used loader protocol • Do a POR of the MLX81200 when the message “>>> Echo : Entering programming mode...” is shown. Uploading the firmware is only possible immediately after POR and for a certain time (500ms). Afterwards uploading is not possible anymore. • Wait until the E-Mlx MM Programmer tool has finished with the message “Info • Close the E-Mlx MM Programmer tool. : Programming completed OK” A working loader inside the IC is necessary for this process. 23 21 22 Fig. 20 MLX81200 SCT – uploading procedure with the programmer tool 21 Button “Load Firmware into the IC” 22 Log window “Compile process window” 23 E-Mlx MM Programmer tool MLX81200 SW Development kit Author: ERE Start the programmer tool and load the actual firmware into the MLX81200 via pin LIN The compile log messages are shown inside The Melexis programmer tool Page 29/39 Rev 1.4 / 05/11/08 SW Development Kit Description MLX81200 BLDC Motor Controller 8. BLDC DemoKit PC program 8.1. General The Motor control Software does NOT include any source code for the MLX81200. The required firmware file BLDC_V20_DemoKit_XY.hex MUST be loaded first into the MLX81200. The program MUST be running either by starting the program in the Melexis interactive debugger or let the CPU run free without the emulator out of power on reset. The BLDC Demokit Firmware can be controlled with the PC program via the LIN bus. The hysteresis brake board can be controlled via the LIN bus too. For programming a HEX file to the flash please refer to chapter 6.2 8.2. Command line parameter It is possible to configure the minimum and maximum speed slider values of the graphical interface. The default limits are 500 rpm for the minimum and 5000 rpm for the maximum. Following parameters are supported: • • -maxspeed:x -minspeed:x set the maximum limit set the minimum limit Example: The command: “MLX81200_Demokit_PC_program.exe –maxspeed:4000 –minspeed:2000” starts the BLDC DemoKit PC program with a speed range from 2000 to 4000 rpm. MLX81200 SW Development kit Author: ERE Page 30/39 Rev 1.4 / 05/11/08 SW Development Kit Description MLX81200 BLDC Motor Controller 8.3. Main window 1 5 2 4 6 7 8 3 Fig. 21 Main window after start 1 2 3 4 5 6 7 8 Button “Disconnect” disconnect the LIN or CAN master. The application does not close. The software can be reactivated by clicking the ‘connect’ button. Button “Connect” connect the LIN master or the CAN master Interface radio buttons The interface can be selected with this two radio buttons Checkbox “Control Load“ open a window to control the hysteresis brake board via the LIN bus Button “About” Checkbox “Control Debug” open the debug window to control the wave form Button “Exit” close all windows and exit the application Status bar show the status of the LIN bus and the revision number of the firmware MLX81200 SW Development kit Author: ERE Page 31/39 Rev 1.4 / 05/11/08 SW Development Kit Description MLX81200 BLDC Motor Controller 9 10 15 11 12 13 16 14 17 Fig. 22 Main window with connected LIN master 9 10 11 12 13 Control bar “PWM” Button ”Send PWM” Control bar “Speed” Button “Send Speed” Button “Start” 14 Button “Stop” 15 Status window 16 Button “Get Status” 17 Checkbox “continuously” MLX81200 SW Development kit Author: ERE adjust the PWM value (send to MLX81200 with button 10) send the adjusted PWM value to the MLX81200 adjust motor speed (send to MLX81200 with button 12) send the adjusted speed value to the MLX81200 start the motor Note: The default speed target after start command is 1200U/min stop the motor immediately shows the current motor speed , PWM value , motor status and the current Note: If the CAN interface is used, the value of the current will not be transferred Click this button to get the actual status of the motor ( shown in 15 ) Note: the received values of the PWM and speed will be transferred automatically to the control bars (9 and 11) get the motor status and send the target speed value every 150 ms. Page 32/39 Rev 1.4 / 05/11/08 SW Development Kit Description MLX81200 BLDC Motor Controller 8.4. Control Load window 18 19 20 21 22 23 24 25 26 Fig. 23 Control Load window 18 19 20 21 22 23 24 25 26 Control bar “Load “ Button “send Load” Button “Enable” Button “Disable” Status window “Current” Button “Get status” Button “Connect LIN” Button “Disconnect” Button “Close” MLX81200 SW Development kit Author: ERE adjust the load value (send to brake board with button 19) send the adjusted load value to the brake board switch the load on switch the load off shows the actual current of the load click this button to get the actual current of the load ( shown in 22 ) connect the LIN master if the CAN interface is used in main window disconnect the LIN master close the window “Control load” and return to the main window Page 33/39 Rev 1.4 / 05/11/08 SW Development Kit Description MLX81200 BLDC Motor Controller 8.5. Control Debug window 28 27 29 30 32 31 33 35 34 Fig. 24 Control Debug window 27 Pull down menu: 28 29 30 31 32 33 34 35 Sine table Edit field “Sinestep” Button “set default(Block)” Button “send Table” Edit field “Parameter0” Edit field “Parameter1” Edit field “Parameter2” Button “send parameter” -“open table” load a saved sine table -“save table” save the sine table -“save table as…” save the sine table to a selected path -“close window” close the debug window each element can be chosen by mouse and modified with field 29 the value for each sine step can be modified direct or with up/down buttons set the sine table to a default block send the table to the MLX81200 via LIN not used not used not used not used 8.6. PID controller and PC program The firmware revision 1.6 for the MLX81200 BLDC DemoKit includes a PID controller. After the button “Start“ is pressed , the start algorithm begins to rotate the motor. After a defined number of motor states (ECM must be active), the PID controller is activated and the predefined target rational speed is set up by the PID controller. Every time the button “Send PWM“ is used to change the PWM value of the motor, the PID controller is disabled and only the adjusted PWM is used by the firmware. The PID controller can be reactivated by sending a new speed target to the MLX81200. MLX81200 SW Development kit Author: ERE Page 34/39 Rev 1.4 / 05/11/08 SW Development Kit Description MLX81200 BLDC Motor Controller 9. Appendix 9.1. Schematics of the Evaluation Board Fig. 25 MLX81200 SW Development kit Author: ERE Schematics of the Evaluation board Page 35/39 Rev 1.4 / 05/11/08 SW Development Kit Description MLX81200 BLDC Motor Controller 9.2. Schematic of the Evaluation Board – Part 2 Programmer Interface Fig. 26 MLX81200 SW Development kit Author: ERE Schematics of the Programmer board Page 36/39 Rev 1.4 / 05/11/08 SW Development Kit Description MLX81200 BLDC Motor Controller 9.3. Schematic of the Power Board Fig. 27 MLX81200 SW Development kit Author: ERE Schematics of the Evaluation board Page 37/39 Rev 1.4 / 05/11/08 SW Development Kit Description MLX81200 BLDC Motor Controller 10. History record Rev. 1.0 1.1 No. 1 2 1.2 1.3 1.4 3 4 5 Change Creation of document Changed description from EMLX-MM programmer to Mini E-MLX and adapted to hardware revision EVB rev1.4 and Powerboard rev1.1 Add chapter 7 BLDC DemoKit PC program Add chapter 7 MLX81200 Software configuration tool Add chapter “8.2 Command line parameter”, adapted new SW structure and add chapter “7.4.1 Configure the hardware in use” MLX81200 SW Development kit Author: ERE Page 38/39 Date 20/Dec/06 13/Feb/08 1/May/08 24/Okt/08 05/Nov/08 Rev 1.4 / 05/11/08 SW Development Kit Description MLX81200 BLDC Motor Controller 11. Disclaimer Devices sold by Melexis are covered by the warranty and patent indemnification provisions appearing in its Term of Sale. Melexis makes no warranty, express, statutory, implied, or by description regarding the information set forth herein or regarding the freedom of the described devices from patent infringement. Melexis reserves the right to change specifications and prices at any time and without notice. Therefore, prior to designing this product into a system, it is necessary to check with Melexis for current information. This product is intended for use in normal commercial applications. Applications requiring extended temperature range, unusual environmental requirements, or high reliability applications, such as military, medical life-support or lifesustaining equipment are specifically not recommended without additional processing by Melexis for each application. The information furnished by Melexis is believed to be correct and accurate. However, Melexis shall not be liable to recipient or any third party for any damages, including but not limited to personal injury, property damage, loss of profits, loss of use, interrupt of business or indirect, special incidental or consequential damages, of any kind, in connection with or arising out of the furnishing, performance or use of the technical data herein. No obligation or liability to recipient or any third party shall arise or flow out of Melexis’ rendering of technical or other services. © 2008 Melexis NV. All rights reserved.. For the latest version of this document, go to our website at: www.melexis.com Or for additional information contact Melexis Direct: Europe and Japan: All other locations: Phone: +32 1367 0495 E-mail: [email protected] Phone: +1 603 223 2362 E-mail: [email protected] ISO/TS 16949 and ISO14001 Certified MLX81200 SW Development kit Author: ERE Page 39/39 Rev 1.4 / 05/11/08