SK-FR80-120PMC-USB Fujitsu, SK-FR80-120PMC-USB Datasheet

no-image

SK-FR80-120PMC-USB

Manufacturer Part Number
SK-FR80-120PMC-USB
Description
BOARD, EVAL, FOR MB91660 SERIES
Manufacturer
Fujitsu
Type
Evaluation Boardr
Datasheet

Specifications of SK-FR80-120PMC-USB

Kit Features
External FRAM Memory MB85RS256, USB A & USB A Connectors, USB To Serial Converter
Mcu Supported Families
MB91660
Silicon Manufacturer
Fujitsu
Core Architecture
FR80
Kit Contents
Board, USB A To Mini-B Cable
Features
USB Connector, 7-segment LED, Humidity Sensor
Rohs Compliant
No
Lead Free Status / RoHS Status
Contains lead / RoHS non-compliant
FR80 Family
32-BIT MICROCONTROLLER
MB91F662
SK-FR80-120PMC-USB “bits pot black”
USB board
User's Manual

Related parts for SK-FR80-120PMC-USB

SK-FR80-120PMC-USB Summary of contents

Page 1

... SK-FR80-120PMC-USB “bits pot black” FR80 Family 32-BIT MICROCONTROLLER MB91F662 USB board User's Manual ...

Page 2

... The use of the deliverables (e.g. software, application examples, target boards, evaluation boards, starter kits, schematics, engineering samples of IC’s etc.) is subject to the conditions of Fujitsu Microelectronics Europe GmbH (“FME”) as set out in (i) the terms of the License Agreement and/or the Sale and Purchase Agreement under which agreements the Product has been delivered, (ii) the technical descriptions and (iii) all accompanying written materials ...

Page 3

Revision History Revisions Date Version 1.0 2009/06/30 Description First issue 2 ...

Page 4

Table of Contents Warranty and Disclaimer ............................................................................................................ 1 Revision History............................................................................................................................. 2 Table of Contents........................................................................................................................... 3 1 Preparations........................................................................................................................... 9 1.1 Checking package contents ......................................................................................... 9 1.2 Other items required .................................................................................................. 10 1.3 Required software ...................................................................................................... 10 1.4 External appearance of the ...

Page 5

Let's make a USB mouse .................................................................................................... 62 5.1 Overview of the USB sample program ...................................................................... 62 5.2 Overview of USB communications flow ..................................................................... 65 5.2.1 Overview of USB communications flow................................................................. 65 5.2.2 Device request (PC -> Starter kit).......................................................................... 69 ...

Page 6

Additional option: Using terminal program for interaction ........................................ 119 Appendix................................................................................................................................ 121 1 Creating projects/sample programs as new projects......................................................... 121 1.1 Sample project configuration ................................................................................... 121 1.2 Explanation of the program...................................................................................... 122 1.3 SOFTUNE settings .................................................................................................. 125 2 Verifying COM ...

Page 7

... The starter kit includes development tools for flash microcontrollers so that students with a basic understanding of the C language can rewrite programs to make the microcontroller perform various tasks. Sample programs for a hygrometer and FRAM, provide the student with ample amusement while learning how to use these functions. We hope this text will serve as a primer for future developers of systems based on the USB ...

Page 8

Part and material suppliers This board was made possible through the cooperation of these suppliers. We express our sincere appreciation for their help. In addition, many individuals provided tremendous help in the planning and realization of this board. To all ...

Page 9

... Fujitsu Microelectronics Limited Provided free of charge: Microcontroller MB91F662 Sensor Conditioner IC MB42M131 FRAM MB85RS256 Power Voltage Monitoring IC with Watchdog Timer Integrated Development Environment SOFTUNE Workbench Sample programs MB3793-30A 8 ...

Page 10

... Figure 1.1-1 shows a photo of the contents. Name (1) Main board (2) USB A to Mini-B cable (1) Main board Table 1.1-1 Starter kit package contents Qty. Specifications/Remarks 1 FUJITSU 32-bit (certified USB) and peripherals mounted 1 USB A⇔Mini-B cable Figure 1.1-1 Starter kit contents (photo) 9 Microcontroller, MB91F662 (2) ...

Page 11

... Dedicated version for bits pot Dedicated version for bits pot - 7-segment LED lighting test (Refer to Chapter 2) - USB mouse (Refer to Chapter 5) - Humidity sensor (Refer to Chapter 7) - FRAM SPI (Refer to Chapter 9) - Skeleton for creating new programs (Refer to Appendix) - USB Host sample (Refer to Chapter 10) 10 ...

Page 12

