Presentation is loading. Please wait.

Presentation is loading. Please wait.

NuMicro MCU Learning Board Introduction

Similar presentations


Presentation on theme: "NuMicro MCU Learning Board Introduction"— Presentation transcript:

1 NuMicro MCU Learning Board Introduction
3/7/2013 Richard Kuo Assistant Professor

2 Outline NuMicro NUC140 Learning Board Nu-LB-NUC140 schematics
SDK installation Learning Board Basic Sample Package Keil Development Environment Setup

3 NuMicro MCU Learning Board (Nu-LB-NUC140)
ICE Bridge Nu-Link CAN/LIN UART 5V DC Power USB Device WAU8822 Codec EEPROM SPI Flash NUC140VE3AN Line out LED Line in Reset 3x3 Key Matrix SW int GPIO Buzzer Variable Resistance

4 NuMicro MCU Learning Board (bottom view)
SD Card

5 Learning Board Power Supply
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 Learning Board provide +5V, +3.3V power on the lower-right side 3VVC1 = 3.3V, 5VCC1 = 5V, VCC = 5V, GND1 = GND max. current is depending on the power supply source, if connecting to PC USB port, its current is about 500mA 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.

6 Learning Board Connectors
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)

7 Learning Board function and used pins

8 NU-LB-NUC140 Pin & Function
Block Pin Function ICE Bridge Nu-Link ICE_CLK ICE_DATA SWD interface UART GPB0 GPB1 UART0 Rx UART0 Tx WAU8822 codec GPC0 GPC1 GPC2 GPC3 GPA15 I2SLRCLK I2SBCLK I2SDI I2SDO I2SMCLK GPA8 GPA9 I2C0 SDA I2C0 SCL GPE14 Line out Enable/Disable GPE15 Line in plug in/out detect Key GPB15 GPB15 INT1

