Preface |
|
xix | |
|
Chapter 1 Real-Time Computing |
|
|
1 | (6) |
|
1.0 Defining the Embedded System |
|
|
1 | (1) |
|
1.1 Embedded Systems History |
|
|
2 | (1) |
|
|
2 | (2) |
|
|
3 | (1) |
|
|
3 | (1) |
|
1.2.3 Hardware and Software |
|
|
3 | (1) |
|
1.3 Execution in Real-Time |
|
|
4 | (3) |
|
1.3.1 Hard and Soft Real-Time Systems |
|
|
5 | (2) |
|
Chapter 2 Circuit Fundamentals |
|
|
7 | (10) |
|
|
7 | (1) |
|
2.2 Circuit Concepts and Components |
|
|
8 | (1) |
|
|
9 | (1) |
|
|
10 | (3) |
|
2.4.1 Light-Emitting Diode (LED) |
|
|
12 | (1) |
|
|
13 | (4) |
|
|
13 | (2) |
|
|
15 | (2) |
|
Chapter 3 Logic Gates and Circuit Components |
|
|
17 | (24) |
|
|
17 | (1) |
|
|
18 | (1) |
|
3.3 Clocked Logic and Flip-Flops |
|
|
19 | (7) |
|
|
19 | (1) |
|
|
20 | (1) |
|
|
21 | (2) |
|
3.3.4 Edge-Triggered D Flip-Flop |
|
|
23 | (1) |
|
3.3.5 Preset and Clear Signals |
|
|
23 | (1) |
|
3.3.6 D Flip-Flop Waveform Action |
|
|
24 | (1) |
|
3.3.7 Flip-Flop Applications |
|
|
25 | (1) |
|
|
26 | (3) |
|
|
26 | (1) |
|
|
27 | (1) |
|
|
28 | (1) |
|
3.4.4 Microcontroller Clocks |
|
|
29 | (1) |
|
3.5 Counters and Frequency Dividers |
|
|
29 | (8) |
|
|
30 | (1) |
|
3.5.2 JK Flip-Flop Counter |
|
|
30 | (1) |
|
|
31 | (1) |
|
|
32 | (1) |
|
3.5.5 Synchronous Counters |
|
|
33 | (2) |
|
|
35 | (1) |
|
|
36 | (1) |
|
3.6 Multiplexers and Demultiplexers |
|
|
37 | (4) |
|
|
38 | (1) |
|
|
39 | (1) |
|
3.6.3 Multiplexer and Demultiplexer ICs |
|
|
40 | (1) |
|
Chapter 4 Input and Output Devices |
|
|
41 | (10) |
|
|
41 | (1) |
|
|
41 | (4) |
|
4.2.1 Switch Contact Bounce |
|
|
43 | (1) |
|
|
44 | (1) |
|
|
45 | (6) |
|
|
45 | (2) |
|
4.3.2 Liquid Crystal Displays |
|
|
47 | (1) |
|
|
48 | (3) |
|
Chapter 5 From Circuit Schematics to PCB |
|
|
51 | (20) |
|
|
51 | (2) |
|
|
52 | (1) |
|
5.1.2 Tools for Electronic Circuit Design |
|
|
53 | (1) |
|
|
53 | (2) |
|
5.2.1 Board Design Standards |
|
|
54 | (1) |
|
|
54 | (1) |
|
5.3 Developing the Circuit Prototype |
|
|
55 | (5) |
|
|
56 | (2) |
|
Limitations of Breadboards |
|
|
58 | (1) |
|
Breadboarding Tools and Techniques |
|
|
58 | (1) |
|
|
59 | (1) |
|
|
60 | (1) |
|
5.4 Printed Circuit Boards |
|
|
60 | (2) |
|
|
61 | (1) |
|
|
62 | (1) |
|
|
62 | (4) |
|
5.5.1 Drawing the CPB Circuit |
|
|
63 | (2) |
|
|
65 | (1) |
|
5.5.3 Transferring the PCB Image |
|
|
65 | (1) |
|
|
65 | (1) |
|
5.5.5 Finishing the Board |
|
|
66 | (1) |
|
|
66 | (1) |
|
5.6 Surface-Mount Components |
|
|
66 | (2) |
|
|
67 | (1) |
|
5.6.2 Soldering SMT Components |
|
|
68 | (1) |
|
5.7 Troubleshooting the Circuit Board |
|
|
68 | (3) |
|
5.7.1 Circuit Testing Tools |
|
|
69 | (2) |
|
Chapter 6 Introducing the Microcontroller |
|
|
71 | (12) |
|
|
71 | (1) |
|
6.2 PICMicro Microcontroller |
|
|
72 | (3) |
|
6.2.1 Programming the PIC |
|
|
73 | (1) |
|
|
74 | (1) |
|
6.2.2 Prototyping a PIC Circuit |
|
|
75 | (1) |
|
|
75 | (8) |
|
6.3.1 Baseline PIC Family |
|
|
75 | (1) |
|
|
75 | (1) |
|
|
76 | (2) |
|
|
78 | (1) |
|
6.3.2 Mid-Range PIC Family |
|
|
79 | (1) |
|
|
79 | (1) |
|
6.3.3 High-Performance PIC Family |
|
|
79 | (1) |
|
|
80 | (3) |
|
Chapter 7 Architecture and Instruction Set |
|
|
83 | (24) |
|
7.1 Mid-Range PIC Architecture |
|
|
83 | (4) |
|
7.1.1 Harvard Architecture |
|
|
83 | (1) |
|
|
84 | (1) |
|
7.1.3 Single-Word Instructions |
|
|
85 | (1) |
|
|
86 | (1) |
|
7.1.5 Mid-Range Device Versions |
|
|
87 | (1) |
|
7.1.6 Arithmetic-Logic Unit |
|
|
87 | (1) |
|
7.2 Data Memory Organization |
|
|
87 | (6) |
|
|
87 | (1) |
|
|
88 | (1) |
|
|
88 | (1) |
|
|
88 | (3) |
|
|
91 | (2) |
|
7.2.3 Indirect Addressing |
|
|
93 | (1) |
|
7.3 Mid-Range I/O and Peripherals |
|
|
93 | (4) |
|
|
94 | (1) |
|
|
95 | (1) |
|
7.3.3 Capture and Compare Module |
|
|
95 | (1) |
|
7.3.4 Master Synchronous Serial Port |
|
|
96 | (1) |
|
|
96 | (1) |
|
|
96 | (1) |
|
7.4 Mid-Range PIC Core Features |
|
|
97 | (4) |
|
|
97 | (1) |
|
|
98 | (2) |
|
|
100 | (1) |
|
7.5 Mid-Range Instruction Set |
|
|
101 | (3) |
|
7.5.1 STATUS and OPTION Registers |
|
|
102 | (2) |
|
|
104 | (3) |
|
7.6.1 EEPROM in Mid-Range PICs |
|
|
105 | (2) |
|
Chapter 8 Embedded Systems Programming |
|
|
107 | (26) |
|
8.1 Assembly versus High-Level Languages |
|
|
107 | (1) |
|
|
107 | (1) |
|
8.2 Integrated Development Environment |
|
|
108 | (7) |
|
|
109 | (2) |
|
|
111 | (1) |
|
8.2.3 Project Build Options |
|
|
112 | (2) |
|
8.2.4 Building the Project |
|
|
114 | (1) |
|
|
114 | (1) |
|
8.3 Simulators and Debuggers |
|
|
115 | (4) |
|
|
115 | (2) |
|
8.3.2 MPLAB Hardware Debuggers |
|
|
117 | (2) |
|
8.3.3 Improvised Debugger |
|
|
119 | (1) |
|
|
119 | (1) |
|
8.5 Engineering PIC Software |
|
|
120 | (11) |
|
8.5.1 Using Program Comments |
|
|
120 | (1) |
|
|
121 | (1) |
|
|
122 | (1) |
|
|
123 | (1) |
|
8.5.2 Defining Data Elements |
|
|
123 | (1) |
|
|
124 | (1) |
|
|
124 | (1) |
|
|
125 | (1) |
|
|
125 | (1) |
|
Deprecated Banking Instructions |
|
|
126 | (1) |
|
8.5.4 Processor and Configuration Controls |
|
|
126 | (1) |
|
|
127 | (1) |
|
|
128 | (3) |
|
8.5.6 Errorlevel Directive |
|
|
131 | (1) |
|
|
131 | (2) |
|
Chapter 9 I/O Circuits and Programs |
|
|
133 | (20) |
|
9.1 Simple Input and Output |
|
|
133 | (1) |
|
9.1.1 16F84A Programming Template |
|
|
133 | (1) |
|
|
134 | (2) |
|
9.2.1 MCLR and Oscillator Template |
|
|
135 | (1) |
|
|
135 | (1) |
|
|
136 | (1) |
|
9.3 Simple Circuits and Programs |
|
|
136 | (10) |
|
|
137 | (2) |
|
|
139 | (2) |
|
9.3.2 LED/Pushbutton Circuit |
|
|
141 | (2) |
|
9.3.3 Multiple LED Circuit |
|
|
143 | (3) |
|
|
146 | (1) |
|
|
147 | (4) |
|
|
148 | (3) |
|
9.6 Comparisons in PIC Programming |
|
|
151 | (2) |
|
|
152 | (1) |
|
Chapter 10 PIC Interrupt System |
|
|
153 | (30) |
|
|
153 | (2) |
|
|
153 | (1) |
|
10.1.2 Interrupt Control Register |
|
|
153 | (1) |
|
|
154 | (1) |
|
|
155 | (4) |
|
10.2.1 Port B External Interrupt |
|
|
156 | (1) |
|
|
156 | (1) |
|
10.2.3 Port B Line Change Interrupt |
|
|
157 | (2) |
|
Multiple External Interrupts |
|
|
159 | (1) |
|
10.2.4 EEPROM Data Write Interrupt |
|
|
159 | (1) |
|
10.3 Developing the Interrupt Handler |
|
|
159 | (2) |
|
10.3.1 Context Saving Operations |
|
|
160 | (1) |
|
Saving W and STATUS Registers |
|
|
160 | (1) |
|
10.4 Interrupt Programming |
|
|
161 | (9) |
|
10.4.1 Programming the External Interrupt |
|
|
161 | (1) |
|
RBO Interrupt Initialization |
|
|
162 | (1) |
|
|
163 | (1) |
|
10.4.2 Wake-Up from SLEEP Using the RBO Interrupt |
|
|
164 | (1) |
|
|
165 | (1) |
|
10.4.3 Port B Bits 4-7 Status Change Interrupt |
|
|
166 | (1) |
|
RB4-7 Interrupt Initialization |
|
|
166 | (2) |
|
|
168 | (2) |
|
|
170 | (1) |
|
10.6 Demonstration Programs |
|
|
171 | (12) |
|
|
171 | (4) |
|
|
175 | (2) |
|
|
177 | (6) |
|
Chapter 11 Timers and Counters |
|
|
183 | (34) |
|
11.1 Controlling the Time Lapse |
|
|
183 | (3) |
|
11.1.1 16F84 TimerO Module |
|
|
183 | (1) |
|
|
184 | (1) |
|
|
185 | (1) |
|
|
185 | (1) |
|
|
186 | (2) |
|
|
187 | (1) |
|
How Accurate Is the Delay? |
|
|
188 | (1) |
|
|
188 | (1) |
|
|
189 | (12) |
|
11.4.1 Programming a Counter |
|
|
190 | (1) |
|
Timer/Counter Test Circuit |
|
|
190 | (1) |
|
|
191 | (1) |
|
|
191 | (1) |
|
11.4.2 TimerO as a Delay Timer |
|
|
192 | (1) |
|
|
192 | (1) |
|
11.4.3 DelayTimer Program |
|
|
193 | (1) |
|
|
193 | (1) |
|
11.4.4 Variable Time Lapse |
|
|
194 | (1) |
|
11.4.5 Variable Lapse Timer Program |
|
|
195 | (1) |
|
|
195 | (3) |
|
11.4.6 Interrupt-Driven Timer |
|
|
198 | (1) |
|
|
198 | (1) |
|
|
198 | (3) |
|
|
201 | (1) |
|
11.5.1 Watchdog Timer Programming |
|
|
202 | (1) |
|
11.6 Demonstration Programs |
|
|
202 | (15) |
|
11.6.1 TmrOCounter program |
|
|
202 | (3) |
|
|
205 | (2) |
|
11.6.3 LapseTimer Program |
|
|
207 | (4) |
|
11.6.4 LapseTmrInt Program |
|
|
211 | (6) |
|
Chapter 12 LCD Hardware and Programming |
|
|
217 | (34) |
|
12.1 Liquid Crystal Display |
|
|
217 | (4) |
|
12.1.1 LCD Features and Architecture |
|
|
217 | (1) |
|
12.1.2 LCD Functions and Components |
|
|
218 | (1) |
|
|
218 | (1) |
|
|
218 | (1) |
|
|
218 | (1) |
|
|
218 | (1) |
|
Character Generator ROM (CGROM) |
|
|
218 | (1) |
|
Character Generator RAM (CGRAM) |
|
|
219 | (1) |
|
Timing Generation Circuit |
|
|
219 | (1) |
|
Liquid Crystal Display Driver Circuit |
|
|
220 | (1) |
|
Cursor/Blink Control Circuit |
|
|
220 | (1) |
|
12.1.3 Connectivity and Pin-Out |
|
|
220 | (1) |
|
12.2 Interfacing with the HD44780 |
|
|
221 | (4) |
|
12.2.1 Busy Flag or Timed Delay Options |
|
|
222 | (1) |
|
|
223 | (1) |
|
|
223 | (1) |
|
12.2.4 Display Memory Mapping |
|
|
223 | (2) |
|
12.3 HD44780 Instruction Set |
|
|
225 | (4) |
|
12.3.1 Instruction Set Overview |
|
|
225 | (1) |
|
|
225 | (1) |
|
|
226 | (1) |
|
|
226 | (1) |
|
Display and Cursor ON/OFF |
|
|
226 | (1) |
|
|
226 | (1) |
|
|
227 | (1) |
|
|
227 | (1) |
|
|
227 | (1) |
|
Read Busy Flag and Address Register |
|
|
227 | (1) |
|
|
227 | (1) |
|
|
228 | (1) |
|
12.3.2 A 16F84 8-Bit Data Mode Circuit |
|
|
228 | (1) |
|
|
229 | (19) |
|
12.4.1 Defining Constants and Variables |
|
|
229 | (2) |
|
Using MPLAB Data Directives |
|
|
231 | (1) |
|
12.4.2 LCD Initialization |
|
|
232 | (1) |
|
|
232 | (1) |
|
|
233 | (1) |
|
|
233 | (1) |
|
|
234 | (1) |
|
|
234 | (1) |
|
|
235 | (1) |
|
12.4.3 Auxiliary Operations |
|
|
235 | (1) |
|
|
235 | (2) |
|
|
237 | (1) |
|
|
237 | (1) |
|
|
238 | (2) |
|
12.4.4 Text Data Storage and Display |
|
|
240 | (1) |
|
Generating and Storing a Text String |
|
|
241 | (2) |
|
Displaying the Text String |
|
|
243 | (1) |
|
12.4.5 Data Compression Techniques |
|
|
244 | (1) |
|
|
244 | (2) |
|
|
246 | (2) |
|
|
248 | (3) |
|
Chapter 13 Analog-to-Digital and Real-Time Clocks |
|
|
251 | (70) |
|
13.1 Clocks and the Digital Revolution |
|
|
251 | (1) |
|
|
252 | (2) |
|
13.2.1 Converter Resolution |
|
|
252 | (1) |
|
13.2.2 ADC Implementation |
|
|
253 | (1) |
|
13.3 A/D Integrated Circuits |
|
|
254 | (3) |
|
13.3.1 ADC0331 Sample Circuit and Program |
|
|
255 | (2) |
|
13.4 PIC Onboard A/D Hardware |
|
|
257 | (9) |
|
13.4.1 A/D Module on the 16F87x |
|
|
257 | (1) |
|
|
258 | (3) |
|
|
261 | (1) |
|
|
262 | (1) |
|
13.4.2 A/D Module Sample Circuit and Program |
|
|
262 | (4) |
|
|
266 | (10) |
|
13.5.1 NJU6355 Real-Time Clock |
|
|
266 | (2) |
|
13.5.2 RTC Demonstration Circuit and Program |
|
|
268 | (5) |
|
BCD Conversion Procedures |
|
|
273 | (3) |
|
13.6 Demonstration Programs |
|
|
276 | (45) |
|
|
276 | (12) |
|
|
288 | (15) |
|
|
303 | (18) |
|
|
321 | (58) |
|
|
321 | (1) |
|
|
321 | (1) |
|
|
322 | (2) |
|
14.2.1 Reading EEPROM Data |
|
|
323 | (1) |
|
14.2.2 EEPROM Data Memory Write |
|
|
323 | (1) |
|
14.3 EEPROM Programming Application |
|
|
324 | (5) |
|
|
324 | (1) |
|
|
324 | (5) |
|
14.4 Demonstration Programs |
|
|
329 | (50) |
|
|
329 | (12) |
|
|
341 | (17) |
|
|
358 | (21) |
|
Chapter 15 Stepper Motors |
|
|
379 | (10) |
|
15.1 Description and Operation |
|
|
379 | (5) |
|
15.1.1 Stepper Motor Types |
|
|
381 | (1) |
|
|
381 | (1) |
|
|
381 | (1) |
|
|
381 | (1) |
|
15.1.2 Unipolar Stepper Motors |
|
|
382 | (1) |
|
15.1.3 Determining Unipolar and Bipolar Wiring |
|
|
383 | (1) |
|
|
383 | (1) |
|
|
383 | (1) |
|
|
383 | (1) |
|
15.1.4 Bipolar Stepper Motors |
|
|
384 | (1) |
|
15.2 Stepper Motor Controls |
|
|
384 | (5) |
|
|
385 | (1) |
|
|
385 | (1) |
|
|
386 | (1) |
|
|
387 | (1) |
|
|
387 | (2) |
|
Chapter 16 Stepper Motor Circuit Components |
|
|
389 | (14) |
|
|
389 | (1) |
|
16.1.1 Input, Output, and Feedback |
|
|
390 | (1) |
|
|
390 | (1) |
|
16.2.1 PIC Microcontroller as a Translator |
|
|
390 | (1) |
|
|
391 | (4) |
|
|
391 | (1) |
|
|
392 | (2) |
|
|
394 | (1) |
|
16.3.4 SLA7060 and SLA7024 |
|
|
394 | (1) |
|
|
395 | (5) |
|
|
395 | (1) |
|
PIC Microcontroller as a Driver |
|
|
395 | (1) |
|
|
395 | (1) |
|
|
396 | (1) |
|
|
397 | (1) |
|
16.4.3 Transistorized H Bridge |
|
|
397 | (1) |
|
|
398 | (1) |
|
|
399 | (1) |
|
|
399 | (1) |
|
|
400 | (1) |
|
16.5 Modules in Circuit Schematics |
|
|
400 | (3) |
|
16.5.1 Example 16F84 Translator Modules |
|
|
401 | (2) |
|
Chapter 17 Unipolar Motor Circuits and Programs |
|
|
403 | (64) |
|
17.1 Stepper Motor Control Circuits |
|
|
403 | (2) |
|
17.1.1 Stepper Motor Circuit Schematic Conventions |
|
|
403 | (2) |
|
|
405 | (2) |
|
17.2.1 Speed Control from Digital Input |
|
|
405 | (1) |
|
17.2.2 Analog Input Speed Control |
|
|
406 | (1) |
|
17.3 Unipolar Motor Control Circuits |
|
|
407 | (20) |
|
17.3.1 Matching Circuit to Motor Power |
|
|
407 | (1) |
|
17.3.2 16F84 Unipolar Circuit |
|
|
408 | (1) |
|
Sample Program SMU_PIC16F84.asm |
|
|
408 | (3) |
|
17.3.3 5804 Unipolar Circuit |
|
|
411 | (2) |
|
Sample Program SMU_5804.asm |
|
|
413 | (2) |
|
Generating the Motor Pulses |
|
|
415 | (1) |
|
Interrupt-Driven Motor Pulsing |
|
|
416 | (3) |
|
17.3.4 16F686 PIC Circuit |
|
|
419 | (1) |
|
17.3.5 16F686 Programming |
|
|
419 | (2) |
|
Sample Program SMU_PIC16F684.asm |
|
|
421 | (3) |
|
Sample Program SMU_PIC16F684_INT.asm |
|
|
424 | (1) |
|
17.3.6 Stepper Motor Position Control |
|
|
424 | (1) |
|
Sample Program SMU_POSITION.asm |
|
|
425 | (2) |
|
17.4 Demonstration Programs |
|
|
427 | (40) |
|
|
427 | (4) |
|
17.4.2 SMU_PIC16F84.asm Program |
|
|
431 | (5) |
|
|
436 | (5) |
|
|
441 | (7) |
|
|
448 | (5) |
|
17.4.6 SMU_PIC16F684_INT.asm |
|
|
453 | (7) |
|
|
460 | (7) |
|
Chapter 18 Constant-Voltage Bipolar Motor Controls |
|
|
467 | (20) |
|
18.1 Unipolar versus Bipolar |
|
|
467 | (1) |
|
18.1.1 Bipolar Drive Circuits |
|
|
467 | (1) |
|
18.2 Simple, L293 Bipolar Circuit |
|
|
468 | (3) |
|
18.2.1 L297- and L293-Based Circuit |
|
|
471 | (1) |
|
18.2.2 Minimal L297- and L298-based Circuit |
|
|
471 | (1) |
|
18.3 Demonstration Programs |
|
|
471 | (16) |
|
|
473 | (5) |
|
|
478 | (4) |
|
|
482 | (5) |
|
Chapter 19 Advanced Motor Controls |
|
|
487 | (56) |
|
19.1 Choppers and Microstepping |
|
|
487 | (1) |
|
19.2 Chopper Circuit Fundamentals |
|
|
487 | (3) |
|
19.3 L297/298 Chopper Circuit |
|
|
490 | (2) |
|
19.3.1 Setting the Reference Voltage |
|
|
491 | (1) |
|
19.4 A Chopper-Based Demo Board |
|
|
492 | (2) |
|
19.4.1 Motor Circuit Power Requirements |
|
|
492 | (2) |
|
19.4.2 Chopper Demo Program |
|
|
494 | (1) |
|
|
494 | (6) |
|
19.5.1 Microstepping Fundamentals |
|
|
497 | (1) |
|
|
497 | (2) |
|
Pulse Width Modulation (PWM) |
|
|
499 | (1) |
|
|
500 | (8) |
|
|
500 | (2) |
|
19.6.2 PWM Circuit and Software |
|
|
502 | (3) |
|
19.6.3 Microstepping by PWM |
|
|
505 | (1) |
|
19.6.4 Microstepping Sample Program |
|
|
506 | (2) |
|
|
508 | (6) |
|
|
508 | (2) |
|
19.7.2 3955-Based Circuit |
|
|
510 | (2) |
|
19.7.3 3955 Motor Driver Program |
|
|
512 | (2) |
|
19.8 Demonstration Programs |
|
|
514 | (29) |
|
|
514 | (4) |
|
|
518 | (4) |
|
|
522 | (8) |
|
|
530 | (13) |
|
Chapter 20 Communications |
|
|
543 | (120) |
|
20.1 PIC Communications Overview |
|
|
543 | (1) |
|
20.2 Serial Data Transmission |
|
|
544 | (10) |
|
20.2.1 Asynchronous Serial Transmission |
|
|
544 | (2) |
|
20.2.2 Synchronous Serial Transmission |
|
|
546 | (1) |
|
20.2.3 PIC Serial Communications |
|
|
546 | (1) |
|
|
547 | (1) |
|
|
548 | (1) |
|
|
549 | (1) |
|
|
549 | (1) |
|
|
550 | (1) |
|
|
550 | (1) |
|
|
551 | (2) |
|
|
553 | (1) |
|
EIA-485 in PIC-based Systems |
|
|
554 | (1) |
|
20.3 Parallel Data Transmission |
|
|
554 | (1) |
|
20.3.1 PIC Parallel Slave Port (PSP) |
|
|
555 | (1) |
|
20.4 PIC "Free-Style" Serial Programming |
|
|
555 | (15) |
|
20.4.1 PIC-to-PIC Serial Communications |
|
|
556 | (1) |
|
PIC-to-PIC Serial Communications Circuits |
|
|
556 | (2) |
|
PIC-to-PIC Serial Communications Programs |
|
|
558 | (6) |
|
20.4.2 Program Using Shift Register ICs |
|
|
564 | (1) |
|
74HC165 Parallel-to-Serial Shift Register |
|
|
565 | (3) |
|
74HC164 Serial-to-Parallel Shift Register |
|
|
568 | (2) |
|
20.5 PIC Protocol-Based Serial Programming |
|
|
570 | (23) |
|
20.5.1 RS-232-C Communications on the 16F84 |
|
|
570 | (1) |
|
|
571 | (1) |
|
|
572 | (1) |
|
|
572 | (1) |
|
|
573 | (2) |
|
|
575 | (4) |
|
20.5.2 RS-232-C Communications on the 16F87x |
|
|
579 | (1) |
|
|
580 | (1) |
|
USART Baud Rate Generator |
|
|
580 | (3) |
|
16F87x USART Asynchronous Transmitter |
|
|
583 | (1) |
|
16F87x USART Asynchronous Receiver |
|
|
584 | (1) |
|
PIC-to-PC RS-232-C Communications Circuit |
|
|
585 | (1) |
|
16F877 PIC Initialization Code |
|
|
585 | (4) |
|
USART Receive and Transmit Routines |
|
|
589 | (1) |
|
|
590 | (3) |
|
20.6 Demonstration Programs |
|
|
593 | (70) |
|
|
593 | (6) |
|
|
599 | (5) |
|
20.6.3 Serial6465 Program |
|
|
604 | (5) |
|
|
609 | (15) |
|
|
624 | (18) |
|
|
642 | (21) |
|
Appendix A Resistor Color Codes |
|
|
663 | (2) |
|
Appendix B Essential Electronics |
|
|
665 | (18) |
|
|
665 | (1) |
|
|
666 | (1) |
|
|
667 | (1) |
|
|
668 | (2) |
|
|
668 | (1) |
|
|
668 | (1) |
|
|
669 | (1) |
|
|
669 | (1) |
|
|
670 | (2) |
|
|
670 | (2) |
|
|
672 | (7) |
|
|
673 | (1) |
|
B.6.2 Revisiting Ohm's Law |
|
|
673 | (1) |
|
B.6.3 Resistors in Series and Parallel |
|
|
674 | (2) |
|
|
676 | (1) |
|
B.6.5 Capacitors in Series and in Parallel |
|
|
677 | (1) |
|
|
678 | (1) |
|
|
679 | (1) |
|
|
679 | (4) |
|
B.7.1 Integrated Circuits |
|
|
680 | (1) |
|
B.7.2 Semiconductor Electronics |
|
|
680 | (1) |
|
B.7.3 P-Type and N-Type Silicon |
|
|
681 | (1) |
|
|
681 | (2) |
|
|
683 | (14) |
|
|
683 | (1) |
|
|
683 | (1) |
|
|
683 | (1) |
|
|
684 | (1) |
|
C.2 Origins of the Decimal System |
|
|
684 | (3) |
|
C.2.1 Number Systems for Digital-Electronics |
|
|
686 | (1) |
|
C.2.2 Positional Characteristics |
|
|
686 | (1) |
|
C.2.3 Radix or Base of a Number System |
|
|
687 | (1) |
|
|
687 | (2) |
|
|
688 | (1) |
|
|
688 | (1) |
|
C.3.3 Rational, Irrational, and Imaginary Numbers |
|
|
688 | (1) |
|
C.4 Radix Representations |
|
|
689 | (2) |
|
C.4.1 Decimal versus Binary Numbers |
|
|
689 | (1) |
|
C.4.2 Hexadecimal and Octal |
|
|
690 | (1) |
|
C.5 Number System Conversions |
|
|
691 | (6) |
|
C.5.1 Binary-to-ASCII-Decimal |
|
|
692 | (1) |
|
C.5.2 Binary-to-Hexadecimal Conversion |
|
|
693 | (1) |
|
C.5.3 Decimal-to-Binary Conversion |
|
|
693 | (4) |
|
Appendix D Character Data |
|
|
697 | (22) |
|
D.1 Character Representations |
|
|
697 | (1) |
|
D.1.1 Electronic-Digital Machines |
|
|
697 | (1) |
|
D.2 Character Representations |
|
|
697 | (4) |
|
|
698 | (2) |
|
|
700 | (1) |
|
|
700 | (1) |
|
D.3 Storage and Encoding of Integers |
|
|
701 | (7) |
|
D.3.1 Signed and Unsigned Representations |
|
|
701 | (1) |
|
|
702 | (1) |
|
|
703 | (1) |
|
D.4.4 Sign-Magnitude Representation |
|
|
704 | (1) |
|
D.3.5 Radix Complement Representation |
|
|
705 | (3) |
|
D.4 Encoding of Fractional Numbers |
|
|
708 | (7) |
|
D.4.1 Fixed-Point Representations |
|
|
709 | (1) |
|
D.4.2 Floating-Point Representations |
|
|
710 | (1) |
|
D.4.3 Standardized Floating-Point Representations |
|
|
711 | (1) |
|
D.4.4 IEEE 754 Single Format |
|
|
712 | (2) |
|
D.4.5 Encoding and Decoding Floating-Point Numbers |
|
|
714 | (1) |
|
D.5 Binary-Coded Decimals (BCD) |
|
|
715 | (4) |
|
|
716 | (3) |
|
Appendix E Digital Arithmetic and Conversions |
|
|
719 | (20) |
|
E.1 Microcontroller Arithmetic |
|
|
719 | (1) |
|
E.2 Unsigned and Two's Complement Arithmetic |
|
|
719 | (4) |
|
E.2.1 Operations on Decimal Numbers |
|
|
721 | (2) |
|
E.3 Bit Manipulations and Auxiliary Operations |
|
|
723 | (2) |
|
E.3.1 Bit Shift and Rotate |
|
|
723 | (1) |
|
E.3.2 Comparison Operations |
|
|
724 | (1) |
|
E.3.3 Other Support Operations |
|
|
724 | (1) |
|
E.4 Unsigned Binary Arithmetic |
|
|
725 | (4) |
|
E.4.1 Multi-Byte Unsigned Addition |
|
|
725 | (1) |
|
E.4.2 Unsigned Multiplication |
|
|
726 | (2) |
|
|
728 | (1) |
|
E.5 Signed Binary Arithmetic |
|
|
729 | (4) |
|
E.5.1 Overflow Detection in Signed Arithmetic |
|
|
730 | (2) |
|
E.5.2 Sign Extension Operations |
|
|
732 | (1) |
|
E.5.3 Multi-Byte Signed Operations |
|
|
732 | (1) |
|
E.6 Data Format Conversions |
|
|
733 | (6) |
|
E.6.1 BCD Digits to ASCII Decimal |
|
|
733 | (1) |
|
E.6.2 Unsigned Binary to ASCII Decimal Digits |
|
|
734 | (1) |
|
E.6.3 ASCII Decimal String to Unsigned Binary |
|
|
734 | (2) |
|
E.6.4 Unsigned Binary to ASCII Hexadecimal Digits |
|
|
736 | (1) |
|
E.6.5 Signed Numerical Conversions |
|
|
736 | (3) |
|
Appendix F Mid-Range Instruction Set |
|
|
739 | (38) |
|
Appendix G Printed Circuit Boards |
|
|
777 | (10) |
|
|
777 | (1) |
|
G.2 Printed Circuit Boards (PCBs) |
|
|
777 | (1) |
|
|
778 | (1) |
|
G.4 Building Your Own Circuit Boards |
|
|
779 | (6) |
|
G.4.1 Tools and Materials |
|
|
779 | (1) |
|
G.4.2 Single-Sided Demo Board |
|
|
780 | (1) |
|
G.4.3 PCB Images for Demo Board |
|
|
780 | (2) |
|
Drawing the Circuit Diagram |
|
|
782 | (1) |
|
|
783 | (1) |
|
|
783 | (1) |
|
Transferring the PCB Image |
|
|
784 | (1) |
|
|
784 | (1) |
|
|
784 | (1) |
|
|
784 | (1) |
|
|
785 | (2) |
|
Appendix H Additional Code |
|
|
787 | (76) |
Index |
|
863 | |