External appearance of the starter kit board and major components Figure 1.4-1 shows the external appearance of the starter kit board, and Table 1.4-1 lists the major components. (2) FRAM (12) USB B connector (13) USB A connector (6) ...

Page 13

... Table 1.4-1 Major components on the starter kit board Component (1) Main MCU FUJITSU 32-bit Microcontroller MB91F662 (certified USB) (2) FRAM FUJITSU MB85RS256 (3) Humidity sensor Measures humidity. (4) Terminal block Connects to plastic board (mounted with strain gauge) to make an electronic scale. (5) 7-segment LED Displays the operating results of sample programs ...

Page 14

Starter kit parts Table 1.5-1 lists the parts in the starter kit. Part number C1,C2,C4,C6,C9, C10,C12,C13, C18,C19,C37, Monolithic ceramic capacitor C36,C56,C58, C60,C61 C3,C5 Monolithic ceramic capacitor C7,C11,C54,C55 Monolithic ceramic capacitor C17,C32,C33 Monolithic ceramic capacitor C14,C15,C16 Monolithic ceramic capacitor C20,C21,C22, ...

Page 15

Part number P_SW1,P_SW2, P_SW3,P_SW4, P_SW5,P_SW6, Push switch P_SW7,P_SW8, P_SW9,P_SW10 Q1 Digital transistor R1,R3,R4,R5,R7,R8, R27,R28,R29,R30, R31,R32,R33,R34, Chip resistor R42,R44,R45,R49, R70,R76,R89 R9,R10,R17,R78, R79,R84,R85, Chip resistor R86,R87,R88 R11,R13,R15,R26,R77 Chip resistor R12,R14,R16 Chip resistor R18,R21,R22,R23, Chip resistor R25,R39,R72,R75 R19,R24 Chip network resistor R20 Chip ...

Page 16

... DUSB-ARA42-T11A-FA LT1963AEQ-3.3#TRPBF Linear Technology FT232RL 54819-0572 DUSB-BRA42-T11-FA MB3793-30A MJ-179P LM3525-H National Semiconductor ALPS ELECTRIC CO., RD7097 CX49GFWB04000H0PESZ KYOCERA Corporation Z FF003-AR79 P3055 KYOWA ELECTRONIC KFG-5-350-C1-11L1M2R INSTRUMENTS CO., USB_B to Mini-B 15 Manufacturer FUJITSU FUJITSU FUJITSU ROHM Co., Ltd. DDK FTDI Molex DDK FUJITSU LTD. Koyo Fasteners LTD. ...

Page 17

Power supply methods There are three methods for supplying power to the board, each selected using SW6 as shown below. The Power LED lights up red when power is supplied. Power supply Silk printing on board 1 USB Mini-B ...

Page 18

Lights up when power External power supply (5V) 2. via USB B connector !! Caution !! • Do not change the power supply selector switch while the microcontroller is operating. • Never change the power supply selector ...

Page 19

Setting up the PC Install the software required to operate this starter kit to your PC. Be sure to download the required software before starting the installation process. The setup procedures are as follows. Setup procedures: - Installation of ...

Page 20

... The SOFTUNE IDE is a tool designed to support the development process by integrating these tasks into a seamless systematic flow. ...

Page 21

Click "Next". Click "Next". 20 ...

Page 22

If you agree with the usage license, click "Yes". Click "Next". 21 ...

Page 23

Click "Next". Leave the destination folder at the default, "C:¥Softune6". Confirm the components selected for installation. "Customize Bar" is not checked by default so place a check in it. 22 ...

Page 24

Verify the details of the installation are acceptable. If there are no problems, click "Next". Wait for the installation to complete. 23 ...

Page 25

Click the "Finish" button to complete the installation of SOFTUNE. 24 ...

Page 26

Installing the USB driver The starter kit is equipped with a USB-to-serial converter IC (made by FTDI) between the USB Mini-B connector and microcontroller. This USB driver must be downloaded from the FTDI website. The driver can be also ...

Page 27

Once the driver has been downloaded and unpacked, the starter kit is ready to be connected to the PC using the supplied USB cable. However, before doing so, check the switch settings on the board. Figure 2.2-1 and Table 2.2-1 ...

Page 28

After setting the switches on the board, connect the PC and board using the USB A to Mini-B cable supplied with the starter kit. Do not connect the cable to "USB FUNC" or "USB HOST". When you connect the board ...

Page 29

This procedure will explain how to install the driver software previously downloaded instead of connecting to Windows Update. Select "Install from a list or specific location (Advanced)", and click "Next". Click "Browse" and specify the folder "CDM 2.04.06 WHQL Certified" ...

Page 30

Wait for the "USB Serial Converter" installation to complete. Click "Finish" to complete the installation of "USB Serial Converter". 29 ...

