Programming_Embedded_System_I.pdf

(2428 KB) Pobierz
Microsoft Word - PES I guide .
1
2
3
4
5
6
7
P1.0
VCC
40
39
38
37
36
35
34
P1.1
P0.0
P1.2
P1.3
P0.1
P0.2
P1.4
P0.3
P1.5
P0.4
P1.6
P0.5
8
9
10
P1.7
RST
P0.6
P0.7
33
32
31
30
29
28
27
26
25
24
P3.0
/ EA
11
12
13
14
15
16
17
18
19
20
P3.1
ALE
P3.2
/ PSEN
P3.3
P3.4
P2.7
P2.6
P3.5
P2.5
P3.6
P2.4
P3.7
P2.3
XTL2
XTL1
P2.2
P2.1
23
22
21
VSS
P2.0
377114778.005.png 377114778.006.png
 
Copyright © Michael J. Pont, 2002-2003
This document may be freely distributed and copied, provided that copyright notice at
the foot of each OHP page is clearly visible in all copies.
II
377114778.007.png 377114778.001.png
Seminar 1: “Hello, Embedded World”
1
Overview of this seminar
2
Overview of this course
3
By the end of the course …
4
Main course textbook
5
Why use C?
6
Pre-requisites!
7
The 8051 microcontroller
8
The “super loop” software architecture
9
Strengths and weaknesseses of “super loops”
10
Example: Central-heating controller
11
Reading from (and writing to) port pins
12
SFRs and ports
13
SFRs and ports
14
Creating and using sbit variables
15
Example: Reading and writing bytes
16
Creating “software delays”
17
Using the performance analyzer to test software delays
18
Strengths and weaknesses of software-only delays
19
Preparation for the next seminar
20
III
377114778.002.png
Seminar 2: Basic hardware foundations (resets, oscillators and port I/O)
21
Review: The 8051 microcontroller
22
Review: Central-heating controller
23
Overview of this seminar
24
Oscillator Hardware
25
How to connect a crystal to a microcontroller
27
Oscillator frequency and machine cycle period
28
Keep the clock frequency as low as possible
29
Stability issues
30
Improving the stability of a crystal oscillator
31
Overall strengths and weaknesses
32
Reset Hardware
34
More robust reset circuits
35
Driving DC Loads
36
Use of pull-up resistors
38
Driving a low-power load without using a buffer
39
Using an IC Buffer
40
Example: Buffering three LEDs with a 74HC04
41
What is a multi-segment LED?
42
Driving a single digit
43
Preparation for the next seminar
44
IV
377114778.003.png
Seminar 3: Reading Switches
45
Introduction
46
Review: Basic techniques for reading from port pins
47
Example: Reading and writing bytes (review)
48
Example: Reading and writing bits (simple version)
49
Example: Reading and writing bits (generic version)
51
The need for pull-up resistors
56
The need for pull-up resistors
57
The need for pull-up resistors
58
Dealing with switch bounce
59
Example: Reading switch inputs (basic code)
61
Example: Counting goats
68
Conclusions
74
Preparation for the next seminar
75
V
377114778.004.png
Zgłoś jeśli naruszono regulamin