F²MC-8FX FAMILY€¦ · UART peripheral communication Jumpers to set MCU pins connect to external...

44
Fujitsu Microelectronics (Shanghai) Co., Ltd. Application Note MCU-AN- 500001-E-11 F²MC-8FX FAMILY 8-BIT MICROCONTROLLER MB95200H/210H SERIES QUICK START GUIDE APPLICATION NOTE

Transcript of F²MC-8FX FAMILY€¦ · UART peripheral communication Jumpers to set MCU pins connect to external...

Page 1: F²MC-8FX FAMILY€¦ · UART peripheral communication Jumpers to set MCU pins connect to external circuit or not . QUICK START GUIDE V1.1 Chapter 2 Hardware Tools MCU-AN- 500001-E-11

Fujitsu Microelectronics (Shanghai) Co., Ltd. Application Note

MCU-AN- 500001-E-11

F²MC-8FX FAMILY 8-BIT MICROCONTROLLER

MB95200H/210H SERIES

QUICK START GUIDE

APPLICATION NOTE

Page 2: F²MC-8FX FAMILY€¦ · UART peripheral communication Jumpers to set MCU pins connect to external circuit or not . QUICK START GUIDE V1.1 Chapter 2 Hardware Tools MCU-AN- 500001-E-11

QUICK START GUIDE V1.1 Revision History

MCU-AN- 500001-E-11 – Page 2

Revision History

Date Author Change Records

2008-03-20 Ivan. Xiao V1.0, First draft 2008-07-21 Ivan. Xiao V1.1, Modify Figure 2.1.3-1, Table 2.2.4-1 and Figure 2.1.3-1.

This manual contains 44 pages.

© 2008 Fujitsu Microelectronics (Shanghai) Co., Ltd. All rights reserved.

1. The products and specifications described in this manual may be changed without prior notice. To obtain the latest information and/or specifications, contact your Fujitsu sales representative or Fujitsu authorized distributer.

2. Fujitsu will not be liable for infringement of copyright, industrial property right, or other rights of a third party caused by the use of information or schematic diagrams described in this manual.

3. The contents of this manual may not be transferred or copied without written permission of Fujitsu.

4. The products contained in this manual are not intended for use of equipment which requires extremely high reliability such as aerospace equipment, undersea repeaters, nuclear control systems or medical equipment for life support.

5. Some of the products described in this manual may be strategic materials (or special technology) as defined by the Foreign Exchange and Foreign Trade Control Law. In such cases, the products or portions thereof must not be exported without written permission as defined under the law.

Page 3: F²MC-8FX FAMILY€¦ · UART peripheral communication Jumpers to set MCU pins connect to external circuit or not . QUICK START GUIDE V1.1 Chapter 2 Hardware Tools MCU-AN- 500001-E-11

QUICK START GUIDE V1.1 CONTENTS

MCU-AN- 500001-E-11 – Page 3

CONTENTS

REVISION HISTORY............................................................................................................ 2

CONTENTS .......................................................................................................................... 3

1 INTRODUCTION.............................................................................................................. 5

2 HARDWARE TOOLS....................................................................................................... 6

2.1 BGM Adaptor .......................................................................................................... 6

2.1.1 Brief Introduction of BGM Adaptor ............................................................. 6

2.1.2 The Advantage of BGM Adaptor ................................................................ 7

2.1.3 Driver for BGM Adaptor ............................................................................. 8

2.2 Evaluation Board ................................................................................................... 11

2.2.1 Evaluation Board Configuration ............................................................... 12

2.2.2 Power Module.......................................................................................... 13

2.2.3 Clock Settings.......................................................................................... 14

2.2.4 Peripheral Modules.................................................................................. 15

2.2.5 Precaution for using Evaluation Board ..................................................... 16

2.2.6 BGM Adaptor Interface ............................................................................ 17

2.3 Emulation System Setup ....................................................................................... 18

2.3.1 Setup....................................................................................................... 18

2.3.2 Steps for power on................................................................................... 18

3 INSTALL SOFTUNE ...................................................................................................... 19

3.1 SOFTUNE Version ................................................................................................ 19

3.2 Installation of SOFTUNE ....................................................................................... 20

4 CODING AND DEBUGGING ......................................................................................... 22

4.1 Set up a new Project ............................................................................................. 22

4.2 Setup Project......................................................................................................... 24

4.3 Coding................................................................................................................... 28

4.3.1 Basic Members of Project ........................................................................ 28

4.3.2 Add Members to Project .......................................................................... 29

4.3.3 Make/Build............................................................................................... 29

4.4 Debugging............................................................................................................. 30

4.4.1 Emulation Environment Setup.................................................................. 30

4.4.2 Start Debug ............................................................................................. 36

4.4.3 Warning and Error ................................................................................... 36

4.4.4 Debug Window ........................................................................................ 37

Page 4: F²MC-8FX FAMILY€¦ · UART peripheral communication Jumpers to set MCU pins connect to external circuit or not . QUICK START GUIDE V1.1 Chapter 2 Hardware Tools MCU-AN- 500001-E-11

