118
Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC [email protected] Karl Henry Instructor, JF Drake State [email protected] u Nasser Alaraje Associate Professor, MTU [email protected] Brian Zufelt Faculty, UNM [email protected] Bassam Matar Instructor, Chandler- Gilbert [email protected] .edu 1

Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC [email protected] Karl Henry Instructor, JF Drake State

Embed Size (px)

Citation preview

Page 1: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Microcontroller Two Day Beginners Workshop

Instructors

1

Craig KiefDeputy Director, COSMIAC

[email protected]

Karl HenryInstructor, JF Drake State

[email protected]

Nasser AlarajeAssociate Professor, MTU

[email protected]

Brian ZufeltFaculty, UNM

[email protected]

Bassam MatarInstructor, Chandler-Gilbert

[email protected]

1

Page 2: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Introductions

• Who are you?

• Where are you from?

• Any Microcontroller or Microprocessor experience?

• Any C experience?

• What do you want to learn from this?

2

Page 3: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

SyllabusDay 1

- 8:30 am Introduction / Survey

- 9:15 am What is a Microcontroller

- 9:45 am Compiler and C as Tools

- 10:15 am Break

- 10:30 am Lab 1 – Load Software

- 11:00 am Lab 2 – White Light

- 12:00 pm Lunch

- 1:00 pm C Syntax, Compilers, Basic C Statements, Preprocessor

- 2:00 pm Lab 3 – Blinking Light and Preprocessor

- 3:00 pm Lab 4 – LED and Counter

3

Page 4: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Syllabus

Day 2- 8:30 am Recap of Day 1

- 9:00 am Functions and Libraries

- 10:00 am Lab 5 – Interrupts

- 11:00 am Lab 6 – UART

- 12:00 pm Lunch

- 1:00 pm Lab 7 – Accelerometers

- 2:00 pmLab 8 – Temp Sensor

- 3:00 pm Lab 9 – OLED / Final Project

- 3:45 pm Microcontroller peripherals

- 4:00 pm Support System (Software & Wiki, etc.)

- 4:30 pm Implementation / Adaption Plan / Issues at schools

- 5:00 pm Conclusions / Feedback / Survey

4

Page 5: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Why we are here

The average instructor when they are told they should be updating their microcontroller lab by a department chair

5

Page 6: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Students learn more, faster, and better with unrestricted access to design tools…

…overall learning improves when applied design skills taught early;

…overall performance improves when design skills used frequently;

…and they like it*

*results published in 2008 and 2009 ASEE proceedings

I never teach my pupils; I only attempt to provide the conditions in which they can learn. Albert Einstein

Method: Immersive hands-on design for every student

6

Page 7: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Microcontroller across the Curriculum

• Computer Architecture• Embedded Processors• System on a Chip

• Digital Logic• Dedicated Controllers• Application Specific Circuit Testing

• Controls• Motor Control• Sensor Interface• Robotics

• DSP• Dedicated MAC

7

Page 8: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Please interrupt and ask questions

8

Page 9: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

What is a Microprocessor• A microprocessor incorporates the functions of a computer's central

processing unit (CPU) on a single integrated circuit (IC). It is a multipurpose, programmable device that accepts digital data as input, processes it according to instructions stored in its memory, and provides results as output.

• It is an example of sequential digital logic, as it has internal memory.• Microprocessors operate on numbers and symbols represented in

the binary numeral system.• The advent of low-cost computers on integrated circuits has

transformed modern society.

9

Page 10: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

What is a Microcontroller• A microcontroller (sometimes abbreviated µC, uC or MCU) is a small

computer on a single integrated circuit containing a processor core, memory, and programmable input/output peripherals. Microcontrollers are designed for embedded applications, in contrast to the microprocessors used in personal computers or other general purpose applications.

• Microcontrollers are used in automatically controlled products and devices, such as automobile engine control systems, implantable medical devices, remote controls, office machines, appliances, power tools, toys and other embedded systems.

• By reducing the size and cost compared to a design that uses a separate microprocessor, memory, and input/output devices, microcontrollers make it economical to digitally control even more devices and processes.

• Mixed signal microcontrollers are common, integrating analog components needed to control non-digital electronic systems.

10

Page 11: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

What is C and AssemblyAll computers process information in the form of bits. However writing code in 1’s and 0’s can be a impossible task for complex systems. For this reason higher level programing languages such as C and Assembly were created.

