Embedded Systems Education
Embedded Systems Laboratory
• Using ARM Cortex M4
• From the Basics to Applications
• Internet of Things, Bluetooth
Why M4?
• Market share
• Complexity
• Parallelism
• Verification
Jonathan Valvano 1
Embedded Systems Education
Outline
1. Objectives What do students need forever?
2. Approach → 5 Takeaways
3. Courses, Books and Labs
4. Successes → Competitions
5. Conclusions
6. BLE demonstration
Engineers make two things:
• Systems
• Interfaces between systems
Jonathan Valvano 2
Embedded Systems Education
1. Educational Objectives Why are
we here?
• Outcomes, Measureables
• Career opportunities
• Economic growth
• Student feedback
• Educational effectiveness
• Improved performance EE ME
• Reduced resources Embedded Systems
• Educational team BME CS
Jonathan Valvano 3
Embedded Systems Education
2A. 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+
Jonathan Valvano 1 of 5 4
Embedded Systems Education
2B. Takeaway: See one, do one, teach one
Students learn by doing
• Equipment must work
• Assignments must be clear
• Tasks support learning objectives
• Professors must do labs
Students learn by teaching
Jonathan Valvano 2 of 5 5
Embedded Systems Education
2C. Takeaway: Empower Students
• Students should have their own board
LaunchPad $13
Connected LP $20
MSP432 $13
Jonathan Valvano 3 of 5 6
Embedded Systems Education
2C 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
Jonathan Valvano 7
Embedded Systems Education
2D. Takeaway: Structure vs Flexibility
Pedagogy: students learn differently
• Remove fear of failure
• Some need structure
• Demonstrate working labs
• Some thrive on open ended design
• Let students negotiate deliverables
• Allow for extra credit
• Create an open-ended design lab
Jonathan Valvano 4 of 5 8
Embedded Systems Education
2E. Takeaway: Team-approach
It takes a village to educate
• Empower the TAs
• Invite them into the decision circle
• Empower the staff
• Invite them into the decision circle
• Make excuses to show off projects
• Chairman, Dean, Newspaper
• Promote your students
Jonathan Valvano 5 of 5 9
Embedded Systems Education
3. 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
floating point
Senior/grad ,CAN, Robot
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
Jonathan Valvano 10
Embedded Systems Education
3. Applications
• Compiler, Simulator, Debugger
• Texas Instruments Code Composer Studio
• Keil uVision
• TExaS (simulation, grading, scope)
• Circuit design and PCB layout
• PCB Artist
• Eagle (100 by 80 mm, 2 layers)
• Design tools
• Texas Instruments Filter Pro
Jonathan Valvano 11
Embedded Systems Education
(bottom-up)
3. Introduction to Embedded Systems
Volume 1 (freshmen EE or BME)
• Switches and LEDs
• Design and Debugging
• Finite State Machine
• Interrupts
• DAC output
• LCD graphics interface
• Fixed-point
• ADC input
• Assembly or C programming • UART and distributed
• Design and Debugging • Capstone design
– Simulation, logic analyzer, scope – video game
Jonathan Valvano 7600 sold 505 pages, $41 12
Embedded Systems Education
Embedded Systems – Shape the World
• What is and isn’t a MOOC?
–Spring 2014, 2015, 2016
– over 100,000 enrolled
– over 2 million video hits
– over 7% got certificates
– 2/3 who started, finished
– 95% approval rate
• Lab kit Physical kit increased completion rates
• Teaching videos Tue. 6/28, 4:45-6:15pm, Room 337
• LaunchPad simulator, graders, voltmeter, scope
• Today’s BLE demo is a MOOC lab
Jonathan Valvano 13
Embedded Systems Education
3. Interfacing and Systems
Volume 2 (junior EE)
• Graphics device driver
• Alarm clock
• Stepper or DC motor
• Music player
• Temperature acquisition
• Wifi and IoT
• Capstone design
– open ended
• Hardware/software debugging – PCB
• Design and debugging – Power
• Analog, power, computer Kindle version
Jonathan Valvano 3800 sold 600 pages, $40 14
Embedded Systems Education
3. Real-Time Operating Systems
Volume 3 (senior/grad EE)
• 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
MOOC starting 9/2016 on edX
[Link]
Jonathan Valvano 2500 sold
447 pages, $34 15
Embedded Systems Education
3. Support for teaching
Web site (download and edit)
• Examples for TM4C123, TM4C1294, MSP432
• PowerPoint slides
• Lab manual, data sheets
• [Link]
edX: Intro Spring 2017, RTOS-BLE Fall 2016
[Link]
Launchpad tester
Adopt a book →
Free parts for LaunchPad tester
[Link]
Jonathan Valvano 16
Embedded Systems Education
4. 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
Jonathan Valvano 17
Embedded Systems Education
4. Competition
Volume 1 (freshmen EE or BME)
• Handheld game
• Peer review <insert video of an
EE319K competition>
• Teams of 2
[Link]
Jonathan Valvano [Link] 18
Embedded Systems Education
4. Competition
Volume 2 (junior EE)
• Requirements document
• Design cycle
• Design for test
• Systems Engineering
• Verification
[Link]
Jonathan Valvano 19
Embedded Systems Education
4. Competitions
Volume 3 (senior/grad EE)
• Autonomous Robot Racing
• Teams of four
Jonathan Valvano [Link]
20
[Link]
Embedded Systems Education
5. Conclusions
• Bottom-up
• Lab-centered
• Empower students Understanding
• Motivate students Design
• Be flexible Innovation
• Be a team builder
• Make a plan and do it
Jonathan Valvano 21
Embedded Systems Education
6. BLE demonstration
Host Generic Access Generic Attribute Profile
Profile (GAP) (GATT)
• Code Composer Studio Security
Manager (SM)
Attribute Protocol
(ATT)
• TExaSdisplay Logical Link Control and
Adaption Protocol (L2CAP)
• MSP432 LaunchPad Controller
Host - Controller Interface (HCI)
• MK-II Booster Pack Link Layer (LL)
• CC2560 LaunchPad Physical Layer (PHY)
ValvanoWare
• VerySimpleApplicationProcessor_MSP432
• ApplicationProcessor_MSP432
• Lab6_MSP432, Lab3_MSP432
Jonathan Valvano 22
Embedded Systems Education
6. BLE demonstration overview
• Install drivers
• Device Manager
• Configure Code Composer Studio
• Import examples into workspace
• Very simple application processor
• Services, characteristics advertising
• Simple application processor
• Data communication
• Labs 3, 6 Fitness device, RTOS, BLE
Jonathan Valvano 23
Embedded Systems Education
6. CC2650
// Pin CC2650LP MSP432
// J1.3 UART DIO3_TXD -> RxD P3.2
// J1.4 UART DIO2_RXD <- TxD P3.3
// J2-14 MRDY DIO8 in <- P1.7 out
// J2-12 SRDY DIO14 out -> P5.2 in
// J4.35 Reset H/W reset <- P6.7 out
// J1.1 3.3V 3.3V in <- 3.3V out
// J2.20 gnd gnd gnd
Remove jumpers
on CC2650 LP
for RxD and TxD
Jonathan Valvano 24
Embedded Systems Education
6. MSP432 drivers
0) Unpack three boards
1) Connect three boards
MK-II on top
MSP432 LaunchPad in middle
CC2650 on bottom
2) Open Device Manager
3) Connect LaunchPad USB to PC and
power up the two boards
4) Watch installation
- Look for first XDS110 COM port
- Class Application/User UART
Jonathan Valvano 25
Embedded Systems Education
6. TExaSdisplay
5) Before you start CCS
- start TExaSdisplay
- COM->OpenNextPort (shift F4)
Jonathan Valvano 26
Embedded Systems Education
6. Configure CCS
6) Start CCS
7) If you do not see my projects
File->Switch Workspace
choose Other…
Jonathan Valvano 27
Embedded Systems Education
6. Configure CCS 1) Browse
8) Select
C:\Users\Administrator\Desktop\ValvanoWare
3) Ok
Jonathan Valvano 28
Embedded Systems Education
6. Configure CCS
9) If you do not see my projects
File->Import
10) Click
ApplicationProcessor_MSP432
Lab3_MSP432
Lab6_MSP432
VerySimpleApplicationProcessor_MSP432
11) Click Finish
Jonathan Valvano 29
Embedded Systems Education
6. VerySimpleApplicationProcessor
12) Click on VerySimpleApplicationProcessor_MSP432 project
13) Open VerySimpleApplicationProcessor.c and edit lines 88, 96
- Change '0', '0', '1' to the three digit number on your handout
Server
Application Processor Any microcontroller
- MSP432
Set of messages
UART
Network Processor Hardware handshake
- CC2650
Jonathan Valvano 30
Embedded Systems Education
6. VerySimpleApplicationProcessor
Standby Client Server
Idle
Requests or Service
Commands - Characteristic
Scanner - Characteristic
Device Advertiser
BLE app
Discovery Service
Initiator
Responses
- Characteristic
- Characteristic
Connection
Slave Master Smart Phone MSP432/CC2650
Characteristic1: lines 159-176 (R/W)
Characteristic2: lines 177-194 (R)
Characteristic3: lines 212-229 (W)
Characteristic4: lines 230-248 (notify)
Jonathan Valvano 31
Embedded Systems Education
6. VerySimpleApplicationProcessor
14) Compile Click on Hammer
15) Download and start debugger Run->Debug
16) Run the program, observe messages between MSP432/CC2650
- TExaSdisplay shows SAP ↔ SNP messages
17) Observe behavior on cell phone
For Android run BLE scanner from Bluepixel
For iPhone run LightBlue Explorer from PunchThrough
- Connect
- Read characteristic1
- Write characteristic1
When done, quit CCS debugger
Jonathan Valvano 32
Embedded Systems Education
6. SimpleApplicationProcessor
18) Click on SimpleApplicationProcessor_MSP432 project
19) Open AP.c and edit lines 194, 202
- Change '0', '0', '1' to the three digit number on your handout
20) Look at main in ApplicationProcessor.c
- Setting characteristics, hooks, variables
21) Compile Click on Hammer
22) Download and start debugger Run->Debug
23) Run the program, observe messages between MSP432/CC2650
24) Observe behavior on cell phone (turn iPhone on and off)
- Connect
- Read HalfWordData (switches)
- Write WordData (bottom three bits to LED)
- Activate Notify on Button1
Jonathan
When done,Valvano
quit CCS debugger 33
Embedded Systems Education
6. Logic Analyzer
25) Quit TExaSdisplay, unplug LaunchPad USB
26) Add MK-II Booster
27) Plug LaunchPad USB
28) Start TExaSdisplay, COM->OpenNextPort (shift F4)
29) In CCS, click on Lab3_MSP432 project
30) Open Lab3.c and edit lines 1247,1248
- include line 1248 to activate logic analyzer
31) Look at main in Lab3.c
- Personal fitness device with RTOS
32) Compile Click on Hammer
33) Download and start debugger Run->Debug
34) Run the program
35) Observe profile on Logic analyzer
Jonathan
-F6Valvano
to zoom out, F7 to zoom in 34
Embedded Systems Education
6. Lab 6, Fitness, RTOS, BLE
36) Click on Lab6_MSP432 project
37) Open AP.c and edit lines 194, 202
- Change '0', '0', '1' to the three digit number on your handout
38) Look at main in Lab6.c
- Lines 789-841 configure Bluetooth
- Lines 466-476 run Bluetooth processing, and notifications
39) Compile Click on Hammer
40) Download and start debugger Run->Debug
41) Run the program, observe messages between MSP432/CC2650
42) Observe behavior on cell phone (turn iPhone on and off)
- Connect
- Read Light, Sound, Temperature
- Activate Notify on NumSteps
Jonathan Valvano 35
Embedded Systems Education
7. Interesting web sites
Valvano Example code
[Link]
[Link] (CCS projects)
TI Example code
[Link]
[Link]
Free samples
[Link]
Compilers
[Link]
[Link]
Jonathan Valvano 36
Embedded Systems Education
7. For more information
Jonathan Valvano valvano@[Link]
[Link]
EE319K Introduction
EE445L Interfacing and systems
EE445M Real-time operating systems
[Link]
[Link]
[Link]
[Link]
Texas Instruments
univ@[Link]
Jonathan Valvano 37