9 NU-LB-NUC140 Pin & Function
Block Pin Function CAN GPD6 GPD7 CAN0 Rx CAN0 Tx GPB12~13 CAN transceiver speed LIN GPB4 GPB5 UART1 Rx UART1 Tx GPB6 LIN transceiver wakeup function GPB7 LIN transceiver Enable/Disable 7-Seg LED GPE0~7 Row GPC4~7 Column Black Dot Matrix LCD Panel GPD8 GPD9 GPD10 GPD11` SPI3 SS30 SPI3 SPCLK LCD Reset SPI3 MOSI0 GPD14 Background Enable/Disable

10 NU-LB-NUC140 Pin & Function
Block Pin Function Variable Resistance GPA7 ADC interface Buzzer GPB11 PWM4 Key Matrix GPA0~5 GPIO Reset RESET EEPROM GPA10 GPA11 I2C1 SDA I2C1 SCL FLASH GPD0 GPD1 GPD2 GPD3 GPD4 GPD5 SPI2 SS20 SPI2 SPCLK SPI2 MISO0 SPI2 MOSI0 SPI2 MISO1 SPI2 MOSI1

11 NU-LB-NUC140 Pin & Function
Block Pin Function LED GPA12 GPA13 GPA14 PWM0 PWM1 PWM2 GPC12~15 GPIO SD card GPD12 GPD13 SD card Power Enable/Disable SD card insert detection GPC8 GPC9 GPC10 GPC11 SPI1 SS10 SPI1 SPCLK SPI1 MOSI0 SPI1 MISO0

12 Learning Board Schematics
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

13 7 segment schematic GPE0~7, GPC4~7

14 64x128 LCD schematic GPD8~11

15 RGB LED schematic GPA14 control Red color GPA13 control Green color
Output low to enable R/G/B LEDs

16 Red LED schematic GPC12,13,14,15 (output low to enable LED)

17 Keypad & SW_INT schematic
GPA0~5 GPB15

18 UART/RS232 schematic GPB0,1

19 I2C & Buzzer schematic GPA10,11 GPB11

20 SPI schematic GPD0~5

21 PS2 & ADC schematic GPA7

22 I2S schematic GPA8,9 GPA15 GPC0~3

23 CAN&LIN schematic CAN : GPD6,7 LIN : GPB4~7

24 SD card schematic GPD12,13 GPC8~11

25 Learning Board GPIO pin assignment
NuMicro MCU Learning Board has 5 group of GPIO pin : GPIOA, GPIOB, GPIOC, GPIOD, GPIOE They are named GPA, GPB, GPC, GPD, GPE Sample code use E_GPA, E_GPB, E_GPC, E_GPD, E_GPE as its defined port name GPIO pins are allocated at the pins at the lower part of the learning board : J4, J5, J6, J7, J8 You can jump wire to external device with these pins

26 GPIO group A, B JP4: GPIOA JP5 : GPIOB

27 GPIO group C, D JP6 : GPIOC JP7 : GPIOD

28 GPIO group E JP8 : GPIOE

29 NuLink ICE used with PC NuLink ICE is built-in on board with miniUSB connector

30 SDK Installation Before connecting NuMicro MCU Learning Board to PC, you will need install the following : Keil/IAR Tools (for program editting, compiling, debugging) NuLink device driver (NuLink USB driver for PC) Nuvoton BSP (Learning board sample codes from Nuvoton) After the above installation, you can connect the miniUSB port of NuLink (upper side of the NUC140 learning board) , and Build (compile) your sample code into binary file, and Download (burn) thru NuLink to NUC140 on the learning board Then press Reset button to execute the new code inside NUC140 Or you can unplug and reconnect USB cable which is also reset the entire system to restart with new code Nuvoton provide NuMicro SDK CDROM with free software tools & sample codes, you can also download the latest driver and sample code from

31 Quick New Project Creation (Keil example)
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

32 Build and Download Binary Code into MCU
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 To build project (compile C code into binary code) Keil command menu,press F7 / Build Target , or select Project and select Build Target If shown 0 error on the console (the bottom of project window), the binary code will be generated, Else you need to debug the error Click on the error message in the console, it will takes you to the line of error code To download binary code into MCU chip Press Download, or menu select Flash and select Download

33 Setup for using printf function
NuMicro has a printf function of C for MCU, the following steps will direct printf output to UART0 : Step 1. startup_NUC1xx.s line #10 FALSE changed to TRUE SEMIHOSTED SETL {TRUE} Step 2. retarget.c around line #20 to add #define DEBUG_ENABLE_SEMIHOST (also retarget.c need to be added to Library Files of the current project, retarget.c can be found in src/NUC1xx-LB_002/ ) Step 3. add printf statement into the C code printf will print message to UART0, so it will slow down the program due to using UART0 to PC, so we recommend to remove printf statement after debug is done Step 4. Build project and Download code into MCU Step 5. Open Debugger Session of Keil, and open UART1 of view window Step 6. Run (F5)

34 Basic Sample Package Smpl_ADC_PWM : ADC input to control PWM output
NUC100SeriesBSP\NuvotonPlatform_Keil\Sample\NUC1xx-LB_002\ Smpl_ADC_PWM : ADC input to control PWM output Smpl_Capture : PMW input (GPA13,14), Catpure Input (GPA12) Smpl_FATFS_SDCard : build FAT system and read SDCard Smpl_FMC : reset button to boot in AP (ICP mode), soft Interrupt button to boot in LDROM (ISP mode) Smpl_HID_IO : PC run HID application to control LEDs on learning board Smpl_I2C_24LC64 : press 3x3 keypad to control read/write 8KB EEPROM (24LC64) Smpl_Interrupt : press soft interrupt buttong to control LED flashing Smpl_LIN_Master : LIN bus master program code Smpl_LIN_Slave : LIN bus slave program code Smpl_SPI_Flash_PDMA : SPI read 16MB flash memory (W25Q16) Smpl_SPI_Flashx2 : SPI dual-wire mode to read 16MB flash memory (W25Q16) Smpl_Start_Kit : starter kit example, it will display message on LCD and 7 segment LEDs Smpl_Timer_WDT_RTC : Timer, WatchDog Timer, RTC alarm, and display RTC time Smpl_UAC : PC play mp3 file, and USB port to learning board output to earphone jack Simpl_UDC : USB to SDCard Smpl_VCOM : USB Virtual Com. port

35 Smpl_ADC_PWM System Diagram
Flash Cortex-M0 SPI ADC Value: 277 LCD Panel PWM0 LED NUC140V3AN Function: adjusting VR1 to change PWM frequency and control LED flashing

36 Smpl_Capture System Diagram
LCD Panel Capture demo High:683usec Low: 683usec SPI Flash Capture0 Cortex-M0 PWM1 PWM2 NUC140V3AN Function : PWM pins perform to capture input

37 Smpl_Capture Pin Usage
Input Channel:GPA12 Counter unit: 1usec (((11+1)*1)/12M) Capture capability: 32 bits (hardware 16bits+ firmware 16bits) PWM1 Output Channel:GPA13 Period: sec (((11+1)*16*( ))/12M) High level: 262msec, Low level: 786msec PWM2 Output Channel:GPA14 Period: usec (((1+1)*1*(8191+1))/12M) High level: 682usec, Low level: 682usec LCD Display Capture0 result

38 Smpl_FMC function description
MCU boot in APROM LED rotates left Press SW_INT to ISP function and Boot from LD MCU boot in LDROM MCU reset, after MCU boot in LDROM LED rotates right and flash reset button to boot in AP (ICP mode), soft Interrupt button to boot in LDROM (ISP mode)

39 Smpl_I2C_24LC64 System Diagram
Flash Cortex-M0 I 2 C SCL I 2 C _ CLK I 2 C 24 LC 64 I 2 C _ DATA I 2 C SDA NUC140V3AN Function: using I2C to read/write EEPROM (24LC64)

40 Smpl_SPI_Flash_PDMA System Diagram
SPICLK2 MISO20 MOSI20 SPISS20 CLK DO DI /CS SPI-Flash (W25Q16BV) SPI2 NUC140V3AN PDMA Function : using SPI to read/write 16MB flash memory (W25Q16)

41 Smpl_SPI_Flash_PDMA SPI setting
Master mode One channel data in/out SPI clock rate 1MHz Transmit data at negative edge Receive data at positive edge Disable the auto slave select Slave select is active low SPICLK2(GPD1) <--> SPI-Flash0_CLK (pin 6) MISO20(GPD2) <--> SPI-Flash0_DO (pin 2) MOSI20(GPD3) <--> SPI-Flash0_DI (pin 5) SPISS20(GPD0) <--> SPI-Flash0_/CS (pin 1)

42 Smpl_SPI_Flashx2 System Diagram
SPICLK2 MISO20 MOSI20 MISO21 MOSI21 SPISS20 CLK DO DI /CS SPI-Flash (W25Q16BV) SPI2 NUC140V3AN SPI-Flash (W25Q16B) Function : using SPI dual-wire mode to read/write flash memory (W25Q16)

43 Smpl_UAC System Diagram
PC USB Flash WAU8822 Cortex-M0 I 2 C 2C0SCL I2C0SDA I 2 S 2SDI 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

44 Smpl_UDC System Diagram
PC USB Flash SD card Cortex-M0 SPI NUC140V3AN Function : USB SDcard reader

45 General Disclaimer The Lecture is strictly used for educational purpose. MAKES NO GUARANTEE OF VALIDITY The lecture cannot guarantee the validity of the information found here. The lecture may recently have been changed, vandalized or altered by someone whose opinion does not correspond with the state of knowledge in the relevant fields. Note that most other encyclopedias and reference works also have similar disclaimers. No formal peer review The lecture is not uniformly peer reviewed; while readers may correct errors or engage in casual peer review, they have no legal duty to do so and thus all information read here is without any implied warranty of fitness for any purpose or use whatsoever. Even articles that have been vetted by informal peer review or featured article processes may later have been edited inappropriately, just before you view them. No contract; limited license Please make sure that you understand that the information provided here is being provided freely, and that no kind of agreement or contract is created between you and the owners or users of this site, the owners of the servers upon which it is housed, the individual Wikipedia contributors, any project administrators, sysops or anyone else who is in any way connected with this project or sister projects subject to your claims against them directly. You are being granted a limited license to copy anything from this site; it does not create or imply any contractual or extracontractual liability on the part of Wikipedia or any of its agents, members, organizers or other users. There is no agreement or understanding between you and the content provider regarding your use or modification of this information beyond the Creative Commons Attribution-Sharealike 3.0 Unported License (CC-BY-SA) and the GNU Free Documentation License (GFDL);

46 General Disclaimer Personality rights Trademarks
Any of the trademarks, service marks, collective marks, design rights or similar rights that are mentioned, used or cited in the lectures are the property of their respective owners. Their use here does not imply that you may use them for any purpose other than for the same or a similar informational use as contemplated by the original authors under the CC-BY-SA and GFDL licensing schemes. Unless otherwise stated , we are neither endorsed by nor affiliated with any of the holders of any such rights and as such we cannot grant any rights to use any otherwise protected materials. Your use of any such or similar incorporeal property is at your own risk. Personality rights The lecture may portray an identifiable person who is alive or deceased recently. The use of images of living or recently deceased individuals is, in some jurisdictions, restricted by laws pertaining to personality rights, independent from their copyright status. Before using these types of content, please ensure that you have the right to use it under the laws which apply in the circumstances of your intended use. You are solely responsible for ensuring that you do not infringe someone else's personality rights.


Download ppt "NuMicro MCU Learning Board Introduction"

Similar presentations


Ads by Google