ARM Cortex M0+ Course Material

ARM Cortex M0+ Course Material

Teaching Embedded System Design and Optimization with the ARM Cortex-M0+ Microcontrollers Dr. Alexander G. Dean Dept. of ECE North Carolina State University Raleigh, NC [email protected] http://www.cesr.ncsu.edu/agdean ARM University Program Copyright © ARM Ltd 2014 1 Course Approach . Hands-on MCU development experience . Programming in C with free toolchain from Keil . Simple, inexpensive hardware . Easy system expansion with Arduino-compatible hardware . Relevant, useful material based on 13 years of experience . Interaction with industry through on-site design reviews of real embedded systems . Teaching large (50 – 120 students) undergraduate and graduate embedded system courses . Prerequisites . Introductory course: introduction to computer organization, C programming . Advanced course: introductory course. Other courses also helpful ARM University Program Copyright © ARM Ltd 2014 2 Course Materials . Easy adoption for your own course . Flexibility with modular design . All source files provided (pptx, docx, vsd, c, h …) . Course modules typically include . PowerPoint slides/lecture notes . Demonstration code for use in lecture and outside of class . Homework questions and solutions . Lab exercise(s) with step-by-step procedure and questions . Programming project(s) with solution . Status . Introductory course materials available now . Advanced course materials available early summer . Developing a textbook to support both courses ARM University Program Copyright © ARM Ltd 2014 3 ARM University Program Copyright © ARM Ltd 2014 4 Worldwide Adoption . Video introduction . Nearly 100 adoptions since launch last summer . North & South America, Europe, Asia, Africa . “We were delighted to be one of the first institutions to receive the ARM University Program's Lab-in-a-Box on Embedded Systems. It has immediately proven itself to me as an excellent resource for our research and teaching activities.” . Dr. Boris Adryan, University of Cambridge, UK. "Freescale is delighted to be building on our longstanding relationship with ARM by providing access to our solutions to universities and electronic engineering students around the world. The Lab-in-a-Box is just one way Freescale and ARM collaboratively reach out to our engineers of the future and help us create a new wave of innovative embedded technologies that will drive our increasingly connected world.“ . Andy Mastronardi, Director, University Programs, Freescale ARM University Program Copyright © ARM Ltd 2014 5 Cortex Processor Cores . Cortex-A: application profile . High performance, multiprocessing . Cortex-R: real-time profile . Predictable performance . Cortex-M: microcontroller profile - optimized for embedded applications . Implementation . Short pipeline . Fast interrupt response . Low cost, low power . Fast GPIO access . Instruction set . Good code density (16-bit Thumb 2 instructions) . Bit and byte operations . Optional single-cycle multiply instruction, hardware divide, saturated math . Optional DSP & SIMD instructions . Optional floating point unit ARM University Program Copyright © ARM Ltd 2014 6 Target Board – Freescale Freedom KL25Z . 32-bit ARM Cortex-M0+ processor . Freescale Kinetis MKL25Z128VLK4 microcontroller . Extremely low power use . 48 MHz max processor clock freq. 128 KB Flash ROM, 16 KB RAM . Wide range of peripherals, including USB on-the-go . FRDM-KL25Z board . $13 (USD) . Peripherals: 3-axis accelerometer, RGB LED, capacitive touch slider . Expansion ports are compatible with Arduino shield ecosystem – endless opportunities, low-cost hardware . mbed.org enabled - online software development toolchain, reusable code Images courtesy of Freescale ARM University Program Copyright © ARM Ltd 2014 7 Hardware Ecosystem . Arduino shields . Wide variety . Low cost . High volume . Xtrinsic sensor board from element 14 Images courtesy of Freescale, Adafruit, Element 14, Parallax, Seeed Studio ARM University Program Copyright © ARM Ltd 2014 8 And Even More Shields Image courtesy of Seeed Studio ARM University Program Copyright © ARM Ltd 2014 9 SOFTWARE DEVELOPMENT TOOLS ARM University Program Copyright © ARM Ltd 2014 10 Software Development Suite: MDK-ARM . Low cost tools for ARM7, ARM9, Cortex-M and Cortex-R4 MCUs . Extensive support for many devices . Core and peripheral simulation . Flash support . Integrated development environment with ARM compiler . Full (pro) version available for teaching, free 32 KB size-limited version available also . Debugger with full access to program, core and peripherals . Real-time trace on devices based on Cortex-M3 and M4 . Real-Time Library . KEIL RTX RTOS + Source Code . TCP networking suite, Flash File System, CAN Driver Library, USB Device Interface . Debug Hardware . Evaluation boards . Separate support channel . See www.keil.com ARM University Program Copyright © ARM Ltd 2014 11 CURRICULUM OVERVIEW ARM University Program Copyright © ARM Ltd 2014 12 Curriculum Overview . Introductory Course: Building an Embedded System with a Microcontroller . Microcontroller concepts . Software design basics . ARM Cortex-M0+ architecture and interrupt system . C as implemented in assembly language . Peripherals and interfacing . Advanced Course: Embedded System Design, Analysis and Optimization . Creating responsive multithreaded systems . Optimizing code speed . Optimizing system power and energy . Optimizing memory requirements . Details in appendix ARM University Program Copyright © ARM Ltd 2014 13 Introductory Course Modules Software Design Basics Cortex-M0+ Emb. SW Concurrency CMSIS Processor Core Engineering C as Implemented in Assembly Lang. Interrupts HW & SW for Serial GP I/O Analog I/O DMA Timers Robustness Comm. Using Arduino Shields ARM University Program Copyright © ARM Ltd 2014 14 Introduction to Embedded Systems . What is an Embedded System? . Why add a computer to the larger system? . Differences between… . Embedded and general-purpose computers . Microcontrollers and microprocessors . Embedded system . Functions . Attributes . Constraints . Economics ARM University Program Copyright © ARM Ltd 2014 15 Embedded MCU vs. General-Purpose CPU . Both have a CPU core to execute instructions . Microcontroller has peripherals for concurrent embedded interfacing and control . Analog . Non-logic level signals . Timing, communications . Reliability and safety . Embedded systems have concurrent, reactive behaviors . Must respond to sequences and combinations of events . Real-time systems have deadlines on responses . Typically must perform multiple separate activities concurrently ARM University Program Copyright © ARM Ltd 2014 16 Concurrent Hardware & Software Operation Software Hardware Software Hardware Software Time . Embedded systems rely on both MCU hardware peripherals and software to get everything done on time ARM University Program Copyright © ARM Ltd 2014 17 Advanced Course Modules (1/2) Concurrency Concepts C as Implemented and Interrupts in Assembly Lang. Cooperative Preemptive Execution-Time Examining Task Scheduling Task Scheduling Profiling Object Code Design, Analysis Source Code and High-Level & Optimization of Toolchain Tuning Optimizations Real-Time Systems CMSIS-DSP and Cortex-M0+ Features ARM University Program Copyright © ARM Ltd 2014 18 Advanced Course Modules (2/2) Power & Energy C Program Modeling & Analysis Memory Use Concepts Cortex M0+ KL25Z Freedom Tools for Analyzing Core MCU Board Memory Use Optimizing Power ROM Size RAM Size and/or Energy with Optimization Optimization Sleep and DVFS ARM University Program Copyright © ARM Ltd 2014 19 COURSE MODULE DETAILS ARM University Program Copyright © ARM Ltd 2014 20 INTRODUCTORY COURSE ARM University Program Copyright © ARM Ltd 2014 21 Software Development, Processor & Interrupts Module Presentations Demonstration Homework Laboratory Programming Code and Test Exercise Project Questions Introduction to Presentation Solutions Embedded Systems SW Design Basics: Presentation Solutions Concurrency, SW Eng. & CMSIS APIs Cortex-M0+ Presentation Solutions Text Processing in Integer Square Root Assembly Approximation Processor Core Language • Assignment • Lab Exercise • Starter code • Code • Solution C Code as Presentation C/Asm Demo 1 Solutions, Examining Code, source project Toolchain Output Implemented in Demo 2 Code • Lab Exercise Assembly • Code Language Interrupts Presentation Interrupt Demo Solutions, Measuring Human Response Code, Notes spreadsheet Interrupt Timing Timer • Lab Exercise • Assignment • Solution ARM University Program Copyright © ARM Ltd 2014 22 Using Peripherals General Purpose Presentation GPIO Demo Code Solutions, Basic User Slide Whistle (includes Basic Spreadsheet Interface with LCD • Assignment Digital Interfacing Light Switch, RGB and switches • Solution LED Flasher, • Lab Exercise Speaker tone • Code generator, Text LCD with parallel bus) Analog Interfacing Presentation Analog Interfacing Solutions, ADC: Voltmeter Infrared Proximity Demo Code spreadsheet • Lab Exercise Sensor • Code • Assignment Interfacing with Comparator: • Solution Arduino Analog Voltage Monitor Devices • Lab Exercise • Code DAC: Signal Generator • Lab Exercise • Code Timers Presentation Timer Demo Code Solutions, Signal Generator Clock with Pulsing spreadsheet with Precision LED Timing and • Assignment Buffering • Solution • Lab Exercise Using PWM to • Code control motor Speed • Solution • Assignment • Solution ARM University Program Copyright © ARM Ltd 2014 23 Using Peripherals Serial Presentation I2C and Solutions UART UART: Creating a Accelerometer Performance

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    82 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us