QUICK START GUIDE V1.1 CONTENTS

MCU-AN- 500001-E-11 – Page 4

4.4.5 How to Disable Watchdog Function ......................................................... 38

5 PROGRAMMING ........................................................................................................... 40

6 ADDITIONAL INFORMATION ....................................................................................... 42

7 APPENDIX..................................................................................................................... 43

7.1 Index of Tables...................................................................................................... 43

7.2 Index of Figures..................................................................................................... 43

Page 5: F²MC-8FX FAMILY€¦ · UART peripheral communication Jumpers to set MCU pins connect to external circuit or not . QUICK START GUIDE V1.1 Chapter 2 Hardware Tools MCU-AN- 500001-E-11

QUICK START GUIDE V1.1 Chapter 1 Introduction

MCU-AN- 500001-E-11 – Page 5

1 Introduction

This application note describes how to start development with MB95200H/210H Series of Fujitsu F2MC-8FX Family.

Chapter 2 explains usage for BGM Adaptor and Evaluation Board.

Chapter 3 explains how to set SOFTTUNE.

Chapter 4 explains how to use SOFTUNE for coding and debugging.

Chapter 5 explains programming methods.

Page 6: F²MC-8FX FAMILY€¦ · UART peripheral communication Jumpers to set MCU pins connect to external circuit or not . QUICK START GUIDE V1.1 Chapter 2 Hardware Tools MCU-AN- 500001-E-11

QUICK START GUIDE V1.1 Chapter 2 Hardware Tools

MCU-AN- 500001-E-11 – Page 6

2 Hardware Tools

This chapter introduces hardware tools

2.1 BGM Adaptor

The following figure is an actual picture of BGM Adaptor,BGM Adaptor ID is MB2146-08-E.

Figure 2.1-1: BGM Adaptor

2.1.1 Brief Introduction of BGM Adaptor

The functions of BGM Adaptor are shown in Table 2.1.1-1.

Item Function

Support 8FX MCU: Frequency, Voltage F2MC-8FX MB95200: 10 MHz, 2.4 - 5.5 V

Breakpoint 256 software breakpoint

Connect USB interface to PC/SOFTUNE

Compatible with USB protocol version 1.1

Connect 1-Line UART interface to Commodity MCU

Baud rate is 62500bps

Support CR trimming automatically Final trimming error is less than ±3.75%

Provide 5 V and 3.3 V for internal test and demo

The function can be available by setting jumper (J1 and J2) inside BGMA. Total current is limited within 500 mA

Support MCU flash programming for engineering development

Provide high voltage for flash operation Program and read speed is about 800 B/S

Table 2.1.1-1: Function of BGM Adaptor

Page 7: F²MC-8FX FAMILY€¦ · UART peripheral communication Jumpers to set MCU pins connect to external circuit or not . QUICK START GUIDE V1.1 Chapter 2 Hardware Tools MCU-AN- 500001-E-11

QUICK START GUIDE V1.1 Chapter 2 Hardware Tools

MCU-AN- 500001-E-11 – Page 7

2.1.2 The Advantage of BGM Adaptor

� Low price compared with 8FX EV-Chip Tools

� Small size

• 128 mm X 55 mm X 29 mm

� USB interface to PC/SOFTUNE

• Compatible to USB protocol version 1.1

� Less pins used in debug interface (5 pins)

• Interface between BGMA and target MCU is IDC-10

� Good debug performance

• Functions are similar to existing 8FX EV chip debug platform

� 5 V and 3.3 V power supply for evaluation application

• Total current is limited within 500 mA

Page 8: F²MC-8FX FAMILY€¦ · UART peripheral communication Jumpers to set MCU pins connect to external circuit or not . QUICK START GUIDE V1.1 Chapter 2 Hardware Tools MCU-AN- 500001-E-11

QUICK START GUIDE V1.1 Chapter 2 Hardware Tools

MCU-AN- 500001-E-11 – Page 8

2.1.3 Driver for BGM Adaptor

The driver for BGM Adaptor should be installed on PC before using it, the steps are shown as below.

(1) Connect BGM Adaptor to PC and popup “Found New Hardware Wizard”. Check the radio button “No, not this time” and click “Next”.

Figure 2.1.3-2: Driver- 1

(2) Check the radio button “Install from a list or specific location (Advanced)” and click “Next”.

Figure 2.1.3-3: Driver- 2

Page 9: F²MC-8FX FAMILY€¦ · UART peripheral communication Jumpers to set MCU pins connect to external circuit or not . QUICK START GUIDE V1.1 Chapter 2 Hardware Tools MCU-AN- 500001-E-11

QUICK START GUIDE V1.1 Chapter 2 Hardware Tools

MCU-AN- 500001-E-11 – Page 9

(3) Select “…\Drivers” from the folder where SOFTUNE is installed, click “Next”.

Figure 2.1.3-4: Wizard Searches

(4) Select the best match for BGM Adaptor from the list below, then click “Next”.

Figure 2.1.3-5: Found New Hardware Wizard

