Outline Introduction to NuMaker TRIO Programming environment setup

Slides:



Advertisements
Similar presentations
Chung-Ta King National Tsing Hua University
Advertisements

Chung-Ta King National Tsing Hua University
Getting Started with a Cortex-M3 Board
Asst. Prof. Dr. Alper ŞİŞMAN
BLDC MOTOR SPEED CONTROL USING EMBEDDED PROCESSOR
Engineering 1040: Mechanisms & Electric Circuits Fall 2011 Introduction to Embedded Systems.
CS4101 嵌入式系統概論 Freescale Tower System Prof. Chung-Ta King Department of Computer Science National Tsing Hua University, Taiwan ( Materials from
3-1 System peripherals & Bus Structure Memory map of the LPC2300 device is one contiguous 32-bit address range. However, the device itself is made up of.
Introduction to the Orbit Edu Board Ahmad Rahmati Teaching Assistant, ELEC424 Rice Efficient Computing Group Sep 12, 2007.
PIC microcontrollers. PIC microcontrollers come in a wide range of packages from small chips with only 8 pins and 512 words of memory all the way up to.
Silicon Labs ToolStick Development Platform
Department of Electrical Engineering, National Taiwan Ocean University NuMicro Learning Board Introduction 1/29/2015 Richard Kuo Assistant.
Holtek 32-bit MCU Promotion
NetBurner MOD 5282 Network Development Kit MCF 5282 Integrated ColdFire 32 bit Microcontoller 2 DB-9 connectors for serial I/O supports: RS-232, RS-485,
Typical Microcontroller Purposes
1 ARM University Program Copyright © ARM Ltd 2013 General Purpose I/O.
ECS642U Embedded Systems Digital I/O William Marsh.
Department of Electrical Engineering, National Taiwan Ocean University NuMicro MCU Learning Board SDK Installation 1/29/2015 Richard.
ATtiny23131 A SEMINAR ON AVR MICROCONTROLLER ATtiny2313.
ChibiOS/RT Demo A free embedded RTOS
Submitted by:.  Project overview  Block diagram  Power supply  Microcontroller  MAX232 & DB9 Connector  Relay  Relay driver  Software requirements.
NAM S.B MDLAB. Electronic Engineering, Kangwon National University 1.
Mobile phone keypad sensed password entry for door opening.
PORTABLE PROGRAMMABLE MEDICATION REMINDER
ENERGY METER TO INDICATE BILLING IN RUPEES FOR LOAD WISE OR DAY WISE
Parking Availability Indication System
3/6/2017 Richard Kuo Assistant Professor
Cypress Roadmap: Platform PSoC®
Introduction In this lab, we will learn
CC2430 module Jinho Son Real-Time System Lab.
Project Title DYNAMICALLY CHANGING SIGNAL LIGHT TIME ALLOTMENT IN STREET JUNCTIONS BASED ON TRAFFIC DENSITY Under the Guidance of Submitted by.
CS4101 嵌入式系統概論 General Purpose IO
Application Case Study Security Camera Controller
Outline Analog to digital conversion (ADC) of NuMaker TRIO
Fundamentals of Computer Engineering
Microcontrollers, Basics Fundamentals of Designing with Microcontrollers 16 January 2012 Jonathan A. Titus.
PROPELLER DISPLAY OF MESSAGE BY VIRTUAL LEDS
Cortex-M0 MCU Clocks & Pins
Microcontrollers & GPIO
PRE-PROGRAMMED DIGITAL SCROLLING MESSAGE
Computer System Laboratory
Project Title EVM IN 8051 Under the Guidance of Submitted by.
PRE-STAMPEDE MONITERING AND ALARM SYSTEM
Implementation of Embedded OS
Cypress Roadmap: CapSense® Controllers
Refer to Chapter 5 in the reference book
PC Mouse operated Electrical Load Control Using VB Application
CS4101 Introduction to Embedded Systems Lab 1: General Purpose IO
DSC - fundamente MPU MCU DSP DSC Alternative Freescale
USING TV REMOTE AS A CORDLESS MOUSE FOR THE COMPUTER
CS4101 Introduction to Embedded Systems Lab 9: NuMaker ADC and LCD
CS4101 嵌入式系統概論 General Purpose IO
Remote Override of Traffic Signal in Emergency
RAILWAY TRACK SNAP NOTIFICATION
Programming Microcontroller
National Tsing Hua University CS4101 Introduction to Embedded Systems Lab 2: Timer and Clock Prof. Chung-Ta King Department of Computer Science National.
Programming Microcontroller GPIO – General Purpose Input/Output
Introduction to the Orbit Edu Board
ECE 3551 Microcomputer Systems 1
ARDUINO     What is an Arduino? Features 14 Digital I/O pins 6 Analogue inputs 6 PWM pins USB serial 16MHz Clock speed 32KB Flash memory 2KB SRAM.
Introduction to Microprocessors and Microcontrollers
Internet-of-Things (IoT)
Using FPGAs with Processors in YOUR Designs
University of Illinois, at Urbana-Champaign
Journey: Introduction to Embedded Systems
Cypress Roadmap: CapSense® Controllers
Wireless Embedded Systems
CS4101 Introduction to Embedded Systems Lab 2: Basic IO and Timer
Prof. Chung-Ta King Department of Computer Science
Arduino म्हणजे काय?.
Presentation transcript:

CS4101 嵌入式系統概論 NuMaker TRIO Prof. Chung-Ta King Department of Computer Science National Tsing Hua University, Taiwan

Outline Introduction to NuMaker TRIO Programming environment setup Clock controller GPIO

Introduction to NuMaker TRIO An IoT development board Based on Nuvoton Cortex®-M0 NANO102 MCU Cortex-M0: 32-bit ARMv6 RISC processor Run up to 32Mhz, 32KB Flash ROM, 8KB SRAM, Real- Time Clock (RTC)  Support SPI, I²C, UART,  ADC, PWM, GPIO interfaces

NuMaker TRIO Board Overview Composed of four sections

MCU Board MCU: Nano102ZC2AN QFN33 Motion : MPU6050 (3-axis accelerometer and 3-axis gyroscope) Real time clock : 32768Hz crystal LEDs and reset button

Sensor Board Gas/CO detection: MQ-7 Luminance: GL5516 (photo-resistor) Flame detection: IR diode Humidity and temperature: DHT11 Buzzer

Wireless Board WiFi: RAK415 (802.11n) BT3.0+BLE: ITON BB2710

Nu-Link Adapter Support ICP (In-Circuit Programming) based on SWD (Serial Wire Debug) interface Support Nuvoton NuMicro ICP Programming Tool Support other development toolkits, such as Keil RVMDK, IAR EWARM, CooCox CoIDE In-circuit emulator (ICE) used to debug the software of an embedded system. The programmer uses the emulator to load programs into the embedded system, run them, step through them slowly, and view and change data used by the system's software. It operates by using a processor with the additional ability to support debugging operations, as well as to carry out the main function of the system. It was historically in the form of bond-out processor which has many internal signals brought out for the purpose of debugging. These signals provide information about the state of the processor.   Joint Test Action Group (JTAG) based hardware debuggers provide equivalent access using on-chip debugging hardware with standard production chips. 

NuMaker TRIO MCU connectors

NANO102 MCU

Outline Introduction to NuMaker TRIO Programming environment setup Clock controller GPIO

Software Development Kit (SDK) ARM Keil Microcontroller Development Kit (MDK) IDE, C/C++ compiler, debugger for ARM Cortex-M https://www.keil.com/demo/eval/arm.htm Register and download MDK517.exe NuLink Driver Nu-Link_Keil_Driver_V1.30.6491.zip Driver to link PC to NuMaker TRIO board through USB Board Support Package (BSP): MCU device driver and sample code Nano102_BSPv3.02_EDU

NANO102 BSP

SampleCode Folder

NuMaker TRIO Folder

Smpl_Debug Folder

Keil Folder Double click on .uvproj file to open a Keil project

Keil MCU Development Environment

Keil MDK Configuration

Build and Execute 1. Build your project

Build and Execute 2. Change to debug mode 3. Run your project

Debug Session

Outline Introduction to NuMaker TRIO Programming environment setup Clock controller GPIO

Clock Controller Generates clocks for the whole chip, including system clocks (CPU clock, HCLKx, and PCLKx) and all peripheral module clocks HCLKx: AHB bus clock for peripherals on AHB bus AHB bus: high performance system bus for devices, such as processors, DMA controller, SRAM controller… PCLKx: APB bus clock for peripherals on APB bus APB bus: low-power peripheral bus for UART, smart card, etc. Each peripheral module clock can be turned on/off

Recall NANO102 MCU

Sources for Clock Controller 32768Hz external low-speed crystal oscillator (LXT) 4~ 24 MHz external high-speed crystal oscillator (HXT) 12/16 MHz internal high-speed RC oscillator (HIRC) 10 kHz internal low-speed RC oscillator (LIRC) Programmable PLL FOUT (PLL source can be selected from HXT or HIRC)

Clock Controller Block Diagram

Host Clock Selection

Host Clock Selection

Peripheral Clock Selection

MCU_init.h //Define Clock source #define MCU_CLOCK_SOURCE #define MCU_CLOCK_SOURCE_HIRC // HXT, LXT, HIRC, LIRC #define MCU_CLOCK_SOURCE_LXT #define MCU_CLOCK_FREQUENCY 32000000 //Hz range 16MHZ~32MHZ

Outline Introduction to NuMaker TRIO Programming environment setup Clock controller GPIO

General Purpose I/O (GPIO) Up to 80 General Purpose I/O pins, arranged in 6 ports GPIOA, GPIOB, GPIOC, GPIOD, GPIOE, GPIOF Three I/O modes: Push-pull output Open-drain output Schmitt trigger Input-only with high impendence I/O pin can be configured as interrupt source with edge/level setting Enabling the pin interrupt function will also enable the pin wake-up function An open-drain or open-collector output pin is driven by a single transistor, which pulls the pin to only one voltage (generally, to ground). When the output device is off, the pin is left floating (open, or hi-z). When the transistor is off, the signal can be driven by another device or it can be pulled up or down by a resistor. The resistor prevents an undefined, floating state. - A logical LOW will cause the pin to force a voltage of 0V ("ground") on whatever is connected to it, just like in normal mode. A logical HIGH will cause the pin to not force anything on whatever is connected to it, as if it were physically disconnected. The most common use is that some electronic components require a 0V / 5V signal rather than 0V / 3.3V. An external resistance will pull the voltage to 5V. Another use is when connecting several components' output pins to a single point, called a "bus". Since we never want any two pins to try to force different voltage levels on a single net, thus damaging each other, we use them all in open-drain mode, and use a single pull-up resistor to either 3.3V or 5V. When one (or more) of the pins on the bus "pulls low" by forcing 0V, the bus voltage will be 0V and all pins listening on that bus can detect it. When all of the pins are HIGH, i.e. virtually disconnected, the bus voltage gets "pulled up" by the resistor to whatever voltage it is connected to.

GPIO Set Mode GPIO set mode: GPIO_SetMode(PA, BIT12, GPIO_PMD_OUTPUT); Library/StdDriver/src/gpio.c GPIO set mode: GPIO_SetMode(PA, BIT12, GPIO_PMD_OUTPUT); I/O groups: NANO102 = PA, PB, PC, PD, PE, PF port no = BIT0~15 I/O modes GPIO_PMD_INPUT: input only mode GPIO_PMD_OUTPUT: push-pull output mode GPIO_PMD_OPEN_DRAIN: open-drain output mode GPIO_PMD_QUASI: quai bi-direction mode Output value: PA12 = 0; Read Input: if (PA12 !=0) { }

Sample Code #include <stdio.h> #include "Nano1X2Series.h" #include "MCU_init.h" #include "SYS_init.h" void Init_RGBLED(void) { GPIO_SetMode(PB, BIT15, GPIO_PMD_OUTPUT); GPIO_SetMode(PA, BIT14, GPIO_PMD_OUTPUT); GPIO_SetMode(PD, BIT10, GPIO_PMD_OUTPUT); PB15=1; PA14=1; PD10=1; }

Sample Code int32_t main() { SYS_Init(); Init_RGBLED(); while(1) { PB15=0; // Red LED on CLK_SysTickDelay(200000); PB15=1; // Red LED off PA14=0; // Green LED on PA14=1; // Grene LED off PD10=0; // Blue LED on PD10=1; // Blue LED off }