User Guide

Starter kit User Guide
SK-FM3-100PMC-MB9BF516N
Hardware V1.1 / Documentation V1.3
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-100PMC-MB9BF516N
− SK-FM3-100PMC-MB9BF516N content
− SK-FM3-100PMC-9BF516N-JL content
− Test it
− The Hardware
− The Software
 Try yourself
− Software examples
− Program Download
− IAR-Embedded Workbench
− KEIL µVision
− Solutions
 Additional documents








Schematic
Factsheet
Data sheet MB9B510R Series
Peripheral Manual and Errata
Peripheral Manual (Timer Part) and Errata
Peripheral Manual (Analog Part) and Errata
Peripheral Manual (Communication Part) and Errata
Flash Programming Manual and Errata
Please visit www.spansion.com to find latest releases
of the above mentioned documents.
 Workshops, Contacts & More
4
© 2015 Spansion Inc.
About the SK-FM3-100PMC-MB9BF516N
 The SK-FM3-100PMC-MB9BF516N is available in two versions:
− The SK-FM3-100PMC-MB9BF516N includes a low-cost evaluation board based on the
SPANSION FM3 microcontroller MB9B510 Series
− SK-FM3-100PMC-9BF516N-JL includes a low-cost evaluation board based on the
SPANSION FM3 microcontroller MB9B510 Series and the JTAG adapter J-Link
 The MB9B510 Series includes the following features:
− Up to 512 KByte Flash Memory
− 32 KByte Work Flash
− 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)
− Three 12 Bit ADCs
− External interrupts
5
5
© 2015 Spansion Inc.
About the SK-FM3-100PMC-MB9BF516N
 Features of the SK-FM3-100PMC-MB9BF516N board:
− Microcontroller MB9BF516N
− 1x UART-Transceiver (SUB-D9 connector)
− 1x USB to serial converter (Type-B connector)
− 1x High-speed CAN-Transceiver (SUB-D9 connector)
− 1x USB-MiniHost (Type-A connector)
− 1x USB-Device (Type-B connector)
− JTAG- and TRACE-Interface each on a 20 pin-header
− TSC-Interface to connect for example the SPANSION SK-TSC-1127S-SB
− 2x LED-Display (7-Segment)
− 2x ‘User’-button
− 1x ‘Reset’-button, ‘Reset’-LED
− All 100 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-100PMC-MB9BF516N content
 The SK-FM3-100PMC-MB9BF516N contains
− SK-FM3-100PMC-MB9BF516N evaluation board with MB9BF516N
− USB cable
− DVD: Documentation, USB driver, Software examples, Programmer
DVD
Additional information
B
A
ESD-foam
7
© 2015 Spansion Inc.
ESD-box
SK-FM3-100PMC-MB9BF516N
USB cable
SK-FM3-100PMC-9BF516N-JL content
 The SK-FM3-100PMC-9BF516N-JL contains
− SK-FM3-100PMC-MB9BF516N evaluation board with MB9BF516N
− 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-100PMC-MB9BF516N
USB cable
Test it
 The microcontroller on the SK-FM3-100PMC-MB9BF516N is already
preprogrammed with a simple application.
− Install the USB driver from the DVD
− Connect the SK-FM3-100PMC-MB9BF516N via USB (X5) with the PC ,
verify that jumper J5 is on the USBPWR position.
− Press the ‚Reset‘- Button
− The SK-FM3-100PMC-MB9BF516N 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-100PMC-MB9BF516N 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
USB
Device Host
CAN
Ext Power
UART ‚A‘ USB to
UART ‚B‘
+8V...+12V
7-Segment Display
P01_8
P01_D
P03_8
P01_9
P03_D
P01_E
P01_C
P03_9
P03_E
P01_A
P01_B
P03_C
P01_F
SEG1: Port18-1F
P03_A
P03_B
P03_F
LED
‚Reset‘
SEG2: Port38-3F
TRACE
JTAG
J-Link
TSC (TouchSensorConnector)
11
© 2015 Spansion Inc.
Keybutton
‚Reset‘
SK-FM3-100PMC-MB9BF516N
Keybutton ‚INT0‘
Keybutton ‚INT1‘
Port P05_0
Port P05_1
LED ‚Power‘
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-4: UART4=UART‘A‘ / U-0: UART0=UART‘B‘ (USB)
R-4: UART4=UART‘A‘ / U-0: UART0=UART‘B‘ (USB)
JP1: DTR-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
SK-FM3-100PMC-MB9BF516N
1-2: 5V supply is used
2-3: 3.3V supply is used
12
© 2015 Spansion Inc.
JP9: MCU Vcc
J5: Power Supply
This jumper can be used
to measure the current
consumption of the MCU
1-2: USB (UART ‚B‘) supply
3-4: USB Device supply
5-6: JLINK supply
7-8: External supply
The Hardware
 The jumpers