Page 10: F²MC-8FX FAMILY€¦ · UART peripheral communication Jumpers to set MCU pins connect to external circuit or not . QUICK START GUIDE V1.1 Chapter 2 Hardware Tools MCU-AN- 500001-E-11

QUICK START GUIDE V1.1 Chapter 2 Hardware Tools

MCU-AN- 500001-E-11 – Page 10

(5) Click “Finish” to close the wizard.

Figure 2.1.3-6: Finish

Page 11: F²MC-8FX FAMILY€¦ · UART peripheral communication Jumpers to set MCU pins connect to external circuit or not . QUICK START GUIDE V1.1 Chapter 2 Hardware Tools MCU-AN- 500001-E-11

QUICK START GUIDE V1.1 Chapter 2 Hardware Tools

MCU-AN- 500001-E-11 – Page 11

2.2 Evaluation Board

Fujitsu offers Evaluation Board (MB95200/210 EV-Board V1.4) for MCU. The introduction of Evaluation Board is shown as below.

Figure 2.2-1: Evaluation Board

Buzzer circuit LPC MCU

Debug Interface

To BGMA Power supply either from USB or from 2 pin header

LEDs to MCU I/O port pins

Potentiometer to MCU AD pin

Switch circuit to MCU

External Interrupt pins

Circuit for LIN-UART peripheral communication

Jumpers to set MCU pins connect to external circuit or not

Page 12: F²MC-8FX FAMILY€¦ · UART peripheral communication Jumpers to set MCU pins connect to external circuit or not . QUICK START GUIDE V1.1 Chapter 2 Hardware Tools MCU-AN- 500001-E-11

QUICK START GUIDE V1.1 Chapter 2 Hardware Tools

MCU-AN- 500001-E-11 – Page 12

� Evaluation board feature

• Clock and sub-clock

• USB 5V power IF, external 5V power IF and the battery

• Reset circuit and reset key

• IDC10 debug interface provided

• 3 LEDs for general use, LED1 indicates DBG pin work status

• One buzzer provided to demonstrate timer output

• 2 keys for general use

• Potentiometer and temperature sensor

• RS-232 level converter and DB9 interface (MAX232).

• LIN circuit reserved

• SIO 4 pins reserved.

• All MCU ports can be easily connected to test pins.

• Special starter kit provided to support each available MCU package

2.2.1 Evaluation Board Configuration

Some settings must be fixed before running a sample code or debugging MB95200 MCU on Evaluation Board,

Figure 2.21-1 is an overview of Evaluation Board.

Figure 2.2.1-1: Overview of Evaluation Board

Page 13: F²MC-8FX FAMILY€¦ · UART peripheral communication Jumpers to set MCU pins connect to external circuit or not . QUICK START GUIDE V1.1 Chapter 2 Hardware Tools MCU-AN- 500001-E-11

QUICK START GUIDE V1.1 Chapter 2 Hardware Tools

MCU-AN- 500001-E-11 – Page 13

2.2.2 Power Module

Three types of DC power supply for Evaluation Board can be selected. If only one of them is connected correctly to evaluation board, power LED (LED5) on evaluation board will be on, See Figure 2.2.2-1.

Figure 2.2.2-1: Power Module

Different power supplies can be selected according to Table 2.2.2-2 below.

Power Supply Header Name Settings

4 AA batteries from BT1 on the back of EV-board.

J1: BAT.

9V DC from CN6 J1: 9V.

USB from CN7 None None

Table 2.2.2-2: Power Supply Selection

Page 14: F²MC-8FX FAMILY€¦ · UART peripheral communication Jumpers to set MCU pins connect to external circuit or not . QUICK START GUIDE V1.1 Chapter 2 Hardware Tools MCU-AN- 500001-E-11

QUICK START GUIDE V1.1 Chapter 2 Hardware Tools

MCU-AN- 500001-E-11 – Page 14

2.2.3 Clock Settings

In MB95200H/210H MCU series, main internal CR clock is used as clock source by default. User can select a crystal clock on board as main clock or sub clock.

Follow the settings below,

Clock Header Name Settings

Main clock SW3: X1, X0

Sub clock SW3: X1A, X0A

Table 2.2.3-1: Clock Settings

� Selectable main clock source

• Main OSC clock (up to 16.25 MHz, maximum machine clock frequency: 8.125 MHz)

• External clock (up to 32.5 MHz, maximum machine clock frequency: 16.25 MHz)

• Main internal CR clock (1/8/10/12.5 MHz ± 2%, maximum machine clock frequency: 12.5 MHz)

� Selectable subclock source

• Sub-OSC clock (32.768 kHz)

• External clock (32.768 kHz)

• Sub-internal CR clock (typ: 100 kHz, min: 50 kHz, max: 200 kHz)

Page 15: F²MC-8FX FAMILY€¦ · UART peripheral communication Jumpers to set MCU pins connect to external circuit or not . QUICK START GUIDE V1.1 Chapter 2 Hardware Tools MCU-AN- 500001-E-11

QUICK START GUIDE V1.1 Chapter 2 Hardware Tools

