User’s Manual DemoKit-LG2 Demonstration Kit for NEC Electronics 78K0/Lx2 Microcontrollers Document No. U17799EU1V0UM00 ©November 2005. NEC Electronics America, Inc. All rights reserved.
DemoKit-LG2 User’s Manual The information in this document is current as of November 2005. 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 upto-date specifications of NEC Electronics products. Not all products and/or types are available in every country. Please check with an NEC sales representative for availability and additional information.
DemoKit-LG2 User’s Manual CAUTION This test and measurement equipment has the potential to be significantly altered by its user through hardware enhancements/modifications and/or test or application software. Thus, with respect to Council Directive 89/336/EEC (Directive on Compliance with the EMC Protection Requirements), this equipment has no autonomous function. Consequently this equipment is not marked by the CE symbol.
DemoKit-LG2 User’s Manual Revision History Date Revision Section Description 11-2005 V1.00 --- First release Microsoft and Windows are registered trademarks of Microsoft Corporation. Pentium is a registered trademark of Intel Corporation. Adobe and Acrobat Reader are registered trademarks of Adobe Systems Incorporated. All other product names are trademarks or registered trademarks of their respective owners.
DemoKit-LG2 User’s Manual Contents 1. Introduction.....................................................................................................................................1 1.1 1.2 1.3 2. System Configuration .....................................................................................................................3 2.1 2.2 2.3 3. 3.5 3.6 3.7 3.8 3.9 3.10 3.11 3.12 3.13 3.14 3.15 3.16 On-Board Debugging.............................................................................
DemoKit-LG2 User’s Manual 6.2 6.3 6.4 7. Toolbar.................................................................................................................................................39 Menu Bar .............................................................................................................................................40 6.3.1 File Menu................................................................................................................................40 6.3.1.
DemoKit-LG2 User’s Manual 1. Introduction DemoKit-LG2 is a demonstration kit for the NEC Electronics 8-bit 78K0S/LG2 microcontrollers (MCUs) with integrated liquid crystal display (LCD) controllers. The kit supports on-board flash programming and real-time execution of application programs up to 32 KB using NEC Electronics’ free C compiler and assembler. The board contains user hardware such as digital input/output (I/O) and analog signals. 1.
DemoKit-LG2 User’s Manual 1.2 System Requirements Table 1. System Requirements Host computer Windows® 98SE, Windows ME, Windows 2000 or Windows XP for the NEC Electronics software tools and FPL3 flash programming software Intel® Pentium® 166 MHz (at least), 128 MB of RAM, 256-color display (1024 × 768), mouse, CD-ROM drive and 200 MB of free hard disk space for installation of tool packages Host interface USB interface to enable communication based on USB 1.1 or later 1.
DemoKit-LG2 User’s Manual 2. System Configuration Configuration of the DemoKit-LG2 system is shown in Figure 1. Figure 1. System Configuration 2.1 DemoKit-LG2 DemoKit-LG2 is a demonstration kit for the NEC Electronics 8-bit 78K0/LG2 MCUs with integrated LCD controllers. The board connects to a host computer by means of a USB interface cable. The system may be used for on-board flash programming of the MCU’s internal flash memory and for execution of application programs.
DemoKit-LG2 User’s Manual Figure 2.
DemoKit-LG2 User’s Manual Figure 3. Bottom View of Board Connectors and Switches CN2 BAT1 Some of the DemoKit-LG2 components are available for user application hardware and software. Please read the MCU user’s manual carefully to get information about the electrical specification of the available I/O ports before connecting any external signals to the DemoKit-LG2 board. 3.1 Jumper JP1: Power Supply Selection The different power supply modes can be set using jumper JP1.
DemoKit-LG2 User’s Manual JP1 Setting Mode 1–2 Closed (default) USB interface-supplied power (CN7) 2–3 Closed Battery-supplied power (BAT1) 3.2 Jumper JP2: Power Selection for On-Chip Debugging The power supply can also be applied using the QB-78K0MINI on-chip debugging (OCD) emulator. Close jumper JP2 to apply power from the QB-78K0MINI. JP2 Setting Mode 1-2 Open (default) Power supply via USB or battery Closed Power supply via QB-78K0MINI emulator 3.
DemoKit-LG2 User’s Manual SW1/S1 Mode OFF (default) Normal operation ON Flash memory programming During normal operation, the user program stored in the MCU’s flash memory is executed. 3.4.2 SW1/S2: UART Selection SW1/S2 specifies the MCU’s UART signals that correspond to the FT232 interface lines. SW1, S2 Selection OFF (default) UART6 ON UART0 3.4.3 SW1/S3: On-Chip Debugging Selection SW1/S3 controls the MCU’s on-chip debugging function.
DemoKit-LG2 User’s Manual 3.6 SW3 Navigation Switch The SW3 navigation switch connects to the MCU’s key interrupt port and operates in five directions, including from the center pushbutton (Figure 4). SW3 Connection to Microcontroller Left P73/KR3 Down P71/KR1 Select P74/KR4 Right P72/KR2 Up P70/KR0 Figure 4.
DemoKit-LG2 User’s Manual 3.7 SB1, SB3, SB4, SB5 and SB6 Soldering Bridges The SB1, SB3, SB4, SB5 and SB6 soldering bridges allow the board to be configured in a variety of ways, as described in Table 2. Figure 5. Soldering Bridges SB1 3 2 1 SB3 SB4 3 2 1 1 2 3 SB5 SB6 1 2 3 Table 2.
DemoKit-LG2 User’s Manual 3.8 CN7 USB Interface Connector The CN7 connector provides a means to connect the board to FPL3 flash programming software to program application software into the MCU’s internal flash memory. Additionally, the on-board debugging function uses connector CN7 for communication with the host computer. CN7 also provides the board’s 5-volt power supply.
DemoKit-LG2 User’s Manual 3.9 CN2 Flash Programmer Connector The CN2 connector (not assembled) allows connection of the PG-FP4 flash programmer (available separately) to DemoKit-LG2 to program application software into the MCU’s internal flash memory.
DemoKit-LG2 User’s Manual 3.10 OCD connector CN8 Connector CN8 (not assembled) allows connection of the QB-78K0MINI on-chip debugging emulator (available separately) to the DemoKit-LG2 to use the MCU’s on-chip debugging function. Table 4.
DemoKit-LG2 User’s Manual is equal to 32 Hz (maximum 100 Hz) within the complete temperature range. The LCD pin assignments, connections and segment definition is shown in Table 6: Table 6.
DemoKit-LG2 User’s Manual 3.12 Temperature Sensor For temperature measurement and primarily as an application example, a silicon temperature sensor KTY13-5 is connected to the input port of the 16-bit timer/event counter 00, equal to port P00 of the MCU. The temperature sensor has a resistor range of R25 min = 1950 Ω and R25 max = 1990 Ω at 25° centigrade, with IOP = 1 mA. The distribution of the temperature factor kT is shown in Table 7: Table 7. Distribution of Temperature Factor kT 1.
DemoKit-LG2 User’s Manual Figure 8. Typical Dependence of Sensor Resistance The following equation, which approximates the characteristic curve, calculates temperature at the sensor according to the change in the sensor’s resistance: T = 25 + with: α² - 4 x β + 4 x β x kT 2xβ -3 α = 7,88 x 10 x K -5 °C -1 β = 1,937 x 10 x K kT = - α -2 RT R25 The temperature is measured using the dual-slope method in which a resistor value can be converted into a digital countervalue.
DemoKit-LG2 User’s Manual internal interrupt is generated. The capture value is read using this interrupt. In the next step, the C18 capacity will be discharged again. The same procedure starts once more with port P03. This time the capacitor is charged via the unknown resistor RVAR of the temperature sensor and after the threshold is reached again the second timer value is read out.
DemoKit-LG2 User’s Manual VDD 1- e 1- e e tREF RREF x C tREF RREF x C tREF RREF x C = VDD 1- e - = 1- e - tVAR RVAR x C tVAR RVAR x C tVAR RVAR x C = e tREF RREF x C = tVAR RVAR x C tREF RREF = tVAR RVAR RVAR = RREF x tVAR tREF The C18 capacitor and VDD supply voltage do not influence the accuracy of the measurement. Only the absolute value of the RREF reference resistor has an influence, because these parameters will not change during one measurement.
DemoKit-LG2 User’s Manual Figure 9 shows a diagram of the dual-slope circuit: Figure 9.
DemoKit-LG2 User’s Manual Example: VDD = 5 V; Vthreshold = VC = (0,4 … 0,7) VDD Typical: Vthreshold = 0,6 × VDD RREF = 10 kΩ; C = C18 = 220 nF t = - RREF x C x ln 1- t = - 10 kΩ x 220 nF x ln VC VDD 1- 0 t = 2,0158 ms 3.13 Q1 Phototransistor For light incidence measurement and primarily as an application example, a PT15-21C phototransistor is connected to the ANI0 analog input, which is equal to port P20 of the MCU. 3.
DemoKit-LG2 User’s Manual 3.16 CN3, CN4 and CN5 External Connectors CN3, CN4 and CN5 are connectors for external user hardware. The MCU signals are connected to CN3, CN4 and CN5. The DemoKit-LG2 board also provides a wire-wrap field area—connector CN3—for the integration of additional application hardware. Figure 10.
DemoKit-LG2 User’s Manual 3.17 Microcontroller Memory Map The MCU’s memory layout is shown in Figure 11. Figure 11. Microcontroller Memory Map The DemoKit-LG2 does not reserve any resources of the MCU; consequently all available MCU memory is free for application software.
DemoKit-LG2 User’s Manual 4. On-Chip Debugging The DemoKit-LG2 board offers two possibilities for on-chip debugging (OCD). The on-board debugging function allows on-chip debugging without a need for external debugging hardware. In this mode, the default USB / UART connection to the host computer serves as the debugging interface.
DemoKit-LG2 User’s Manual Table 8. Switch and Jumper Settings for On-Board Debugging Switch/Jumper Setting Mode SW1/S1 OFF Normal operation SW1/S2 OFF UART6 select SW1/S3 ON OCD enabled SW1/S4 OFF On-board debugging function JP1 1–2 closed Power supply via USB JP2 Open Power supply via USB JP3 Closed Clock supplied via CPLD 4.
DemoKit-LG2 User’s Manual 5. Installation and Operation The Windows-based FPL3 flash programming software enables selection and downloading of application programs to the DemoKit-LG2 board. The board communicates with a host computer via a USB interface that must be installed properly before you can download and run a program. Figure 13.
DemoKit-LG2 User’s Manual 5.2.3 Sample Program To use sample/demonstration program for the DemoKit-LG2 board, copy the directory \fscommand\SampleProgram\ on the CD-ROM to you local hard drive. Remember to remove the "read only" attribute from the files. 5.2.4 USB Driver Installation To use the board for on-chip debugging or flash programming, install the USB driver in accordance with the procedure for your particular operating system. 5.2.4.1 Installation on Windows 98SE/Me 1.
DemoKit-LG2 User’s Manual 2. Select the Search for the best driver for your device box and then click Next. Figure 15. Search Method (Windows 98SE) 3. Select the Specify a location box, browse to and select C:\ProgramFiles\NECTools32\ FPL3\DRIVER, and then click Next. Figure 16. Search Location Specification (Windows 98SE) Note: If the destination folder changes when the GUI software is installed, type the newfolder\DRIVER name in the Specify a location box.
DemoKit-LG2 User’s Manual 4. Click Next. Figure 17. Checking Driver to Be Installed (Windows 98SE) 5. Click Finish to complete the installation. Figure 18.
DemoKit-LG2 User’s Manual 5.2.4.2 Installation on Windows 2000 1. When you connect the board to the host computer, the Plug and Play function recognizes the board and initializes the wizard for adding new hardware. Click Next. Figure 19. Found New Hardware Wizard 1 (Windows 2000) 2. Select the Search for a suitable driver for my device box and then click Next. Figure 20.
DemoKit-LG2 User’s Manual 3. Select the Specify a location box and then click Next. Figure 21. Driver File Location 1 (Windows 2000) 4. Browse to and select C:\Program Files\NECTools32\FPL3\DRIVER and then click OK. Figure 22. Address Specification 1 (Windows 2000) Note: If the destination folder changes when the GUI software is installed, type the newfolder\FPL3\DRIVER name in the Copy manufacturer’s files from: box.
DemoKit-LG2 User’s Manual 5. Click Next. Figure 23. Driver File Search 1 (Windows 2000) 6. Click Finish to complete the installation of the USB converter. Figure 24.
DemoKit-LG2 User’s Manual 7. To proceed to the USB driver installation, click Next. Figure 25. Found New Hardware Wizard 2 (Windows 2000) 8. Select the Search for a suitable driver for my device box and click Next. Figure 26.
DemoKit-LG2 User’s Manual 9. Select the Specify a location box and click Next. Figure 27. Driver File Location 2 (Windows 2000) 10. Browse to and select C:\Program Files\NECTools32\FPL3\DRIVER and then click OK. Figure 28. Address Specification 2 (Windows 2000) Note: If the installation destination folder changes at the time of GUI software installation, enter the new-folder\DRIVER name in the Copy manufacturer’s files from box. 11. Click Next. Figure 29.
DemoKit-LG2 User’s Manual 12. Click Finish to complete the installation of the USB driver. Figure 30. USB Driver Installation (Windows 2000) 5.2.4.3 Installation on Windows XP 1. After the board is connected to the host computer, the Plug and Play function recognizes the board and initializes the wizard for finding new hardware. Select the Install from a list or specific location box and then click Next. Figure 31.
DemoKit-LG2 User’s Manual 2. Select the Search for the best driver in these locations and Include this location in the search: boxes, browse to and select C:\Program Files\NECTools32\FPL3\DRIVER, and then click Next. Figure 32. Search Location Specification 3 (Windows XP) 3. When you receive the has not passed Windows Logo testing to verify its compatibility with Windows XP message, click Continue Anyway. Figure 33.
DemoKit-LG2 User’s Manual 4. Click Finish to finish the installation of the converter. Figure 34. USB Serial Converter Installation (Windows XP) 5. To proceed to the installation of the USB serial port driver, click Next. Figure 35.
DemoKit-LG2 User’s Manual 6. Select the Search for the best driver in these locations and Include this location in the search: boxes, browse to and select C:\Program Files\NECTools32\FPL3\DRIVER, and then click Next. Figure 36. Search Location Specification 2 (Windows XP) 7. When you receive the has not passed Windows Logo testing to verify its compatibility with Windows XP message, clock Continue Anyway. Figure 37.
DemoKit-LG2 User’s Manual 8. Click Finish to complete the installation of the driver. Figure 38. USB Serial Port2 Driver Installation Completion (Windows XP) 5.3 Confirmation of USB Driver Installation After installing the two types of drivers, which are needed for using the DemoKit-LG2 board with FPL3 GUI, you can verify that they were installed successfully by checking the Device Manager directory. Figure 39.
DemoKit-LG2 User’s Manual 1. When using Windows XP, log on as the computer administrator. When using Windows 2000, log on as the Administrator. 2. Double-click My Computer → C:\Program Files → NECTools32 → FPL3 → DRIVER → Ftdiunin.exe. Figure 40. Driver Uninstallation 3. Click Continue. Figure 41. FTDI Uninstaller 4. Click Finish to complete driver uninstallation. Figure 42. Completion of Driver Uninstallation Caution: If the GUI software was uninstalled earlier, then the Ftdiunin.
DemoKit-LG2 User’s Manual 6. FPL3 Flash Programming Software The MCU’s parameter file is automatically stored in the \PRM folder during installation of the FPL3 GUI. Nevertheless, the most up-to-date file can be downloaded from the NEC Electronics America web site at http://www.am.necel.com/microcontrollers/devtools.php and copied into \PRM. Refer to Section 5.2, “Software Installation.” 6.1 Starting the GUI Software On the Start menu, click FPL3.
DemoKit-LG2 User’s Manual Device → Blank Check button Device → Erase button Device → Program button Device → Verify button Device → Autoprocedure(EPV) button 6.3 Menu Bar Depending on the actual device status and type, some commands of the commands discussed in this section may be disabled. 6.3.1 File Menu The File menu displays a list of commands related to file operation. Figure 45.
DemoKit-LG2 User’s Manual 6.3.1.1 Load Command The Load command selects the file to be programmed into the MCU’s flash memory. Figure 46. Open Dialog Box The Open dialog box displays the directory containing the most recently loaded user program. After the program is loaded, the checksum is calculated, and the result displayed in the Programmer Parameter window. 6.3.1.2 Quit Command The Quit command terminates the FPL3 GUI software.
DemoKit-LG2 User’s Manual 6.3.2 Device Menu The Device menu displays the programming commands. Figure 47. Device Menu 6.3.2.1 Blank Check Command The Blank Check command executes a blank check on the target device connected to the FPL3 programmer. If the target MCU’s flash memory has been erased, the blank check terminates normally. If the flash memory has not been erased completely, the program displays a not blank message, after which you will need to execute an Erase command. 6.3.2.
DemoKit-LG2 User’s Manual 6.3.2.4 Verify Command The Verify command sends a specified user program to the target device and verifies the program against the data written to the device’s flash memory. During verification, the Action Log window displays the progress. Upon completion, the GUI software displays the result of the command on the target device. 6.3.2.5 Security Command The Security command programs the security flag of the target device connected to the FPL3 (Table 12). 6.3.2.
DemoKit-LG2 User’s Manual • Standard Properties: The Standard tab contains options for the parameter file, host connection, supply oscillator, and operating mode. Refer to the user’s manual for the target device when setting properties. Figure 48. Device Setup Box: Standard Tab Table 11.
DemoKit-LG2 User’s Manual Group/Item Operation Mode (some modes not available in all devices) Target Reset Message Option Description Chip Subjects the entire flash memory area of the target device to rewriting Block Specifies a block of flash memory to be rewritten Area Specifies an area to be rewritten. The Start/End list boxes display the Area numbers where the flash memory of the target device is configured.
DemoKit-LG2 User’s Manual Group/Item Option Description Disable Boot block cluster reprogramming Uses the last block cluster setting as the current setting and displays a warning message stating that When boot block cluster programming is disabled, boot block cannot be erased and programmed anymore. Caution: If the security flag is set in the target device, the boot area cannot be rewritten afterward. Table 13.
DemoKit-LG2 User’s Manual The About FPL3 box displays copyright information and the program version number. Figure 52. About FPL3 Box 6.4 Programmer Parameter Window This Programmer Parameter window displays the settings of the programming parameters. Figure 53. Programmer Parameter Window Table 14.
DemoKit-LG2 User’s Manual 7. How to Use the FPL3 Flash Programming Software This section explains the basic operation of the FPL3 GUI for programming the DemoKit-LG2 board, including how to start the system, execute the Autoprocedure (EPV) command, and program the target device. Table 15 and Table 16 list the specifications for the series of operations described. Table 15.
DemoKit-LG2 User’s Manual 7.4 Connecting and Starting 1. Switch SW1/S1 to ON to initiate flash programming mode. Figure 54. Switch and Jumper Settings in Flash Programming Mode SW1 Setting Mode S1 S2 S3 S4 ON OFF OFF OFF Programming mode UART6 select OCD disabled On-board debugging function Jumper Setting Mode JP1 JP2 JP3 1–2 closed Open Closed Power supply via USB Power supply via USB Clock supplied via CPLD 2. Connect the DemoKit-LG2 board to the host computer via the USB cable.
DemoKit-LG2 User’s Manual Figure 57. Parameter File Selection 7. In the Port box, select the communication port that matches the host computer being used. 8. In the Speed box, select the communication speed of the host connection. Figure 58. Port Selection Note: Ports can be selected using Device Manager, as explained in Section 5.3, “Confirmation of USB Driver Installation.” 9. Set "Supply oscillator" according to the specifications of the DemoKit-LG2 board, “Frequency = 6.
DemoKit-LG2 User’s Manual 10. Click the Advance tab. Figure 60. Device Setup Dialog Box: Advance Tab 11. Select Blank check before Erase and then click OK to set the parameters. Figure 61. Completion of Parameter Setting PRM File Read OK is displayed. The display is updated. 7.5 Selecting a User Program 1. Click File → Load. 2. Select a program file to be written to the target device and then click Open. Figure 62. After Downloading "Success read HEX file." is displayed. The display is updated.
DemoKit-LG2 User’s Manual 7.6 Autoprocedure(EPV) Command Execution Click Device → Autoprocedure(EPV) to execute the Blank Check, Erase, Program, and Verify commands in succession. Figure 63. After EPV Execution "...finish" is displayed. 7.7 Terminating the GUI Click File → Quit to terminate the GUI software. All settings in effect upon termination are preserved in the FPL3.INI file for recall at the next session. 7.
DemoKit-LG2 User’s Manual 8. TROUBLESHOOTING Table 17. Recommended Actions to Correct Problems Problem Cause Faulty Plug and Play recognition during driver installation The USB connector may not be inserted normally into the USB port of the personal computer. The driver file cannot be found in the specified location. The FPL3 flash programming software may not be installed correctly. The USB connector may not be inserted normally into the USB port of the personal computer.
DemoKit-LG2 User’s Manual 9. Sample Project The DemoKit-LG2 sample program resides in a single directory called main-directory, which contains all of the output files for NEC Electronics’ integrated development environment (IDE). The main directory contains the workspace and project files. All source files and associated files are located in the directory. The workspace file is named DemoKit-LG2.prw is provided to demonstrate the 78K0/LG2 MCU’s functionality. 9.
DemoKit-LG2 User’s Manual Figure 64. Sample Project Menus 78K0/LG2 CLOCK TIME 11:15:00 SET 11:15 MODE 24 HOUR AM / PM TEMP + 20 °C + 68 °F 9.5.1 LIGHT 90 % BUZZER MELODY Setting the Time To adjust the clock, go the SET submenu. Move SW3 left or right to switch between hours and minutes; move SW3 up or down to select the time. To leave the sub-menu, press SW3. 9.5.2 Setting the Clock Format To set the clock format, go to the MODE sub-menu.
DemoKit-LG2 User’s Manual 10. NEC Electronics IDE and ID78K0-TK Debugger The DemoKit-LG2.prw project workspace is included for real-time debugging with the ID78K0-TK debugger. To initialize the integrated development environment (IDE), click Start → Programs → NEC Tools32 → PM Plus. Figure 65. PM Plus To open the sample program, click File → Open → DemoKit-LG2.prw. Figure 66.
DemoKit-LG2 User’s Manual Figure 67. Portconfig for ID78K0-TK After the port has been set for ID78K0-TK, from PM Plus you can invoke ID78K0-TK by selecting Tools → Debug. Figure 68. ID78K0-TK Debugger To open the debugger separately, without PM Plus, click NEC Tools32 → ID78K0-TK and then enter main.lmf to download the sample code.
DemoKit-LG2 User’s Manual 11. Cable Figure 69.
DemoKit-LG2 User’s Manual 12.
DemoKit-LG2 User’s Manual 60
DemoKit-LG2 User’s Manual 61
DemoKit-LG2 User’s Manual 62