JP24-JP26: Flow Control UART4
JP24
JP25
JP26
1-2: Flow control disabled
2-3: Flow control enabled
1-2: Flow control enabled
2-3: Flow control disabled
open: Flow control disabled
closed: Flow control enabled
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+
JP16: USB prog
(for PROG-Mode S1)
Open: UART programming enabled
Closed: USB programming enabled
SK-FM3-100PMC-MB9BF516N
13
JP2: Pullup resistor TSC
JP3: Pullup resistor TSC
Closed: Pull up SCL3
Closed: Pull up SDA3
© 2015 Spansion Inc.
JP22,JP23: Flow Conrol CTS4, DTS4
JP22, JP23 1-2: Flow control on UART‘A‘
JP22, JP23 2-3: Flow control on UART‘B‘
JP22, JP23 Open: Flow control disabled
The Hardware
 JP4, JP5 : UART selection
− UART0 and UART4 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), UART4 = Sub-D9 (X4) (default)
 Setting of Jumper JP4 and JP5: U-0 / R-4
RS232
USB
(default)
− UART0 = Sub-D9 (X4), UART4 = USB-connector (X5)
 Setting of Jumper JP4 and JP5: U-4 / R-0
RS232
14
© 2015 Spansion Inc.
USB
The Hardware
 Extension headers X20-X23
− Standard 0.1” / 2.54mm grid for use with prototype boards
0.3“ / 7.62mm
2x 15 pins
1.4“ / 35.56mm
0.3“ / 7.62mm
0.5“ / 12.7mm
SK-FM3-100PMC-MB9BF516N
0.2“
5.08mm
15
© 2015 Spansion Inc.
0.7“
2x10 pins
17.78mm0.9“/22.86mm
0.4“
10.16mm
The Hardware
 The microcontroller pins
Pin-name
Pin-Function on
SK-FM-100PMCMB9BF516N
Pin
Pin-name
1
VCC
MCUVCC
11
P32/ZIN0_0/TIOB2_1/SOT6_1/INT05_2/
MADATA09_0
2
P50/INT00_0/AIN0_2/SIN3_1/RTO10_0/
MADATA00_0
Key button
‘INT0’
12
P33/INT04_0/TIOB3_1/SIN6_1/ADTG_6/
MADATA10_0
3
P51/INT01_0/BIN0_2/SOT3_1/RTO11_0/
MADATA01_0
Key button
‘INT1’
13
P34/FRCK0_0/TIOB4_1/TX0_1/MADAT
A11_0
CAN0 TX
4
P52/INT02_0/ZIN0_2/SCK3_1/RTO12_0/
MADATA02_0
USB current
limitation‘INT2’
14
P35/IC03_0/TIOB5_1/RX0_1/INT08_1/M
ADATA12_0
CAN0 RX
5
P53/SIN6_0/TIOA1_2/INT07_2/RTO13_0
/MADATA03_0
15
P36/IC02_0/SIN5_2/INT09_1/MADATA1
3_0
6
P54/SOT6_0/TIOB1_2/RTO14_0/MADAT
A04_0
16
P37/IC01_0/SOT5_2/INT10_1/MADATA1
4_0
7
P55/SCK6_0/ADTG_1/RTO15_0/MADAT
A05_0
17
P38/IC00_0/SCK5_2/INT11_1/MADATA1
5_0
SEG2-A
8
P56/INT08_2/DTTI1X_0/MADATA06_0
18
P39/DTTI0X_0/ADTG_2
SEG2-B
9
P30/AIN0_0/TIOB0_1/INT03_2/MADATA
07_0
19
P3A/RTO00_0/TIOA0_1/RTCCO_2/SUB
OUT_2
SEG2-C
10
P31/BIN0_0/TIOB1_1/SCK6_1/INT04_2/
MADATA08_0
20
P3B/RTO01_0/TIOA1_1
SEG2-D
Pin
16
© 2015 Spansion Inc.
Pin-Function on
SK-FM-100PMCMB9BF516N
The Hardware
 The microcontroller pins (cont‘d)