MCU-AN- 500001-E-11 – Page 15

2.2.4 Peripheral Modules

There are several peripheral modules on Evaluation Board. To use these peripheral modules, follow Table 2.2.4-1 below, 模块模块模块模块 插头名称插头名称插头名称插头名称 设置设置设置设置 蜂鸣器: BUZ1 SW1: BUZ.

AD:VR3 SW2: VR3

SW2:

LED2, LED3

LED*: LED2, LED3, LED4

SW1:LED4

Key:S1, S2 SW2: S1, S2

SW2: SOT, SIN

UART

J5: UART

J6: UART

SW2:

SCK, SOT, SIN

LIN**

J5: LIN

J6: LIN

Table 2.2.4-2: Peripheral Modules

*LED module has four LEDs in total, but P12 (LED1) isn’t active during debugged by BGMA.

**LIN module is optional; contact your local vender for EV-board with LIN module.

Page 16: F²MC-8FX FAMILY€¦ · UART peripheral communication Jumpers to set MCU pins connect to external circuit or not . QUICK START GUIDE V1.1 Chapter 2 Hardware Tools MCU-AN- 500001-E-11

QUICK START GUIDE V1.1 Chapter 2 Hardware Tools

MCU-AN- 500001-E-11 – Page 16

2.2.5 Precaution for using Evaluation Board

� High voltage on RST PIN

• A typical voltage (+10VD.C) should be applied on RST pin when writing/erasing data in flash memory. While MCU is connected with BGMA for debugging, The jumper (J2 red mark in the picture below) must be left open in order to protect BGMA from being damaged by high voltage on reset pin.

Figure 2.2.5-1: Jumper of RST Pin

� Connect 8FX BGMA (MB2146-09) and MB95200H/210H Series BGMA (MB2146-08).

Page 17: F²MC-8FX FAMILY€¦ · UART peripheral communication Jumpers to set MCU pins connect to external circuit or not . QUICK START GUIDE V1.1 Chapter 2 Hardware Tools MCU-AN- 500001-E-11

QUICK START GUIDE V1.1 Chapter 2 Hardware Tools

MCU-AN- 500001-E-11 – Page 17

2.2.6 BGM Adaptor Interface

• To start debugging by BGM adaptor, user must connect IDC 10 socket of BGM adaptor to CN1 on EV-board. See Figure 2.2.6-1: BGM Adaptor Interface

Figure 2.2.6-1: BGM Adaptor Interface

PIN ID 1 2 3 4 5

PIN NAME UVCC GND RSTIN (BGMA-

>Target) RSTOUT RSV

PIN ID 6 7 8 9 10

PIN NAME 3.3 V (not open to customers), we can say it is open in LPC BGMA side

RSV DBG RSV 5 V (not open to

customers)

Table 2.2.6-1: CN1

Page 18: F²MC-8FX FAMILY€¦ · UART peripheral communication Jumpers to set MCU pins connect to external circuit or not . QUICK START GUIDE V1.1 Chapter 2 Hardware Tools MCU-AN- 500001-E-11

QUICK START GUIDE V1.1 Chapter 2 Hardware Tools

MCU-AN- 500001-E-11 – Page 18

2.3 Emulation System Setup

2.3.1 Setup

The emulation system is set as below.

Figure 2.3.1-1: Emulation System Setup

2.3.2 Steps for power on

First, connect BGM Adaptor with evaluation board by 1-line UART. Second, connect BGM Adaptor with PC by USB cable. Last, evaluation board is power on.

(1) Connect IDC cable and USB cable. Then BGM Adapter status LED turns green.

Figure 2.3.2-1: Connect USB Cable to BGM Adapter

(2) When EV board is power on, BGM Adapter status LED turns red.

Figure 2.3.2-2: Evaluation Board Power-on

Page 19: F²MC-8FX FAMILY€¦ · UART peripheral communication Jumpers to set MCU pins connect to external circuit or not . QUICK START GUIDE V1.1 Chapter 2 Hardware Tools MCU-AN- 500001-E-11

QUICK START GUIDE V1.1 Chapter 3 Install SOFTUNE

MCU-AN- 500001-E-11 – Page 19

3 Install SOFTUNE

This chapter introduces how to Install SOFTUNE

3.1 SOFTUNE Version

The following settings are done in F2MC-8L/8FX Family SOFTUNE Workbench V30L31.

Figure 3.1- 1: SOFTUNE Version

Page 20: F²MC-8FX FAMILY€¦ · UART peripheral communication Jumpers to set MCU pins connect to external circuit or not . QUICK START GUIDE V1.1 Chapter 2 Hardware Tools MCU-AN- 500001-E-11

QUICK START GUIDE V1.1 Chapter 3 Install SOFTUNE

MCU-AN- 500001-E-11 – Page 20

3.2 Installation of SOFTUNE

(1) Open setup folder and double click “setup.exe” file, click “Next” after the following window appear.

Figure 3.2-1: SOFTUNE Setup-1

(2) Press “Browse” to select folder where SOFTUNE will be installed. and click “Next”

