Numicro Mcu Learning Board: Department of Electrical Engineering
Numicro Mcu Learning Board: Department of Electrical Engineering
Introduction
3/7/2013
Richard Kuo
Assistant Professor
Outline
Department of Electrical Engineering, www.ee.ntou.edu.tw
National Taiwan Ocean University
USB
Device
WAU8822
Codec
NUC140VE3AN
Line out EEPROM
SPI Flash
LED
Line in Reset
SW int
3x3 Key Matrix
GPIO
Buzzer
Variable
Resistance
NuMicro MCU Learning Board (bottom view)
Department of Electrical Engineering, www.ee.ntou.edu.tw
National Taiwan Ocean University
SD Card
Learning Board Power Supply
Department of Electrical Engineering, www.ee.ntou.edu.tw
National Taiwan Ocean University
► Basic Supply Voltage is 5V, there are 3 ways to supply power :
– ICE_USB : mini USB connector for on-board NuLink ICE
– CON5: DC supply connector
– POWER1: VCC & GND pins (beside CON5)
– J3: mini USB of NUC140 device
Note: During the excerise/experiement, PC may cut off power of USB port if
short circuit happens. Please reset the PC to resume the power supply from
USB port.
Learning Board Connectors
Department of Electrical Engineering, www.ee.ntou.edu.tw
National Taiwan Ocean University
► VCC5 = +5V, VCC33 = +3V
► ICE_USB: NuLink’s miniUSB port for connecting to PC
► CON2: RS232 port
► CON5 : DC power supply (+5V)
► SW_POW : DC power switch (on/off control of CON5 to board)
► POWER1 : System Power connector pins (for jumping wire to power
the board when use external voltage converter as power supply)
► J3 : NUC140 USB port (when NUC140 serve as USB device)
► J1 : audio output (connect to earphone)
► J2 : audio input (connect to mic)
► RESET : reset button (below on-board LCD)
► SW_INT : soft interrrupt button (below RESET button)
Learning Board function and used pins
Department of Electrical Engineering, www.ee.ntou.edu.tw
National Taiwan Ocean University
NU-LB-NUC140 Pin & Function
Department of Electrical Engineering, www.ee.ntou.edu.tw
National Taiwan Ocean University
► 7-segment schematic
► 64x128 LCD schematic
► RGB LED schematic
► Keypad & SW_INT schematic
► UART/RS232 schematic
► I2C & Buzzer schematic
► SPI schematic
► PS2 & ADC schematic
► I2S schematic
► CAN & LIN schematic
► SD card schematic
7 segment schematic
Department of Electrical Engineering, www.ee.ntou.edu.tw
National Taiwan Ocean University
GPE0~7, GPC4~7
64x128 LCD schematic
Department of Electrical Engineering, www.ee.ntou.edu.tw
National Taiwan Ocean University
GPD8~11
RGB LED schematic
Department of Electrical Engineering, www.ee.ntou.edu.tw
National Taiwan Ocean University
GPC12,13,14,15
(output low to enable LED)
Keypad & SW_INT schematic
Department of Electrical Engineering, www.ee.ntou.edu.tw
National Taiwan Ocean University
GPA0~5 GPB15
UART/RS232 schematic
Department of Electrical Engineering, www.ee.ntou.edu.tw
National Taiwan Ocean University
GPB0,1
I2C & Buzzer schematic
Department of Electrical Engineering, www.ee.ntou.edu.tw
National Taiwan Ocean University
GPA10,11 GPB11
SPI schematic
Department of Electrical Engineering, www.ee.ntou.edu.tw
National Taiwan Ocean University
GPD0~5
PS2 & ADC schematic
Department of Electrical Engineering, www.ee.ntou.edu.tw
National Taiwan Ocean University
GPA7
I2S schematic
Department of Electrical Engineering, www.ee.ntou.edu.tw
National Taiwan Ocean University
GPA8,9
GPA15
GPC0~3
CAN & LIN schematic
Department of Electrical Engineering, www.ee.ntou.edu.tw
National Taiwan Ocean University
CAN : GPD6,7
LIN : GPB4~7
SD card schematic
Department of Electrical Engineering, www.ee.ntou.edu.tw
National Taiwan Ocean University
GPD12,13
GPC8~11
Learning Board GPIO pin assignment
Department of Electrical Engineering, www.ee.ntou.edu.tw
National Taiwan Ocean University
JP8 : GPIOE
NuLink ICE used with PC
Department of Electrical Engineering, www.ee.ntou.edu.tw
National Taiwan Ocean University
Nuvoton provide NuMicro SDK CDROM with free software tools & sample codes,
you can also download the latest driver and sample code from www.nuvoton.com
Quick New Project Creation (Keil example)
Department of Electrical Engineering, www.ee.ntou.edu.tw
National Taiwan Ocean University
► Create a new project folder Smpl_newproj
► Copy 3 files from old sample project
– smpl_old.uvproj
– smpl_old.uvopt
– smpl_old.c
► Rename 3 files into new sample name
– smpl_new.uvproj
– smpl_new.uvopt
– smpl_new.c
► Change to new project folder, double click on smpl_new.uvproj
– the error message show up is smpl_old.c is missing (because we rename it to smpl_new.c)
– Move cursor to the left side of the Keil window
– Point to smpl_old.c & right mouse click, a menu will show up, please choose “remove from the
project”
– Point cursor to Source Files, and right mouse click, a file window will show up, then select
smpl_new.c to add into the project Source Files
– Point cursor to window left top corner, and revise the project name from smpl_old to smpl_new
Build and Download Binary Code into MCU
Department of Electrical Engineering, www.ee.ntou.edu.tw
National Taiwan Ocean University
► At Keil project window, top menu select Flash , select Configure Flash Tools…
– it will show up a configuration window : Options for Target ‘Smpl_new’
– select Output, and rename Smpl_old to Smpl_new
– select Target to confirm the correct Target Device is Nuvoton NUC140VE3AN (learning
board MCU)
– select Debug to use Nu-Link Debugger
– select Utilities to use Target Driver Nu-Link Debugger
– select OK on the bottom of the configuration window
VCC
Flash
ADC7 VR1
ADC 20K
G PA 7
Cortex-M0
SPI
ADC Value: 277
LCD Panel
PWM0
NUC140V3AN LED
Function: adjusting VR1 to change PWM frequency and control LED flashing
Smpl_Capture System Diagram
Department of Electrical Engineering, www.ee.ntou.edu.tw
National Taiwan Ocean University
LCD Panel
Capture demo
SPI High:683usec
Flash
Low: 683usec
Capture0
Cortex-M0
PWM1
PWM2
NUC140V3AN
Function : PWM pins perform to capture input
Smpl_Capture Pin Usage
Department of Electrical Engineering, www.ee.ntou.edu.tw
National Taiwan Ocean University
► Capture0
– Input Channel:GPA12
– Counter unit: 1usec (((11+1)*1)/12M)
– Capture capability: 32 bits (hardware 16bits+ firmware 16bits)
► PWM1
– Output Channel:GPA13
– Period: 1.049 sec (((11+1)*16*(65535+1))/12M)
– High level: 262msec, Low level: 786msec
► PWM2
– Output Channel:GPA14
– Period: 1365.3 usec (((1+1)*1*(8191+1))/12M)
– High level: 682usec, Low level: 682usec
► LCD
– Display Capture0 result
Smpl_FMC function description
Department of Electrical Engineering, www.ee.ntou.edu.tw
National Taiwan Ocean University
Flash
I2C0SCL I2C_CLK
Cortex-M0 I2C 24LC64
I2C0SDA I2C_DATA
NUC140V3AN
SPICLK2 CLK
MISO20
SPI2 DO
MOSI20 DI
SPISS20 /CS
NUC140V3AN SPI-Flash
(W25Q16BV)
PDMA
SPICLK2 CLK
MISO20 DO
MOSI20 DI
SPI2 MISO21 /CS
MOSI21
SPISS20
NUC140V3AN
CLK
DO
DI
/CS
SPI-Flash (W25Q16B)
PC
USB
Flash
I2C0SCL
Cortex-M0 I2C I2C0SDA
WAU8822
I2SDI
I2S I2SDO
NUC140V3AN
Function : MP3 player , PC play mp3 file and send audio data to USB,
NuMicro learning board receive data from USB and use I2S send to audio codec
(WAU8822), then output to earphone or speaker
Smpl_UDC System Diagram
Department of Electrical Engineering, www.ee.ntou.edu.tw
National Taiwan Ocean University
PC
USB
Flash
NUC140V3AN