17
Pin
Pin-name
Pin-Function on
SK-FM-100PMCMB9BF516N
Pin
Pin-name
21
P3C/RTO02_0/TIOA2_1
SEG2-E
31
P44/TIOA4_0/RTO14_1/MAD00_0
22
P3D/RTO03_0/TIOA3_1
SEG2-F
32
P45/TIOA5_0/RTO15_1/MAD01_0
23
P3E/RTO04_0/TIOA4_1
SEG2-G
33
C
‘C’ capacitor
24
P3F/RTO05_0/TIOA5_1
SEG2-DP
34
VSS
GND
25
VSS
GND
35
VCC
MCUVCC
26
VCC
MCUVCC
36
P46/X0A
Subclock
(optional)
27
P40/TIOA0_0/RTO10_1/INT12_1
TINT TSC-Connector ‘INT12’
37
P47/X1A
Subclock
(optional)
28
P41/TIOA1_0/RTO11_1/INT13_1
GINT TSC-Connector ‘INT13’
38
INITX
Key button
‚Reset‘
29
P42/TIOA2_0/RTO12_1
39
P48/DTTI1X_1/INT14_1/SIN3_2/MAD02_
0
30
P43/TIOA3_0/RTO13_1/ADTG_7
40
P49/TIOB0_0/IC10_1/AIN0_1/SOT3_2/M
AD03_0
© 2015 Spansion Inc.
Pin-Function on
SK-FM-100PMCMB9BF516N
SDA3 TSCConnector
The Hardware
 The microcontroller pins (cont‘d)
18
Pin
Pin-name
Pin-Function on
SK-FM-100PMCMB9BF516N
Pin
Pin-name
Pin-Function on
SK-FM-100PMCMB9BF516N
41
P4A/TIOB1_0/IC11_1/BIN0_1/SCK3_2/
MAD04_0
SCL3 TSCConnector
51
VCC
MCUVCC
42
P4B/TIOB2_0/IC12_1/ZIN0_1/MAD05_0
52
P10/AN00
43
P4C/TIOB3_0/IC13_1/SCK7_1/AIN1_2/
MAD06_0
53
P11/AN01/SIN1_1/INT02_1/RX1_2/FRC
K0_2/MAD09_0
44
P4D/TIOB4_0/FRCK1_1/SOT7_1/BIN1_
2/MAD07_0
54
P12/AN02/SOT1_1/TX1_2/IC00_2/MAD1
0_0
45
P4E/TIOB5_0/INT06_2/SIN7_1/ZIN1_2/
MAD08_0
55
P13/AN03/SCK1_1/RTCCO_1/SUBOUT
_1/IC01_2/MAD11_0
46
PE0/MD1
GND
56
P14/AN04/SIN0_1/INT03_1/IC02_2/MAD
12_0
47
MD0
Mode-Switch S1
57
P15/AN05/SOT0_1/IC03_2/MAD13_0
48
PE2/X0
4 MHz Crystal
58
P16/AN06/SCK0_1/MAD14_0
49
PE3/X1
4 MHz Crystal
59
P17/AN07/SIN2_2/INT04_1/MAD15_0
50
VSS
GND
60
AVCC
© 2015 Spansion Inc.
MCUVCC
The Hardware
 The microcontroller pins (cont‘d)
