User Guide

Starter kit User Guide
SK-FM3-80PMC-MB9BF524M
SK-FM3-80PMC-9BF524M-JL
Hardware V1.1 / Documentation V1.1
1
© 2015 Spansion Inc.
Warranty and Disclaimer
The use of the deliverables (deliverables shall include, but not limited to, software, application examples, hardware, target boards, evaluation boards, starter kits, schematics, engineering samples of IC’s
etc.) is subject to the terms and conditions of Spansion LLC and its affiliates (“SPANSION”) as set out below and in (i) the terms and conditions of the License Agreement and/or the Sale and Purchase
Agreement and/or any other agreement under which deliverables have been delivered, (ii) the technical descriptions and (iii) all accompanying written materials.
1. Please note that the deliverables are intended for and must only be used for test applications in an evaluation laboratory environment.
2. The software deliverables are provided on an as-is basis without charge and are subject to alterations. It is the user’s obligation to fully test the software in its environment and to ensure proper
functionality, qualification and compliance with component specifications.
3. Regarding hardware deliverables, the following limited warranty shall apply:
Except as otherwise provided in the following paragraphs, for a period of one (1) year from date of shipment to customer (“Warranty Period”), SPANSION warrants the hardware deliverables (i) are free of
defects in material and workmanship, and (ii) conform to SPANSION applicable data sheet specifications (available at www.spansion.com or upon request).
This warranty does not extend beyond the first purchaser of the deliverables. The liability of SPANSION under this warranty is limited, at SPANSION’s option, solely to repair the deliverable, to send
replacement deliverable, or to make an appropriate credit adjustment or refund in an amount not to exceed the original purchase price actually paid for the deliverable returned to SPANSION. SPANSION’S
warranty obligations are conditioned upon the following: (a) SPANSION is promptly notified in writing by customer during the applicable warranty period of any defect or nonconformance in the deliverable,
(b) customer obtains authorization from SPANSION to return the defective deliverable, (c) the defective deliverable is returned to SPANSION in accordance with SPANSION’S shipping instructions set forth
below, and (d) SPANSION’S examination of such deliverable discloses to its satisfaction that any defect or nonconformance actually existed and was not caused by improper use or operation outside of the
data sheet specifications for the deliverable, abuse, negligence, improper installation, accident, loss or damage in transit, or unauthorized repair or alteration by a person other than SPANSION. Customer
shall ship such defective deliverable to SPANSION via SPANSION’S carrier, collect. Risk of loss will transfer to SPANSION when the defective deliverable is provided to SPANSION’S carrier. If customer
fails to adhere to these warranty returns guidelines, customer shall assume all risk of loss and shall pay for all freight to SPANSION’S specified location. This warranty shall not apply to any deliverables
that have been repaired or altered, except those which have been repaired or altered by SPANSION. The aforementioned provisions do not extend the original warranty period of any deliverable that has
either been repaired or replaced by Seller.
THESE WARRANTIES ARE IN LIEU OF ALL OTHER WARRANTIES, EXPRESSED, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, AND ANY WARRANTY OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE.
SPANSION NEITHER ASSUMES NOR AUTHORIZES ANY OTHER PERSON TO ASSUME FOR IT ANY OTHER LIABILITIES. THE FOREGOING CONSTITUTES CUSTOMER’S SOLE AND
EXCLUSIVE REMEDY FOR THE FURNISHING OF DEFECTIVE OR NONCONFORMING DELIVERABLES.
4. The following limitation of liability shall apply for all deliverables
EXCEPT FOR DAMAGES FOR BODILY INJURY OR DEATH, SPANSION SHALL NOT BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, RELIANCE, OR CONSEQUENTIAL DAMAGES,
RELIANCE DAMAGES, AND/OR PUNITIVE, OR EXEMPLARY DAMAGES, WHETHER ANY SUCH DAMAGES ARE BASED ON CONTRACT, TORT OR ANY OTHER LEGAL THEORY, AND WHETHER
OR NOT SPANSION HAS BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES, AND NOTWITHSTANDING ANY FAILURE OF ESSENTIAL PURPOSE OF ANY LIMITED REMEDY.
REGARDLESS OF THE BASIS ON WHICH CUSTOMER IS ENTITLED TO CLAIM DAMAGES FROM SPANSION (INCLUDING FUNDAMENTAL BREACH, NEGLIGENCE, MISREPRESENTATION, OR
OTHER CONTRACT OR TORT CLAIM), SPANSION ENTIRE LIABILITY IN ANY CALENDAR YEAR, REGARDLESS OF THE NUMBER OF CLAIMS, SHALL NOT EXCEED FIFTY PERCENT (50%) OF
THE TOTAL AMOUNT PAID BY CUSTOMER TO SPANSION FOR THE DELIVERABLES SOLD IN SUCH CALENDAR YEAR.
5. Should one of the above stipulations be or become invalid and/or unenforceable, the remaining stipulations shall stay in full effect.
6. The contents of this document are subject to change by SPANSION without a prior notice, thus contact SPANSION about the latest one.
This board and its deliverables must only be used for test applications in an evaluation laboratory environment.
2
© 2015 Spansion Inc.
Information about this PDF document
 For your convenience this user guide includes external links that
simplify installing of drivers, software utilities, and quick jumps to
documentation.
 Some PDF viewer do not allow access to external content by links
because of security reasons.
 A viewer called “PDF XChange” is provided in the software package
of this starter kit. It’s use is free of charge and no additional
installation is required.
 Launching “start.bat” opens this user guide in the PDF XChange
