Arduino Mar 20, 2015 Page 1 of 17 Rev 1.01 ARDUINO USER MANUAL ARM ® Cortex ® -M 32-bit Microcontroller Arduino User Manual for NuMicro ™ MCU 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
17
Embed
Arduino User Manual - Thaieasyelec4)UserGuide_NuMicr… · Arduino Mar 20, 2015 Page 3 of 17 Rev 1.01 L 1 OVERVIEW Arduino is an open-source electronics platform based on easy-to-use
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Arduino
Mar 20, 2015 Page 1 of 17 Rev 1.01
AR
DU
INO
US
ER
MA
NU
AL
ARM® Cortex
®-M
32-bit Microcontroller
Arduino User Manual for NuMicro™ MCU 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.
6 Revision History .................................................................................. 16
Arduino
Mar 20, 2015 Page 3 of 17 Rev 1.01
AR
DU
INO
US
ER
MA
NU
AL
1 OVERVIEW
Arduino is an open-source electronics platform based on easy-to-use hardware and software.
The NuMicroTM
NuEdu Evaluation Board is an Arduino compatible hardware using NuMicro MCU as the microcontroller. Its function can be extended with Arduino add-ons. Users can use Arduino IDE to develop their applications and leverage large number of open source samples.
Figure 1-1 NuMicro NuEdu Board with Different Add-ons
The next chapter introduces the steps to install Arduino IDE and apply patch to support NuMicro NuEdu Evaluation Board.
Arduino
Mar 20, 2015 Page 4 of 17 Rev 1.01
AR
DU
INO
US
ER
MA
NU
AL
2 ARDUINO IDE INSTALLATION
Please follow the steps below to install Arduino 1.5.8 IDE and apply patch to support NuMicro MCU. Refer to Arduino official website for the usage of Arduino IDE.
1. Download Arduino 1.5.8 IDE from http://arduino.cc/en/Main/OldSoftwareReleases
Figure 2-1 Download Arduino 1.5.8
2. Extract arduino-1.5.8-windows.zip to the installation path.
3. Double-click NuMicro Arduino patch (NuMicro_Patch_For_Arduino1.5.8.exe), and input the Arduino 1.5.8 installation path.
Figure 2-3 Install NuMicro Arduino Patch
4. After successfully applying the patch, five board names NuEdu-M451, NuEdu-NUC240, NuEdu-NANO130, NuEdu-NUC131, and NuMaker-TRIO can be found in Arduino IDE as shown in the figure below.
Figure 2-4 Installation Complete
Arduino
Mar 20, 2015 Page 6 of 17 Rev 1.01
AR
DU
INO
US
ER
MA
NU
AL
3 HARDWARE SETUP
The Arduino IDE consists of source code editor, project build tool and also supports firmware download and UART debug function. To download firmware to NuEdu evaluation board, PC must be connected with the on-board Nu-Link Me using USB cable. The NuEdu Evaluation Board can print out debug message through the USB virtual COM (VCOM) interface.
Figure 3-1 NuEdu-UNO Hardware Setup
Figure 3-2 USB Connection on NuEdu-UNO
Arduino
Mar 20, 2015 Page 7 of 17 Rev 1.01
AR
DU
INO
US
ER
MA
NU
AL
The VCOM function can be used in Arduino IDE, Keil and IAR. To enable VCOM function on Nu-Link Me, all SW2 pins need to turn to ON position. Otherwise, turn pin2~4 to OFF position. For the usage of different NuEdu Evaluation Boards, please refer to the user manual respectively.
Figure 3-3 Switch Default as UART Mode
Pin Number Pin Name Disable VCOM Mode
Enable VCOM Mode
1 ICE_VCC On On
2 VCOM_Open Off On
3 VCOM_TX Off On
4 VCOM_RX Off On
Arduino
Mar 20, 2015 Page 8 of 17 Rev 1.01
AR
DU
INO
US
ER
MA
NU
AL
4 NUEDU EVALUATION BOARD PIN OUT
This chapter shows the pin out of different NuEdu Evaluation Boards.
NuEdu-M451 Board 4.1
NuEdu-EVB-M451
NU1NU2NU3
NU4 NU5 NU6
NU7
NU8*
ADC
(0~7)
I2C0UART
(1~3)I2C1UART0
SPI2
SPI2
I2S
PWM
(0~5)PWM
(6~7)
TIMER
SPI0
UART1
VIN
CLKO
INT0
POWER
TM1_OUT
TM0_CAP
VD
D
3V
CC
5V
CC
VS
S
VS
S
RE
SE
T
GPIO
GPIO
SMBus
VCC
VSS
CAN0
POWER
VS
S
VR
EF
NC
80 79
1 2 3 4 5 6 70 8 9 10 11 12 13 14 15
16171819202122232425262728293031
32 33 34 35 36 37 38 39
40
4142
4344
78 77
76 75
74 73
72 71
70 69
6768
66 65
64 63
62 61
60 59
56
58
54
52
50
48
46
INT1
ACMP
ADC
(8~10)DA
C0
SM
AR
T C
AR
D
NC
GPIO
GP
IO
NC
RESET
SPI2
NC
Figure 4-1 NuEdu-M451 Pin Out
Arduino
Mar 20, 2015 Page 9 of 17 Rev 1.01
AR
DU
INO
US
ER
MA
NU
AL
NuEdu-NUC240 Board 4.2
NuEdu-EVB-NUC240
NU1NU2NU3
NU4 NU5 NU6
NU7
NU8*
ADC
(0~7)
I2C0UART
(1~2)I2C1UART0
SPI2
SPI2
I2S
PWM
(0~5)PWM
(6~7)
TIMER
SPI1 UART1
VIN
CLKO
INT0
POWER
TM1_OUT
TM0_CAP
VD
D
3V
CC
5V
CC
VS
S
VS
S
RE
SE
T
GPIO
GPIO
SMBus
VCC
VSS RESET
CAN
POWER
VS
S
VR
EF
NC
80 79
1 2 3 4 5 6 70 8 9 10 11 12 13 14 15
16171819202122232425262728293031
32 33 34 35 36 37 38 39
SPI240
4142
4344
78 77
76 75
74 73
72 71
70 69
6768
66 65
64 63
62 61
60 59
57
56
58
55
54 53
52 51
50 49
48 47
46 45
INT1
ACMP
GPIO GPIO
GPIO
GPIO
Figure 4-2 NuEdu-NUC240 Pin Out
Arduino
Mar 20, 2015 Page 10 of 17 Rev 1.01
AR
DU
INO
US
ER
MA
NU
AL
NuEdu-NANO130 Board 4.3
NuEdu-EVB-Nano130
NU1NU2NU3
NU4 NU5 NU6
NU7
NU8*
ADC
(0~7)
ADC
(8~9)
DAC
(0~1)
I2C0 UART1 I2C1UART0
SPI0
SPI0
I2S
PWM
(0~5)PWM
(6~7)
TIMER
SPI1
SM
AR
T C
AR
D
UART1
VIN
CLKO
INT0
POWER
TM1_OUT
TM0_CAP
VD
D
3V
CC
5V
CC
VS
S
VS
S
RE
SE
T
GPIO
GPIO
GPIO
GPIO
GPIO
GPIO
GPIO
VCC
VSS RESET
GPIOGPIO
GPIO
POWER
VS
S
VR
EF
NC
80 79
1 2 3 4 5 6 70 8 9 10 11 12 13 14 15
16171819202122232425262728293031
32 33 34 35 36 37 38 39
SPI040
4142
4344
78 77
76 75
74 73
72 71
70 69
6768
66 65
64 63
62 61
60 59
57
56
58
55
54 53
52 51
50 49
48 47
46 45
Figure 4-3 NuEdu-NANO130 Pin Out
Arduino
Mar 20, 2015 Page 11 of 17 Rev 1.01
AR
DU
INO
US
ER
MA
NU
AL
NuEdu-UNO Board 4.4
NuEdu-UNO
VIN
RESET
AD
C_
CH
0P
A.0
A0
44
AD
C_
CH
1P
A.1
A1
45
A2
46
PA
.2A
DC
_C
H2
A3
47
PA
.3A
DC
_C
H3
A4
48
PA
.4A
DC
_C
H4
A5
49
PA
.5A
DC
_C
H5
RX
01
0P
B.4
TX
11
1P
B.5
2~
5P
F.4
3~
4P
F.5
4~
7P
A.1
0
5~
6P
A.1
1
6~
37
PA
.15
7~
29
PE
.5
PW
M1
CH
4
UA
RT
3
RX
D
UA
RT
3
TX
D
UA
RT
1
RX
D
UA
RT
1
TX
D
PW
M1
CH
5
PW
M1
CH
2
PW
M1
CH
3
PW
M0
CH
3
TM
1_
EX
TP
WM
0
CH
5T
M1
8~
30
PB
.11
PW
M0
CH
4
9~
38
PA
.14
PW
M0
CH
2
39
PA
.13
40
PA
.12
PC
.02
8SP
I0_SS0
1P
B.1
4
9P
A.8
I2C
0_
SC
L
I2C
0_
SD
A
PA
.98
SCK
26PC.2SPI0_MISO0
27PC.1SPI0_CLK
MOSIPC.3SPI0_MOSI0
Re
se
rve
d6
4P
B.8
CLK
OS
TA
DC
TM
0B
PW
M1
CH
2
PW
M0
CH
4
PW
M0
CH
5
PW
M1
CH
0
PW
M1
CH
1
UA
RT
3
RX
D
I2C
1_
SC
L
I2C
1_
SD
AU
AR
T5
RX
D
UA
RT
5
TX
D
I2C
0_
SC
L
I2C
0_
SD
A
I2C
1_
SC
L
I2C
1_
SD
A
TM
3
PW
M0
CH
11
0~
11~
PW
M0
CH
0
UA
RT
5
RX
D
UA
RT
5
TX
D
INT
1
BP
WM
0
CH
01
2
13
UA
RT
1
nC
TS
UA
RT
1
nR
TS
MISOBPWM0
CH2
BPWM0
CH1
VDD
25BPWM0
CH3
VSS
Power-related
Pin
Legend
I2C Pin
Analog-related
Pin
Serial Pin
Digital Pin*
UNO
DefinedPhysical Pin
Port Pin
ADC Pin
PWM Pin
UART Pin
Timer Pin
SPI Pin
Clock Output Pin
External Interrupt
Input Pin
1st
PinReserved
Re
se
rve
d
Re
se
rve
d
Note: ʺ~ʺ means it has
PWM function pin.
BPWM Pin
VS
S
VR
EF
VS
S
VS
S
5V
CC
3V
CC
RE
SE
T
VD
D
NUC131
SD2AE
USB
JACK
7~12V
Power
JACK
NuLink-Me
Figure 4-4 NuEdu-UNO Pin Out
Arduino
Mar 20, 2015 Page 12 of 17 Rev 1.01
AR
DU
INO
US
ER
MA
NU
AL
5 SAMPLE CODE
NuEdu-M451 Board 5.1
The following table lists the Arduino samples which have been tested on M451 NuEdu board.
2015.3.20 1.01 1. Merged NuEdu-M451, NuEdu-NUC240, NuEdu-NANO130, NuEdu-UNO, and NuMaker-TRIO into the same platform group.
2. Updated sample list to include SernsorsKit_37in1 samples.
Arduino
Mar 20, 2015 Page 17 of 17 Rev 1.01
AR
DU
INO
US
ER
MA
NU
AL
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.