19
Pin
Pin-name
Pin-Function on
SK-FM-100PMC MB9BF516N
Pin
Pin-name
61
AVRH
MCUVCC
71
P23/SCK0_0/TIOA7_1
62
AVSS
GND
72
P22/SOT0_0/TIOB7_1/ZIN1_1
UART0 (TXD)
63
P18/AN08/SOT2_2/MAD16_0
SEG1-A
73
P21/SIN0_0/INT06_1/BIN1_1
UART0 (RXD)
64
P19/AN09/SCK2_2/MAD17_0
SEG1-B
74
P20/INT05_0/CROUT_0/AIN1_1/MAD24
_0
Reset TSCConnector
65
P1A/AN10/SIN4_1/INT05_1/IC00_1/MAD
18_0
SEG1-C
75
VSS
GND
66
P1B/AN11/SOT4_1/IC01_1/MAD19_0
SEG1-D
76
VCC
MCUVCC
67
P1C/AN12/SCK4_1/IC02_1/MAD20_0
SEG1-E
77
P00/TRSTX/MCSX7_0
JTAG TRSTX
68
P1D/AN13/CTS4_1/IC03_1/MAD21_0
SEG1-F
78
P01/TCK/SWCLK
JTAG/TRACE
TCK
69
P1E/AN14/RTS4_1/DTTI0X_1/MAD22_0
SEG1-G
79
P02/TDI/MCSX6_0
JTAG/TRACE TDI
70
P1F/AN15/ADTG_5/FRCK0_1/MAD23_0
SEG1-DP
80
P03/TMS/SWDIO
JTAG/TRACE
TMS
© 2015 Spansion Inc.
Pin-Function on
SK-FM-100PMCMB9BF516N
The Hardware
 The microcontroller pins (cont‘d)
20
Pin
Pin-name
Pin-Function on
SK-FM-100PMCMB9BF516N
Pin
Pin-name
Pin-Function on
SK-FM-100PMCMB9BF516N
81
P04/TDO/SWO
JTAG/TRACE
TDO
91
P0E/CTS4_0/TIOB3_2/IC13_0/IC23_0/R
TO25_1/MDQM1_0
CTS4 Flow
control
82
P05/TRACED0/TIOA5_2/SIN4_2/INT00_
1/MCSX5_0
TRACE
TRACED0
92
P0F/NMIX/CROUT_1/RTCCO_0/DTTI2X
_0/DTTI2X_1/SUBOUT_0
83
P06/TRACED1/TIOB5_2/SOT4_2/INT01
_1/AIN2_1/MCSX4_0
TRACE
TRACED1
93
P63/INT03_0/SIN5_1/RX0_2/MWEX_0
USB-Switch
Device/Host
84
P07/TRACED2/ADTG_0/SCK4_2/BIN2_
1/MCLKOUT_0
TRACE
TRACED2
94
P62/SCK5_0/ADTG_3/TX0_2/MOEX_0
Current limitation enable
85
P08/TRACED3/TIOA0_2/CTS4_2/ZIN2_1
/MCSX3_0
TRACE
TRACED3
95
P61/SOT5_0/TIOB2_2/UHCONX
USB UHCONX
86
P09/TRACECLK/TIOB0_2/RTS4_2/RTO
20_1/MCSX2_0
TRACE
TRACECLK
96
P60/SIN5_0/TIOA2_2/INT15_1/MRDY_0
Mode-Switch S1
87
P0A/SIN4_0/INT00_2/FRCK1_0/FRCK2_
0/RTO21_1/MCSX1_0
UART4 (RXD)
97
USBVCC
USB-power
supply
88
P0B/SOT4_0/TIOB6_1/IC10_0/IC20_0/R
TO22_1/MCSX0_0
UART4 (TXD)
98
P80/UDM0
USB Data-
89
P0C/SCK4_0/TIOA6_1/IC11_0/IC21_0/R
TO23_1/MALE_0
99
P81/UDP0
USB Data+
90
P0D/RTS4_0/TIOA3_2/IC12_0/IC22_0/R
TO24_1/MDQM0_0
100
VSS
GND
© 2015 Spansion Inc.
RTS4 Flow
control
The Software
 The SK-FM3-100PMC-MB9BF516N 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 Wizward‘
− Software examples for the SK-FM3-100PMC-MB9BF516N
 Please check our dedicated microcontroller website:
− for updates of the Flash programmer tool, utilities and examples
− for data sheets, hardware manuals, application notes, etc.
21
© 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!
22
© 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-100PMC-MB9BF516N
for IAR Embedded Workbench V6 and KEIL µVision4:
− mb9bf51xn_template ‚Empty‘ project as base for user applications
− mb9bf51xn_adc_dvm Digital Voltage Meter based on the A/D-converter
− mb9bf51xn_can_uart_terminal Simple CAN example (CAN0)
− mb9bf51xn_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!
23
© 2015 Spansion Inc.
Flash Programming
 There are two 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