viewer.
 Please ensure you have copied the complete software package
related to this starter kit in order to use and run the links and
examples given on the next pages.
 Please contact the Spansion Support in case of any question.
3
© 2015 Spansion Inc.
Overview
 Introduction
− About the SK-FM3-80PMC-MB9BF524M
− SK-FM3-80PMC-MB9BF524M content
− SK-FM3-80PMC-9BF524M-JL content
− Test it
− The Hardware
− The Software
 Try yourself
− Software examples
− Program download
− IAR-Embedded Workbench
− KEIL µVision
− Solutions
 Workshops, Contacts & More
4
© 2015 Spansion Inc.
 Additional documents









Schematic
Factsheet
Data sheet MB9B520M Series
Peripheral Manual and Errata
Peripheral Manual (Timer Part) and Errata
Peripheral Manual (Analog Part) and Errata
Peripheral Manual (Communication Part) and Errata
Cortex M3 Technical Reference Manual
Flash Programming Manual
Please visit www.spansion.com to find latest releases
of the above mentioned documents.
About
The SK-FM3-80PMC-MB9BF524M is available in two versions:
 The SK-FM3-80PMC-MB9BF524M includes a low-cost evaluation board
based on the Spansion FM3 microcontroller MB9B520M Series
 SK-FM3-80PMC-9BF524M-JL includes a low-cost evaluation board
based on the Spansion FM3 microcontroller MB9B520M Series and the
JTAG adapter J-Link
 The MB9B520M Series includes the following features:
− Up to 288 KByte Dual Operation Flash Memory
− Up to 64 KByte RAM
− Up to 2 CAN controller 2.0A/B
− Up to 8 LIN-USART-I²C interfaces
− USB-Host/-Device interface
− Timers (ICUs, OCUs, PPGs, others)
− Two 12 Bit ADCs, up to 26 channels
− External interrupts
5
© 2015 Spansion Inc.
Features
 Features of the SK-FM3-80PMC-MB9BF524M board:
− Microcontroller MB9BF524M
− 1x UART-Transceiver (SUB-D9 connector)
− 1x USB to serial converter (Type-B connector)
− 1x High-speed CAN-Transceiver (SUB-D9 connector)
− 1x USB-Host (Type-A connector)
− 1x USB-Device (Type-B connector)
− 2x LED-Display (7-Segment)
− 2x ‘User’-button
− 1x ‘Reset’-button, ‘Reset’-LED
− JTAG-Interface on a 20 pin-header
− FMtouch connector interface for software touch solutions
− TSC-Interface to connect for example the Spansion SK-TSC-1127S-SB
− All 80 pins routed to pin-header
− On-board 5V and 3V voltage regulators, ‘Power’-LED
− Power supply via USB (UART’B’), USB-Device, JTAG or external with a 8V to 12V power
connector
6
© 2015 Spansion Inc.
SK-FM3-80PMC-MB9BF524M content
 The SK-FM3-80PMC-MB9BF524M contains
− SK-FM3-80PMC-MB9BF524M evaluation board with MB9BF524M
− USB cable
− DVD: Documentation, USB driver, Software examples, Programmer
DVD
Additional information
B
A
ESD-foam
7
© 2015 Spansion Inc.
ESD-box
SK-FM3-80PMC-MB9BF524M
USB cable
SK-FM3-80PMC-9BF524M-JL content
 The SK-FM3-80PMC-9BF524M-JL contains
− SK-FM3-80PMC-MB9BF524M evaluation board with MB9BF524M
− USB cable
− DVD: Documentation, USB driver, Software examples, Programmer
− Segger J-Link JTAG adapter incl. USB cable
Box
Note
Segger J-Link JTAG adapter
USB cable
B
A
DVD
Additional information
B
A
ESD-foam
8
© 2015 Spansion Inc.
ESD-box SK-FM3-80PMC-MB9BF524M
USB cable
Test it
 The microcontroller on the SK-FM3-80PMC-MB9BF524M is already
preprogrammed with a simple application.
− Connect the SK-FM3-80PMC-MB9BF524M via USB (X5) with the PC
− Install the USB driver from the DVD
− Press the ‚Reset‘- Button
− The SK-FM3-80PMC-MB9BF524M will automatically start counting
− The count direction can be changed by pressing the key buttons
INT1
INT0
9
© 2015 Spansion Inc.
Test it
 You finished successfully the first test
 Now you will get more details about the
SK-FM3-80PMC-MB9BF524M board
 You will learn more about
− The on-board features
− How to program the Flash
− How to start with IAR-Embedded-Workbench and KEIL µVision
10
© 2015 Spansion Inc.
The Hardware
 Main features
USB
Device
USB
Host
CAN
UART ‚A‘
USB to
UART ‚B‘
Ext Power
+8V...+12V
7-Segment Display
P3A
LED
‚Reset‘
P32
P3E
P39
P3D
P3F
P3B
P3C
P33
SEG1
P54
P31
P53
P55
P30
P56
P44
SEG2
Keybutton
‚Reset‘
FMtouch
Connector
LED
‚Power‘
TSC (TouchSensorConnector)
11
© 2015 Spansion Inc.
JTAG
J-Link
Keybutton
‚NMIX/WKUP0‘
Keybutton
‚INT21_1‘
Port P0F
Port P4A
The Hardware
 The jumpers
