0% found this document useful (0 votes)
57 views

Micro-Controller Notes223 PDF

This document is an introduction to microcontrollers course taught at Vienna University of Technology. It covers microcontroller basics and components, including the processor core, memory, digital and analog I/O, interrupts, timers, and communication interfaces. The document provides an overview of key concepts and terms related to microcontrollers.

Uploaded by

hassan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views

Micro-Controller Notes223 PDF

This document is an introduction to microcontrollers course taught at Vienna University of Technology. It covers microcontroller basics and components, including the processor core, memory, digital and analog I/O, interrupts, timers, and communication interfaces. The document provides an overview of key concepts and terms related to microcontrollers.

Uploaded by

hassan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Introduction to Microcontrollers

Courses 182.064 & 182.074


Vienna University of Technology
Institute of Computer Engineering
Embedded Computing Systems Group

March 19, 2006

Version 1.3

Günther Gridling, Bettina Weiss


Contents

1 Microcontroller Basics 1
1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Frequently Used Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.3 Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.4 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

2 Microcontroller Components 11
2.1 Processor Core . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.1.1 Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.1.2 Instruction Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.1.3 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.2 Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.2.1 Volatile Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.2.2 Non-volatile Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.2.3 Accessing Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.2.4 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.3 Digital I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
2.3.1 Digital Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
2.3.2 Digital Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
2.3.3 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
2.4 Analog I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
2.4.1 Digital/Analog Conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
2.4.2 Analog Comparator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
2.4.3 Analog/Digital Conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
2.4.4 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
2.5 Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
2.5.1 Interrupt Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
2.5.2 Interrupt Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
2.5.3 Interrupt Service Routine . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
2.5.4 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
2.6 Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
2.6.1 Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
2.6.2 Input Capture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
2.6.3 Output Compare . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
2.6.4 Pulse Width Modulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
2.6.5 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
2.7 Other Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
2.7.1 Watchdog Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

i
2.7.2 Power Consumption and Sleep . . . . . . . . . . . . . . . . . . . . . . . . . 69
2.7.3 Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
2.7.4 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

3 Communication Interfaces 73
3.1 SCI (UART) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
3.2 SPI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
3.3 IIC (I2C) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
3.3.1 Data Transmission . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
3.3.2 Speed Control Through Slave . . . . . . . . . . . . . . . . . . . . . . . . . 86
3.3.3 Multi-Master Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
3.3.4 Extended Addresses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
3.4 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87

A Table of Acronyms 89

Index 93

ii

You might also like