Figure 3.2-2: SOFTUNE Setup -2

Page 21: F²MC-8FX FAMILY€¦ · UART peripheral communication Jumpers to set MCU pins connect to external circuit or not . QUICK START GUIDE V1.1 Chapter 2 Hardware Tools MCU-AN- 500001-E-11

QUICK START GUIDE V1.1 Chapter 3 Install SOFTUNE

MCU-AN- 500001-E-11 – Page 21

(3) Check “SOFTUNE Workbench” and ”SOFTUNE C Compiler” and “SOFTUNE Assembler Pack”, then click “Next”.

Figure 3.2-3: SOFTUNE Setup -3

(4) Click “Finish” to complete Setup.

Figure 3.2-4: SOFTUNE Setup -4

Page 22: F²MC-8FX FAMILY€¦ · UART peripheral communication Jumpers to set MCU pins connect to external circuit or not . QUICK START GUIDE V1.1 Chapter 2 Hardware Tools MCU-AN- 500001-E-11

QUICK START GUIDE V1.1 Chapter 4 Coding and Debugging

MCU-AN- 500001-E-11 – Page 22

4 Coding and Debugging

This chapter describes programming and debugging.

4.1 Set up a new Project

(1) Select “File”→” New” to set up a new project.

Figure 4.1-1: Set Up a New Project-1

Page 23: F²MC-8FX FAMILY€¦ · UART peripheral communication Jumpers to set MCU pins connect to external circuit or not . QUICK START GUIDE V1.1 Chapter 2 Hardware Tools MCU-AN- 500001-E-11

QUICK START GUIDE V1.1 Chapter 4 Coding and Debugging

MCU-AN- 500001-E-11 – Page 23

(2) When the following window appears, select target series name from “Target MCU” pull-down menu, then input Project Name and set Project Directory etc., last click “OK”.

Figure 4.1-2: Set Up a New Project-2

Page 24: F²MC-8FX FAMILY€¦ · UART peripheral communication Jumpers to set MCU pins connect to external circuit or not . QUICK START GUIDE V1.1 Chapter 2 Hardware Tools MCU-AN- 500001-E-11

QUICK START GUIDE V1.1 Chapter 4 Coding and Debugging

MCU-AN- 500001-E-11 – Page 24

4.2 Setup Project

(1) Click “Project”→“Setup Project”.

Figure 4.2-1: Setup a Project-1

(2) Execute (1) above and the following window appears,

Figure 4.2-2: Setup a Project-2

Page 25: F²MC-8FX FAMILY€¦ · UART peripheral communication Jumpers to set MCU pins connect to external circuit or not . QUICK START GUIDE V1.1 Chapter 2 Hardware Tools MCU-AN- 500001-E-11

QUICK START GUIDE V1.1 Chapter 4 Coding and Debugging

MCU-AN- 500001-E-11 – Page 25

(3) Set “C Compiler” as below.

Figure 4.2-3: Set C Compiler

(4) Set as “include path” from Category.

Figure 4.2-4: Set Include Path

Page 26: F²MC-8FX FAMILY€¦ · UART peripheral communication Jumpers to set MCU pins connect to external circuit or not . QUICK START GUIDE V1.1 Chapter 2 Hardware Tools MCU-AN- 500001-E-11

QUICK START GUIDE V1.1 Chapter 4 Coding and Debugging

MCU-AN- 500001-E-11 – Page 26

(5) Set ROM/RAM Area in “Linker” option.

Figure 4.2-5: Set ROM/RAM Area

(6) Click “Set Section” above and the following window appears, then set as below.

Figure 4.2-6: Setup Section

Page 27: F²MC-8FX FAMILY€¦ · UART peripheral communication Jumpers to set MCU pins connect to external circuit or not . QUICK START GUIDE V1.1 Chapter 2 Hardware Tools MCU-AN- 500001-E-11

QUICK START GUIDE V1.1 Chapter 4 Coding and Debugging

MCU-AN- 500001-E-11 – Page 27

(7) Set “Output Data Format” as desired.

Figure 4.2-7: Set Output Data Format

Page 28: F²MC-8FX FAMILY€¦ · UART peripheral communication Jumpers to set MCU pins connect to external circuit or not . QUICK START GUIDE V1.1 Chapter 2 Hardware Tools MCU-AN- 500001-E-11

QUICK START GUIDE V1.1 Chapter 4 Coding and Debugging

MCU-AN- 500001-E-11 – Page 28

4.3 Coding

The project has been built. Now we can write codes in SOFTUNE. First, add basal members to project and then add other source code files.

4.3.1 Basic Members of Project

� Main.c

This is a main C program and contains the entry point of your project. Program codes will be run here in void main (void) function.

� mb95200.asm

All addresses of resource registers are defined in this assembly file. Functions of these registers are described in corresponding chapters of Hardware Manual.

Note that this file covers all resources of EV MCU. Take care that you should only use the resources covered by your flash device!

� readme.txt

This file contains the version information of template project and some other useful information. This file can be erased if not needed.