JP4: UART RX select
JP5: UART TX select
R-0: UART0=UART‘A‘ / U-4: UART4=UART‘B‘ (USB)
R-0: UART0=UART‘A‘ / U-4: UART4=UART‘B‘ (USB)
R-3: UART3=UART‘A‘ / U-0: UART0=UART‘B‘ (USB)
R-3: UART3=UART‘A‘ / U-0: UART0=UART‘B‘ (USB)
JP1: UART-Reset
1-2: DTR-Signal of the UART connector
is connected to the MCU reset-pin.
2-3: DTR-Signal of the USB connector
is connected to the MCU reset-pin.
Some terminal-programs, e.g.
Spansion‘s Skwizard, allow to reset
the evaluation board by using the DTRSignal.
JP6: MD0 selection
Close this jumper to control
the MD0 level by the RTS signal
of the USB interface
S1: Mode selection
PROG: Program-mode
RUN: Run-mode
JP10: 5V / 3.3V
1-2: 5V supply is used
2-3: 3.3V supply is used
JP9: MCU Vcc
This jumper can be used
to measure the current
consumption of the MCU
12
© 2015 Spansion Inc.
J5: Power Supply
1-2: USB (UART ‚B‘) supply
3-4: USB Device supply
5-6: JLINK supply
7-8: External supply
The Hardware
 The jumpers
JP25, JP45: UART3_2/1
JP24:RTS/DTR
JP26: DCD
JP25
1-2: Flow control disabled
2-3: Flow control enabled
open: Flow control disabled
closed: Flow control enabled
1-2: SIN3_2
2-3: SIN3_1
JP45
1-2: SOT3_2
2-3: SOT3_1
JP17: Port8 (USB use)
1-2: USB in use
2-3: USB not in use
2-4: Use Port 8 as digital I/O
JP67: USB Function
HCONX
Open: D+ is not pulled up
Closed: HCONX controls Pullup of D+
JP2: Pullup resistor TSC
Open
JP3: Pullup resistor TSC
Open
JP16: USB prog
(for PROG-Mode S1)
Open: UART programming enabled
Closed: USB programming enabled
13
© 2015 Spansion Inc.
The Hardware
 The jumpers(back)
JP20-JP23, JP27-JP30: SEG1
Closed: SEG1a- SEG1DP active
JP31-JP38: SEG2
Closed: SEG2a- SEG2DP active
14
© 2015 Spansion Inc.
The Hardware
 JP4, JP5 : UART selection
− UART0 and UART3 of the microcontroller can be used together with a
typical RS232 SUB-D9 connector and a serial/USB converter
− The jumpers JP4 and JP5 routes the channel to the connector
− UART0 = USB-connector (X5), UART3 = Sub-D9 (X4) (default)
 Setting of Jumper JP4 and JP5: U-0 / R-3
RS232
USB
(default)
− UART0 = Sub-D9 (X4), UART3 = USB-connector (X5)
 Setting of Jumper JP4 and JP5: U-3 / R-0
RS232
15
© 2015 Spansion Inc.
USB
The Hardware
 Extension headers X20-X23
 Standard 0.1” / 2.54mm grid for use with prototype boards
5.08mm
22.86mm
2x6 pins
2x10 pins
17.7mm
5.08mm
2x10 pins
2x6 pins
14.7 mm
19.5mm 10.16mm
16
© 2015 Spansion Inc.
22.86mm
10.16mm
The Hardware
 The microcontroller pins
17
Board
Function
Pin Function
MB9BF524M
MCUVCC
VCC
1
(SW-Touch_4 , Connector X15)/
(TSC_7, Connector X10)/
UART3_1
P50/INT00_0 /AIN0_2/SIN3_1/AN22
2
(SW-Touch _3, Connector X15)/
(TSC _2, Connector X10) /
UART3_1
INT01_0/BIN0_2/SOT3_1/AN23
3
(SW-Touch_2, Connector X15)/
(TSC _4, Connector X10)
P52/INT02_0/ZIN0_2/SCK3_1/AN24
4
SEG2g
P53/SIN6_0/TIOA1_2/INT07_2
5
SEG2f
P54/SOT6_0/TIOB1_2/INT18_1
6
SEG2e
P55/SCK6_0/ADTG_1/INT19_1
7
SEG2d
P56/INT08_2
8
SEG2c
P30/AIN0_0/TIOB0_1/INT03_2/AN25
9
SEG2b
P31/BIN0_0/TIOB1_1/SCK6_1/INT04_2/AN26
10
© 2015 Spansion Inc.
The Hardware
 The microcontroller pins
18
Board
Function
Pin Function
MB9BF524M
SEG2a
P32/ZIN0_0/TIOB2_1/SOT6_1/INT05_2
11
SEG1DP
P33/INT04_0/TIOB3_1/SIN6_1/ADTG_6
12
SEG1b
P39/DTTI0X_0/INT06_0/ADTG_2
13
SEG1a
P3A/RTO00_0/TIOA0_1/INT07_0/SUBOUT_2/RTCCO_2
14
SEG1c
P3B/RTO01_0/TIOA1_1
15
SEG1d
P3C/RTO02_0 /TIOA2_1/INT18_2
16
SEG1g
P3D/RTO03_0/TIOA3_1
17
SEG1f
P3E/RTO04_0/TIOA4_1/INT19_2
18
SEG1e
P3F/RTO05_0/TIOA5_1
19
GND
VSS
20
© 2015 Spansion Inc.
The Hardware
 The microcontroller pins
