Jonathan Valvano
University of Texas at Austin
valvano@mail.utexas.edu
Volume 1: Embedded Systems, Introduction to ARM Cortex-M Microcontrollers,
Labs
2016, ISBN: 978-1477508992 Switches and LEDs
TM4C123, EE319K Design and Debugging
Keil or CCS projects Finite State Machine
MOOC on edX
http://users.ece.utexas.edu/~valvano/arm/outline1.htm Interrupts
TM4C123 Lab in bag (Larissa made them) DAC output
LCD graphics interface
Volume 1: Embedded Systems, Introduction to the MSP432 Microcontroller,
Fixed-point
2015, ISBN: 978-1512185676
MSP432, ADC input
New robot curriculum September 2017 UART and distributed
Keil or CCS projects Capstone design - video game
http://users.ece.utexas.edu/~valvano/arm/msp432.htm
Volume 2: Embedded Systems, Real-Time Interfacing to ARM Cortex-M Microcontrollers
2016, ISBN: 978-1463590154
TM4C123 or TM4C1294,
Labs
EE445L class at University of Texas at Austin Graphics device driver
Set of lecture notes and lab assignments Alarm clock
http://users.ece.utexas.edu/~valvano/arm/outline.htm Stepper or DC motor
Music player
Volume 2: Embedded Systems, Real-Time Interfacing to the MSP432 Microcontroller Temperature acquisition
2016, ISBN: 978-1463590154 Wifi and IoT
MSP432 PCB, Power
CCS projects
http://users.ece.utexas.edu/~valvano/arm/msp432.htm Capstone design
Volume 3: Embedded Systems, Real-Time Operating Systems for ARM Cortex-M Microcontrollers
2017, ISBN: 978-1466468863
TM4C123, TM4C1294, and MSP432 Labs
Keil or CCS projects Memory manager, device driver
edX MOOC on TM4C123 and MSP432 Thread switching RTOS
EE445M class at University of Texas at Austin
Set of lecture notes and lab assignments Blocking semaphores
Priority scheduler
Digital and analog filters, FFT
Digital control systems
File system
CAN or Ethernet network
BLE
Autonomous robot racing
2017 ASEE Texas Instruments Workshop
TI LaunchPad Development Kit for Embedded Systems and IoT Courses
University.ti.com
Embedded System Education – Real Time Operating Systems
Hardware
0) MSP432 LaunchPad (MSP-EXP432P401R)
1) MKII Educational Boosterpack (BOOSTXL-EDUMKII)
Install Software
0) Install Code Composer Studio 7 (configure for MSP432)
http://www.ti.com/tool/CCSTUDIO
1) Install TI RTOS (configure for MSP432)
http://www.ti.com/tool/TI-RTOS
2) This ASEE workshop example code (unzip into a location easy to find)
http://edx-org-utaustinx.s3.amazonaws.com/UT601x/Valvano_TI_RTOS.zip
This workshop PowerPoint http://users.ece.utexas.edu/~valvano/ASEE2017.pdf
Optional Software with lots of examples
0) MSPware (MSP432 examples from TI) http://www.ti.com/tool/mspware
1) edX MOOC examples (RTOS+BLE)
http://edx-org-utaustinx.s3.amazonaws.com/UT601x/RTOSsoftware.html
2) Valvano examples (MSP432 examples for books)
http://users.ece.utexas.edu/~valvano/arm/downloadmsp432.html
Documentation
0) MSP432 http://www.ti.com/ww/en/launchpad/launchpads-msp430-msp-exp432p401r.html
1) TI RTOS http://www.ti.com/tool/TI-RTOS
2) MKII http://www.ti.com/tool/boostxl-edumkii
Configure jumpers, boards
0) On MSP432 LaunchPad leave in all jumpers; the USB cable is needed. Line up the silk
screens. Connect MSP432+MKII boards. Double check for alignment before powering
Jonathan Valvano, University of Texas at Austin, valvano@mail.utexas.edu
Page |1
2017 ASEE Texas Instruments Workshop
TI LaunchPad Development Kit for Embedded Systems and IoT Courses
University.ti.com
1) Plug LaunchPad USB into PC and observe the drivers in
the device manager
Demo: WorldShapers_TIRTOS_MSP432 project
1) Open Code Composer Studio Execute File-
>Switch Workspace choose Other…
Browse, find the folder with Valvano_TI_RTOS
and click OK
2) Execute Project->Import CCS Projects,
Browse for folder, Select them all, Click Finish
Jonathan Valvano, University of Texas at Austin, valvano@mail.utexas.edu
Page |2
2017 ASEE Texas Instruments Workshop
TI LaunchPad Development Kit for Embedded Systems and IoT Courses
University.ti.com Your Application
3) See how the project connects to TI RTOS,
click project, open Includes Standardized cross-platform APIs
USB, FAT IPC
TCP/IP MSC, File Multicore
HID, System comm
CDC
Real-Time OS Kernel
Debug and Instrumentation
I/O drivers
Microcontroller Target
Note:
Run WorldShapers_TIRTOS_MSP432
4) See low level I/O functions for MK-II, open BSP.c not Lab4_WorldShapers-MSP432
Written in “Valvano style”
5) See high-level game engine, open WorldShapersMain.c
• Three main threads “thread”
o Look like main programs Thread Stack Thread Stack Thread Stack
o Have priority R0 R0 R0
R1 R1 R1
• I/O-triggered thread “task” ... ... ...
o Looks like an interrupt service routine SP SP SP
PC PC PC
• Search for “thread” PSR PSR PSR
Program Program Program
o Use sleep to cooperate
• MoveEnemiesThread (low priority)
o Implements AI of enemies
• GameThread (middle priority)
o Execute player dynamics
o Runs about 30 Hz
• SoundThread (high priority)
o Outputs sound to buzzer void Thread1(void){ void Thread2(void){
o Runs at 1.4 kHz Init1(); Init2();
while(1){ while(1){
• Search for “SlowPeriodicTask” Semaphore_pend(MutexHandle); Semaphore_pend(MutexHandle);
// exclusive access // exclusive access
o Triggered by periodic clock
o Looks like an ISR Semaphore_post(MutexHandle); Semaphore_post(MutexHandle);
• Search for “stack” }
// other processing
}
// other processing
o Each thread has its own stack } }
• Search for “main”
o See how four threads are created
• Search for “semaphore”
o Pend: decrement counter, block if <0
o Post: increment counter, wake up one block if needed
Jonathan Valvano, University of Texas at Austin, valvano@mail.utexas.edu
Page |3
2017 ASEE Texas Instruments Workshop
TI LaunchPad Development Kit for Embedded Systems and IoT Courses
University.ti.com
o construct
6) Debug
• Build
o Compile and link
• Debug
o Download and debug
• Run
• Edit
o Quit
o Edit line 592 in Intermission(),
o Edit lines 110-114, reducing the KillCount to make game easier
o Build, debug, run!
Additional Resources:
Embedded Systems MOOC
https://www.edx.org/course/embedded-systems-shape-world-utaustinx-ut-6-10x
https://www.edx.org/course/embedded-systems-shape-world-multi-utaustinx-ut-6-20x
http://users.ece.utexas.edu/~valvano/Volume1/E-Book/VideoLinks.htm
Real-time Bluetooth MOOC
https://www.edx.org/course/real-time-bluetooth-networks-shape-world-utaustinx-ut-rtbn-12-01x
http://edx-org-utaustinx.s3.amazonaws.com/UT601x/RTOS.html
ASEE 2015 Resources (wifi)
2015 Workshop PowerPoint http://users.ece.utexas.edu/~valvano/ASEE2015.pdf
2015 Workshop Server code http://users.ece.utexas.edu/~valvano/ASEE2015.zip
2015 Workshop server http://embedded-systems-server.appspot.com/
2015 Workshop map http://embedded-systems-server.appspot.com/map
MOOC server http://embsysmooc.appspot.com/
MOOC map http://embsysmooc.appspot.com/map
ASEE 2016 Resources (BLE)
2016 Workshop PowerPoint http://users.ece.utexas.edu/~valvano/ASEE2016.pdf
2016 Workshop projects code http://edx-org-utaustinx.s3.amazonaws.com/UT601x/BLE.zip
Valvano Example code
Valvano home page http://users.ece.utexas.edu/~valvano/
Individual projects http://users.ece.utexas.edu/~valvano/arm/
ValvanoWareTM4C123 folder http://tinyurl.com/nuq4zpx
LaunchPad tester http://users.ece.utexas.edu/~valvano/arm/tester/
Jonathan Valvano, University of Texas at Austin, valvano@mail.utexas.edu
Page |4
Embedded, RTOS, and IoT
• Cathy Wicks, c-wicks@ti.com
• Jonathan Valvano, valvano@mail.utexas.edu
• Daniel Valvano
• Mark Easley Why ARM M4?
• Market share
• John Gracia • Complexity
• Parallelism
• Verification
1
Outline
1. LaunchPad ecosystem (Mark)
2. Demonstrations (All)
– Unpack and blink
– TI-RTOS
– Questions and answers
3. Embedded System Education (Jon)
– Courses, Books and Labs
– Competitions
4. IoT Demonstration (Mark) 2
Isolation Jumper TI LaunchPad™
Let’s you isolate Target
20/40‐pin Standardized Pinout
Add BoosterPack
Jumper to your own hardware
BYOB – Build Your Own Boosterpack
Segmented Display (LCD)
Available on some LaunchPads
User LEDs
LaunchPad is TI’s Common Denominator
Modular hardware enables developers to explore new ideas quickly
TI Wireless: Sub-1GHz, NFC/RFID, Wi-Fi, ZigBee, BLE, Bluetooth
Analog, sensors, displays & more from TI, 3rd parties & Maker
community
LaunchPads featuring TI MCUs & BoosterPack interface
MSP430 TM4C C2000 Hercules CC3200
(Ultra-Low Power) (ARM Cortex M4F) (Real-time Control) (Safety) (MCU + WiFi)
TI LaunchPad
• Students should have their own board
MSP432 LaunchPad $13
TM4C LaunchPad $13
Connected LP $20 5
RTOS demonstration overview
• Configure Code Composer Studio
• Import examples into workspace
• TI RTOS
• WorldShapers_TIRTOS_MSP432
• Threads, stacks
• Hardware-triggered tasks
• Semaphores
CCS and TI-RTOS are already installed
6
MSP432-EDUMKII 0) Unpack LaunchPad and MKII
1) Connect MKII to LaunchPad
Cortex M4 64k RAM
GPIO GPIO/SSI
Buttons P3.5 P1.5
P5.1 four eight
SPI P5.0
UART P1.6 LCD
P5.7
Light GPIO/I2C P3.7
P4.6 GPIO
P6.5 P5.6
P6.4 four P2.4 LED
P3.6 I2C four
TimerA P2.6
Temperature
PWM
Analog P2.7 Buzzer
Microphone P4.3
Analog 24 UART
P6.0 channels P1.3 PC/grader
Joystick P4.4 ADC14 Timer32 P1.2
P4.1
Analog RTC UART
P6.1 P3.3 Bluetooth
Accelerometer P4.0 P3.2
P4.2 System Bus 7
MSP432 Drivers
2) Open Device Manager
3) Connect LaunchPad USB to PC
and power up the two boards
4) Watch installation
Make note of the COM port
8
Configure CCS
File->Switch Workspace
choose Other…
9
Configure CCS
2) Select all 1) Browse
C:\Users\Administrator\Desktop\Valvano_TI_RTOS
3) OK
10
Configure CCS
1) Project->Import CCS Projects
2) Click them all
WorldShapers_TIRTOS_MSP432
3) Click Finish
11
Debug
• Build
– Compile and link
• Debug
– Download and starts debugger
• Run
• Play game
• Quit debugger 12
WorldShapers_TIRTOS_MSP432
• See how project links
to TI RTOS
– Open Includes
Derived from a
TI RTOS example project
13
TI-RTOS Your Application
Standardized cross-platform APIs You can teach
USB, FAT
TCP/IP MSC, File
IPC
Multicore
Applications
HID,
CDC
System comm Interfacing
Real-Time OS Kernel RTOS
Debug and Instrumentation
I/O drivers
Microcontroller Target
14
CCS and TI RTOS are already installed
WorldShapers_TIRTOS_MSP432
• BSP.c Teach interfacing
– My I/O drivers for EDUMKII
• WorldShapersMain.c
– 3 main threads
– 1 periodic task
– Semaphore used for mutual exclusion 15
Use RTOS to teach applications
Threads
Thread Stack Thread Stack Thread Stack
R0 R0 R0
R1 R1 R1
... ... ...
SP SP SP
PC PC PC
PSR PSR PSR
Program Program Program
• Three main threads “thread” • I/O-triggered thread “task”
– Look like main programs – Looks like an interrupt
– Have priority service routine
16
WorldShapersMain.c
• Search for “thread”
– Manage: timeout, sleep, wait on event, kill
• MoveEnemiesThread (low priority)
– Implements AI of enemies
• GameThread (middle priority)
– Execute player dynamics
– Runs about 30 Hz
• SoundThread (high priority)
– Outputs sound to buzzer
– Runs at 1.4 kHz 17
WorldShapersMain.c
• Search for “SlowPeriodicTask”
– Triggered by periodic clock
– Looks like an ISR
• Search for “stack”
– Each thread has its own stack
• Search for “main”
– See how four threads are created
18
Search for “semaphore”
Semaphores
• pend
• post
• construct
• Semaphore_pend •Semaphore_post
– Decrement counter – Increment counter
– Block if < 0 – Wake up one blocked if needed
void Thread1(void){ void Thread2(void){
Init1(); Init2();
while(1){ while(1){
Semaphore_pend(MutexHandle); Semaphore_pend(MutexHandle);
// exclusive access // exclusive access
Semaphore_post(MutexHandle); Semaphore_post(MutexHandle);
// other processing // other processing
19
} }
} }
Change the loading screen
• Edit line 592
– Add your name
• Build
• Debug
• Run
• Questions? 20
Educational Objectives Why are
we here?
• Outcomes, Measureables
• Career opportunities
• Economic growth
• Student feedback
Aero
• Educational effectiveness EE ME
• Improved performance Embedded Systems
• Reduced resources
• Educational team BME Civil CS 21
Takeaway: Bottom up (what?)
• Bottom up: From simple to complex
• Transistors → Gates → Computer → Systems
• Assembly → C → Java/C++ → LabVIEW
• Abstraction
• Understand → Put it in a box → Use the box
• Systems
• Take two systems→ Connect → New system+
22
Takeaway: See one, do one, teach one
Students learn by doing
• Equipment must work
• Assignments must be clear
• Assignments must be relevant
• Tasks support learning objectives
• Professors must do labs
Students learn by teaching
23
Takeaway: Empower Students
Students need to learn outside of lab
• Students should have their own DVM
• Show labs to friends and parents
• Encourage them to work beyond lab
• Find sources of free parts
• Give simple stuff away
• Mentor their careers
• Job versus grad school
• Online presence
24
Courses, Books, and Labs
Introduction to Embedded Systems
Freshman, MOOC • Cortex-M4
• serial, SPI, ADC,
System Level Design • timer, PWM, DMA
Junior, PCB, IoT • interrupt controller
Real-time Operating Systems • JTAG debugger
Senior/grad ,CAN, Robot • floating point
EK-TM4C123GXL, 43 I/O pins, 32k RAM, 256k RAM, 80 MHz, USB, CAN $13
EK-TM4C1294XL, 90 I/O pins, 256k RAM, 1M ROM, 120 MHz, Ethernet $20
MSP-EXP432P401R, 67 I/O pins, 64k RAM, 256k ROM, 48 MHz, low power $13 25
Applications
• Compiler, Simulator, Debugger
• TI: Code Composer Studio
• Keil uVision
• TExaS (simulation, grading, LA, scope)
• Circuit design and PCB layout
• PCB Artist
• Eagle (100 by 80 mm, 2 layers)
• Circuit Maker (Altium)
• Design tools
• TI: WEBENCH, Filter Pro 26
Introduction to Embedded Systems
Volume 1 (freshmen EE or BME) 9,295 sold, 507 pages, $34
• Switches and LEDs
• Design and Debugging
• Finite State Machine
• Interrupts
• DAC output
• LCD graphics interface
• Fixed-point
• ADC input
• UART and distributed
• Assembly or C programming
• Capstone design - video game
• Design and Debugging 27
– Simulation, logic analyzer, scope
Embedded Systems – Shape the World
• What is and isn’t a MOOC?
– Spring 14, 15, 16, 17
– over 110,000 enrolled
– over 2.5 million video hits
– over 7% got certificates
– 2/3 who started, finished
Physical kit increased completion rates
– 95% approval rate
• Lab kit + Teaching videos
• LaunchPad simulator, graders, voltmeter, scope 28
• Have done both Wifi and BLE in MOOC
Interfacing and Systems
Volume 2 (junior EE) 4,274 sold, 600 pages, $44
• Graphics device driver
• Alarm clock
• Stepper or DC motor
• Music player
• Temperature acquisition
• Wifi and IoT
• Hardware/software debugging • Capstone design - open
• Design and debugging ended, PCB, Power
• Analog, power, computer 29
Real-Time Operating Systems
Volume 3 (senior/grad EE) 3,061 sold, 485 pages, $30
• Memory manager, device driver
• Thread switching RTOS
• Blocking semaphores
• Priority scheduler
• Digital and analog filters, FFT
• Digital control systems
• File system
• CAN or Ethernet network
• Autonomous robot racing 30
MOOC starting 9/2017 on edX http://ow.ly/ophC301Aa0p
Support for teaching http://ow.ly/ophC301Aa0p
Website (download and edit)
• Examples for TM4C123, TM4C1294, MSP432
• PowerPoint slides
• Lab manual, data sheets
• http://users.ece.utexas.edu/~valvano/
edX: Intro until Dec, RTOS-BLE Fall 2017
LaunchPad tester
Adopt a book →
Free parts for LaunchPad tester
31
http://users.ece.utexas.edu/~valvano/arm/tester/
Support for teaching on university.ti.com
Robotic System Education (Fall 2017)
• MSP432+Robot
• PowerPoint slides
• Lab manual, data sheets
• Quizzes
• CCS software projects
• Sensors
• Motors
• IoT/BLE 32
Support for teaching on university.ti.com
Robotic System Education (Fall 2017)
• Systems approach
• Aggregate components
• Explorer robot
• Introduction • Intermediate
– Volume 1 – Volume 2
– No Calculus – Circuits
– Signal processing
33
Successes: Competitions
Students need to appreciate relevance
• Appropriate use of teams
• Build things that are fun to play with
• Show off to friends, family, interviewers
• Competitions
• Fun, intense
• Open-ended
• Creativity, life-long learning, springboard 34
Competition
Volume 1 (freshmen EE or BME)
• Handheld game, peer review
Volume 2 (junior EE)
• Design cycle, testing, systems
Volume 3 (senior/grad EE)
• Autonomous Robot Racing
http://youtu.be/QxDQUUDStOw http://youtu.be/bZ1fXtN1T08
http://youtu.be/z6_jlM2Y5qI http://youtu.be/GKctvlvprAQ
http://youtu.be/K9FD50qpGwg 35
Competitions
https://youtu.be/0ZOI5AGtdf0
http://youtu.be/bZ1fXtN1T08
http://youtu.be/GKctvlvprAQ
36
Conclusions
• Bottom-up
• Lab-centered
• Empower students Understanding
• Motivate students Design
• Be flexible Innovation
• Be a team builder
• Make a plan and do it 37
IoT Demonstration (Mark)
• Temboo + TI LaunchPad
• View full workshop at https://goo.gl/VbymuW
38
For more information
Jonathan Valvano valvano@mail.utexas.edu
http://users.ece.utexas.edu/~valvano/
EE319K Introduction
EE445L Interfacing and systems
EE445M Real-time operating systems
https://www.edx.org/course/embedded-systems-shape-world-utaustinx-ut-6-10x
https://www.edx.org/course/embedded-systems-shape-world-multi-utaustinx-ut-6-20x
http://users.ece.utexas.edu/~valvano/Volume1/E-Book/VideoLinks.htm
http://edx-org-utaustinx.s3.amazonaws.com/UT601x/RTOS.html
Mark Easley
Cathy Wicks univ@ti.com
39