Page 31

Next, install the "USB Serial Port". Select "Install from a list or specific location (Advanced)", and click "Next". Click "Browse" and specify the folder "CDM 2.04.06 WHQL Certified" downloaded earlier, then click "Next". 30 ...

Page 32

Wait for the "USB Serial Port" installation to complete. Click "Finish" to complete the installation of "USB Serial Port". This completes the installation of the USB driver. 31 ...

Page 33

Launching SOFTUNE and using the monitor debugger 3.1 Launching SOFTUNE After installing SOFTUNE and the USB driver, launch SOFTUNE by clicking Windows [Start] - [All Programs] - [SOFTUNE V6] - [FR Family SOFTUNE Workbench]. Figure 3.1-1 shows the screen ...

Page 34

Menu bar Tool bar Project window Edit window Output window Status bar !! HINT !! You can move the position of the tool bars and resize windows freely to match your preferences. Project window Contains menu items for the SOFTUNE ...

Page 35

... Table 3.1-1 shows the projects in the workspace. Figure 3.1-2 Contents of "sample.wsp" Table 3.1-1 List of projects in sample.wsp Project name io_mb91660 CPU register definitions file sample_LED 7-segment LED program sample_skeleton For creating new programs sample_USB sample_humidity sample_strain_gauge Electronic scale sample_FRAM_SPI Counter using FRAM Description ― ...

Page 36

In order to confirm everything has been setup properly, we will use the sample program "sample_LED" to flash the letters "FJ" on the 7-segment LED on the starter kit board. Make sure "sample_LED.abs – “sample_LED.prj”[Debug]” is set as the active ...

Page 37

Next, we will compile the program. Click the "Build" button to compile, and verify there were no errors in the compilation results in the output window. If the compilation was successful, proceed to setup and launch the monitor debugger. "Build" ...

Page 38

Setting and launching the monitor debugger Explanation of the monitor debugger The monitor debugger allows developers to debug the program loaded on a production microcontroller with built-in FLASH memory. Installing a monitor program with the application program provides access ...

Page 39

The setup wizard for the debugger starts up. Click "Next". Select "Monitor Debugger" for debugger type. Click "Next". 38 ...

Page 40

Select "RS" as the Type and specify the COM port the board is connected to. Leave the baud rate at "256000". Click "Next". Refer to Appendix 2 in this manual to verify COM ports. 39 ...

Page 41

Click "Next". Make sure the option "Auto load when starting debug." has a check in it, and that the batch file for "Before" is set to "FshLdWrt.prc". "FshLdWrt.prc" batch file for writing user programs to the FLASH memory ...

Page 42

Before launching the debugger, check the switch settings on the board and the connection with the PC. If the settings and connections are correct, press the Reset switch. !! Caution !! Be sure to always press the Reset switch before ...

Page 43

From the SOFTUNE "Debug" menu, select "Start debug". If the settings were made correctly, the batch file for "Before " in the setup wizard will run. When the dialog bar is showing, the program is being downloaded to the FLASH ...

Page 44

If the debugger does not launch Check the following. 1. Board settings. • Is the USB cable properly connected to the board and PC? • Are the switches on the board set properly? 2. Setup wizard settings. • Are the ...

Page 45

Using the monitor debugger The debugger will launch when the download to the FLASH memory on the microcontroller completes. The debugger should be pointing to the starting address of the user program. 44 ...

Page 46

Run the program by clicking the "Run continuously" button in the upper left of the SOFTUNE window. 45 ...

Page 47

Execution is successful if the letters "FJ" appear flashing on the 7-segment LED. 46 ...

Page 48

To stop program execution, press the "DEBUG STOP" button on the board. The flashing "FJ" will stop when the DEBUG STOP button is depressed. Depending on the timing, the program may stop with FJ still showing. To resume program execution, ...

Page 49

Function (1) Run Continuously Executes program continuously from the current position in the program counter (PC). (2) Step In Executes the step and moves the PC to the address of the next instruction and stops. (3) Step ...

Page 50

Make Compiles/assembles only the source files that have changed. Then, links all objects and libraries to generate the target program. (6) Build Compiles/assembles all source files registered in the project, whether they have changed or not, then links all ...

Page 51

Memory window (12) Register window (13) Watch window (11) (12) Shows the memory contents during debug. If the window is not showing, click "View" - "Memory" to show it. Shows the register contents during debug. If the window is ...

Page 52

Exiting monitor debug To end debugging, always stop the program execution by pressing the DEBUG STOP button on the board . Then, click "Debug" - "End Debug". Refer to the monitor debugger limitations provided in the Appendix. 51 ...