19
Board
Function
Pin Function
MB9BF524M
SEG2DP
P44/TIOA4_0/INT10_0
21
P45/TIOA5_0/INT11_0
22
C-Pin
C
23
GND
VSS
24
MCUVCC
VCC
25
(32.768KHz Crystal)
P46/X0A
26
(32.768KHz Crystal)
P47/X1A
27
Key button- ‚Reset‘
INITX
28
UART3_2 (RXD)
P48/INT14_1/SIN3_2
29
UART3_2 (TXD)
P49/TIOB0_0/INT20_1/DA0_0/SOT3_2/AIN0_1
30
© 2015 Spansion Inc.
The Hardware
 The microcontroller pins
20
Board
Function
Pin Function
MB9BF524M
Key button ‚INT‘
P4A/TIOB1_0/INT21_1/DA1_0/SCK3_2/BIN0_1
31
P4B/TIOB2_0/INT22_1/IGTRG_0/ZIN0_1
32
P4C/TIOB3_0/SCK7_1/INT12_0/AIN1_2
33
P4D/TIOB4_0/SOT7_1/INT13_0/BIN1_2
34
P4E/TIOB5_0/INT06_2/SIN7_1/ZIN1_2
35
GND
MD1/PE0
36
Mode-Switch ‚S1‘
MD0
37
4MHz Crystal
X0/PE2
38
4MHz Crystal
X1/PE3
39
GND
VSS
40
© 2015 Spansion Inc.
The Hardware
 The microcontroller pins
21
Board
Function
Pin Function
MB9BF524M
MCUVCC
VCC
41
USB Switch Device/Host
P10/AN00
42
CAN RX
P11/AN01/SIN1_1/INT02_1/RX1_2/FRCK0_2/WKUP1
43
CAN TX
P12/AN02/SOT1_1/TX1_2/IC00_2
44
GND
AVSS
45
USB Power Enable
AN04/INT03_1/IC02_2/SIN0_1
46
Current limitation enable
P15/AN05/IC03_2/SOT0_1/INT14_0
47
(SW-Touch _9, Connector X15)
P16/AN06/SCK0_1/INT15_0
48
(SW-Touch _10, Connector X15)
P17/AN07/SIN2_2/INT04_1
49
AVCC
AVCC
50
© 2015 Spansion Inc.
The Hardware
 The microcontroller pins
22
Board
Function
Pin Function
MB9BF524M
AVRH
AVRH
51
GND
AVRL
52
(SW-Touch _12, Connector X15)
P18/AN08/SOT2_2
53
(SW-Touch _11, Connector X15)
P19/AN09/SCK2_2
54
(SW-Touch _14, Connector X15)
AN10/SIN4_1/INT05_1/IC00_1
55
(SW-Touch _15, Connector X15)
P1B/AN11/SOT4_1/IC01_1/INT20_2
56
(SW-Touch _13, Connector X15)
SCK0_0/TIOA7_1/AN12
57
UART0 TX
P22/SOT0_0/TIOB7_1/ZIN1_1/AN13
58
UART0 RX
P21/SIN0_0/INT06_1/WKUP2/BIN1_1/AN14
59
P20/INT05_0/CROUT_0/AIN1_1
60
© 2015 Spansion Inc.
The Hardware
 The microcontroller pins
23
Board
Function
Pin Function
MB9BF524M
(JTAG TRSTX, Connector X13)
P00/TRSTX
61
(JTAG TCK, Connector X13)
P01/TCK/SWCLK
62
(JTAG TDI, Connector X13)
P02/TDI
63
(JTAG TMS, Connector X13)
P03/TMS/SWDIO
64
(JTAG TDO, Connector X13)
P04/TDO/SWO
65
P07/ADTG_0/INT23_1
66
(SW-Touch_8, Connector X15)
P0A/SIN4_0/INT00_2/AN15
67
(SW-Touch_7,Connector X15)
P0B/SOT4_0/TIOB6_1/AN16/INT18_0
68
(SW-Touch_6, Connector X15)
P0C/SCK4_0/TIOA6_1/INT19_0/AN17
69
(TSC- TINT, Connector X10)
P0D/RTS4_0/TIOA3_2/INT20_0
70
© 2015 Spansion Inc.
The Hardware
 The microcontroller pins
24
Board
Function
Pin Function
MB9BF524M
(TSC- GINT, Connector X10)
P0E/CTS4_0/TIOB3_2/INT21_0
71
NMIX/ WKUP
P0F/NMIX/SUBOUT_0/CROUT_1/RTCCO_0/WKUP0/AN18
72
(TSC- Reset, Connector X10)
P63/INT03_0
73
(SW-Touch_5, Connector X15)
P62/SCK5_0/ADTG_3/AN19
74
USB UHCONX
P61/SOT5_0/TIOB2_2/UHCONX/DTTI0X_2/AN20
75
Mode Switch ‚S1‘
P60/SIN5_0/TIOA2_2/INT15_1/WKUP3/IGTRG_1/AN21
76
USB-power supply
USBVCC
77
USB Data -
P80/UDM0/INT16_1
78
USB Data +
P81/UDP0/INT17_1
79
GND
VSS
80
© 2015 Spansion Inc.
The Software
 The SK-FM3-80PMC-MB9BF524M DVD includes the following software:
− MCU Flash programming tools

FLASH MCU Programmer for FM3

FLASH USB DIRECT Programmer
− USB driver for on-board USB-to-RS232 converter
− The terminal program ‚Serial Port Viewer‘
− The USB configuration tool ‚USB Wizard‘
− Software examples for the SK-FM3-80PMC-MB9BF524M
 Please check our dedicated microcontroller website:
− for updates of the Flash programmer tool, utilities and examples
− for data sheets, hardware manuals, application notes, etc.
25
© 2015 Spansion Inc.
Installation of the USB-driver
 Install the USB driver from the DVD with administrator priviliges
 Start the Device Manager of the Windows Control Panel