� Start8FX.asm

This file is a very important. It contains all softwares and pre-processors used for adjusting basic project settings and start-up code. This code is executed before starting the void main (void) function.

� vectors.c

The interrupt level and interrupt number are declared in this C file. It contains interrupt processing service by default. The related interrupt control registers may be initialized as well.

� mb95200.h

In this header file, the same as the mb95200.asm file, the bit names of the resource registers are declared and defined. They also correspond to the bit names in Hardware Manual. Note that this file covers all resources of EV MCU. Take care that you should only use the resources covered by your flash device!

Note:

These files above can be found from website().

Page 29: F²MC-8FX FAMILY€¦ · UART peripheral communication Jumpers to set MCU pins connect to external circuit or not . QUICK START GUIDE V1.1 Chapter 2 Hardware Tools MCU-AN- 500001-E-11

QUICK START GUIDE V1.1 Chapter 4 Coding and Debugging

MCU-AN- 500001-E-11 – Page 29

4.3.2 Add Members to Project

To add a new member to the project, right click the project name in the workspace window,

and then select “Add member to project”→“File” to add a new member. Just browse to the

corresponding location and add the module as desired to the project.

Figure 4.3.2-1: Add Members to Project

4.3.3 Make/Build

Select “Project”→“Make” or “Build”, or click the mark with red ellipse as below.

Page 30: F²MC-8FX FAMILY€¦ · UART peripheral communication Jumpers to set MCU pins connect to external circuit or not . QUICK START GUIDE V1.1 Chapter 2 Hardware Tools MCU-AN- 500001-E-11

QUICK START GUIDE V1.1 Chapter 4 Coding and Debugging

MCU-AN- 500001-E-11 – Page 30

Figure 4.3.3- 1: Make/Build

4.4 Debugging

4.4.1 Emulation Environment Setup

The following steps can be skipped if emulation environment has been configured (using a template project).

Right click and select [Add Setup] > [New…] from popup menu to set up a new emulation environment, Then you will be asked for a setup name.

Figure 4.4.1-1: Create New Emulation Environment-1

To change the existing environment, right click and select [Change] to change “Setup Wizard”.

Page 31: F²MC-8FX FAMILY€¦ · UART peripheral communication Jumpers to set MCU pins connect to external circuit or not . QUICK START GUIDE V1.1 Chapter 2 Hardware Tools MCU-AN- 500001-E-11

QUICK START GUIDE V1.1 Chapter 4 Coding and Debugging

MCU-AN- 500001-E-11 – Page 31

Figure 4.4.1-2: Create New Emulation Environment-2

(1) When Setup Wizard window appears, please click “Next”.

Figure 4.4.1-3: Setup Wizard-1

Page 32: F²MC-8FX FAMILY€¦ · UART peripheral communication Jumpers to set MCU pins connect to external circuit or not . QUICK START GUIDE V1.1 Chapter 2 Hardware Tools MCU-AN- 500001-E-11

QUICK START GUIDE V1.1 Chapter 4 Coding and Debugging

MCU-AN- 500001-E-11 – Page 32

(2) Select “Emulator Debugger” from Debug Type and click “Next”.

Figure 4.4.1-4: Setup Wizard-2

(3) Select “MB2146-08” from ICE type and click “Next”.

Figure 4.4.1-5: Setup Wizard-3

Page 33: F²MC-8FX FAMILY€¦ · UART peripheral communication Jumpers to set MCU pins connect to external circuit or not . QUICK START GUIDE V1.1 Chapter 2 Hardware Tools MCU-AN- 500001-E-11

QUICK START GUIDE V1.1 Chapter 4 Coding and Debugging

MCU-AN- 500001-E-11 – Page 33

(4) Select “USB” from Device Name and then click “Next”.

Figure 4.4.1-6: Setup Wizard-4

(5) SOFTUNE wants to know external oscillator frequency of EV board, “Response speed optimization” option is used to enable/disable speed optimization function, it is recommended to check “Enable”.

Figure 4.4.1-7: Setup Wizard-5

Page 34: F²MC-8FX FAMILY€¦ · UART peripheral communication Jumpers to set MCU pins connect to external circuit or not . QUICK START GUIDE V1.1 Chapter 2 Hardware Tools MCU-AN- 500001-E-11

QUICK START GUIDE V1.1 Chapter 4 Coding and Debugging

MCU-AN- 500001-E-11 – Page 34

(6) Click “Next”.

Figure 4.4.1-8: Setup Wizard-6

(7) Check “Auto load when starting debug” and clicks “Next”.

Figure 4.4.1-9: Setup Wizard-7

Page 35: F²MC-8FX FAMILY€¦ · UART peripheral communication Jumpers to set MCU pins connect to external circuit or not . QUICK START GUIDE V1.1 Chapter 2 Hardware Tools MCU-AN- 500001-E-11

QUICK START GUIDE V1.1 Chapter 4 Coding and Debugging

MCU-AN- 500001-E-11 – Page 35

(8) Check the button “Select All” and click “Next”.

Figure 4.4.1-10: Setup Wizard-8

