hit counter script
Fujitsu F2MC-8FX Series Application Note
Fujitsu F2MC-8FX Series Application Note

Fujitsu F2MC-8FX Series Application Note

Hide thumbs Also See for F2MC-8FX Series:
Table of Contents

Advertisement

Quick Links

Fujitsu Semiconductor (Shanghai) Co., Ltd.
MCU-AN-500083-E-12

Application Note

F²MC-8FX FAMILY
8-BIT MICROCONTROLLER
MB95350L SERIES
EV BOARD MB2146-460-E
APPLICATION NOTE

Advertisement

Table of Contents
loading

Summary of Contents for Fujitsu F2MC-8FX Series

  • Page 1: Application Note

    Fujitsu Semiconductor (Shanghai) Co., Ltd. MCU-AN-500083-E-12 Application Note F²MC-8FX FAMILY 8-BIT MICROCONTROLLER MB95350L SERIES EV BOARD MB2146-460-E APPLICATION NOTE...
  • Page 2: Revision History

    To obtain up-to-date information and/or specifications, contact your Fujitsu sales representative or Fujitsu authorized dealer. 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 drawings described in this manual.
  • Page 3: Table Of Contents

    MB2146-460-E Setup Guide V1.2 Contents CONTENTS REVISION HISTORY ......................2  CONTENTS ..........................3  1  PRODUCT OVERVIEW ..................... 6  1.1  Objective and Deliverable ..................6  1.2  System Block ......................6  1.3  Handling Precautions ....................6  1.4  Feature ........................7  1.5  Hardware Setup ......................7  2 ...
  • Page 4 MB2146-460-E Setup Guide V1.2 Contents 4  SAMPLE CODE MANUAL ....................26  4.1  Project Structure ..................... 26  4.2  Source Code File Description ................. 27  4.2.1  ADC .c ....................... 27  4.2.2  Addressjudge .c ..................28  4.2.3  Ext-interrupt .c ................... 29  4.2.4  I2C .c ......................30  4.2.5 ...
  • Page 5 MB2146-460-E Setup Guide V1.2 Contents 4.6.21  Code of I2C_SlaveMacro ................50  4.6.22  Code of Sleep_Macro ................50  5  DEVELOPMENT PLATFORM QUICK START ............... 51  5.1  Tools Setup Sequence .................... 51  5.2  Open Project and Start Debug ................51  5.3  Operation Precautions .................... 51  6 ...
  • Page 6: 1  Product Overview

    MB2146-460-E Setup Guide V1.2 Chapter 1 Product Overview Product Overview This product is a set of EV-Board of MB95350L series. It is composed of a BGMA (MB2146- 08-E) and an EV-board (MB2146-460-E). Combining the SOFTUNE Workbench on PC, the EV-Board enables the quick start of development before the user system is ready. 1.1 Objective and Deliverable The EV-Board provides users a complete development platform.
  • Page 7: Feature

    MB2146-460-E Setup Guide V1.2 Chapter 1 Product Overview 1.4 Feature The MB95350L Series EV-Board is the best for a performance and functional evaluation, and operation check before using MB95350L Series MCU in a user's system. The features of the BGM debugger for MB95350L Series MCU are shown as below. Microcomputer operation voltage ranging from +1.8V to +3.3V.
  • Page 8: 2  Bgma Manual

    MB2146-460-E Setup Guide V1.2 Chapter 2 BGMA Manual 2 BGMA Manual This chapter gives introduction on how to set up BGMA. 2.1 BGMA Overview Following is a close shot of a MB95350L Series BGMA. The Part Number is MB2146-08-E. It provides a debugging platform for the MB95350L Series MCU with a small size of 55.7mm (W) X127mm (D) X30mm (H).
  • Page 9: Idc10 Interface Description

    MB2146-460-E Setup Guide V1.2 Chapter 2 BGMA Manual 2.3 IDC10 Interface Description Pin Number Pin Name Description UVCC Target MCU V Target MCU V RSTIN Target MCU reset input RSTOUT Target MCU reset output Reserved Reserved Reserved Target MCU debug pin Reserved Reserved 2.4 BGMA USB Configuration...
  • Page 10 MB2146-460-E Setup Guide V1.2 Chapter 2 BGMA Manual Select Install from a list or specific location (Advanced), then click Next. Figure 2-3: Install BGMA in Windows (2) Select …\Drivers from the folder where SOFTUNE is installed, click Next. Figure 2-4: Install BGMA in Windows (3) MCU-AN-500083-E-12 –...
  • Page 11 MB2146-460-E Setup Guide V1.2 Chapter 2 BGMA Manual Select BGMA (MB2146-08) from the window displayed in Figure 2-5 and then click Next. Figure 2-5: Install BGMA in Windows (4) Windows will install the driver automatically. Click Finish after the driver has completed the installation normally.
  • Page 12: Led Description

    MB2146-460-E Setup Guide V1.2 Chapter 2 BGMA Manual 2.5 LED Description First, when USB cable is plugged to PC, check whether the Power LED turns green or not. Refer to Figure 2-7. Figure 2-7: BGMA Power LED (1) Second, plug IDC10 cable to the EV-board (target MCU board), then turn on EV-board. After that, check whether the Power LED on the BGMA turns orange or not.
  • Page 13: 3  Ev-Board Manual

    MB2146-460-E Setup Guide V1.2 Chapter 3 EV-board Manual 3 EV-board Manual This chapter gives introduction on how to set up EV-board and functions of EV-Board. 3.1 EV-board Overview MB95350L EV-board is an evaluation platform for the MB95350L Family microcontroller. Figure 3-1 is a close shot of EV-board. BGMA Power circuit Circuit...
  • Page 14: Function List

    MB2146-460-E Setup Guide V1.2 Chapter 3 EV-board Manual 3.2 Function List The EV-board is consisted of a board and a sample firmware. The board, together with a BGMA (PN: MB2146-08-E) and a SOFTUNE, provides a useful platform for using the MCU and its peripherals.
  • Page 15: Ev-Board Schematic

    MB2146-460-E Setup Guide V1.2 Chapter 3 EV-board Manual 3.3 EV-board Schematic Figure 3-2: EV-board Schematic MCU-AN-500083-E-12 – Page 15...
  • Page 16: Hw Module Description And Jumper Settings

    MB2146-460-E Setup Guide V1.2 Chapter 3 EV-board Manual 3.4 HW Module Description and Jumper settings 3.4.1 Pin Assignment of MB95350L Table 3-1 describes the assignment of MCU Pin Table 3-1: Assignment of Pin Pin name Pin Usage Description Logical Description External main clock External main clock External sub-clock...
  • Page 17: Power Module

    MB2146-460-E Setup Guide V1.2 Chapter 3 EV-board Manual 3.4.2 Power Module EV-board provides 2 kinds of power supplies for user to choose. Please read the following instructions before using. DC Adaptor: 5V DC: Output voltage: 3.3V Connection: Connector (J1) Battery: QTY: 4PCS;...
  • Page 18: I2C Slave Module

    MB2146-460-E Setup Guide V1.2 Chapter 3 EV-board Manual 3.4.3 I2C Slave Module .4.3 I2C Slave Module The I2C slave is used to connect external master SDA and SCL. There are two channels in The I2C slave is used to connect external master SDA and SCL. There are two channels in I2C slave module.
  • Page 19: A/D Module

    MB2146-460-E Setup Guide V1.2 Chapter 3 EV-board Manual 3.4.5 A/D Module Use A/D value to set address. Slave device1 Slave device2 Slave device3 Slave device4 Slave device5 Orientation Figure 3-6: ADC Module Note: The orientation to which the section faced will decide the slave device MCU-AN-500083-E-12 –...
  • Page 20: Led Module

    MB2146-460-E Setup Guide V1.2 Chapter 3 EV-board Manual 3.4.6 LED Module .4.6 LED Module Three LEDs are connected to P07, P06 and P05, for showing the states. Three LEDs are connected to P07, P06 and P05, for showing the states. Sleep mode Device selected...
  • Page 21: Operation Manual

    MB2146-460-E Setup Guide V1.2 Chapter 3 EV-board Manual 3.5 Operation Manual 3.5.1 Single Board Mode Figure 3-8: Single Mode When you get one board, the board works singly as follows: When it is started (power on or reset), the I2C0 works as I2C master, and its sub- address is determined by the ADC.
  • Page 22: Series Connection Mode

    MB2146-460-E Setup Guide V1.2 Chapter 3 EV-board Manual 3.5.2 Series Connection Mode .5.2 Series Connection Mode Down Main board board board Figure 3-9: Series Mode In series connection mode, main board and down board work as master and slave simultaneously, while up board only works as master. After the Send key on up board is pressed, the ADC value is sent to main board.
  • Page 23: Net Connection Mode

    MB2146-460-E Setup Guide V1.2 Chapter 3 EV-board Manual 3.5.3 Net Connection Mode .5.3 Net Connection Mode Main board Potentiometer Slave Slave board1 board2 Figure 3-10: Net Mode In net connection mode, one board is the master board and the other boards are the slave boards.
  • Page 24: Adc Module

    MB2146-460-E Setup Guide V1.2 Chapter 3 EV-board Manual 3.5.4 ADC module The potentiometer is divided into 5 grades, and each grade corresponds to one slave board address. The slave address is divided into 0x10, 0x20, 0x30, 0x40 and 0x50. Details are as follow.
  • Page 25: Reset Operation

    MB2146-460-E Setup Guide V1.2 Chapter 3 EV-board Manual 3.5.6 Reset Operation There is a reset key to be used when user wants to reset system. In normal condition, the reset pin is connected to V The reset key is connected to GND when being pressed. 3.5.7 Test Pin There is a test pin connected to each pin of MB95350L.
  • Page 26: 4  Sample Code Manual

    MB2146-460-E Setup Guide V1.2 Chapter 4 Sample Code Manual 4 Sample Code Manual 4.1 Project Structure There is a project in this MB95350L EV-Board. The following structure describes the flow chart of this project, as shown in Figure 4-1. Figure 4-1: Project Structure MCU-AN-500083-E-12 –...
  • Page 27: Source Code File Description

    MB2146-460-E Setup Guide V1.2 Chapter 4 Sample Code Manual The following sample codes are provided by MB95350L Series EV-Board. 4.2 Source Code File Description Eight drive files are available in this project shown below, Figure 4-2: Source Code Files 4.2.1 ADC .c Following table describes the ADC library.
  • Page 28: Addressjudge .C

    MB2146-460-E Setup Guide V1.2 Chapter 4 Sample Code Manual 4.2.2 Addressjudge .c Following table describes the Addressjudge library: Function Name Description unsigned char Judge_SlaveAddr(unsigned char Divide ADC value into five constants AddrJudg) When IIC0 is connected to multiple slave devices, these five constants are used decide which one to access.
  • Page 29: Ext-Interrupt .C

    MB2146-460-E Setup Guide V1.2 Chapter 4 Sample Code Manual 4.2.3 Ext-interrupt .c In this function, external interrupt registers are initialized. Following table describes the external interrupt library. Function Name Description void EXT_Init(void) Initialize external interrupt __interrupt void INTER_EXT (void) Capture falling edge and generate interrupt Following table describes the function EXT_Init.
  • Page 30: I2C .C

    MB2146-460-E Setup Guide V1.2 Chapter 4 Sample Code Manual 4.2.4 I2C .c All following functions are for IIC0 which works as master. Following table describes the I2C library. Function Name Description void I2C_Init( void ) Initialize I2C register unsigned char Read_I2C(unsigned char DevAddr, Read data for slave unsigned char SubAddr) void Write_I2C(unsigned char DevAddr, unsigned char...
  • Page 31: Initial .C

    MB2146-460-E Setup Guide V1.2 Chapter 4 Sample Code Manual Following table describes function Write_I2C. Function name Write_I2C Function prototype void Write_I2C(unsigned char DevAddr, unsigned char SubAddr, unsigned char WDat) Behavior description Write data to slave device Input parameter1 DevAddr: slave device address Input parameter2 SubAddr: slave device sub-addres Input parameter3...
  • Page 32: Slavemodei2C .C

    MB2146-460-E Setup Guide V1.2 Chapter 4 Sample Code Manual 4.2.6 Slavemodei2c .c Following table describes the slavemodei2c library. Function Name Description void SlaveI2C_PrepareForInter(void) Initialize IIC1 as slave __interrupt void INTER_I2CSlaveModeWakeUp(void) IIC1 receives interrupt Following table describes how to use function SlaveI2C_PrepareForInter. Function name SlaveI2C_PrepareForInter Function prototype...
  • Page 33: Standby .C

    MB2146-460-E Setup Guide V1.2 Chapter 4 Sample Code Manual 4.2.7 Standby .c Following table describes the standby library. Function Name Description void STBLED_ON(unsigned char LEDSwiDat) LED show standby status void Write_StandBy(void) Go to standby Following table describes how to use function STBLED_ON. Function name STBLED_ON Function prototype...
  • Page 34: Timer.c

    MB2146-460-E Setup Guide V1.2 Chapter 4 Sample Code Manual 4.2.8 Timer.c Following table describes the timer library. Function Name Description void Clock_Init(void) system clock initialization Following table describes how to use function Clock_Init. Function name Clock_Init Function prototype void Clock_Init(void) Behavior description Select clock mode Input parameter...
  • Page 35: Api Code File Description

    MB2146-460-E Setup Guide V1.2 Chapter 4 Sample Code Manual 4.3 API Code File Description API files are used to transfer drive file. They are shown as below, Figure 4-3: API Code Files 4.3.1 I2CMasterMacro.c In this function, Following table describes I2C master library. Function Name Description unsigned char Judge_P00(void)
  • Page 36 MB2146-460-E Setup Guide V1.2 Chapter 4 Sample Code Manual Following table describes how to use function EEPROM_I2C. Function name EEPROM_I2C Function prototype void EEPROM_I2C(void) Behavior description When Judge_P00(void) function return 1, IIC0 will write data to EEPROM when “send” key pressed Input parameter None Return value...
  • Page 37: I2Cslavemacro.c

    MB2146-460-E Setup Guide V1.2 Chapter 4 Sample Code Manual 4.3.2 I2CSlaveMacro.c Following table describes the I2C slave library. Function Name Description void I2C_SlaveMacro(void) Decide MCU address When IIC0 is connected to multiple slaves, these five constants are used decide which one to access.
  • Page 38: Sleepmacro.c

    MB2146-460-E Setup Guide V1.2 Chapter 4 Sample Code Manual 4.3.3 SleepMacro.c In this function, Following table describes the sleep library. Function Name Description void Sleep_Macro(void) Make system enter into stop mode Following table describes how to use function Sleep_Macro. Function name Sleep_Macro Function prototype void Sleep_Macro(void)
  • Page 39: Global Variable Description

    MB2146-460-E Setup Guide V1.2 Chapter 4 Sample Code Manual 4.4 Global Variable Description Five drive files are available in this project shown below. Figure 4-4: H Files _f2mc8fx.h _f2mc8fx.h is system-defined document. Ignore it mb95350l.h Mb95350l.h is system-defined document. Ignore it def.h This file basically includes all global variables of FW Following picture describes the global variable.
  • Page 40: How To Add These Files

    MB2146-460-E Setup Guide V1.2 Chapter 4 Sample Code Manual 4.5 How to Add These Files Before using files in section 4.2, please refer to the following steps. Create a new project. Copy .c file to project document. Add .c file to project. Add all needed .c files to project.
  • Page 41: Usage Demo

    MB2146-460-E Setup Guide V1.2 Chapter 4 Sample Code Manual 4.6 Usage Demo Following table lists all C files. 4.6.1 Code of main.c InitIrqLevels(); // Initialize Interrupt level register and IRQ vector table Initial(); Initial_ADC(); Init_EXT(); TBT_Init(); __EI (); While (1) I2C_SlaveMacro ();...
  • Page 42: Code Of Read_Adc

    MB2146-460-E Setup Guide V1.2 Chapter 4 Sample Code Manual 4.6.3 Code of Read_ADC unsigned char i=0,j=0, Vadc; unsigned int k=0; for(i=0;i<8;i++) ADC1=0x01; While (!ADC1_ADI); j++; k=k+ADD_ADDL; Vadc = k/8; ADC1_ADI = 0; //clear interrupt return Vadc; 4.6.4 Code of Judge_SlaveAddr unsigned char ReturValu;...
  • Page 43: Code Of Init_Ext

    MB2146-460-E Setup Guide V1.2 Chapter 4 Sample Code Manual 4.6.5 Code of Init_EXT DDR0_P04 = 0; //input PUL0_P04 = 0; //disable pull up AIDRL_P04 = 1; //i/o port use EIC20 = 0x05; 4.6.6 Code of INTER_EXT EIC20_EIR0 = 0; PraGlo.KeyStatus = 1; //key pressed 4.6.7 Code of I2C_Init ICCR0_EN...
  • Page 44: Code Of Read_I2C

    MB2146-460-E Setup Guide V1.2 Chapter 4 Sample Code Manual 4.6.8 Code of Read_I2C unsigned char Temp; I2C_Init (); I2C_Start (DevAddr); // Write Comand to ... I2C_Acknowlegde (); I2C_Write (SubAddr); // ... set address from where to read I2C_Continue (DevAddr+1) ; Restart, with READ...
  • Page 45: Code Of Slavei2C_Prepareforinter

    MB2146-460-E Setup Guide V1.2 Chapter 4 Sample Code Manual 4.6.11 Code of SlaveI2C_PrepareForInter ICCR1_EN = 0; ILSR_P16 = 1; //coms level ILSR_P17 = 1; DDR1_P16 = 0; DDR1_P17 = 0; ICCR1_EN = 0; // clear I2C interface ICCR1_CS4 = 0; // set clock divider 'm' =>...
  • Page 46: Code Of Inter_I2Cslavemodewakeup

    MB2146-460-E Setup Guide V1.2 Chapter 4 Sample Code Manual 4.6.12 Code of INTER_I2CSlaveModeWakeUp IBCR01_WUE = 0; //disable i2c wake up interrupt if (IBCR01_SPF == 0x01) // stop condition detected IBCR01_SPF = 0x00; // clear stop condition if (IBCR11_INT == 0x01) // transfer completed ReaDat = IDDR1;...
  • Page 47: Code Of Stbled_On

    MB2146-460-E Setup Guide V1.2 Chapter 4 Sample Code Manual 4.6.13 Code of STBLED_ON if(LEDSwiDat == 1) PDR0_P07 = 0; //on DDR0_P07 = 1; else PDR0_P07 = 1; //off DDR0_P07 = 1; 4.6.14 Code of Write_StandBy STBLED_ON(1); //LED on SYCC = 0x00; //main clock SYCC2 = 0x21;//0x34;...
  • Page 48: Code Of Judge_P00

    MB2146-460-E Setup Guide V1.2 Chapter 4 Sample Code Manual 4.6.16 Code of Judge_P00 .6.16 Code of Judge_P00 unsigned char StatuP0; DDR6_P64 = 0; StatuP0 = PDR6_P64; return StatuP0; 4.6.17 Code of LEDCoordin 4.6.17 Code of LEDCoordin switch(LedStatus) case 0x00: //off DDR0_P06 = 1;...
  • Page 49: Code Of Eeprom_I2C

    MB2146-460-E Setup Guide V1.2 Chapter 4 Sample Code Manual 4.6.18 Code of EEPROM_I2C unsigned char Coordin=0; if(PraGlo.CoordiFlag == 1) Write_I2C(AddrEEPROM, PraGlo.DatSlavI2CRead,PraGlo.DatSlavI2CRead); Coordin = Read_I2C(AddrEEPROM,PraGlo.DatSlavI2CRead); if(Coordin == PraGlo.DatSlavI2CRead) LEDCoordin(1); PraGlo.CoordiFlag = 0; PDR0_P05 = 1; else Coordin = Read_ADC(); Write_I2C(AddrEEPROM,Coordin,Coordin); LEDCoordin(0); 4.6.19 Code of EndDevice_I2C unsigned char ValuAdc, AddrEndDevi;...
  • Page 50: Code Of I2C_Mastermacro

    MB2146-460-E Setup Guide V1.2 Chapter 4 Sample Code Manual 4.6.20 Code of I2C_MasterMacro if(PraGlo.KeyStatus == 1) P00Status = Judge_P00 (); if(P00Status == 1) EEPROM_I2C (); else EndDevice_I2C (); PraGlo.KeyStatus = 0; 4.6.21 Code of I2C_SlaveMacro unsigned char ReadADC; ReadADC = Read_ADC(); PraGlo.AddrMCU = Judge_SlaveAddr(ReadADC);...
  • Page 51: 5  Development Platform Quick Start

    MB2146-460-E Setup Guide V1.2 Chapter 5 Development Platform Quick Start 5 Development Platform Quick Start 5.1 Tools Setup Sequence Start the debugging system in the following sequence: Connect a BGMA to the PC with a USB cable, confirm whether the LED on the BGMA is green;...
  • Page 52: 6  Additional Information

    MB2146-460-E Setup Guide V1.2 Chapter 6 Additional Information 6 Additional Information For more Information on FUJITSU products, visit the following websites: English version address: http://www.fujitsu.com/cn/fsp/services/mcu/mb95/application_notes.html Chinese version address: http://www.fujitsu.com/cn/fss/services/mcu/mb95/application_notes.html MCU-AN-500083-E-12 – Page 52...
  • Page 53: 7  Appendix

    MB2146-460-E Setup Guide V1.2 Chapter 7 Appendix 7 Appendix 7.1 Tables Table 3-1: Assignment of Pin ....................16  Table 3-2: Selection of Power Supply ..................17  Figures Figure 1-1: System Block ......................6  Figure 2-1: BGMA Overview ....................8  Figure 2-2: Install BGMA in Windows (1) ................. 9  Figure 2-3: Install BGMA in Windows (2) ................

This manual is also suitable for:

Mb95350l seriesMb2146-460-e

Table of Contents