− START -> Settings -> Control Panel
− Control Panel -> System -> Hardware -> Device Manager
 Check ‘Ports’ for the assigned virtual COM-port number
− USB Serial Port (e.g.: COM7)
 Ready!
26
© 2015 Spansion Inc.
Tools and Software Examples
 Serial Port Viewer
− Free of charge terminal program, Start installation
 USB Wizard
− Free of charge USB configuration tool, Start installation
 Following examples are provided with SK-FM3-80PMC-MB9BF524N for IAR
Embedded Workbench V6 and KEIL µVision4:
− mb9bf52xm_template ‚Empty‘ project as base for user applications
− mb9bf52xm_adc_dvm Digital Voltage Meter based on the A/D-converter
− mb9bf52xm_can_uart_terminal Simple CAN example (CAN0)
− mb9bf52xm_ioport_counter Counts from 0 to 99 on the 7-segment Display
− Further examples on DVD and on our website
Note: Please copy the examples to your local drive!
27
© 2015 Spansion Inc.
Flash Programming
 There are three options to program the flash:
− UART Programming (X4, X5)
 Check jumper JP16 is opened
 Connect UART0 of the board to the USB-Port of the PC
• via USB (JP4,JP5: U-0, R-4)
• via RS232 (JP4,JP5: U-4, R-0)
 Use the FLASH MCU Programmer
− USB Programming (X3)
 Check jumper JP16 is closed
 Connect the board via USB-Device (X3) to the USB-Port of the PC
 Use the FLASH USB DIRECT Programmer
− JTAG
 Use the JTAG-adapter supported by the development toolchain.
28
© 2015 Spansion Inc.
FLASH MCU Programmer for UART Programming
 FLASH MCU Programmer
− Free of charge, no registration required
− Windows based programming tool for FM3 microcontroller
− Uses PC serial port COMx (incl. virtual COM port: USB-to-RS232)
− Start installation
MB9BF524M
mb9bf52xm_ioport_counter.srec
29
© 2015 Spansion Inc.
Program Download
 Start the FLASH MCU Programmer
 Select the target microcontroller (MB9BF524M)
 Select the crystal frequency (4 MHz)
 Choose the software example from the example ‘exe‘-folder
(e.g. Examples\mb9bf52xm_ioport_counter-v10\example\IAR\output\release\exe\
mb9bf52xm_ioport_counter.srec)
MB9BF524M
mb9bf52xm_ioport_counter.srec
30
© 2015 Spansion Inc.
Program Download
(see JP4, JP5 jumper settings)
 Connect to the PC
RS232 USB port
− Connect UART0 with RS232 (X4) or
with the USB interface X5
− Select COM port (‚Set Environment‘)
 Open JP16
 Set switch S1 to position ‚PROG‘
 Press ‚Reset‘
 Start ‚Full Operation‘
b9bf52xm_ioport_counter.srec
31
© 2015 Spansion Inc.
S1: Mode selection
PROG: Set switch to position
‚PROG‘ in order to select the
program-mode
Keybutton ‚RESET‘
Program Download
 Close the FLASH MCU Programmer
 Set switch S1 to position ‚RUN‘
 Press ‚Reset‘
S1: Mode selection
RUN: Set switch to position ‚RUN‘
in order to select the run-mode
Keybutton ‚RESET‘
MB9BF524M
mb9bf52xm_ioport_counter.srec
Close the FLASH MCU
Programmer
32
© 2015 Spansion Inc.
FLASH USB DIRECT Programmer for USB Direct Programming
 FLASH USB DIRECT Programmer
− Windows based programming tool for FM3 microcontroller
− Uses direct USB connection (via X3)
− Start installation
MB9BF524M
9bf52xm_ioport_counter.srec
33
© 2015 Spansion Inc.
Program Download
 Start the FLASH USB DIRECT Programmer
 Select the target microcontroller (MB9BF524M)
 Choose the software example from the example ‘exe‘-folder
(e.g. Examples\mb9bf52xm_ioport_counter-v10\example\IAR\output\release\exe\
mb9bf52xm_ioport_counter.srec)
 Select the COM port
MB9BF524M
9bf52xm_ioport_counter.srec
34
© 2015 Spansion Inc.
Program Download
USB port X3
 Select the MCU power supply (J5)
J5
 Close JP16, Set switch S1 to position ‘PROG‘
 Connect USB port X3 with the PC
JP16
 Install the USB driver
− See subfolder ‘driver‘ of installed programmer
− E.g.: C:\Program Files (x86)\Spansion\..
S1: Mode selection
..FLASH USB DIRECT Programmer\driver
Press ‘Reset‘ and Start ‘Full Operation‘
35
© 2015 Spansion Inc.
PROG: Set switch to position
‚PROG‘ in order to select the
program-mode
Keybutton
‚RESET‘
Program Download
 Close the FLASH USB DIRECT Programmer
 Set switch S1 to position ‚RUN‘
 Press ‚Reset‘
S1: Mode selection
RUN: Set switch to position ‚RUN‘
in order to select the run-mode
MB9BF524M
Keybutton ‚RESET‘
Close the FLASH USB
DIRECT Programmer
36
© 2015 Spansion Inc.
Debugging via JTAG
 The MB9BF524M microcontroller offers a JTAG-Interface