(9) Click “Finish”.

Figure 4.4.1-11: Setup Wizard-9

Page 36: F²MC-8FX FAMILY€¦ · UART peripheral communication Jumpers to set MCU pins connect to external circuit or not . QUICK START GUIDE V1.1 Chapter 2 Hardware Tools MCU-AN- 500001-E-11

QUICK START GUIDE V1.1 Chapter 4 Coding and Debugging

MCU-AN- 500001-E-11 – Page 36

4.4.2 Start Debug

Select “Debug”“Start debug” to start debugging.

Figure 4.4.2-1: Start Debug

4.4.3 Warning and Error

• If no warning message appears, it means “CR is OK, Processing is being done normally”.

• If the following window appears, it means “NVR is broken and CR trimming has passed”. Click ”OK” button and continue to debug.

Figure 4.4.3- 1: CR is OK

• If the following window occurs, it means “NVR is broken and CR trimming has failed”. Click ”OK” button and reset BGM Adaptor and MCU.

Figure 4.4.3-2: NVR is broken and CR trimming has failed

Page 37: F²MC-8FX FAMILY€¦ · UART peripheral communication Jumpers to set MCU pins connect to external circuit or not . QUICK START GUIDE V1.1 Chapter 2 Hardware Tools MCU-AN- 500001-E-11

QUICK START GUIDE V1.1 Chapter 4 Coding and Debugging

MCU-AN- 500001-E-11 – Page 37

• If the following window appears, it means “CR trimming is in process”. Click “Yes” to continue to wait or click “No” to exit from debug mode.

Figure 4.4.3-3: CR trimming is in Process

4.4.4 Debug Window

When all above are ok, the following windows appear. Now, we can start debugging.

Figure 4.4.4-1: Debug Window-1

Page 38: F²MC-8FX FAMILY€¦ · UART peripheral communication Jumpers to set MCU pins connect to external circuit or not . QUICK START GUIDE V1.1 Chapter 2 Hardware Tools MCU-AN- 500001-E-11

QUICK START GUIDE V1.1 Chapter 4 Coding and Debugging

MCU-AN- 500001-E-11 – Page 38

Figure 4.4.4-2: Debug Window-2

4.4.5 How to Disable Watchdog Function

Watchdog function is enabled by default. If it is not in use, please disable it as below.

(1) Click “setup”→“Debug environment”→“Debug Environment”.

Figure 4.4.5-1: Disable Watchdog Function-1

Page 39: F²MC-8FX FAMILY€¦ · UART peripheral communication Jumpers to set MCU pins connect to external circuit or not . QUICK START GUIDE V1.1 Chapter 2 Hardware Tools MCU-AN- 500001-E-11

QUICK START GUIDE V1.1 Chapter 4 Coding and Debugging

MCU-AN- 500001-E-11 – Page 39

(2) Check “Disable” to disable Watchdog function.

Figure 4.4.5-2: Disable Watchdog Function-2

Page 40: F²MC-8FX FAMILY€¦ · UART peripheral communication Jumpers to set MCU pins connect to external circuit or not . QUICK START GUIDE V1.1 Chapter 2 Hardware Tools MCU-AN- 500001-E-11

QUICK START GUIDE V1.1 Chapter 5 Programming

MCU-AN- 500001-E-11 – Page 40

5 Programming

Three plans are recommended for programming.

� Programming using SOFTUNE.

• Delete all break point before programming.

• Click “Debug”→“Start debug” and SOFTUNE starts uploading flash memory as below.

Figure 5-1: Upload Flash Memory

• Click “Debug”→“Run” →“Go” and SOFTUNE starts programming flash memory.

Figure 5-2: Download Flash Memory

� Third Party Programmer (Xeltek solution is available on M/April)

• The programmer is provided by third party, they have the dedicated software and the dedicated hardware for themselves.

Page 41: F²MC-8FX FAMILY€¦ · UART peripheral communication Jumpers to set MCU pins connect to external circuit or not . QUICK START GUIDE V1.1 Chapter 2 Hardware Tools MCU-AN- 500001-E-11

QUICK START GUIDE V1.1 Chapter 5 Programming

MCU-AN- 500001-E-11 – Page 41

� Programming using dedicated software (TBD)

• The dedicated software is only intended for programming, the dedicated hardware is used as evaluation board of Fujitsu.

Page 42: F²MC-8FX FAMILY€¦ · UART peripheral communication Jumpers to set MCU pins connect to external circuit or not . QUICK START GUIDE V1.1 Chapter 2 Hardware Tools MCU-AN- 500001-E-11

QUICK START GUIDE V1.1 Chapter 6 Additional Information

MCU-AN- 500001-E-11 – Page 42

6 Additional Information

For more information about FUJITSU MICROELECTRONICS products, visit the following website.

Simplified Chinese Version: http://www.fujitsu.com/cn/fmc/services/mcu/mb95200

English Version: http://www.fujitsu.com/cn/fmc/en/services/mcu/mb95200