Page 53

What is a USB? 4.1 What is a USB? USB stands for Universal Serial Bus. In 1993, engineers from Compaq, Intel, Microsoft, and NEC gathered and jointly developed a peripherals interface for next-generation PCs. This led to their release ...

Page 54

Today, printers and digital cameras are also equipped with USB, not just the PC. These devices can transfer data between themselves without going through a host PC using a hosting function called USB Mini-Host. The MB91F662 installed on this board ...

Page 55

Keyboard PC Mouse (Host) Hub Figure 4.3-1 USB Connection Example 4.4 Plug Each end of the USB has a plug with a different shape. One end is called the A plug, the other the B plug. A smaller connector is ...

Page 56

Transfer rate USB transfer rates are standardized as shown below. Low Speed USB 1.0/1.1 1.5 Mbps USB 2.0 1.5 Mbps The MB91F662 supports only Full Speed. 4.6 Transfer rate detection The USB standard requires that USB devices allow for ...

Page 57

Transfer methods Several transfer methods are specified for the USB. Table 4.7-1 below summarizes the USB transfer methods. Isochronous transfer This is the most preferred transfer method for the USB. This transfer method has a guaranteed Typical bandwidth and ...

Page 58

Configuration of a device The host communicates by specifying addresses and endpoint numbers that it assigns to each USB device. When the USB device is connected, the host assigns a unique address to each function and hub. At the ...

Page 59

Enumeration Enumeration refers to the process that begins by the host recognizing the device connected to the bus, specifying an address, and fixating the descriptor information received from the device. The USB device uses the descriptor to inform the ...

Page 60

USB transmissions are managed by dividing time into frames that repeat every 1 ms, and allocating small portions of this transmission time to each device within each frame. The host starts a frame by sending the SOF packet every 1 ...

Page 61

The packets shown in Figure 4.9-3 are combined to form a frame for transferring over the USB. Each packet will be explained. All packets begin with a SYNC field. This is an 8-bit field used to synchronize the input data ...

Page 62

Table 4.9-1 shows the PID types (which indicates the status of the packet being sent) defined for USB. PID type PID name PID[3:0] Description OUT 0001b IN 1001b Token SOF 0101b SETUP 1101b DATA0 0011b Data DATA1 1011b ACK 0010b ...

Page 63

Let's make a USB mouse This sample program will provide USB communications that a USB mouse uses (HID class) by utilizing the USB function controller in the microcontroller (MB91F662) installed on the starter kit. When the starter kit board ...

Page 64

Sample program execution procedures> 1. Set the switches on the board to execute the program in debug mode, then connect the starter kit to the PC using the USB cable. 2. ...

Page 65

Part name Silk printing on board Pushbutton SW P_SW3 Pushbutton SW P_SW4 Pushbutton SW P_SW5 Pushbutton SW P_SW6 Pushbutton SW P_SW7 Pushbutton SW P_SW8 Slider SW VR1 USB port USB FUNC Figure 5.1-1 Operation and details of the USB sample ...

Page 66

Overview of USB communications flow This section explains the USB communications flow performed by the sample program. Details on the USB communications protocol have been omitted. Refer to the USB and HID class specifications for details. 5.2.1 Overview of ...

Page 67

PC (USB host) USB connection (bus connection) Get Descriptor (Device) request Device Descriptor response Issue bus reset signal Set Address request 0 byte data response Get Descriptor (Device) request Device Descriptor response Figure5.2.1-1 USB (mouse) communications flow (Configuration 1) Starter ...

Page 68

PC (USB host) Get Descriptor (Configuration) request Configuration Descriptor response Interface Descriptor response HID Class Descriptor response Endpoint Descriptor response Set Configuration request 0 byte data response Set Idle request 0 byte data response Get Descriptor (Report) request Report Descriptor ...

Page 69