that is supported by SK-FM3-80PMC-MB9BF524M.
− Debug your program with a JTAG-Adapter e.g. Segger J-Link
− Connect the J-Link to the JTAG-Interface routed to the 20-Pin-Header on
X13 and to the USB-Port of your PC
− Use IAR-Embedded Workbench to debug your program
− If the JTAG-Adaper allows powering the target, then jumper J5 can be set
as follows:
37
© 2015 Spansion Inc.
IAR Embedded Workbench
 Installation
 Getting Started
 Open Project
 Build Project
 Debug Project
38
© 2015 Spansion Inc.
IAR Workbench Getting Started
 Install EWARM from IAR-CD or download latest version from IAR
Website
− EWARM size-limited (32k) or time-limited (full) Evaluation Version
 http://supp.iar.com/Download/SW/?item=EWARM-EVAL
 Start EWARM Workbench
 Choose File → Open → Workspace
− e.g.: <drive:>\<board>\ mb9bf52xm_ioport_counter-v11\example\IAR\
− Choose mb9b52xm_ioport_counter.eww
39
© 2015 Spansion Inc.
IAR Workbench – Main Window
 IAR Workbench
− Workspace on left side
of Workbench window
 If hidden then View→Workspace
− Source files on right
side of Workbench
window as tabbed
windows
− Project open
File → Open → Workspace → *.eww
− For new projects
start with ‚mb9bf52xm_template’
40
© 2015 Spansion Inc.
IAR Workbench – Menu Bar
 IAR Menu Bar
File Control
(new, open,
save, etc.)
41
Configuration
Control
(e.g. RAM or ROM
debugging)
Build Control
(compile, make,
stop build)
Edit Control
Navigation Control
Debug Control
(cut, copy,
paste, undo,
redo)
(Find, Bookmarks, File
Navigation, etc.)
(Breakpoint, start
Debug w/ and w/o
download)
© 2015 Spansion Inc.
IAR Workbench – Workspace
 IAR Workspace Window
Project Name
Sub Folder Modules
Main Modules
Module Includes
Project Description
Project Built Output
42
© 2015 Spansion Inc.
IAR Workbench – Making Project
 Making the Project
− Use Make-Icon (
), <F7> or
Menu: Project→Make
− Check for no errors in Output window
below
or
− Build errors are indicated by
In Output window and Source view
43
© 2015 Spansion Inc.
IAR Workbench – Download to Target
 Download to Target and Start Debugging
− Use
Icon, <Ctrl>-D, or Project→Download and Debug
− A new menu bar will occur on sucessful connection to target
Reset
Target
Stop
44
© 2015 Spansion Inc.
Step
Out
Step
Over
Step
Into
Run to
Cursor
Next
Statement
End
Debugging
Run
Trace
Control
IAR Workbench – Debug (1)
 Source Window
− The Source windows do not change contents but get additional information
 Current line (PC):
 Halted on Breakpoint:
 Halted on Data break (example):
 Disassembly Window
− Shows ‘pure‘ disassebly view
− Shows mixed mode view
45
© 2015 Spansion Inc.
IAR Workbench – Debug (2)
 Watch Window
− Watch
 Expressions/Variables have to be added by user and are updated by
Halt/Breakpoint
− Quick Watch
 The Quick watch allows the user to calculate and recalculate expressions
even with variables
 The drop down menu memorizes the last typed contents
46
© 2015 Spansion Inc.
IAR Workbench – Simulator
 Simulator
− Mark Project File in Workspace
− Choose Project→Options
− Choose Simulator in Debugger Setup
− Start Simulator with usual
47
© 2015 Spansion Inc.
Icon
KEIL µVision
 Installation
 Getting Started
 Open Project
 Build Project
 Debug Project
48
© 2015 Spansion Inc.
KEIL µVision IDE and Debugger Getting Started
 Install µVision from KEIL-CD or download latest version from KEIL
Website
− Evaluation Version
 https://www.keil.com/demo/eval/arm.htm
 Registration required
 Install ULINK-ME
− Special installation is not needed, because ULINK-ME acts as a USB
Human Interface Device (HID) and thus needs no extra USB driver
 Install ULINK Pro (optional)
− ULINK Pro needs an own dedicated USB driver located in:
<Installation Path>\KEIL\ARM\ULINK
 Start µVision
49
© 2015 Spansion Inc.
KEIL µVision – Getting Started
 Choose Menu: Project→Open Project...
− Browse to: <drive:>\<board>\Examples\mb9bf52xm_adc_dvm-v11\example\ARM\
− Choose mb9b52xm_adc_dvm.uvproj
50
© 2015 Spansion Inc.
KEIL µVision – Main Window
 KEIL µVision
− Project window on left side of
IDE window
 Choose:
View→Project Window
if hidden
− Source files on right side
of IDE window as tabbed
windows
− Output window on bottom
side of IDE window
51
© 2015 Spansion Inc.
KEIL µVision – Menu Bars (1)
 Menu Bar 1
− Can be moved in bar window area or set floating
52
File Control
Navigation Control
(new, open,
save, etc.)
(Bookmarks + search, etc.)
(Text search, search in files, etc.)
Edit Control
Debug Control
(cut, copy, paste, etc.)
(indention, commenting)
(Start/Stop Debug Session,
set/remove/disable
breakpoints, remove/disable
all breakpoints)
© 2015 Spansion Inc.
Project
Window View
IDE
Configuration
KEIL µVision – Menu Bars (2)
 Menu Bar 2
− Can be moved in bar window area or set floating
Build Control
(Compile [Translate],
Build, Rebuild, etc.)
Configuration
Control
(e.g. RAM or ROM
debugging)
Manage Books,
File Extensions,
Environment
MB9BF524M_Release
Download
to Target
53
© 2015 Spansion Inc.
Target
Options
Manage
MultiProject
Workspace
KEIL µVision – Project Window
 µVision Project Window
