Table of Contents

Introduction to Design (2) — Microcontroller Systems and Interfaces

Classes

Mondays and Fridays 08:50 – 12:00

Download and watch videos before the class. (The 'subs' versions have English subtitles burned in.) Complete as many lab experiments as you can before the class.

Cookbook (PDF)

A collection of useful information and recipes about programming and interfacing microcontrollers using the Arduino IDE.

Application notes (PDF)

Application notes covering the communication protocols we use in this course.

Data sheets (PDF)

Data sheets and other useful information about the active devices that we use in this course.

NOTE The class has an associated development kit. Before the first class, use the kit parts list to verify that your kit has all the parts.

Class content is delivered by video. It will normally not be repeated during classes. You therefore must download and watch each week's videos before attending the class.

You should also download and try to complete each week's lab experiments before attending the class. The deadline for submission of experimental results is the first Monday following the class.

The class periods on Friday will be for answering questions about the course content and for assisting anyone who cannot make progress on the experimental part of the class.

Class summaries are posted below with details of homework assignments, etc.

Week 1 — Overview and introduction

Course outline. Assessment methods. Office hours, course web site. Project work environment and tools. Lecture format: interrupt and ask questions! Installing the IDE. Writing microcontroller programs.

Sample answers for week 1 experiments:

01-blink blinkenlichten

Challenges:

01-morse-simple simplest Morse code SOS generator
01-morse-factored move repeated actions into reusable functions
01-morse-pattern use a pattern like “… — …” to send a message
01-morse-letters decode a string like “SOS” into patterns to send
01-morse-general same thing extended for the entire Morse code
01-morse-array use an array instead of switch (trade data memory for code space)

Homework
Download and watch all week 1 videos.
Complete week 1 lab experiments.
Download and watch the week 2 videos before next week's class.
Complete as many lab experiments as possible before next week's class.

Week 2 — Serial monitor, basic input/output

Configuring and using the serial monitor. Reading analogue input values. Configuring and operating digital output pins. Using analogue input to control digital output. Using the serial plotter to visualise sensor data.

Please complete as many of the experiments as possible before class.

Sample answers for experiments:

02-serial serial monitor “hello world”
02-serial-a0 A0 value to serial monitor
02-blink-a0 analogue voltage controls blink rate

Challenges:

02-serial-volts report analogue voltage
02-serial-angle report potentiometer angle
02-serial-a0a1 A0 and A1 values to serial monitor
sketch_etch.pyde etch-a-sketch with dots (for Processing 3 ONLY!)
sketch_line.pyde etch-a-sketch with connected line segments (for Processing 3 ONLY)
sketch_etch.pde etch-a-sketch with dots (for Processing 4)
sketch_line.pde etch-a-sketch with connected line segments (for Processing 4)

Homework
Download and watch the week 3 videos before next week's class.
Complete week 3 lab experiments before next week's class.

Week 3 — Prototyping, protection, and sound

Rapid prototyping, historically and now; circuit diagrams. Electricity and Ohm's law. Protecting the microcontroller from overload. Connecting a loudspeaker safely to a digital output; generating square waves; frequency versus cycle time; playing musical notes.

Please complete as many of the experiments as possible before class.

Homework
Download and watch next week's videos before the class.
Complete as many lab experiments as possible before the class.

Week 4 — LEDs and Pulse Width Modulation

Diodes and light-emitting diodes, voltage drop, current-limiting resistors. Frequency and time; pulse-width modulation (PWM).

Week 5 — Environmental sensing: temperature

Temperature sensing. Increasing analogue resolution.

Week 6 — Environmental sensing: light

Electronics review: series and parallel circuits, potential dividers. Light-dependent resistors. Light-dependent voltage dividers. Self-calibrating measurements.

Week 7 — Managing multiple outputs

Connecting several LEDs. Representing LED states with a single integer. Decimal and binary number representations. Using each bit of an integer to represent an independent true/false value.

Week 8 — LED arrays

Using LED arrays. Using all available digital outputs. Accessing the hardware I/O registers directly. Parallel digital output.

Week 9 — Multi-coloured RGB LED arrays

RGB LED arrays and interfacing to them. Controlling 30 LEDs with 13 digital pins. Time-division multiplexing. Interrupts, foreground and background tasks, timer interrupts to implement background tasks.

Week 10 — Seven-segment displays

Displaying alphanumeric information on seven-segment displays.

Week 11 — Digital input

Digital input. Momentary push-button 'tactile' switches. Pull-up resistors. Switch bounce and debouncing in hardware and software. Capacitors and time constants. Event-based interrupts for concurrency.

Week 12 — Shift registers

Serial to parallel conversion. Shift registers.

Week 13 — Serial communication: I2C and SPI

Serial communication. I2C and SPI protocols. Using the MCP3204 analogue to digital converter with SPI.

Week 14 — Project

Project suggestions: id2-14.pdf
Support files: sine.h

License

The content of this page and all materials linked from it are
Copyright © 2015–2021 by Ian Piumarta.
All rights reserved.

The author hereby grants a perpetual, non-transferable license to Kyoto University of Advanced Science and its directly affiliated high schools to use this material in original or modified form for classrom and/or online teaching.