Assembly is a language that is closely tied to a given architectures instruction set. An instruction set is the commands a given processor is able to execute as a single instruction. For example, bit shifts , memory jump, basic math operations.

C is a widely used programming language that rises above a specific instruction set. This allows C to be more readable and portable to multiple devices, while still remaining close enough to the hardware language that minimal performance sacrifices are made. For these reasons C has become the language of choice for many embedded system designers.

As you move to higher languages (C++, Java, C#, and objective C, Visual Basic) the language is easier to read, however performance is sacrificed.

11

Page 12: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Top Languages

12

• According to IEEE July, 2014

Page 13: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

The Compiling Process• A compiler is a computer program (or set of programs) that transforms

source code written in a programming language (the source language) into another computer language (the target language, often having a binary form known as object code). The most common reason for wanting to transform source code is to create an executable program.

• The name "compiler" is primarily used for programs that translate source code from a high-level programming language to a lower level language (e.g., assembly language or machine code).

• For this course, we will use the Texas Instruments Code Composer Compiler.

13

Page 14: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Stellaris vs. Tiva• What is the difference?

• Please see this document that lists the equivalent part numbers in the two families. The parts are the same and you can directly replace the Tiva part number in a design with the equivalent LM4F part number.  For software porting, please see this document. Both the launchpad and the EK-LM4F232 will continue to be supported, and there is a new version of the Launchpad with a Tiva part and additional functionality.  Please let me know if you have additional questions.

• Part number doc: http://www.ti.com/lit/ml/spmt284/spmt284.pdf

• Tiva LaunchPad vs Stellaris LaunchPad

14

Page 15: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Stellaris vs. Tiva

15

Page 16: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

What projects are Microcontrollers good for?The Tiva TM4C (formerly Stellaris LM4F) series of ARM Cortex-M4 microcontrollers provides top performance and advanced integration. The product family is positioned for cost-conscious applications requiring significant control processing and connectivity capabilities such as:

•Connectivity•Sensor aggregation•Security and access control•Home and building automation•Industrial automation•Human machine interface•Lighting control•Energy•Data acquisition•System management

For applications requiring extreme conservation of power, the TM4C1233H6PM microcontroller

features a battery-backed Hibernation module to efficiently power down the TM4C1233H6PM to a

low-power state during extended periods of inactivity. A Hibernation module positions the

TM4C1233H6PM microcontroller perfectly for battery applications.

16

Page 17: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Why this tool

Eclipse (Design Environment) – Free

Code Composer (not free but open with IDE)

ADT (Android Development Tool)

Java

PIC (gcc)

AVR (gcc)

17

In computer programming, Eclipse is a multi-language software development environment comprising a base workspace and an extensible plug-in system for customizing the environment. It is written mostly in Java. It can be used to develop applications in Java and, by means of various plug-ins, other programming languages including Ada, C, C++, COBOL, Fortran, Haskell, JavaScript, Perl, PHP, Python, Scala, Scheme, and Erlang.

Page 18: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

18

Pinouts for Projects

Tiva Chip

TM4C1232H6PM

Page 19: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Section Objectives

At the end of this section you will be able to Understand the high-level architecture of ARM processor Understand the CPU, Digital, Analog and Programmable

Routing / Interconnect Systems

19

Page 20: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Why we went the way we did

• ARM is the way of the future. Wanted a way to teach intro microcontrollers but also a path way ahead to life long learning

• Wanted to have hardware that instructors could inexpensively obtain for a long period of time

• Wanted to utilize Digilent reliability • Wanted a free high quality design environment• Wanted to utilize simple enough C code that instructors could immediately

begin simple projects

Digilent Orbit Board Mounted on Tiva LaunchPad

20

TI Tiva LaunchPad

Page 21: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Tiva LaunchPad21

The Tiva Launchpad is an evaluation platform provided by Texas Instruments. It provides an excellent platform for exploring all the options the Tiva family of microcontrollers provide. Some features include:

•In-circuit-debugger•I/O headers•USB connection•RGB LED•USB to Serial converter•Pushbuttons

Page 22: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

22

What’s a kibibyte?

Page 23: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

23

System Overview

Courtesy of Real-Time OS for ARM Cortex-M by Valvano

Page 24: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Digilent Orbit Board24

The Orbit board contains many features to help students grasp the concepts presented

•OLED display

•Expandable PMOD connectors

•Potentiometer

•Switches

•Push Buttons

•LEDs

•I2C headers

There are definitely other alternatives

Page 25: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Texas Instrument's Stellaris® family of microcontrollers provide designers a high-performance ARM®Cortex™-M-based architecture with a broad set of integration capabilities and a strong ecosystemof software and development tools. Targeting performance and flexibility, the Stellaris architecture offers a 80 MHz Cortex-M with FPU, a variety of integrated memories and multiple programmable GPIO. Offering quicker time-to-market and cost savings, the Stellaris family of microcontrollers is the leading choice in high-performance 32-bit applications.

CPU Subsystem

25

Full datasheet at: http://cosmiac.org/Community_Portal_Micro.html

Page 26: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

What and Why ARM?• The ARM architecture describes a family of RISC-based computer

processors designed and licensed by British company ARM Holdings. It was first developed in the 1980s by Acorn Computers Ltd to power their desktop machines and subsequently spun off as a separate company, now ARM Holdings.

• Globally as of 2013 it is the most widely used 32-bit instruction set architecture in terms of quantity produced. According to ARM Holdings, in 2010 alone, producers of chips based on ARM architectures reported shipments of 6.1 billion ARM-based processors, representing 95% of smartphones, 35% of digital televisions and set-top boxes, and 10% of mobile computers.

• As an IP core business, Advanced RISC Machine (ARM) Holdings itself does not manufacture its own electronic chips, but licenses its designs to other semiconductor manufacturers.

26

Page 27: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Why are they important• Virtually every appliance, smart phone, automobile, well,

you name it, has one in it. • Having a technician, technologist or engineer that doesn‘t at

least have a working knowledge of them is doing them an injustice.

27

Page 28: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

How are Microcontroller projects Designed?

• For our workshop, we will use three packages• Code Composer Studio• TivaWare Firmware Development Package • LM Flash Programmer Utility• ATE Workshop Lab

• The overall design language is C code!

28

Page 29: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

I wish to help all of you to begin teaching Microcontrollers

29

Page 30: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Three Elements of Focus• Hardware : Includes the

architecture of the microcontroller / microprocessor used, and if there is and operating system installed.

• SDK: Includes all software used for development; IDE, Debuggers ,etc..

• Programming Language: Includes all programming languages used to develop your project. We will use C.

30

Page 31: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

ARCHITECTURE OVERVIEWARM Processor

31

Page 32: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

ARM CORTEX M4F

32

• The next series of slides will drill down into the specifics and capabilities

Page 33: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

ARM Cortex M4F

• The Cortex-M4F processor is built on a high-performance processor core, with a 3-stage pipeline Harvard architecture, making it ideal for demanding embedded applications.

• Four Parts that will be discussed:

• ARM• System Peripherals• Serial Peripherals• Analog Peripherals

33

Page 34: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

ARM Cortex M4F

• “F” means the processor has a Floating Point Unit (FPA)

34

Page 35: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

ARM Cortex M4F – Processor Core

• 32-bit ARM Cortex-M4F architecture optimized for small-footprint embedded applications

• 80-MHz operation • Outstanding processing performance combined with fast

interrupt handling• ARM core in a compact memory size usually associated with 8-

and 16-bit devices, typically in the range of a few kilobytes of memory for microcontroller-class applications

• IEEE754-compliant single-precision Floating-Point Unit (FPU)• 16-bit SIMD vector processing unit• Fast code execution permits slower processor clock or increases

sleep mode time• Harvard architecture characterized by separate buses for

instruction and data

35

Page 36: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

ARM Cortex M4F FPU and Peripherals• Floating-Point Unit (FPU) - The FPU fully supports single-precision add,

subtract, multiply, divide, multiply and accumulate, and square root operations. It also provides conversions between fixed-point and floating-point data formats, and floating-point constant instructions.

• The TM4C1233H6PM microcontroller is integrated with the following set of on-chip memory and features: 32 KB single-cycle SRAM, 256 KB single-cycle Flash memory and 2KB EEPROM

36

Page 37: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Memory Mapped I/OMemory Mapped I/O is a method of assigning a memory address to all the peripherals attached to the processor. This allows the processor to access peripherals in the same way it accesses memory. This method reduces development time, and code space.

37

Page 38: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

SERIAL

38

Page 39: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

SERIAL - OVERVIEW

The TM4C123GH6PM controller supports both asynchronous and synchronous serial communications with:•USB 2.0 Device•Eight UARTs with IrDA, 9-bit and ISO 7816 support (one UART with modem flow control)•Six I2C modules with four transmission speeds including high-speed mode•CAN 2.0 A/B controller•Four Synchronous Serial Interface modules (SSI)

39

Page 40: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

SERIAL - USB

• Universal Serial Bus (USB) is a serial bus standard designed to allow peripherals to be connected and disconnected using a standardized interface without rebooting the system.

• USB was designed to standardize the connection of computer peripherals (including keyboards, pointing devices, digital cameras, printers, portable media players, disk drives and network adapters) to personal computers, both to communicate and to supply electric power.

• It has become commonplace on other devices, such as smartphones, PDAs and video game consoles. USB has effectively replaced a variety of earlier interfaces, such as serial and parallel ports, as well as separate power chargers for portable devices.

40

Page 41: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

SERIAL - UART• A Universal Asynchronous Receiver/Transmitter (UART) is an integrated

circuit used for RS-232C serial communications, containing a transmitter (parallel-to-serial converter) and a receiver (serial-to-parallel converter), each clocked separately.

• The TM4C123GH6PM microcontroller includes eight fully programmable 16C550-type UARTs. Although the functionality is similar to a 16C550 UART, this UART design is not register compatible. The UART can generate individually masked interrupts from the Rx, Tx, modem flow control, and error conditions. The module generates a single combined interrupt when any of the interrupts are asserted and are unmasked.

41

Page 42: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

SERIAL – I2C• The Inter-Integrated Circuit (I2C) bus provides bi-directional data transfer

through a two-wire design (a serial data line SDA and a serial clock line SCL). The I2C bus interfaces to external I2C devices such as serial memory (RAMs and ROMs), networking devices, LCDs, tone generators, and so on.

• The I2C bus may also be used for system testing and diagnostic purposes in product development and manufacture.

• Each device on the I2C bus can be designated as either a master or a slave. I2C module supports both sending and receiving data as either a master or a slave and can operate simultaneously as both a master and a slave. Both the I2C master and slave can generate interrupts.

• The TM4C123GH6PM microcontroller includes six I2C modules.

42

Page 43: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

SERIAL - CAN• Controller Area Network (CAN) is a multicast shared serial-bus standard for

connecting electronic control units (ECUs). CAN was specifically designed to be robust in electromagnetically noisy environments and can utilize a differential balanced line like RS-485 or twisted-pair wire. Originally created for automotive purposes, it is now used in many embedded control applications (for example, industrial or medical). Bit rates up to 1 Mbps are possible at network lengths below 40 meters. Decreased bit rates allow longer network distances (for example, 125 Kbps at 500m)

• CAN bus is a vehicle bus standard designed to allow microcontrollers and devices to communicate with each other within a vehicle without a host computer.

• CAN bus is a message-based protocol, designed specifically for automotive applications but now also used in other areas such as aerospace, industrial automation and medical equipment.

43

Page 44: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

SERIAL – SSI• Synchronous Serial Interface (SSI) is a four-wire bi-directional

communications interface that converts data between parallel and serial. The SSI module performs serial-to-parallel conversion on data received from a peripheral device, and parallel-to-serial conversion on data transmitted to a peripheral device. The SSI module can be configured as either a master or slave device. As a slave device, the SSI module can also be configured to disable its output, which allows a master device to be coupled with multiple slave devices. The TX and RX paths are buffered with separate internal FIFOs.

• The SSI module also includes a programmable bit rate clock divider and prescaler to generate the output serial clock derived from the SSI module's input clock. Bit rates are generated based on the input clock and the maximum bit rate is determined by the connected peripheral.

• The TM4C123GH6PM microcontroller includes four SSI modules

44

Page 45: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

ANALOG

45

Page 46: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

ANALOG - OVERVIEW

The TM4C123GH6PM microcontroller provides analog functions integrated into the device, including:•Two 12-bit Analog-to-Digital Converters (ADC) with 12 analog input channels and a sample rate of one million samples/second•Two analog comparators•16 digital comparators•On-chip voltage regulator

46

Page 47: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

ANALOG - ADC

• An analog-to-digital converter (ADC) is a peripheral that converts a continuous analog voltage to a discrete digital number. The Stellaris ADC module features 12-bit conversion resolution and supports 12 input channels plus an internal temperature sensor. Each ADC module has a digital comparator function that allows the conversion value to be diverted to a comparison unit that provides eight digital comparators.

• The TM4C123GH6PMmicrocontroller provides two ADC modules.

47

Page 48: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

ANALOG – ANALOG COMPARATOR

• An analog comparator is a peripheral that compares two analog voltages and provides a logical output that signals the comparison result. The TM4C123GH6PM microcontroller provides two independent integrated analog comparators that can be configured to drive an output or generate an interrupt or ADC event.

• The TM4C123GH6PM microcontroller provides two independent integrated analog comparators.

48

Page 49: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

DEVELOPMENT TOOLSARM Processor

49

Page 50: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

IDE IS A TOOL

Code Composer Studio is more than a compiler. CCS contains many tools

•Debugger•Editor•Disassembler•GUI•Simulator•Drivers / Libraries•Examples•Optimization | Published 1988 | | Published 2012 |

50

Page 51: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

SyllabusDay 1

- 8:30 am Introduction / Survey

- 9:15 am What is a Microcontroller

- 9:45 am Compiler and C as Tools

- 10:15 am Break

- 10:30 am Lab 1 – Load Software

- 11:00 am Lab 2 – White Light

- 12:00 pm Lunch

- 1:00 pm C Syntax, Compilers, Basic C Statements, Preprocessor

- 2:00 pm Lab 3 – Blinking Light and Preprocessor

- 3:00 pm Lab 4 – LED and Counter

51

Page 52: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Start the Learning

The key from this workshop is to learn what you need to know to successfully teach with Microcontrollers

52

Page 53: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Lab 1 Overview

• Provides you with an introduction to the design tools • Steps you through the design tool installation process• Loading and licensing the software

53

Page 54: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Lab 2 Overview

54

• Turn on a light• Still only using the Tiva

LaunchPad• Change the color

Page 55: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

SyllabusDay 1

- 8:30 am Introduction / Survey

- 9:15 am What is a Microcontroller

- 9:45 am Compiler and C as Tools

- 10:15 am Break

- 10:30 am Lab 1 – Load Software

- 11:00 am Lab 2 – White Light

- 12:00 pm Lunch

- 1:00 pm C Syntax, Compilers, Basic C Statements, Preprocessor

- 2:00 pm Lab 3 – Blinking Light and Preprocessor

- 3:00 pm Lab 4 – LED and Counter

55

Page 56: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Lunch

• Talking ATE• Proposals are due in October, 2014

56

Page 57: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Advanced Technological Education (ATE)Synopsis of Program:With an emphasis on two-year colleges, the Advanced Technological Education (ATE) program focuses on the education of technicians for the high-technology fields that drive our nation's economy. The program involves partnerships between academic institutions and employers to promote improvement in the education of science and engineering technicians at the undergraduate and secondary school levels. The ATE program supports curriculum development; professional development of college faculty and secondary school teachers; career pathways to two-year colleges from secondary schools and from two-year colleges to four-year institutions; and other activities. Another goal is articulation between two-year and four-year programs for K-12 prospective teachers that focus on technological education. The program also invites proposals focusing on research to advance the knowledge base related to technician education.

Page 58: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

ATE Video

What is ATE? Video

Page 59: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Advanced Technological Education (ATE)

Cognizant Program Officer(s):Please note that the following information is current at the time of publishing. See program website for any updates to the points ofcontact.

V. Celeste  Carter [email protected] 703-292-4651   David  B. Campbell

[email protected] (703) 292-5093  885 S  

David  R. Brown [email protected] (703) 292-8831  835 N  Connie  K. Della-Piana

[email protected] (703) 292-5309  835 N  

R. Corby  Hovis [email protected] (703) 292-4625  835 N  

Page 60: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Advanced Technological Education (ATE)Synopsis of Program:With an emphasis on two-year colleges, the Advanced Technological Education (ATE) program focuses on the education of technicians for the high-technology fields that drive our nation's economy. The program involves partnerships between academic institutions and industry to promote improvement in the education of science and engineering technicians at the undergraduate and secondary school levels. The ATE program supports curriculum development; professional development of college faculty and secondary school teachers; career pathways to two-year colleges from secondary schools and from two-year colleges to four-year institutions; and other activities. Another goal is articulation between two-year and four-year programs for K-12 prospective STEM teachers that focus on technological education. The program invites research proposals that advance the knowledge base related to technician education.

Page 61: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Anticipated number, size, and duration of new awards

• Anticipated number, size, and duration of new awards:• ATE Projects: approximately 20-35 new awards, ranging from $25,000 to $300,000 per year and having

a duration of up to three years, except for ATE-Coordination Network projects, which may be up to $200,000 per year for four years.

• ATE small grants for institutions new to the ATE program: approximately 12-20 awards for up to $200,000 (each) typically spread over three years. It is expected that the budget request will match the scope of the project.

• New national center proposals will be considered only if a compelling case that there is a national need for a center in the particular technology and that the proposed center does not duplicate in any substantial way an existing national center or nationally-coordinated activities in the same technology (see text above under national centers). National centers funding will be $4 million spread over five years, with the possibility of a competitive grant renewal for $4 million over an additional five years.

• Regional Centers of Excellence: up to 2 new awards for up to $3 million (each) spread over four years, with the possibility of a competitive grant renewal, normally at a lower level of annual funding, for an additional three years.

• Support Centers: up to 2 new awards for up to $1.6 million (each) spread over four years with the possibility of a competitive grant renewal.

• Planning Grants for Centers: up to 2 new awards for up to $70,000 (each) to develop well-formulated plans for future national and/or regional centers (see Section V.A ["Proposal Preparation"] for additional information).

• Targeted Research on Technician Education: up to 5 new awards, ranging from $150,000 total for up to 2 years to $800,000 total for up to 3 years.

Page 62: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Other Stuff

Proposals due 9 October

External Evaluator

2 year important

We consult

Paperwork takes forever

Serve as proposal evaluator

Letters of support

Page 63: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Publications

63

Legend: 1=Really Important; 2=Important; 3=Cool to Know

Page 64: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

1 SW-TM4C-DRL-UG-2.1.0.12573.pdf

• This document describes the most common peripherals available on the chip. The library functions that are included with TivaWare to run the peripherals are also included.

• 700+ pages on ever peripheral including CAN, AES, LCD, DES, UART, …….

64

Page 65: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

1 SW-TM4C-EXAMPLES-UG-2.1.0.12573• The document provides example code and descriptions

for basic peripheral use and applications. Goes along with the project code included in your installation.

65

Page 66: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

1 SW-TM4C-RLN-2.1.0.12573• Release notes are good to check for troubleshooting and

debug purposes. Sometimes the function calls will be modified between releases and this is a great place to begin to look for problem/solutions

• Note: it is not required to use the latest release of TivaWare for every application – use what works

66

Page 67: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

2 SW-TM4C-BOOTLDR-UG-2.1.0.12573• This document describes how to use the boot loader and

the various features it offers.

67

Page 68: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

2 SW-TM4C-IQMATH-UG-2.1.0.12573

• IQ Math document provides additional math functions that are not included in the standard C library.

68

Page 69: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

2 SW-TM4C-SENSORLIB-UG-2.1.0.12573• The sensor library provides

many functions to control third party sensors that can be connected to the Tiva board.

• 160 pages of how to work with a wide variety of sensors

• Note that not all sensors are created by TI.

69

Page 70: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

2 SW-TM4C-TOOLS-UG-2.1.0.12573

• The tools user guide provide additional information on the development environment

70

Page 71: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

2 SW-TM4C-USBL-UG-2.1.0.12573• USB is a dedicated document for the USB function on the

Tiva board. While USB is a standard, it is more involved than a UART.

71

Page 72: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

3 SW-TM4C-GRL-UG-2.1.0.12573• The graphics library provides functions to translate and

display graphics options to use resistive touch screens and there are multiple booster packs that take advantage of this.

72

Page 73: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

3 SW-TM4C-NFCLIB-UG-2.1.0.12573

• The NFC library provides functions to control near field communications chips. NFC is the new RF ID. Think ApplePay on the new iWatch. The common chip is from NXP

73

Page 74: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

3 SW-TM4C-UTILS-UG-2.1.0.12573• The utilities document is an extension of the tools

document and describes additional utilities for debugging, programming, operations and applications.

74

Page 75: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

SyllabusDay 1

- 8:30 am Introduction / Survey

- 9:15 am What is a Microcontroller

- 9:45 am Compiler and C as Tools

- 10:15 am Break

- 10:30 am Lab 1 – Load Software

- 11:00 am Lab 2 – White Light

- 12:00 pm Lunch

- 1:00 pm C Syntax, Compilers, Basic C Statements, Preprocessor

- 2:00 pm Lab 3 – Blinking Light and Preprocessor

- 3:00 pm Lab 4 – LED and Counter

75

Page 76: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

C PROGRAMMING LANGUAGEARM Processor

76

Page 77: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Basic C

• Variables and Datatypes • Arithmetic Expressions• Relational and Logical Operators• Bitwise operators• Conditional statements• Loops• Functions• Pointers

77

Page 78: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Variables and Data types• Variables store bits of data, the size depends on the data type. • Missing data types are bool and bit. These are typically handled

differently by the compiler.

78

Page 79: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Arithmetic Expressions

79

Page 80: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Relational and Logical Operators

80

These operations always return a Boolean result aka: True/False , On/Off.

NOTE: False is any zero value, and True is a non-zero value.

Page 81: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Bitwise Operators

81

Bitwise Operations work on each bit within a given value

Page 82: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Conditional Statements• Conditional Statements execute ONLY when a certain condition is

evaluated as true, or tested to be a specific value. • if(condition){}• else{}• switch(value){

case value1:

break;

case value2:

break;

default:

break;

}

82

Page 83: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Loops• Loops involve a code block that will continue running in a

loop while a current condition is evaluated to be true.• While(condition)• For((initialize); (condition) ; (after loop)){}

83

Notice that each example contains a while(1) loop. If this code block was not there, the code will execute only once.

Page 84: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Functions• Functions allow you to separate you code into small

chunks that are intended to accomplish a specific task.

• All programs begin with the main(){}; function

• Functions must be declared before the main function. This is called a prototype.

• All functions that call another function, must be declared below the called function.

84

Page 85: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Pointers

85

• Pointers are variables that contain the memory address of a specific value.

• Pointer bit size depends on the architecture of the hardware used.

• Pointers are usually the most confusing subject for those new to programming. There is even books dedicated to the proper use of pointers.

• We will cover pointers in the labs as they come up.

Page 86: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Preprocessor

• The C preprocessor, is a macro processor that is used automatically by the C compiler to transform your program before compilation.

• The Preprocessor allows the developer to organize code to make it more readable, portable, and reusable.

• All statements that begin with ‘#’ are handled by the Preprocessor before the compiler is invoked.

86

Page 87: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

C Syntax

• All #define are in all CAPS• All functions begin with a capital letter • All variables are lower case• Indent one tab for all sub block code (eg. All code

between {})• Keep all code related to a particular task together. Don’t