Project Name
Startup Code Subfolder
Startup Code Source and Header Files
Main Project Code Subfolder
Main Project Code Source and Header
Files
Project Description Subfolder and
Abstract File
54
© 2015 Spansion Inc.
KEIL µVision – Making Project
 Making the Project
− Use Rebuild Icon
(
) or
Project→Rebuild all target
files
− Check for no errors in
Output window below
− Build errors are shown in Output window.
 Can be double-clicked by showing the source line with a blue arrow
55
© 2015 Spansion Inc.
KEIL µVision – Debug (1)
 Start Debugging
− Download to target first, when MCU Flash does not contain the current
application openend and built in the IDE
 Use Download Icon (
) or Menu: Flash→Download
− Start Debug Session
 Use Start/Stop Debug Icon (
Session
) or Menu: Debug→Start/Stop Debug
− Ending Debug Session
 Use same way as for starting debug session
56
© 2015 Spansion Inc.
KEIL µVision – Debug (2)
 Debugging Icon Bar
− During a Debug Session there will be visible a new icon bar
Reset
Target
Start/
Stop
Application
57
© 2015 Spansion Inc.
Step Control
Show Windows
(Step in, out, etc.)
Show
Source/Code
Line of current
PC
(Command,
Disassembly, Symbols,
Registers, Call Stack)
Show (multiple)
Windows
(Watch, Memory, Serial,
Analysis, Trace, System
Viewer)
Tool Box
(can be
customized)
Debug
Restore
Views
KEIL µVision – Debug (3)
 Source View
− The Source windows do not change contents but get additional information
Active Breakpoint
Disabled Breakpoint
Current Program
Counter
Current Cursor Line of
Source Code
Code Lines with
compiled Instructions
(dark grey )
58
© 2015 Spansion Inc.
KEIL µVision – Debug (4)
 Disassembly View
− Mixed mode is selectable and deselectable
Active Breakpoint
Disabled Breakpoint
Current Program
Counter
Current Cursor Line of
Code highlighted in
yellow background ( )
59
© 2015 Spansion Inc.
KEIL µVision – Debug (5)
 Memory Window
− Up to 4 Memory windows can be displayed in tabs
− Memory is updated during runtime
− Memory window tabs are shared with Watch windows
 Register View
− Register view is a tab of the Project window
− Changes are highlighted in dark blue text
background
− Register tree knots can be expanded
60
© 2015 Spansion Inc.
KEIL µVision – Debug (6)
 Variable Windows
− Watch Windows
 Up to 2 Watch windows are sharing their tabs with e.g. Memory and Local
views
 Updated during runtime
 Any changes are highlighted in dark blue text backround color
 Displayed values can be changed by user during break
− Local View
 The local view shares the tab with e.g. Memory and Watch windows
 Any changes are highlighted in dark blue text backround color
 Displayed values can be changed by user during break
61
© 2015 Spansion Inc.
KEIL µVision – Trace (ULINK ME)
 Trace via ITM
− Simple Trace views via Instrumentation Trace Macro is supported by
µLINK ME
 Records
 Exceptions
 Counters
62
© 2015 Spansion Inc.
KEIL µVision – Trace (ULINK Pro) (1)
 Trace via ETM
− Check settings in menu:
Flash→Configure Flash Tools... Tab:Debug
enables ETM pins
63
© 2015 Spansion Inc.
KEIL µVision – Trace (ULINK Pro) (2)
 Instruction Trace
− Real Time Trace recording
− Output can be filtered by several ETM and ITM events
− Trace buffer is held in PC memory and transfered to µVision on break
64
© 2015 Spansion Inc.
KEIL µVision – Simulator
 Simulator
− The Core Simulator can be selected by the menu:
[Flash] → [Configure Flash Tools...] → [Debug]
and then choosing [Use Simulator]
− Look & feel is like using ULINK debugger
− Controlable also with *.ini files
65
© 2015 Spansion Inc.
Solutions
66
© 2015 Spansion Inc.
Products
67
© 2015 Spansion Inc.
Eco system
safety
inverter
touch
connect
library
Solutions
.....
Solutions
library
 FM3 Low Level Library (L3)
− CMSIS compliant header files
− Driver collection to supports MCU peripherals
− Hardware abstraction layer offers an API
− Interrupt handling supported
− Optimized memory use
 For unused resources, no memory for library code is allocated
 Supported Modules
− ADC (A/D-Converter), BT (Base Timer), CAN, CRC, CLK , CRTRIM (CR Clock
Trimming), CSV (Clock Supervisor) , DAC (D/A-Converter), DMA, DSM (Deep
Standby Modes), DT (Dual Timer), EXINT (External Interrupts), EXTIF
(External Bus Interface), FLASH, GPIO, LVD (Low Voltage Detection), MFS
(Multi Function Serial: UART, SPI, I2C, LIN), MFT (Multi Function Timer),
QPRC (Quadrature Encoding), RESET (Reset Cause), RTC (Real Time Clock),
USB (Host and Device) , WC (Watch Counter), WDG (Watchdog: SW, HW), …,
and more.
68
© 2015 Spansion Inc.
Solutions
 FMconnect USB
− Up to two USB interfaces
 Supports Host/Device/OTG
 Control, interrupt, bulk, isochronous
− Free software examples
− Spansion USB Wizard (PC based GUI):
 USB driver configuration
 Easy creation of USB descriptors
 Code injection in existing projects
 FMconnect Ethernet
