Nuvoton NuTiny-SDK-MS51FB User manual

  • Hello! I am an AI chatbot trained to assist you with the Nuvoton NuTiny-SDK-MS51FB User manual. I’ve already reviewed the document and can help you find the information you need or explain it in simple terms. Just ask your questions, and providing more details will help me assist you more effectively!
NuTiny-MS51EB
Jan 29, 2019 Page 1 of 16 Rev 1.00
NUTINY-MS51FB USER MANUAL
1T 8051
8-bit Microcontroller
NuTiny-MS51FB
User Manual
NuMicro® 8051 Series
The information described in this document is the exclusive intellectual property of
Nuvoton Technology Corporation and shall not be reproduced without permission from Nuvoton.
Nuvoton is providing this document only for reference purposes of NuMicro microcontroller based system
design. Nuvoton assumes no responsibility for errors or omissions.
All data and specifications are subject to change without notice.
For additional information or questions, please contact: Nuvoton Technology Corporation.
www.nuvoton.com
NuTiny-MS51EB
Jan 29, 2019 Page 2 of 16 Rev 1.00
NUTINY-MS51FB USER MANUAL
Table of Contents
1 OVERVIEW ......................................................................................... 3
2 NUTINY-MS51FB INTRODUCTION ............................................................ 4
Virtual COM Port Switch Description ............................................................... 4 2.1
NuTiny-MS51FB Power Setting and Connector .................................................. 4 2.2
2.2.1 Power Setting ................................................................................................... 4
2.2.2 Debug Connector ............................................................................................... 5
2.2.3 ICE USB Connector ............................................................................................ 5
2.2.4 Extended Connector ........................................................................................... 5
2.2.5 Reset Button ..................................................................................................... 5
2.2.6 Power Connector ............................................................................................... 5
2.2.7 Virtual COM Port Function Switch ........................................................................... 5
Pin Assignment for Extended Connector .......................................................... 6 2.3
3 HOW TO START NUTINY-MS51FB ON THE KEIL .......................................... 7
Downloading and Installing Keil C-51 μVision® IDE Software .................................. 7 3.1
Downloading and Installing Nuvoton Nu-Link Driver ............................................. 7 3.2
Hardware Setup ........................................................................................ 7 3.3
Example Program ...................................................................................... 7 3.4
4 NUTINY-MS51FB SCHEMATIC ............................................................... 10
Nu-Link-Me Schematic ............................................................................... 10 4.1
NuTiny-MS51FB Schematic ......................................................................... 11 4.2
NuTiny-MS51FB Connector ......................................................................... 12 4.3
5 DOWNLOAD RELATED FILES FROM NUVOTON WEBSITE ........................... 13
Downloading Nuvoton Keil C-51 μVision® IDE Driver ........................................... 13 5.1
Downloading Nuvoton 8bit 8051 MCUs MS51 Series Sample Code ......................... 14
5.2
6 REVISION HISTORY ............................................................................ 15
NuTiny-MS51EB
Jan 29, 2019 Page 3 of 16 Rev 1.00
NUTINY-MS51FB USER MANUAL
1 OVERVIEW
NuTiny-MS51FB is the specific development tool for 8-bit high performance 1T 8051-based
microcontroller MS51 16K flash size series. User can use NuTiny-MS51FB to develop and verify
the application program easily.
The MS51 contains a up to 16K Bytes of main Flash called APROM, in which the contents of User
Code resides. The MS51 Flash supports In-Application-Programming (IAP) function, which
enables on-chip firmware updates. IAP also makes it possible to configure any block of User
Code array to be used as non-volatile data storage, which is written by IAP and read by IAP or
MOVC instruction, this function means whole 16K Bytes area all can be use as Data Flash
through IAP command. MS51 support an function of configurationable Flash from APROM called
LDROM, in which the Boot Code normally resides for carrying out In-System-Programming (ISP).
The LDROM size is configurable with a maximum of 4K Bytes by CONFIG define. There is an
additional include special 128 bytes security protection memory (SPROM) to enhance the security
and protection of customer application. To facilitate programming and verification, the Flash
allows to be programmed and read electronically by parallel Writer or In-Circuit-Programming
(ICP). Once the code is confirmed, user can lock the code for security.
The MS51 provides rich peripherals including 256 Bytes of SRAM, 1K Bytes of auxiliary RAM
(XRAM), Up to 18 general purpose I/O, two 16-bit Timers/Counters 0/1, one 16-bit Timer2 with
three-channel input capture module, one Watchdog Timer (WDT), one Self Wake-up Timer
(WKT), one 16-bit auto-reload Timer3 for general purpose or baud rate generator, two UARTs
with frame error detection and automatic address recognition, one SPI, one I2C, five enhanced
PWM output channels, eight-channel shared pin interrupt for all I/O, and one 12-bit ADC. The
peripherals are equipped with 18 sources with 4-level-priority interrupts capability.
The MS51 is equipped with three clock sources and supports switching on-the-fly via software.
The three clock sources include external clock input, 10 kHz internal oscillator, and one 16 MHz
internal precise oscillator that is factory trimmed to ±1% at room temperature. The MS51 provides
additional power monitoring detection such as power-on reset and 4-level brown-out detection,
which stabilizes the power-on/off sequence for a high reliability system design.
The MS51 microcontroller operation consumes a very low power with two economic power modes
to reduce power consumption Idle and Power-down mode, which are software selectable. Idle
mode turns off the CPU clock but allows continuing peripheral operation. Power-down mode stops
the whole system clock for minimum power consumption. The system clock of the MS51 can also
be slowed down by software clock divider, which allows for a flexibility between execution
performance and power consumption.
With high performance CPU core and rich well-designed peripherals, the MS51 benefits to meet a
general purpose, home appliances, or motor control system accomplishment.
NuTiny-MS51EB
Jan 29, 2019 Page 4 of 16 Rev 1.00
NUTINY-MS51FB USER MANUAL
2 NUTINY-MS51FB INTRODUCTION
NuTiny-MS51FB uses the MS51FB9AEas the target microcontroller. Figure 2.1-1 is NuTiny-
MS51FB for the MS51 16K flash size series, the left portion is called NuTiny-MS51FB and the
right portion is Debug Adaptor called Nu-Link-Me.
NuTiny-MS51FB is similar to other development boards. User can use it to develop and verify
applications to emulate the real behavior. The on-board chip covers MS51 series features. The
NuTiny-MS51FB can be a real system controller to design users target systems.
Nu-Link-Me is a Debug Adaptor. The Nu-Link-Me Debug Adaptor connects your PC's USB port to
the users target system (via Serial Wired Debug Port) and allows user to program and debug
embedded programs on the target hardware. To use Nu-Link-Me Debug adaptor with Keil, please
refer to Nuvoton Nu-Link debug adapter user manual” in detail. This document will be stored in
the local hard disk when user installs each driver. Nu-Link-Me also supports virtual COM port
function. User can use Nu-Link-Me as a USB to UART virtual COM port, which connects to on-
board MS51FB9AE UART0.
ICE Controller
Extended Connector
Reset Key
Power LED
USB Connector
VDD
VSS
GPIO LED
MS51FB9AE
Extended Connector
Virtual COM
Enable Switch
Power Select
Connector
5V or 3.3V
VSS
VDD
Figure 2.1-1 NuTiny-MS51FB (PCB Board)
Virtual COM Port Switch Description 2.1 The switch in Nu-Link-Me, SW3, determines that the virtual COM port function is enabled or
disabled. When user turns on all of the positions of switch, the virtual COM port function will be
enabled. By using virtual COM port function, user can access the USB device in the same way as
it would access a standard COM port to MS51FB9AEUART0 (P3.1 and P3.0) . To use this
function, user needs to install “VCOM Driver” at first. User can get Nuvoton USB driver from
NuMicroDVD www.nuvoton.com\NuMicroDVD in folder “Software Utilities” or from website:
Nu-Link_USB_Driver
NuTiny-MS51FB Power Setting and Connector 2.2
2.2.1 Power Setting
J1: USB port in Nu-Link-Me
JP7 and JP9: VCC33 Voltage connector in NuTiny-MS51FB
NuTiny-MS51EB
Jan 29, 2019 Page 5 of 16 Rev 1.00
NUTINY-MS51FB USER MANUAL
Model
JPR1
J1USB port
JP7 & JP9 VCC33
Model 1
Select VCC33
(default)
Connect to PC
DC 3.3V output
Model 2
X
X
DC 2.4 V ~ 5.5 V
Input
2.2.2 Debug Connector
JP4: Connector in target board (NuTiny-MS51FB) for connecting with Nuvoton ICE adaptor
(Nu-Link-Me)
JP2: Connector in ICE adaptor (Nu-Link-Me) for connecting with a target board (for
example NuTiny-MS51FB)
2.2.3 ICE USB Connector
J1: Mini USB Connector in Nu-Link-Me connected to a PC USB port
2.2.4 Extended Connector
JP5 and JP6: Show all chip pins in NuTiny-MS51FB
2.2.5 Reset Button
SW1: Reset button in NuTiny-MS51FB
2.2.6 Power Connector
JP7 and JP9: VDD connector in NuTiny-MS51FB
JP8 and JP10: VSS connector in NuTiny-MS51FB
2.2.7 Virtual COM Port Function Switch
SW3: Switch ON/OFF to enable or disable Nu-Link-Me virtual COM port function.
Function
Switch
Descriptions
1
2
3
4
Enable
ON
ON
ON
ON
Enable Nu-Link-Me virtual
COM port function
Disable
OFF
OFF
OFF
OFF
Disable Nu-Link-Me virtual
COM port function
NuTiny-MS51EB
Jan 29, 2019 Page 6 of 16 Rev 1.00
NUTINY-MS51FB USER MANUAL
Pin Assignment for Extended Connector 2.3 NuTiny-MS51FB provides MS51FB9AE on board and the extended connector for TSSOP-20 pin.
Error! Reference source not found.Table is the pin assignment for MS51FB9AE.
Pin No
Pin Function
Pin No
Pin Function
01
PWM2/IC6/T0/AIN4/P0.5
11
P1.4/SDA/FB/PWM1
02
TXD/AIN3/P0.6
12
P1.3/SCL/[STADC]
03
RXD/AIN2/P0.7
13
P1.2/PWM0/IC0
04
RST/P2.0
14
P1.1/PWM1/IC1/AIN7/CLO
05
INT0/OSCIN/AIN1/P3.0
15
P1.0/PWM2/IC2/SPCLK
06
INT1/AIN0/P1.7
16
P0.0/PWM3/IC3/MOSI/T1
07
GND
17
P0.1/PWM4/IC4/MISO
08
[SDA]/TXD_1/ICPDA/OCDDA/P1.6
18
P0.2/ICPCK/OCDCK/RXD_1/[SCL]
09
VDD
19
P0.3/PWM5/IC5/AIN6
10
PWM5/IC7/SS/P1.5
20
P0.4/AIN5/STADC/PWM3/IC3
Table 2.3-1 Pin Assignment for MS51FB9AE
NuTiny-MS51EB
Jan 29, 2019 Page 7 of 16 Rev 1.00
NUTINY-MS51FB USER MANUAL
3 HOW TO START NUTINY-MS51FB ON THE KEIL
Downloading and Installing Keil C-51 μVision® IDE Software 3.1 Please connect to the Keil company website (http://www.keil.com) to download the Keil C-51
μVision® IDE and install the RVMDK.
Downloading and Installing Nuvoton Nu-Link Driver 3.2 Please connect to Nuvoton 8bit 8051 MCUs website (http://www.nuvoton.com/8bit-8051-mcus) to
download the “Nu-Link_Keil_Driver” file. Please refer to section 5.1 for the detailed download flow.
After the Nu-Link driver is downloaded, please unzip the file and execute the file to install the
driver.
Hardware Setup 3.3 The hardware setup is shown as Figure 3.3-1
Figure 3.3-1 NuTiny-MS51FB Hardware Setup
Example Program 3.4 This example demonstrates the ease of downloading and debugging an application on a NuTiny-
MS51FB board. It can be found on Figure 3.4-1 list directory and downloaded from Nuvoton 8bit
8051 MCUs website.
The example file can be found in the directory list shown in Figure 3.4-1.
NuTiny-MS51EB
Jan 29, 2019 Page 8 of 16 Rev 1.00
NUTINY-MS51FB USER MANUAL
Directory
Figure 3.4-1 Example Directory
To use this example:
1. Open a project from the MS51 sample code installation folder (default as C:\Nuvoton) using
the following path
\SampleCode\StdDriver\GPIO_InputOutput\KEIL\
2. Execute “GPIO.uvproj
Enter compile mode interface
3. Compiler
4. Download the program code to Flash
5. Enter / Exit Debug mode
3
4
5
NuTiny-MS51EB
Jan 29, 2019 Page 9 of 16 Rev 1.00
NUTINY-MS51FB USER MANUAL
Enter Debug mode interface
6. Execute the program
7. The I/O LED on the NuTiny-MS51FB board will be toggled on.
6
NuTiny-MS51EB
Jan 29, 2019 Page 10 of 16 Rev 1.00
NUTINY-MS51FB USER MANUAL
4 NUTINY-MS51FB SCHEMATIC
Nu-Link-Me Schematic 4.1
N12
12M Oscillators
ISPLED
RED
ICELED
GREEN
ICEDAT
ICE_RST
ICECLK
VCC_connect
RXD
SWD connect
TXD
NUC_RST#
ICE_USB
RXD
ICERST
RESET
power switch
ICE_CLK
ICE_RST
ICE_DAT
ICE_TX
ICE_TX Title
Size Document Number Rev
Date: Sheet of
13.0
Nu-Link-Me
A4
1 3Monday, June 25, 2018
5V
ICE CONNECT IF
DEBUG
TXD
RP1
8P4R-330
1 2
3 4
5 6
7 8
1 2
PD1
SS24A
RTDA1
100K
C5
0.1u
SW3
SW DIP-4/SM(EHS104LD)
R1
33
JPR1
1&2 (0 ohm)
1
2
3
C4
1uF/16V
12
ICERST
UP1
AMS1117_3.3v
IN
3
GND
1
OUT
2
OUT
4
R4
10K
R6
33
RTCK1
100K
12 ICP1
YELLOW
C7 20p
J1
MICRO USB 5P
母座
AB-ty pe R/A SMT P/N:2290536250
GND
5NC
4DP
3DM
2VCC
1SHIELD 6
SHIELD 7
SHIELD 8
SHIELD 9
C3 20p
12 IDLE1
RED
CB1
0.1u
ICE_RX
12M_I
12 ICE1
RED
RTDA333
CP1
10uF/10V
12
R3 33
1 2
D1 SS24A
JP3
NC
1
2
3
4
12 BUSY1
GREEN
L2FERRITE BEAD
X2
12MHz
L3FERRITE BEAD
U1
NUC12SRE3DE
PA0/ADC0 44
PA1/ADC1 45
PA2/ADC2 46
PA3/ADC3 47
PA4/ADC4 48
INT0/PB14
1
CPO1/PB13
2
CPO0/PB12
3
VBUS
17
VDD33
18
D-
19
D+
20
PB0/RX0
21
PB1/TX0
22
PB2/RTS0
23
PB3/CTS0
24
PC2/SDI00
26
PC1/SPCLK0
27
PC0/SS00
28
PC11/SDO10 33
PC10/SDI10 34
PC9/SPCLK1 35
PC8/SS10 36
PA15/PWM3 37
PA14/PWM2 38
PA13/PWM1 39
X32I
4
X32O
5
I2C1SCL/PA11
6
I2C0SDA/PA8
9I2C1SDA/PA10
7
I2C0SCL/PA9
8
RX1/PB4
10
TX1/PB5
11
RTS1/PB6
12
CTS1/PB7
13
PC3/SDO00
25
AVSS 43
ICE_CLK 42
ICE_DAT 41
PA12/PWM0 40
LDO
14
VSS
16 VDD
15
ADC/PA5 49
ADC6/PA6 50
ADC7/PA7 51
AVDD 52
CPN0/PC7 53
CPP0/PC6 54
CPN1/PC15 55
CPP1/PC14 56
INT1/PB15 57
XT1_Out 58
XT1_In 59
/RESET 60
VSS1 61
VDD1 62
PVSS 63
STADC/TM0/PB8 64
PE5
29
PB11/TM3
30
PB10/SS01/TM2
31
PB9/SS11/TM1
32
RTDA20
C8
10uF/10V
12
C6
1u
JP6
NC
1 2
3 4
5 6
7 8
910
JP1
NC
1
2
3
4
5
L4
FERRITE BEAD
RRSET1
100K
VCC
VCC
VCC
VCC
VCC
ADAVSS
USBVBUS
ICE_AVDD
VCC
5V
USBVBUS
ICE_AVDD
ADAVSS
USBVBUS
VCC 3.3V
VCC
VCC
GND
VCC
USBVBUS
VCC
12M_O
ICE_RX
VCC_connect
DM
ICECLK
DP
VCOM_pin
ICE_RX
ICE_TX
ICECLK
DM
DP
12M_I
PVSS
NUC_RST#
12M_O
ISPLED
RED
GREEN
ICELED
VBUS
USB_D+
USB_D-
ICERST
VCC_connect
ICE_CLK
ICE_DAT
TICEDAT
TICECLK
TICERST
MCU_TXD
MCU_RXD
N13
ICEDAT
ICEDAT
3.3V
VCOM_pin
ICE_Status
VCOM switch
USB_D-
USB_D+
NuTiny-MS51EB
Jan 29, 2019 Page 11 of 16 Rev 1.00
NUTINY-MS51FB USER MANUAL
NuTiny-MS51FB Schematic 4.2
VDD
Tiny_RX
Tiny_TX
TICEDAT
GND
TICECLK
TICEDAT
VDD
VDD
Tiny_RX
Tiny_TX
Of f- page Connector
TICERST TICERST
TICECLK
P[1:20]
P[1:20]
C8
10uF/10V
12
C9
0.1u
JP5
NC
1 2
3 4
5 6
7 8
910
11 12
13 14
15 16
17 18
19 20
P3
P2
P1
P8
P7
P6
P5
P4
P10
P9
P17
P18
P19
P20
P13
P14
P15
P16
P12
P11
JP6
NC
1 2
3 4
5 6
7 8
910
11 12
13 14
15 16
17 18
19 20
Title
Size Document Number Rev
Date: Sheet of
21.1
SDK Circuit
A4
210Tuesday, August 30, 2016
P6
P5
P4
P3
P2
P1
P10
P9
P8
P7
R8
10K
C14
10uF/10V
12
SW1
PUSH BOTTOM (B)
12
GPIO1 RED
LED1 N3 R9
1K
VDD
N1 R10
1K
12
POWER1GREEN
P16
P18
P17
P19
P11
P12
P13
P14
P15
P20
P1
VDD
VDD
TICERST
TICEDAT
JP4
1 2
3 4
5 6
7 8
910
Debug Interface & Off Page
Tiny_TX TICECLK VCC_connect
Tiny_RX
Power
VDD
VDD
P2Tiny_TX
P5
P4TICERST P3Tiny_RX
P8TICEDAT P7
P6
P10
P9
JP7
NC
1
2
3
4
5
VDD
JP8
NC
1
2
3
4
5
JP10
NC
SIP-2P
1
2
JP9
NC
SIP-2P
1
2
VDD
MS51FB9AE
U3
MS51 TSSOP20
P0.6/AIN3/TXD
2
P0.7/AIN2/RXD
3
P2.0/RST
4
P3.0/AIN1/OSCIN/INT0
5
P1.7/AIN0/INT1
6
GND
7
P1.6/OCDDA/ICPDA/TXD_1/[SDA]
8
VDD
9
P1.5/SS/IC7/PWM5
10 PWM1/FB/SDA/P1.4 11
AIN6/IC5/PWM5/P0.3 19
IC3/PWM3/STADC/AIN5/P0.4 20
[STADC]/SCL/P1.3 12
IC0/PWM0/P1.2 13
CLO/AIN7/IC1/PWM1/P1.1 14
SPCLK/IC2/PWM2/P1.0 15
T1/MOSI/IC3/PWM3/P0.0 16
MISO/IC4/PWM4/P0.1 17
[SCL]/RXD_1/OCDCK/ICPCK/P0.2 18
P0.5/AIN4/T0/IC6/PWM2
1
LED
GPIO
P11
P14
P13 LED1
P16
P17
P18 TICECLK
P19
P20
P15
Reset
P12
TICERST
NuTiny-MS51EB
Jan 29, 2019 Page 12 of 16 Rev 1.00
NUTINY-MS51FB USER MANUAL
NuTiny-MS51FB Connector 4.3
JP2
HEADER 8X2
1 2
3 4
5 6
7 8
910
11 12
13 14
15 16
JP4
HEADER 8X2
1 2
3 4
5 6
7 8
910
11 12
13 14
15 16
JP7
HEADER 8X2
1 2
3 4
5 6
7 8
910
11 12
13 14
15 16
JP5
HEADER 8X2
1 2
3 4
5 6
7 8
910
11 12
13 14
15 16
Title
Size Document Number Rev
Date: Sheet of
ML51PC0AE Target board
v1.0
Ext. Connector
A
3 3Monday, June 25, 2018
VDD / GND Header
J2
HEADER 2x2
1
2
3
4
PB.4
PB.3
PB.2
PB.0
PB.1
PF.5
PF.4
J5
HEADER 2x2
1
2
3
4
VDD
PB.4
PB.3
PB.2
PB.0
PB.1
PF.5
PF.4
PB.5
P9 - P16
P1 - P8 P17 - P24
P25 - P32
PA.2
PA.3
nRESET
PA.1
PF.15
PF.3
PF.2
PA.0
PA.2
PA.3
nRESET
PA.1
PF.15
PF.3
PF.2
PA.0
PB.5
PA.13
PA.15
PA.12
PA.14
PB.14
PB.15
PB.13
PB.12
VDD
External Connector
PA.13
PA.15
PA.12
PA.14
PF.0
PF.1
PC.1
PC.0
PB.14
PB.15
PB.13
PB.12
VDD
GND
LDO_CAP
AVDD
PF.0
PF.1
PC.1
PC.0
GND
LDO_CAP
AVDD
NuTiny-MS51EB
Jan 29, 2019 Page 13 of 16 Rev 1.00
NUTINY-MS51FB USER MANUAL
5 DOWNLOAD RELATED FILES FROM NUVOTON WEBSITE
Downloading Nuvoton Keil C-51 μVision® IDE Driver 5.1
Step1
Visit the Nuvoton 8bit 8051 MCUs website: http://www.nuvoton.com/8bit-8051-mcus
Step2
Step3
Step4
Download the Nuvoton_Keil_ Drive
3. Click here to
download
NuTiny-MS51EB
Jan 29, 2019 Page 14 of 16 Rev 1.00
NUTINY-MS51FB USER MANUAL
Downloading Nuvoton 8bit 8051 MCUs MS51 Series Sample Code 5.2
Step1
Visit the Nuvoton 8bit 8051 MCUs website: http://www.nuvoton.com/8bit-8051-mcus
Step2
Step3
Download the MS51_16KBSP_KEIL_V1.00
NuTiny-MS51EB
Jan 29, 2019 Page 15 of 16 Rev 1.00
NUTINY-MS51FB USER MANUAL
6 REVISION HISTORY
Date
Revision
Description
2019.01.29
1.00
Initial release
NuTiny-MS51EB
Jan 29, 2019 Page 16 of 16 Rev 1.00
NUTINY-MS51FB USER MANUAL
Important Notice
Nuvoton Products are neither intended nor warranted for usage in systems or equipment, any
malfunction or failure of which may cause loss of human life, bodily injury or severe property
damage. Such applications are deemed, “Insecure Usage”.
Insecure usage includes, but is not limited to: equipment for surgical implementation, atomic
energy control instruments, airplane or spaceship instruments, the control or operation of
dynamic, brake or safety systems designed for vehicular use, traffic signal instruments, all
types of safety devices, and other applications intended to support or sustain life.
All Insecure Usage shall be made at customer’s risk, and in the event that third parties lay
claims to Nuvoton as a result of customer’s Insecure Usage, customer shall indemnify the
damages and liabilities thus incurred by Nuvoton.
/