create patchy code.• Comment, Comment, Comment!!!

87

Page 88: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

SyllabusDay 1

- 8:30 am Introduction / Survey

- 9:15 am What is a Microcontroller

- 9:45 am Compiler and C as Tools

- 10:15 am Break

- 10:30 am Lab 1 – Load Software

- 11:00 am Lab 2 – White Light

- 12:00 pm Lunch

- 1:00 pm C Syntax, Compilers, Basic C Statements, Preprocessor

- 2:00 pm Lab 3 – Blinking Light and Preprocessor

- 3:00 pm Lab 4 – LED and Counter

88

Page 89: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Lab 3 Overview

• Blinking Light and Preprocessor

89

Page 90: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Next Project

90

Page 91: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Lab 4 Overview

• LED and Counter

91

Page 92: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

SyllabusDay 1

- 8:30 am Introduction / Survey

- 9:15 am What is a Microcontroller

- 9:45 am Compiler and C as Tools

- 10:15 am Break

- 10:30 am Lab 1 – Load Software

- 11:00 am Lab 2 – White Light

- 12:00 pm Lunch

- 1:00 pm C Syntax, Compilers, Basic C Statements, Preprocessor

- 2:00 pm Lab 3 – Blinking Light and Preprocessor

- 3:00 pm Lab 4 – LED and Counter