− One or two channels Ethernet MAC
− Dedicated Ethernet starter kit
− Free Ethernet software:
 Low level driver available
 TCP/IP stack available
 Software examples, e.g.: web server
− Commercial products from partners
69
© 2015 Spansion Inc.
connect
Solutions
touch
 Software FM3touch library
− Works on all FM3 derivatives,
user can freely choose
best-fitting FM3 MCU
and add touch functionality
− No external components
− Only one pin (ADC channel)
per touch input
− High sensitivity (<10fF)
− Low ressource usage,
no ‚atomic‘ handling required
− Flexible configuration and event system for easy integration
− Configuration tool included
− Free of charge (basic variant)
70
© 2015 Spansion Inc.
Solutions
inverter
 FM3 inverter drive hardware features
− Up to 3 ch flexible 3-phase motor timers, automatic dead time insertion
− Up to 3 ch independent 12-bit 1Msps ADCs, up to 32 ADC inputs
− Up to 3 ch ABZ quadrature decoder units
− DTTI input for motor emergency stop
− 3.3V and true 5V single supply
guarantees robustness
 FM3 software motor control library
− Support for BLDC, PMSM, IPM and ACIM
− Field oriented control
− Support for encoder or hall sensor feedback, or sensorless application
71
© 2015 Spansion Inc.
Solutions
safety
 FM3 functional safety hardware features
− Two stage watchdog with independent clock source
− Clock supervisor (clock failure and abnormal frequency detection)
− On-Chip Low Voltage Detector
− CRC hardware module
− MPU (Memory Protection Unit)
− DTTI input for motor emergency stop
 IEC60730 Class B
− Self-Test Library available
− CPU test
− Clock test
− Interrupt test
− Memory test
− I/O test
− A/D converter test
72
© 2015 Spansion Inc.
Finally
73
© 2015 Spansion Inc.
Workshops & Seminars
FM Seminar
Motor Control
USB Workshop
Ethernet Workshop
Please register here: http://news.spansion.com/seminars
• Overview FM family
• Memory
• Peripheral resources
• Packages
• Introduction of Spansion MCU
• Line-Up of microcontrollers
with motion control features
• Performance
• Processor architecture
• Bus structure
• Flash memory
• Flash programming
• Introduction of motors types
• ACIM
• BLDC
• PMSM
• Peripheral resources
• Clock distribution
• Timer
• Interfaces
• FM features
• Introduction of control types
• Sinusoidal commutation
• Field Orientated Control
• Space Vector Modulation
• Development tool chains
• IAR workbench / J-Link
• KEIL µVision / uLink
• Starter Kits
• Practical exercises
• Flash programming
• Project setup/modification
• Debugging
• External interrupts
74
© 2015 Spansion Inc.
• Peripherals of FM3/FM4 MCUs
• Base Timer
• Multifunction Timer
• 12-bit A/D Converter
• Quadrature Position
and Revolution Counter
• Interrupt Controller
• Hands-on exercise / SW-Example
• BLDC motor with hall sensor
• PMSM motor with
field orientated control
• Introduction of Spansion MCU
• Line-op of USB MCUs
• Introduction of Spansion MCU
• Line-op of Ethernet MCUs
• USB vs. RS232
• Historical Background
• Fundamentals of Ethernet
• Ethernet Microcontrollers
• Electrical Layer
• Hardware Design considerations
• USB Protocol
• Enumeration Process
(Descriptors & USB Settings)
• Transfer Types
• Data Transfers
• USB Class Concept
• Software Design considerations
• Communication layer models
• The Internet Protocol suite
• Software Driver Concepts
• USB Host
• Web technologies
in embedded systems
• USB Examples
• Virtual COM Port
• USB Descriptor Manager
• Create Template Classes
• Create Descriptors
• Developing Ethernet applications
• Tools and methods
• PC software based on LibUSB
• Hands-on training
• Special Use Cases
• e.g. boot loader
• Practical hints and advice
on FM3 Ethernet solutions
Spansion Support
 Please check the following website, for any available updates
www.spansion.com
www.spansion.com/starterkit
 Please contact your local support team for any technical question
America: [email protected]
75
China:
[email protected]
Europe:
[email protected]
Japan:
[email protected]
Other:
http://www.spansion.com/Support/SES/Pages/Ask-Spansion.aspx
© 2015 Spansion Inc.
Recycling
 Gültig für EU-Länder:
− Gemäß der Europäischen WEEE-Richtlinie und deren Umsetzung in
landesspezifische Gesetze nehmen wir dieses Gerät wieder zurück.
− Zur Entsorgung schicken Sie das Gerät bitte an die folgende Adresse:
 Valid for European Union Countries:
− According to the European WEEE-Directive and its implementation into
national laws we take this device back.
− For disposal please send the device to the following address:
CCS Express GMBH
c/o Spansion International Inc.
Frankfurter Str. 83-107
D-65479 Raunheim
Germany
 This board is compliant with China RoHS
76
© 2015 Spansion Inc.
www.spansion.com
Spansion®, the Spansion logo, MirrorBit®, MirrorBit® Eclipse™ and combinations thereof are trademarks and registered
trademarks of Spansion LLC in the United States and other countries. Other names used are for informational purposes
only and may be trademarks of their respective owners.
This document is for informational purposes only and subject to change without notice. Spansion does not represent that
it is complete, accurate or up-to-date; it is provided “AS IS.” To the maximum extent permitted by law, Spansion disclaims
any liability for loss or damages arising from use of or reliance on this document.
77
© 2015 Spansion Inc.