PC (USB host) Configuration completed board as a USB mouse) Notification of Report data Notification of Report data Notification of Report data Figure5.2.1-3 USB (mouse) communications flow (After configuration) Starter kit (USB Function) [EP1] (recognizes : : : : The ...

Page 70

Device request (PC -> Starter kit) In this sample program, the data received by the starter kit is called a device request. The format of data in a device request is standardized. The device requests received by the starter ...

Page 71

Table 5.2.2-3 Device request (GET_DESCRIPTOR (Configuration)) Byte Item 1 BmRequestType Type of request (Transfer direction: Device -> host / type: standard/ receive: device : 80h) 1 Brequest Request (GET_DESCRIPTOR: 06h) 2 WValue Requested descriptor type and index value (Descriptor type ...

Page 72

Table 5.2.2-5 Device request (SET_IDLE) Byte Item 1 BmRequestType Type of request (Transfer direction: Host -> device / type: class/ receive: interface : 21h) 1 Brequest Request (SET_IDLE: 0Ah) 2 WValue 0 2 WIndex 0 2 WLength 0 Table 5.2.2-6 ...

Page 73

... Class code (00h: no class) 1 bDeviceSubClass Subclass code 1 bDeviceProtocol Protocol code (00h: unique protocol unused) 1 bMaxPacketSize0 Max. packet size for endpoint 0 2 idVendor Vendor ID (04C5h: Fujitsu) 2 idProduct Product ID (2019h: USB starter kit) 2 bcdDevice Device version 1 iManufacture Index of a string descriptor that represents the manufacturer 1 iProduct ...

Page 74

Table 5.2.3-2 Configuration Descriptor Byte Item 1 bLength Descriptor size (09h) 1 bDescriptorType Descriptor type (configuration: 02h) 2 wTotalLength Descriptor size returned for this configuration (Total size including configuration, interface, HID class, and endpoint descriptor) 1 bNumInterfaces Number of interfaces ...

Page 75

Table 5.2.3-4 HID Class Descriptor Byte Item 1 bLength Descriptor size (09h) 1 bDescriptorType Descriptor type (HID descriptor: 21h) 2 bcdHID HID class version (Ver. 1.01 -> 01h01h) 1 bCountryCode Country identification code (00h: no identification) 1 bNumDescriptors Number of ...

Page 76

... ReportCount 2 Input 2 ReportSize 2 ReportCount Description Page usage (Generic Desktop Control) Item usage (Mouse) Collection item tag (Application) Page usage (Pointer) Collection item tag (Physical) Page usage (Button) Minimum number of items used (1) Maximum number of items used (3) Minimum value the item can report (0) ...

Page 77

... Sample program sequence This section describes the operation of the sample program. Table 5.2.3-7 Report Descriptor 2 Description Input item tag (Data, Variable, Absolute) Page usage (Generic Desktop Control) Item usage (X direction) Item usage (Y direction) Item usage (Wheel) Minimum value the item can report (-127) ...

Page 78

Main routine The operation of the main routine is shown below. Note that the following conditions are assumed when operating this sample program. <MB91F662 operating conditions> FLASH access settings FLASH access size setting: 32 bits (no changes to default ...

Page 79

USB (Function) initialization process SW operation detection process *2 Figure 5.3.1-1 Operating flow of the main routine (main.c, usb_mouse_ctrl.c) *1 This sample program assumes a startup routine will be executed before the main ...

Page 80

USB initialization process The figure below shows the details of the USB initialization process. USB operation enabled (USBEN=1) - EP1 setting (INT-IN transfer/ 64 bytes) Set V-BUS detection pin (PH3) Connect to HOST (HCONX = 0) Figure 5.3.2-1 Operating ...

Page 81

USB interrupt processing The figure below shows the details of the USB interrupt processing. The USB function in the MB91F662 processes status interrupts and interrupts EP1 to EP5. However, this sample program uses only the status interrupt. After connecting ...

Page 82

Yes Suspend interrupt? No Yes SOF interrupt? No Yes Bus reset interrupt? No End Figure 5.3.3-2 Status interrupt 2 (usb_mouse_ctrl.c) 81 Clear SOF flag Clear SOF flag Clear BRST flag ...

Page 83

EP0 data receive process The figure below shows the details for the EP0 data receive process. EP0 data receive process Get length of received data bytes Get received data (read from EP0DT register) Clear DRQ0 flag End Figure 5.3.4-1 ...

Page 84

Setup command receive process The figure below shows the details for the EP0 Setup command receive process. The Setup command receive process also handles responses for the received Setup command. Setup command receive process Get received data byte length ...

Page 85

GET DESCRIPTOR (device) received? No GET DESCRIPTOR (config) received? No GET DESCRIPTOR (report) received? No End Figure 5.3.5-2 Setup command receive processing 2 (usb_mouse_ctrl.c) ② Yes Return Device Descriptor (write to EP1DT register) Clear DRQI flag Yes Return Configuration ...

Page 86

Switch operation detection process The figures below show the details of the switch (pushbuttons and slider) operation detection process. The device issues an HID data notification to the PC when it detects switch operation. The sample program ignores simultaneous ...

Page 87

SW9 (left click) input? No SW10 (left click) input? No Update click information (Bottom = 00h) ② Figure 5.3.6-2 Switch operation detection process 2 (main.c) Yes Update click information (Bottom = 01h) Yes Update click information (Bottom = 02h) ...

Page 88

A/D conversion start (AD-ch15) A/D conversion complete? Yes Get A/D conversion value (ad_data=(A/D conversion value & 0x03E0) >> 23) ad_data > ad_data_old? No ad_data > ad_data_old? No Update scroll data (wheel = 0) HID data notification process End Figure ...

Page 89

HID data notification process The figure below shows the details of the HID data notification process. Configuration completed? IN requested to EP1? HID data updates? Write HID data to be notified to PC (Host) in the EP1DT register (button ...

Page 90

... Humidity sensor 6.1 What is humidity? In the winter, our hands and skin tend to dry, and our throats easily become sore. Conversely, in areas where rain season occurs, the humidity tends to cause discomfort. And those who hang dry their laundry no doubt pay attention to the humidity level in weather reports ...

Page 91

The material used in the sensor to detect humidity defines its type, such as high-molecular, metallic oxide, or electrolytic. We will explain the most common type of humidity sensor, the high-molecular sensor. The high-molecular film absorbs ...

Page 92

INDUSTRY CO., LTD) mounted to it. This is a resistance changing humidity sensor that uses a moisture sensitive polymer. This device must be driven by an alternating voltage as a constantly applied direct voltage can affect the device's properties. In ...

Page 93

Let's make a hygrometer This sample program will create a hygrometer using the AD converter and base timer (PPG) in the microcontroller (MB91F662) installed on the starter kit, and the humidity sensor also mounted on the starter kit. 7.1 ...

Page 94

Sample program execution procedures> 1. Connect the starter kit to the PC with the USB cable. 2. Run the humidity sensor sample program. 3. The humidity is displayed in the 7-SEG ...

Page 95

Details on the humidity sensor 7.2.1 Wiring the humidity sensor The humidity sensor on the starter kit board is wired as shown below. 3.3V(Vin) MB91F662 Figure 9.2.1-1 Schematics of humidity sensor PPG0 output port Humidity sensor A/D9 input port ...

Page 96

Driving the humidity sensor The humidity sensor must be driven as follows. +3.3V PPG0 output waveform 0V +3.3V PPG1 output waveform 0V A/D conversion timing (PPG2) A/D conversion Figure 9.2.2-1 Driving the humidity sensor 1kHz (Duty:50%) 1/2 to 2/3 ...

Page 97

Based on a setting in the MB91F662, PPG0 will output a pulse waveform at 1 kHz, 50% duty. PPG1 will output the phase-inverted waveform of PPG0. This will produce an alternating current of ±3.3 volts at the equivalent of ...

Page 98

This sample program is designed for a fixed temperature of 22°C. The voltage dividing characteristics at 22°C is given below. Table 9.2.3-2 Humidity sensor voltage dividing characteristics table 2 Voltage Relative Relative dividing humidity humidity characteristics (%RH) (%RH) (V) 90 ...

Page 99

Sample program operating details This section describes the operating details of the sample program. 7.3.1 Main routine The operating conditions (setting conditions) for the peripheral functions of the MB91F662 used in this sample program are outlined below. The figure ...

Page 100

Figure 9.3-1 shows the flow of the main routine. This sample program measures time using the interrupt of reload timer ch0. Processing for humidity calculation and LED display alternate every two seconds so that changes can be observed in the ...

Page 101

A/D converter interrupt processing When 10 converted data values are written to the FIFO buffer, an A/D interrupt is generated so that interrupt processing can take place. The interrupt processing routine fetches 10 A/D conversions from the FIFO buffer, ...

Page 102

Humidity calculation process The figure below shows the details of the humidity calculation process. The voltage divisor is obtained by multiplying the A/D conversion average by 0.00322 (= 3.3 volts / 2 the A/D converter has 10 bits of ...

Page 103

What is an FRAM? Do you know what FRAM is? Although many types of memory devices are available today, they are largely separated into two groups. (1) memory that loses its contents when power is lost (volatile) : SRAM, ...

Page 104

The characteristics of the FRAM are the very reason they are ideal for security-dependant applications such as those in the figure below (train and bus passes, electronic money, membership cards used to record profiles and preferences in addition to member ...

Page 105

... Visit the Fujitsu website listed below. http://jp.fujitsu.com/microelectronics/ The starter board is equipped with a stand-alone FRAM MB85RS256. In the next Chapter, we will explain a program that accesses the FRAM using microcontroller communications. 104 ...

Page 106

Let's make a counter This sample program explains how to make a simple counter using FRAM. The counter functionality is achieved by using the SPI communications function on the multifunction serial interface (MFS), on the microcontroller (MB91F662) on this ...

Page 107

Sample program execution procedures> 1. Connect the starter kit to the PC with the USB cable. 2. Run the FRAM sample program. 3. Pressing the pushbutton switch increments the count. (The ...

Page 108

Part name Silk printing on board FRAM FRAM Pushbutton SW P_SW7 Pushbutton SW P_SW8 Pushbutton SW P_SW10 LED 7-segment LED 7-SEG LED Figure 11.1-1 Operation and details of the FRAM sample program Description Stores data. Increments data by 1. Clears ...

Page 109

Details on the FRAM MB85RS256 The MB85RS256 is a stand-alone FRAM device with a 256-Kbit capacity that supports the SPI interface. The features are listed below. <Features> - Bit configuration: 32,768 words x 8 bits - Operating power supply ...

Page 110

The commands listed above are input to the FRAM synchronized with the clock (SCK) after the trailing edge of the CS signal. Reading is done by inputting the READ command followed by a 16-bit address. In response, MB85RS256 outputs the ...

Page 111

Writing is done by inputting the WRITE command followed by a 16-bit address, followed the data to write in 8-bit units synchronized to the clock bit. incremented automatically to continuously write 8 more bits of data by inputting data for ...

Page 112

Explanation of the sample program This section explains the program for writing data to the FRAM using the SPI multifunction serial interface on the MB91F662. Also refer to the actual sample program. This sample program is only intended for ...

Page 113

Main routine The operation of the main routine is shown below. Note that the following conditions are assumed when operating this sample program. <MB91F662 setting conditions> FLASH access settings FLASH access size setting: 32 bits (no changes to default ...

Page 114

... Start interrupt routine Set CPU interrupt level (external interrupt level mask) Read from FRAM address 0x0000 No SW7 input? Yes Clear interrupt flag No LED_data < 99? Yes LED_data = LED_data +1 Issue WREN command to FRAM Write LED_data to FRAM address 0x0000 7-SEG LED output Set CPU interrupt level ...

Page 115

No SW10 input? Yes Clear interrupt flag Lighting = Lighting = 0 Issue WREN command to FRAM Write Lighting to FRAM address 0x0001 ② Figure 11.3.1-3 Counter operation flow (Extint.c, sio.tx.c) Yes Lighting = 1 114 ...

Page 116

... Overview of the sample program The sample program uses USB Host functionality to get access to a mass storage device. The pushbutton switches are used to make a file “fujitsu.txt” or folder “FUJITSU” on the connected mass storage device and/or delete the created file or folder. ...

Page 117

... CAUTION: Do not unplug the memory stick while monitor debugger is running. Status indication USB Switch set to “Host” USB Host connector “USER_CN” connector Figure 12.1-1 Operation and details of the USB mass storage sample program For debug Make file: fujitsu.txt Delete file: fujitsu.txt Make folder: FUJITSU 116 Delete folder: FUJITSU ...

Page 118

... ON = “Current action finished” “Mass storage initialized failed” “Device class not supported” “USB Hub not supported” Make file “fujitsu.txt” Delete file “fujitsu.txt” Make folder “FUJITSU” Delete folder “FUJITSU” Connector to plug in the USB mass storage device 117 ...

Page 119

... Before unplugging the memory stick please press pushbutton “DEBUG STOP” to break the current debugging session. Then end the debugging session in Softune Workbench. Now unplug the memory stick from SK-FR80-120PMC-USB and plug USB port of a computer to check if the file and/or folder were made correctly. ...

Page 120

... Additional option: Using terminal program for interaction The sample program provides also the possibility to do user interaction via a terminal program which is running on a computer (e.g. SKwizard which can be found on this CD). To make this work the sample program uses a further USART I/F for communication. ...

Page 121

... When the SK-FR80-120PMC-USB is connected properly to the computer, please start your terminal program and do following settings: Number of COM-port which is connected to the RS232 transceiver, 115.200 Baud and 8N1, then click the connect button. Plug the mass storage device to USB Host connector of the starterkit and press reset - the terminal program window will come up with the main menu which is shown in figure 12 ...

Page 122

... Creating projects/sample programs as new projects This Appendix will explain the settings to be made in order to create and debug new projects and sample programs using the monitor debugger. The "Sample_skeleton" project file supplied with the sample programs will be used for this explanation. 1.1 Sample project configuration The " ...

Page 123

... Launch SOFTUNE WORKBENCH, then from "File" - "Open Workspace" select sample.wsp in the sample folder, or drag and drop the sample.wsp file onto the SOFTUNE workspace. Clicking the + button next to "sample_skeleton.abs" will reveal the registered files as shown below. Right-click on sample_skeleton.abs and select "Set as Active Project". ...

Page 124

The user program executes from the main () function. Type your program from the line after the comment /* user program */. Do not delete the code for internal FLASH memory access or the interrupt settings. Set Flash ...

Page 125

... This file executes the flash_erase_sec.bin (FLASH sector erase command) and flash_write.bin (FLASH write command) programs. This file can be used without any modification for programs created using the "sample_skeleton" project. (Note, the DATA_SIZE (*1) must be changed if the data size exceeds, 0x00004000.) If you create a new workspace or project, the code indicated in italics (red) must be edited. ...

Page 126

The (project file name).bin file will be created from the mhx file using the converter program, which in turn, will be created from the abs file. (This process will be ...

Page 127

In "ROM/RAM area" select "_INROM01", and in section name specify "@INIT". Then select "const" for the content type and press the "Set" button. This area is where initial values for the variables with initial values (INIT area) ...

Page 128

Place a check in the "Launch load module converter", and specify "Motorola S format (f2ms)" as the conversion format. This setting will automatically generate an mhx file from the abs file every time the make/build command is ...

Page 129

Enter the name as shown below. Title: M2BS (Any name may be specified) Execution file name: C:¥Softune6¥Bin¥M2BS.EXE Options: %X.mhx -o %X.bin -ran 0x00080000, 0x000FC000 Working directory: %x¥Debug¥ABS After entering the above, click "OK" to save these settings. These settings will ...

Page 130

Customize bar After starting debugging on SOFTUNE, click "View" - "Customize bar" and specify "start.prc". You can either type "start.prc" in the "Entry" box, or specify the file by clicking the button to the right of the text box. ...

Page 131

Verifying COM ports This Section will explain how to verify the COM ports allocated on your PC. 2.1 For Windows XP Right-click "My Computer" and then select "Properties". In the "System properties" window, select the "Hardware" tab and click ...

Page 132

In this example, the COM port is assigned to "COM2". 131 ...

Page 133

Installation and usage of the PC writer This starter kit is shipped with the monitor program written in the FLASH area of the microcontroller. The monitor program must be running in order to connect to SOFTUNE, and to use ...

Page 134

Click "Next". Click "Install". 133 ...

Page 135

Wait for the installation to complete. Click the "Finish" button to complete the installation of the PC writer. After installing the PC writer, check the switch settings on the board before launching the software. 134 ...

Page 136

Set to "USB Mini-B". (4) Set to "FUNC". (2) Set MODE0 to "PROG". (3) MODE1 to "Debug". 135 ...

Page 137

After setting the switches on the board, connect the PC and board using the USB B to Mini-B cable supplied with the starter kit. Do not connect the cable to "USB FUNC" or "USB HOST". To USB Mini-B connector 136 ...

Page 138

After setting the switches on the board and connecting to the PC, launch PC Writer from the Windows Start menu. Click the "Set Environment" button and select the COM port being used. Refer to Appendix 12.1 to verify the COM ...

Page 139

Click "Open", or drag and drop the file from Explorer onto the GUI to specify the file to write. The monitor program file is "monitor.mhx (*)". (*) bits_pot_black/monitor/monitor.mhx Click "Full Operation (D+E+B+P)". 138 ...

Page 140

When the following window appears, press the reset button on the board, and then click OK on the screen. Do not connect the cable to "USB FUNC" or HOST". "USB 139 After pressing the reset button on the board, click ...

Page 141

Wait for the monitor program to finish writing to the microcontroller FLASH memory. Writing to FLASH is complete when the message "Full Operation OK!" appears. Click "OK" to close the window. 140 ...

Page 142

Monitor debugger 4.1 Explanation of the monitor debugger Microcontrollers are usually made available as an evaluation device for program development and test evaluation (debugging), and as a production device. The evaluation device connects to the PC via an ICE ...

Page 143

Resources used by monitor debugger The resources used by the monitor debugger on this starter kit are listed in the following Table. Resource Condition RAM Approximately 8 Kbytes 0x3E000 to 0x3FFFF FlashROM Approximately 8 Kbytes 0xFE000 to 0xFFFFF Multifunction ...

Page 144

Memory map with monitor debugger installed The figure below shows the memory map when the monitor debugger is installed on this starter kit. MB91F662 143 Built-in RAM (48Kbyte) Built –in ROM (512Kbyte) ...

Page 145

Monitor debugger limitations The monitor debugger provided on this starter kit is functionally limited compared to an ICE as listed below. - "Program stop", "Reset" must be done by pressing the switch on the board. (This cannot be controlled ...

Page 146

Stand-alone operation of the sample program The starter kit can run sample programs without launching the debugger. To run a program stand-alone, follow these procedures. 1. Make sure the program operates normally using monitor debugger. 2. Stop the monitor ...

Related keywords