92

Page 93: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Day 2

• Recap yesterday events

93

Page 94: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Syllabus

Day 2- 8:30 am Recap of Day 1

- 9:00 am Functions and Libraries

- 10:00 am Lab 5 – Interrupts

- 11:00 am Lab 6 – UART

- 12:00 pm Lunch

- 1:00 pm Lab 7 – Accelerometers

- 2:00 pmLab 8 – Temp Sensor

- 3:00 pm Lab 9 – OLED / Final Project

- 3:45 pm Microcontroller peripherals

- 4:00 pm Support System (Software & Wiki, etc.)

- 4:30 pm Implementation / Adaption Plan / Issues at schools

- 5:00 pm Conclusions / Feedback / Survey

94

Page 95: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Functions

• A function is a block of code that has a name and it has a property that is reusable (i.e. it can be executed from as many different points in a C program as required

• A function groups a number of program statements into a unit and gives it a name.

• Functions give the ability for code segmented into modules or “black boxes”

95

Page 96: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Libraries

• A C library is a set of named functions. Some libraries are part of the C language standard. There are static and dynamic libraries• Static Libraries are part of the build environment• Dynamic Libraries are part of the run-time environment

• .h files or header files include functional prototypes and declarations (not definitions) of functions

• The .h file is used to generate a library

96

Page 97: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Lab 5 Overview

• Interrupts – airbag or stereo

97

Page 98: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Lab 6 Overview - UART Implementation• According to wikipedia: A universal asynchronous receiver/transmitter, abbreviated UART, is a piece of computer hardware that translates data between parallel and serial forms. UARTs are commonly used in conjunction with communication standards such as EIA, RS-232, RS-422 or RS-485. The universal designation indicates that the data format and transmission speeds are configurable. The electric signaling levels and methods (such as differential signaling etc.) are handled by a driver circuit external to the UART.•A UART is usually an individual (or part of an) integrated circuit used for serial communications over a computer or peripheral device serial port. UARTs are now commonly included in microcontrollers.

98

Page 99: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Lunch• Documentation

• TivaWare• Tutorials• Software Installation• Online Resources

99

Page 100: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

TivaWare Documentation

100

Page 101: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

TivaWare Documentation• You only care about the

files with TM4C123… in them

101

Page 102: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Lab 7 Overview - Accelerometer

• Accelerometer – This device is on the Orbit board.

102

Y+

X+

Z+

Page 103: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Lab 7 Overview• What is an accelerometer?An accelerometer is an electromechanical device that will measure acceleration forces. These forces may be static, like the constant force of gravity pulling at your feet, or they could be dynamic - caused by moving or vibrating the accelerometer. • What are accelerometers useful for?By measuring the amount of static acceleration due to gravity, you can find out the angle the device is tilted at with respect to the earth. By sensing the amount of dynamic acceleration, you can analyze the way the device is moving. At first, measuring tilt and acceleration doesn't seem all that exciting. However, engineers have come up with many ways to make really useful products with them.

103

Page 104: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

104

Page 105: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Lab 8 Overview

• Temp Sensor with a UART

105

Page 106: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Don’t get frustrated

The project may not be successful for each person each time. Don’t get frustrated. The process is simple but it is often easy to make simple mistakes.

106

Page 107: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Lab 9 Overview

• Final Project•Suggestions:

•Output Temp sensor data to the LEDs on the Orbit board•Output Accelerometer data to the UART

107

Page 108: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Impediments to Implementation

• Hurdles we have seen• We have always done it this way

• Hurdles you might see• Fear factor

108

Page 109: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Additional Materials

• Here is the link for our tutorials

• http://cosmiac.org/Projects_Micro.html

• Here is a link for an advanced TI ARM series of tutorials and workshops.

• http://processors.wiki.ti.com/index.php/Getting_Started_with_the_Stellaris_EK-LM4F120XL_LaunchPad_Workshop

109

Page 110: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

The Team’s Plan

• Develop Instructional Material• Train Faculty

110

Page 111: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Collaboration

• We do collaborations very well

• Small Grants for Institutions New to the ATE Program

• Project Proposals

111

Page 112: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Developing Curriculum

• Lab1 – Intro – SW Install• Lab 2 – LED• Lab 3 – Blink LED• Lab 4 – Switches Buttons• Lab 5 – Interrupts• Lab 6 – UART• Lab 7 – Accelerometer• Lab 8 – Temp Sensor• Lab 9 – OLED• Lab 10 – EEPROM• Lab 11 – ADC• Lab 12 – Graphic Display Module

112

Page 113: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Moving Forward

• Different Development Platforms• Additional resources and examples• Different architectures• Operating Systems• Higher level languages• Object Oriented language

113

Page 114: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Conclusions

114

Page 115: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

Painful survey

We need your help in statistics. We will be contacting you!

115

Page 116: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

APPENDIX

116

Page 117: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

117

Page 118: Microcontroller Two Day Beginners Workshop Instructors 1 Craig Kief Deputy Director, COSMIAC craig.kief@cosmiac.org Karl Henry Instructor, JF Drake State

118