24
© 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
MB9BF516
25
© 2015 Spansion Inc.
Program Download
 Start the FLASH MCU Programmer
 Select the target microcontroller (MB9BF516[N/R])
 Select the crystal frequency (4 MHz)
 Choose the software example from the example ‘exe‘-folder
(e.g. Examples\mb9bfxxx_ioport_counter-v11\example\IAR\output\release\exe\
mb9bfxxx_ioport_counter.srec)
26
© 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‘
SK-FM3-100PMC-MB9BF516N
 Press ‚Reset‘
 Start ‚Full Operation‘
27
© 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
SK-FM3-100PMC-MB9BF516N
Keybutton ‚RESET‘
Close the FLASH MCU
Programmer
28
© 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
29
© 2015 Spansion Inc.
Program Download
 Start the FLASH USB DIRECT Programmer
 Select the target microcontroller (MB9BF516)
 Choose the software example from the example ‘exe‘-folder
(e.g. Examples\mb9bfxxx_ioport_counter-v10\example\IAR\output\release\exe\
mb9bfxxx_ioport_counter.srec)
 Select the COM port
30
© 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\..
SK-FM3-100PMC-MB9BF516N
S1: Mode selection
..FLASH USB DIRECT Programmer\driver
Press ‘Reset‘ and Start ‘Full Operation‘
31
© 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
SK-FM3-100PMC-MB9BF516N
Keybutton ‚RESET‘
Close the FLASH USB
DIRECT Programmer
32
© 2015 Spansion Inc.
Debugging via JTAG
 The MB9BF516N microcontroller offers a JTAG-Interface
that is supported by SK-FM3-100PMC-MB9BF516N.
− 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:
33
© 2015 Spansion Inc.
Debugging via TRACE
 The MB9BF516N microcontroller offers an ETM (Embedded-TraceMacrocell) that is supported by SK-FM3-100PMC-MB9BF516N
− An optional JTAG-Adapter supporting trace features is required e.g.
ULINKpro from KEIL
− The ETM is connected to the 20-Pin-Header X11 (TRACE)
− Use e.g. KEIL µVision to trace your program
34
© 2015 Spansion Inc.
IAR Embedded Workbench
 Installation
 Getting Started
 Open Project
 Build Project
 Debug Project
35
© 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>\Examples\mb9b510n_ioport_counter_v11\example\IAR\
− Choose mb9b510n_ioport_counter.eww
36
© 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 ‚mb9bf56xr_template’
37
© 2015 Spansion Inc.
IAR Workbench – Menu Bar
 IAR Menu Bar
File Control
(new, open,
save, etc.)
38
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
39
© 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
40
© 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
41
© 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
42
© 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
43
© 2015 Spansion Inc.
IAR Workbench – Simulator
 Simulator
− Mark Project File in Workspace
− Choose Project→Options
− Choose Simulator in Debugger Setup
− Start Simulator with usual
44
© 2015 Spansion Inc.
Icon
KEIL µVision
 Installation
 Getting Started
 Open Project
 Build Project
 Debug Project
45
© 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
46
© 2015 Spansion Inc.
KEIL µVision – Getting Started
 Choose Menu: Project→Open Project...
− Browse to: <drive:>\<board>\Examples\mb9b510n_adc_dvm-v11\example\ARM\
− Choose mb9b510n_adc_dvm.uvproj
47
© 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
48
© 2015 Spansion Inc.
KEIL µVision – Menu Bars (1)
 Menu Bar 1
− Can be moved in bar window area or set floating
49
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
MB9BF51x Release
Download
to Target
50
© 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
51
© 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
52
© 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
53
© 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
54
© 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 )
55
© 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 ( )
56
© 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
57
© 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
58
© 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
59
© 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
60
© 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
61
© 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
62
© 2015 Spansion Inc.
Solutions
63
© 2015 Spansion Inc.
Products
64
© 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.
65
© 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
66
© 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)
67
© 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
68
© 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
69
© 2015 Spansion Inc.
Finally
70
© 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
71
© 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]
72
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
73
© 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.
74
© 2015 Spansion Inc.