Page 43: F²MC-8FX FAMILY€¦ · UART peripheral communication Jumpers to set MCU pins connect to external circuit or not . QUICK START GUIDE V1.1 Chapter 2 Hardware Tools MCU-AN- 500001-E-11

QUICK START GUIDE V1.1 Chapter 7 Appendix

MCU-AN- 500001-E-11 – Page 43

7 Appendix

7.1 Index of Tables

Table 2.1.1-1: Function of BGM Adaptor ............................................................................... 6

Table 2.2.2-2: Power Supply Selection ............................................................................... 13

Table 2.2.3-1: Clock Settings .............................................................................................. 14

Table 2.2.4-1: Peripheral Modules ...................................................................................... 15

Table 2.2.6-2: CN1 15

7.2 Index of Figures

Figure 2.1- 1: BGM Adaptor .................................................................................................. 6

Figure 2.1.3-1: Driver-1 ......................................................................................................... 8

Figure 2.1.3-2: Driver-2 ......................................................................................................... 8

Figure 2.1.3-3: Wizard Searches........................................................................................... 9

Figure 2.1.3-4: Found New Hardware Wizard ....................................................................... 9

Figure 2.1.3-5: Finish .......................................................................................................... 10

Figure 2.2-1: Evaluation Board............................................................................................ 11

Figure 2.2.1-1: Overview of Evaluation Board ..................................................................... 12

Figure 2.2.2-1: Power Module ............................................................................................. 13

Figure 2.2.5-1: Jumper of RST Pin...................................................................................... 16

Figure 2.2.6-1: BGM Adaptor Interface ............................................................................... 17

Figure 2.3.1-1: Emulation System Setup............................................................................. 18

Figure 2.3.2-1: Connect USB Cable to BGM Adapter.......................................................... 18

Figure 2.3.2-2: Evaluation Board Power-on......................................................................... 18

Figure 3.1- 1: SOFTUNE Version........................................................................................ 19

Figure 3.2-1: SOFTUNE Setup-1 ........................................................................................ 20

Figure 3.2-2: SOFTUNE Setup-2 ......................................................................................... 20

Figure 3.2-3: SOFTUNE Setup-3 ......................................................................................... 21

Figure 3.2-4: SOFTUNE Setup-4 ......................................................................................... 21

Figure 4.1-1: Set Up a New Project-1.................................................................................. 22

Figure 4.1-2: Set Up a New Project-2.................................................................................. 23

Figure 4.2-1: Setup a Project-1 ........................................................................................... 24

Figure 4.2-2: Setup a Project-2 ........................................................................................... 24

Figure 4.2-3: Set C Compiler............................................................................................... 25

Figure 4.2-4: Set Include Path............................................................................................. 25

Figure 4.2-5: Set ROM/RAM Area....................................................................................... 26

Figure 4.2-6: Setup Section................................................................................................. 26

Page 44: F²MC-8FX FAMILY€¦ · UART peripheral communication Jumpers to set MCU pins connect to external circuit or not . QUICK START GUIDE V1.1 Chapter 2 Hardware Tools MCU-AN- 500001-E-11

QUICK START GUIDE V1.1 Chapter 7 Appendix

MCU-AN- 500001-E-11 – Page 44

Figure 4.2-7: Set Output Data Format ................................................................................. 27

Figure 4.3.2-1: Add Members to Project.............................................................................. 29

Figure 4.3.3- 1: Make/Build ................................................................................................. 30

Figure 4.4.1-1: Create New Emulation Environment-1 ........................................................ 30

Figure 4.4.1-2: Create New Emulation Environment-2 ........................................................ 31

Figure 4.4.1-3: Setup Wizard-1 ........................................................................................... 31

Figure 4.4.1-4: Setup Wizard-2 ........................................................................................... 32

Figure 4.4.1-5: Setup Wizard-3 ........................................................................................... 32

Figure 4.4.1-6: Setup Wizard-4 ........................................................................................... 33

Figure 4.4.1-7: Setup Wizard-5 ........................................................................................... 33

Figure 4.4.1-8: Setup Wizard-6 ........................................................................................... 34

Figure 4.4.1-9: Setup Wizard-7 ........................................................................................... 34

Figure 4.4.1-10: Setup Wizard-8 ......................................................................................... 35

Figure 4.4.1-11: Setup Wizard-9 ......................................................................................... 35

Figure 4.4.2-1: Start Debug................................................................................................. 36

Figure 4.4.3- 1: CR is OK.................................................................................................... 36

Figure 4.4.3-2: NVR is broken and CR trimming has failed ................................................. 36

Figure 4.4.3-3: CR trimming is in Process ........................................................................... 37

Figure 4.4.4-1: Debug Window-1 ........................................................................................ 37

Figure 4.4.4-2: Debug Window-2 ........................................................................................ 38

Figure 4.4.5-1: Disable Watchdog Function-1 ..................................................................... 38

Figure 4.4.5-2: Disable Watchdog Function-2 ..................................................................... 39

Figure 5-1: Upload Flash Memory....................................................................................... 40

Figure 5-2: Download Flash Memory .................................................................................. 40