Muutke küpsiste eelistusi

E-raamat: Microcontrollers: High-Performance Systems and Programming

(Eastern Florida State College, USA), (Brevard Public Schools, USA)
  • Formaat: 701 pages
  • Ilmumisaeg: 08-Oct-2018
  • Kirjastus: CRC Press Inc
  • ISBN-13: 9781351831932
  • Formaat - EPUB+DRM
  • Hind: 130,00 €*
  • * hind on lõplik, st. muud allahindlused enam ei rakendu
  • Lisa ostukorvi
  • Lisa soovinimekirja
  • See e-raamat on mõeldud ainult isiklikuks kasutamiseks. E-raamatuid ei saa tagastada.
  • Formaat: 701 pages
  • Ilmumisaeg: 08-Oct-2018
  • Kirjastus: CRC Press Inc
  • ISBN-13: 9781351831932

DRM piirangud

  • Kopeerimine (copy/paste):

    ei ole lubatud

  • Printimine:

    ei ole lubatud

  • Kasutamine:

    Digitaalõiguste kaitse (DRM)
    Kirjastus on väljastanud selle e-raamatu krüpteeritud kujul, mis tähendab, et selle lugemiseks peate installeerima spetsiaalse tarkvara. Samuti peate looma endale  Adobe ID Rohkem infot siin. E-raamatut saab lugeda 1 kasutaja ning alla laadida kuni 6'de seadmesse (kõik autoriseeritud sama Adobe ID-ga).

    Vajalik tarkvara
    Mobiilsetes seadmetes (telefon või tahvelarvuti) lugemiseks peate installeerima selle tasuta rakenduse: PocketBook Reader (iOS / Android)

    PC või Mac seadmes lugemiseks peate installima Adobe Digital Editionsi (Seeon tasuta rakendus spetsiaalselt e-raamatute lugemiseks. Seda ei tohi segamini ajada Adober Reader'iga, mis tõenäoliselt on juba teie arvutisse installeeritud )

    Seda e-raamatut ei saa lugeda Amazon Kindle's. 

"This book focuses on high-performance microcontrollers and on the digital signal processors offered by Microchip. In addition to their enhanced features, extended peripherals, and improved performance, there are several practical factors that make the high-performance PIC series a better choice than their mid-range predecessors for most systems: The possibility of programming high-performance microcontrollers in a high-level language (C language)Source code compatibility with PIC16 microcontrollers, which facilitates code migration from mid-range to PIC18 devicesPin compatibility of some PIC18 devices with their PIC16 predecessors. This makes possible the reuse of PIC16 controllers in circuits originally designed for mid-range hardware. One consideration that is sometimes mentioned in favor of the mid-range devices is the abundance of published application circuits and code samples. This book attempts to correct this. It is a continuation of Embedded Systems Circuits and Programming (CRC Press, 2012) bythe same authors"--

This book focuses on high-performance microcontrollers and on the digital signal processors offered by Microchip. In addition to their enhanced features, extended peripherals, and improved performance, several practical factors make the high-performance PIC series a better choice than their mid-range predecessors for most systems. However, one consideration sometimes mentioned in favor of mid-range devices is the abundance of published application circuits and code samples; this book attempts to correct this. It is a continuation of Embedded Systems Circuits and Programming by the same authors.

Preface xx
Chapter 1 Microcontrollers for Embedded Systems
1(12)
1.1 Embedded Systems
1(1)
1.2 Microchip PIC
1(3)
1.2.1 PIC Architecture
2(1)
1.2.2 Programming the PIC
2(1)
PIC Programmers
3(1)
Development Boards
4(1)
1.3 PIC Architecture
4(9)
1.3.1 Baseline PIC Family
5(1)
PIC 10 devices
6(1)
PIC 12 Devices
7(2)
1.3.2 Mid-Range Family
9(1)
PIC 14 Devices
9(1)
PIC 16 Devices
9(1)
1.3.3 High-Performance PIC s and DSPs
10(1)
Digital Signal Processor
11(1)
Analog-to-Digital
12(1)
Chapter 2 PIC 18 Architecture
13(24)
2.1 PIC 18 Family Overview
13(9)
2.1.1 PIC 18FXX2 Group
14(1)
2.1.2 PIC 18FXX2 Device Group Overview
15(1)
2.1.3 PIC 18F4X2 Block Diagram
16(1)
2.1.4 Central Processing Unit
17(1)
Status Register
17(1)
Program Counter Register
17(1)
Hardware Multiplier
18(1)
Interrupts
18(1)
2.1.5 Special CPU Features
19(1)
Watchdog Timer
20(1)
Wake-Up by Interrupt
21(1)
Low Voltage Detection
21(1)
Device Configuration
21(1)
2.2 Memory Organization
22(7)
2.2.1 Program Memory
22(1)
2.2.2 18FXX2 Stack
23(1)
Stack Operations
23(1)
Fast Register Stack
24(1)
Instructions in Memory
25(1)
2.2.3 Data Memory
25(2)
2.2.4 Data EEPROM Memory
27(1)
2.2.5 Indirect Addressing
28(1)
2.3 PIC 18FXX2 Oscillator
29(2)
2.3.1 Oscillator Options
29(1)
Crystal Oscillator and Ceramic Resonator
29(1)
RC Oscillator
30(1)
External Clock Input
31(1)
Phase Locked Loop Oscillator Mode
31(1)
2.4 System Reset
31(3)
2.4.1 Reset Action
32(1)
Power-On Reset (POR)
33(1)
Power-Up Timer (PWRT)
33(1)
Oscillator Start-Up Timer (OST)
33(1)
PLL Lock Time-Out
33(1)
Brown-Out Reset (BOR)
33(1)
Time-Out Sequence
33(1)
2.5 I/O Ports
34(1)
2.5.1 Port Registers
34(1)
2.5.2 Parallel Slave Port
35(1)
2.6 Internal Modules
35(2)
2.6.1 PIC 18FXX2 Modules
35(2)
Chapter 3 Programming Tools and Software
37(34)
3.1 Environment
37(3)
3.1.1 Embedded Systems
37(1)
3.1.2 High-and Low-Level Languages
38(2)
3.1.3 Language-Specific Software
40(1)
3.2 Microchip's MPLAB
40(1)
3.2.1 MPLAB X
40(1)
3.2.2 Development Cycle
40(1)
3.3 An Integrated Development Environment
41(9)
3.3.1 Installing MPLAB
42(1)
3.3.2 Creating the Project
43(2)
3.3.3 Setting the Project Build Options
45(2)
3.3.4 Adding a Source File
47(1)
3.3.5 Building the Project
48(1)
3.3.6 Hex File
48(2)
3.3.7 Quickbuild Option
50(1)
3.4 MPLAB Simulators and Debuggers
50(6)
3.4.1 MPLAB SIM
51(1)
Using Breakpoints
51(1)
Watch Window
52(1)
Simulator Trace
52(2)
3.4.2 MPLAB Stimulus
54(1)
Stimulus Dialog
54(1)
3.4.3 MPLAB Hardware Debuggers
55(1)
3.4.4 An Improvised Debugger
56(1)
3.5 Development Programmers
56(5)
3.5.1 Microchip PIC kit 2 and PIC kit 3
58(2)
3.5.2 Micropro USB PIC Programmer
60(1)
3.5.3 MPLAB ICD 2 and ICD 3 In-Circuit Debuggers/Programmers
60(1)
3.6 Test Circuits and Development Boards
61(10)
3.6.1 Commercial Development Boards
61(2)
3.6.2 Circuit Prototype
63(1)
3.6.3 Breadboard
64(1)
Limitations of Breadboards
65(1)
Breadboarding Tools and Techniques
66(1)
3.6.4 Wire Wrapping
67(1)
3.6.5 Perfboards
67(1)
3.6.6 Printed Circuit Boards
68(3)
Chapter 4 Assembly Language Program
71(14)
4.1 Assembly Language Code
71(4)
4.1.1 A Coding Template
71(2)
Program Header
73(1)
Program Environment Directives
73(1)
Configuration Bits
73(1)
Error Message Level Control
74(1)
Variables and Constants
74(1)
Code Area and Interrupts
74(1)
4.1.2 Programming Style
74(1)
Source File Comments
75(1)
4.2 Defining Data Elements
75(2)
4.2.1 Equ Directive
76(1)
4.2.2 Cblock Directive
76(1)
4.2.3 Access to Banked Memory
77(1)
4.3 Naming Conventions
77(2)
4.3.1 Register and Bit Names
77(2)
4.4 PIC 18FXX2 Instruction Set
79(6)
4.4.1 Byte-Oriented Instructions
80(1)
4.4.2 Bit-Oriented Instructions
80(1)
4.4.3 Literal Instructions
80(1)
4.4.4 Control Instructions
80(5)
Chapter 5 PIC 18 Programming in C Language
85(18)
5.1 C Compilers
85(1)
5.1.1 C versus Assembly Language
85(1)
5.1.2 MPLAB C18
86(1)
5.2 MPLAB C18 Installation
86(5)
5.2.1 MPLAB Software Components
87(1)
5.2.2 Configuration Options
88(1)
5.2.3 System Requirements
89(1)
5.2.4 Execution Flow
90(1)
5.3 C Compiler Project
91(7)
5.3.1 Creating the Project
91(1)
Select Hardware Device
92(1)
Select the Language Toolsuite
92(1)
Create a New Project
93(2)
Add Files to the Project
95(1)
5.3.2 Selecting the Build Directory
96(2)
5.4 A First Program in C
98(5)
5.4.1 Source Code Analysis
99(1)
main() Function
100(1)
Local Functions
101(2)
Chapter 6 C Language in an Embedded Environment
103(22)
6.1 MPLAB C18 System
103(1)
6.1.1 PIC 18 Extended Mode
104(1)
6.2 MPLAB C18 Libraries
104(2)
6.2.1 Start-Up Routines
104(1)
6.2.2 Online Help for C18 and Libraries
105(1)
6.3 Processor-Independent Libraries
106(9)
6.3.1 General Software Library
106(1)
Character Classification Functions
107(1)
Data Conversion Functions
107(1)
Memory and String Manipulation Functions
108(2)
Delay Functions
110(1)
Reset Functions
111(1)
Character Output Functions
112(3)
6.4 Processor-Specific Libraries
115(3)
6.4.1 Hardware Peripheral Library Functions
115(1)
6.4.2 Software Peripherals Library Functions
116(1)
6.4.3 Macros for Inline Assembly
116(1)
6.4.4 Processor-Specific Header Files
117(1)
6.5 Math Libraries
118(4)
6.5.1 ANSI-IEEE 754 Binary Floating-Point Standard
118(1)
Encodings
119(1)
Rounding
119(1)
6.5.2 Standard Math Library Functions
120(1)
6.5.3 Floating-Point Math Sample Program
120(2)
6.6 C18 Language Specifics
122(3)
6.6.1 C18 Integer Data Types
122(1)
6.6.2 C18 Floating-Point Data Types
122(1)
6.6.3 Endianness
123(1)
6.6.4 Storage Classes
123(1)
6.6.5 Static Function Argument
123(1)
6.6.6 Storage Qualifiers
123(1)
Far and near Qualifiers
123(1)
Rom and ram Qualifiers
124(1)
Chapter 7 Programming Simple Input and Output
125(22)
7.1 Port-Connected I/O
125(6)
7.1.1 A Simple Circuit and Code
125(1)
7.1.2 Circuit Schematics
125(1)
7.1.3 Assembler Simple I/O Program
126(3)
7.1.4 Assembler Source Code Analysis
129(1)
Command Monitoring Loop
129(1)
Action on the LEDs
130(1)
A Delay Routine
130(1)
7.2 C Language Simple I/O Program
131(3)
7.2.1 C Source Code Analysis
132(1)
main() Function
133(1)
7.3 Seven-Segment LED Programming
134(7)
7.3.1 Computed Goto
135(1)
7.3.2 Assembler Seven-Segment LED Program
136(1)
Access Bank Operation
136(1)
Port A for Digital Operation
137(1)
DIP Switch Processing
138(1)
Seven-Segment Code with Computed Goto
139(1)
7.3.3 Assembler Table Lookup Sample Program
140(1)
7.4 C Language Seven-Segment LED Programs
141(2)
7.4.1 Code Selection by Switch Construct
142(1)
7.4.2 Code Selection by Table Lookup
142(1)
7.5 A Demonstration Board
143(4)
7.6.1 Power Supply
145(1)
Voltage Regulator
145(2)
Chapter 8 Interrupts
147(32)
8.1 Interrupt Mechanism
147(1)
8.2 PIC 18 Interrupt System
147(10)
8.2.1 Hardware Sources
148(1)
8.2.2 Interrupt Control and Status Registers
148(1)
INTCON Registers
149(2)
PIE Registers
151(1)
PIR Registers
152(1)
IPR Registers
152(2)
8.2.3 Interrupt Priorities
154(1)
High-Priority Interrupts
154(1)
Low-Priority Interrupts
155(1)
An Interrupt Interrupting Another One
155(1)
8.2.4 Context Saving Operations
155(1)
Context Saving during Low-Priority Interrupts
156(1)
8.3 Port B Interrupts
157(11)
8.3.1 Port B External Interrupt
158(1)
8.3.2 INT0 Interrupt Demo Program
158(1)
Cblock Directive
158(1)
Vectoring the Interrupt
159(1)
Initialization
160(1)
Setup INT0
160(1)
Program Foreground
161(1)
Interrupt Service Routine
161(1)
Switch Debouncing
162(1)
Interrupt Action
162(1)
8.3.3 Port B Line Change Interrupt
163(1)
Reentrant Interrupts
164(1)
Multiple External Interrupts
165(1)
8.3.4 Port B Line Change Interrupt Demo Program
165(1)
Setting Up the Line Change Interrupt
165(1)
Interrupt Service Routine
166(2)
8.4 Sleep Mode and Interrupts
168(3)
8.4.1 Wake-Up from SLEEP
169(1)
8.4.2 Sleep_Demo Program
170(1)
8.5 Interrupt Programming in C Language
171(8)
8.5.1 Interrupt Action
171(1)
Context in the Stack
172(1)
Interrupt Data
172(1)
8.5.2 Interrupt Programming in C18
173(1)
Sleep Mode and RBO Interrupt Demo Program
174(2)
Port B Interrupt on Change Demo Program
176(3)
Chapter 9 Delays, Counters, and Timers
179(48)
9.1 PIC 18 Family Timers
179(1)
9.2 Delay Timers
179(3)
9.2.1 Power-Up Timer (PWRT)
179(1)
9.2.2 Oscillator Start-Up Timer (OST)
180(1)
9.2.3 Phase Locked Loop (PLL)
180(1)
Power-Up Delay Summary
181(1)
9.2.4 Watchdog Timer
181(1)
Watchdog Timer Uses
181(1)
9.3 Hardware Timer-Counters
182(1)
9.4 Timer0 Module
182(17)
9.4.1 Timer0 Architecture
184(1)
16-bit Mode Operation
184(1)
Timer and Counter Modes
185(1)
Timer0 Interrupt
185(1)
External Clock Source
185(1)
Timer0 Prescaler
186(1)
9.4.2 Timer0 as a Delay Timer
186(1)
Long Delay Loops
187(1)
Delay Accuracy Issues
188(1)
Black--Ammerman Method
188(1)
Delays with 16-Bit Timer0
189(1)
9.4.3 Counter and Timer Programming
189(1)
Programming a Counter
190(1)
Timer0_as_Counter.asm Program
190(1)
A Timer/Counter Test Circuit
191(1)
Timer0 _Delay.asm Program
191(2)
A Variable Time-Lapse Routine
193(1)
Timer0_VarDelay.asm Program
193(3)
Interrupt-Driven Timer
196(3)
9.5 Other Timer Modules
199(11)
9.5.1 Timer1 Module
199(1)
Timer1 in Timer Mode
200(1)
Timer1 in Synchronized Counter Mode
201(1)
External Clock Input Timing in Synchronized Mode
201(1)
Timer1 Read and Write Operations
201(1)
16-bit Mode Timer1 Write
201(1)
16-Bit Read-Modify-Write
202(1)
Reading and Writing Timer1 in Two 8-bit Operations
202(1)
9.5.2 Timer2 Module
203(1)
Timer Clock Source
204(1)
TMR2 and PR2 Registers
204(1)
Prescaler and Postscaler
205(1)
Timer2 Initialization
205(1)
9.5.3 Timer3 Module
205(2)
Timer3 in Timer Mode
207(1)
Timer3 in Synchronized Counter Mode
207(1)
External Clock Input Timing
208(1)
Timer3 in Asynchronous Counter Mode
208(1)
External Clock Input Timing with Unsynchronized Clock
208(1)
Timer3 Reading and Writing
208(1)
Writing in 16-Bit Mode
208(1)
16-bit Read-Modify-Write Operation
209(1)
Reading in Asynchronous Counter Mode
209(1)
Timer1 Oscillator in Timer3
210(1)
9.6 C-18 Timer Functions
210(2)
9.6.1 CloseTimerx Function
210(1)
9.6.2 OpenTimerx Function
211(1)
9.6.3 ReadTimerx Function
211(1)
9.6.4 WriteTimerx Function
212(1)
9.7 Sample Programs
212(15)
9.7.1 Timer0_as_Counter program
212(3)
9.7.2 Timer0_Delay Program
215(1)
9.7.3 Timer0_VarDelay Program
216(4)
9.7.4 Timer0_VarInt Program
220(4)
9.7.5 C_Timer_Show Program
224(3)
Chapter 10 Data EEPROM
227(12)
10.1 EEPROM on the PIC 18 Microcontrollers
227(1)
10.1.2 On-Board Data EEPROM
227(1)
10.2 EEPROM Programming
228(3)
10.2.1 Reading EEPROM Data
228(2)
10.2.2 Writing EEPROM Data
230(1)
10.3 Data EEPROM Programming in C Language
231(2)
10.3.1 EEPROM Library Functions
232(1)
10.3.2 Sample Code
232(1)
10.4 EEPROM Demonstration Programs
233(6)
10.4.1 EEPROM_to_7Seg Program
233(4)
10.4.2 C_EEPROM_Demo Program
237(2)
Chapter 11 Liquid Crystal Displays
239(64)
11.1 LCD
239(4)
11.1.1 LCD Features and Architecture
239(1)
11.1.2 LCD Functions and Components
240(1)
Internal Registers
240(1)
Busy Flag
240(1)
Address Counter
240(1)
Display Data RAM (DDRAM)
240(1)
Character Generator ROM (CGROM)
241(1)
Character Generator RAM (CGRAM)
241(1)
Timing Generation Circuit
241(1)
Liquid Crystal Display Driver Circuit
242(1)
Cursor/Blink Control Circuit
242(1)
11.1.3 Connectivity and Pin Out
242(1)
11.2 Interfacing with the HD44780
243(4)
11.2.1 Busy Flag and Timed Delay Options
244(1)
11.2.2 Contrast Control
245(1)
11.2.3 Display Backlight
245(1)
11.2.4 Display Memory Mapping
245(2)
11.3 The HD44780 Instruction Set
247(4)
11.3.1 Instruction Set Overview
247(1)
Clearing the Display
248(1)
Return Home
248(1)
Entry Mode Set
248(1)
Display and Cursor ON/OFF
248(1)
Cursor/Display Shift
248(1)
Function Set
248(1)
Set CGRAM Address
249(1)
Set DDRAM Address
249(1)
Read Busy Flag and Address Register
249(1)
Write data
249(1)
Read data
250(1)
11.3.2 18F452 8-Bit Data Mode Circuit
250(1)
11.4 LCD Programming
251(27)
11.4.1 Defining Constants and Variables
252(1)
Constants
252(1)
11.4.2 Using MPLAB Data Directives
253(1)
Data Definition in Absolute Mode
253(1)
Relocatable Code
254(1)
Issues with Initialized Data
254(1)
11.4.3 LCD Initialization
255(1)
Reset Function
255(1)
Initialization Commands
256(1)
Function Preset Command
256(1)
Function Set Command
256(1)
Display Off
257(1)
Display and Cursor On
257(1)
Set Entry Mode
258(1)
Cursor and Display Shift
258(1)
Clear Display
258(1)
11.4.4 Auxiliary Operations
259(1)
Time Delay Routine
259(1)
Pulsing the E Line
260(1)
Reading the Busy Flag
261(1)
Bit Merging Operations
262(2)
11.4.5 Text Data Storage and Display
264(1)
Generating and Storing a Text String
265(1)
Data in Program Memory
265(1)
Displaying the Text String
266(2)
Sample Program LCD_18F_MsgFlag
268(10)
11.5 Data Compression Techniques
278(13)
11.5.1 4-Bit Data Transfer Mode
279(1)
11.5.2 Preserving Port Data
279(1)
11.5.3 Master/Slave Systems
280(1)
11.5.4 4-Bit LCD Interface Sample Programs
281(10)
11.6 LCD Programming in C18
291(8)
11.6.1 Editing xlcd.h
292(1)
Defining the Interface
292(1)
Defining the Data Port and Tris Register
293(1)
11.6.2 Timing Routines
294(1)
11.6.3 XLCD Library Functions
295(1)
BusyXLCD
295(1)
OpenXLCD
296(1)
putrXLCD
296(1)
putsXLCD
296(1)
ReadAddr
296(1)
ReadDataXLCD
297(1)
SetDDRamAddr
297(1)
SetCGRamAddr
297(1)
WriteCmdXLCD
298(1)
WriteDataXLCD
298(1)
11.7 LCD Application Development in C18
299(4)
11.7.1 Using the Project Wizard
299(1)
Main Program File
300(3)
Chapter 12 Real-Time Clocks
303(40)
12.1 Measuring Time
303(6)
12.1.1 Clock Signal Source
303(1)
32 kHz Crystal Circuit
304(1)
12.1.2 Programming the Timer1 Clock
305(1)
Setting Up Timer1 Hardware
305(1)
Coding the Interrupt Handler
306(1)
Sample Program RTC_18F_Timer1.asm
306(3)
12.2 Real-Time Clock ICs
309(9)
12.2.1 NJU6355
310(1)
12.2.2 6355 Data Formatting
310(1)
12.2.3 Initialization and Clock Primitives
311(1)
Reading and Writing Clock Data
311(3)
Initialize RTC
314(2)
12.2.4 BCD Conversions
316(2)
12.3 RTC Demonstration Circuit and Program
318(18)
12.3.1 RTC_F18_6355.asm Program
318(1)
Code Details
319(1)
Code Listing
319(17)
12.4 Real-Time Clocks in C18
336(7)
12.4.1 Timer1-Based RTC in C18
336(7)
Chapter 13 Analog Data and Devices
343(34)
13.1 Operations on Computer Data
343(1)
13.2 18F452 A/D Hardware
343(22)
13.2.1 A/D Module on the 18F452
344(1)
ADCON0 Register
345(2)
ADCON1 Register
347(1)
SLEEP Mode Operation
348(1)
13.2.2 A/D Module Sample Circuit and Program
349(1)
Initialize A/D Module
350(1)
A/D Conversion
351(1)
13.2.3 A2D_Pot2LCD Program
352(13)
13.3 A/D Conversion in C18
365(6)
13.3.1 Conversion Primitives
365(1)
Busy ADC
365(1)
CloseADC
365(1)
ConvertADC
366(1)
OpenADC
366(1)
ReadADC
367(1)
SetChan ADC
367(1)
13.3.2 C_ADConvert.c Program
368(1)
C_ADConvert.c Code Listing
368(3)
13.4 Interfacing with Analog Devices
371(6)
13.4.1 LM 34 Temperature Sensor
371(1)
13.4.2 LM 135 Circuits
372(1)
Calibrating the Sensor
372(1)
13.4.3 C_ADC_LM35.c Program
373(4)
Chapter 14 Operating Systems
377(36)
14.1 Time-Critical Systems
377(1)
14.1.2 Multitasking in Real-Time
378(1)
14.2 RTOS Scope
378(3)
14.2.1 Tasks, Priorities, and Deadlines
379(2)
14.2.2 Executing in Real-Time
381(1)
14.3 RTOS Programming
381(3)
14.3.1 Foreground and Background Tasks
382(1)
Interrupts in Tasking
382(1)
14.3.2 Task Loops
383(1)
14.3.3 Clock-Tick Interrupt
383(1)
14.3.4 Interrupts in Preemptive Multitasking
383(1)
14.4 Constructing the Scheduler
384(2)
14.4.1 Cyclic Scheduling
384(1)
14.4.2 Round-Robin Scheduling
385(1)
14.4.3 Task States and Prioritized Scheduling
385(1)
14.5 A Small System Example
386(2)
14.5.1 Task Structure
386(1)
14.5.2 Semaphore
387(1)
14.6 Sample OS Application
388(25)
Appendix A MPLAB C18 Language Tutorial
413(78)
A.1 In This Appendix
413(6)
A.1.1 About Programming
413(1)
A.1.2 Communicating with an Alien Intelligence
414(1)
A.1.3 Flowcharting
415(2)
A.1.4 C Language Rules
417(1)
Comments
418(1)
Program Header
418(1)
Programming Templates
419(1)
A.2 Structure of a C Program
419(9)
A.2.1 Sample Program C_LEDs_ON
420(1)
Identifiers
420(1)
Reserved Words
421(1)
main() Function
421(1)
A.2.2 Sample Program C_LEDs_Flash
422(1)
Expressions and Statements
423(1)
Variables
423(2)
Scope and Lifetime of a Variable
425(1)
Constants
426(1)
Local Functions
427(1)
A.2.3 Coding Style
428(1)
A.3 C Language Data
428(3)
A.3.1 Numeric Data
429(1)
A.3.2 Alphanumeric Data
430(1)
A.3.3 Arrays of Alphanumeric Data
430(1)
A.3.4 Arrays of Numeric Data
431(1)
A.4 Indirection
431(5)
A.4.1 Storage of C Language Variables
432(1)
A.4.2 Address of Operator
432(1)
A.4.3 Indirection Operator
433(1)
A.4.4 Pointers to Array Variables
434(1)
A.4.5 Pointer Arithmetic
435(1)
A.5 C Language Operators
436(15)
A.5.1 Operator Action
436(1)
A.5.2 Assignment Operator
437(1)
A.5.3 Arithmetic Operators
438(1)
Remainder Operator
439(1)
A.5.4 Concatenation
439(1)
A.5.5 Increment and Decrement
440(1)
A.5.6 Relational Operators
441(1)
A.5.7 Logical Operators
442(1)
A.5.8 Bitwise Operators
443(2)
AND Operator
445(1)
OR Operator
446(1)
XOR Operator
447(1)
NOT Operator
447(1)
Shift-Left and Shift-Right Operators
448(1)
A.5.9 Compound Assignment Operators
449(1)
A.5.10 Operator Hierarchy
449(1)
Associativity Rules
450(1)
A.6 Directing Program Flow
451(9)
A.6.1 Decisions Constructs
451(1)
If Construct
451(1)
Statement Blocks
452(1)
Nested if Construct
452(2)
Else Construct
454(1)
Dangling else Case
454(2)
else-if Clause
456(1)
Switch Construct
457(3)
Conditional Expressions
460(1)
A.7 Loops and Program Flow Control
460(6)
A.7.1 Loops and Iterations
461(1)
A.7.2 Elements of a Program Loop
461(1)
A.7.3 For Loop
462(2)
Compound Statement in Loops
464(1)
While Loop
464(1)
do-while Loop
465(1)
A.8 Breaking the Flow
466(3)
A.8.1 Goto Statement
466(1)
A.8.2 Break Statement
467(1)
A.8.3 Continue Statement
468(1)
A.9 Functions and Structured Programming
469(5)
A.9.1 Modular Construction
469(1)
A.9.2 Structure of a Function
470(1)
Function Prototype
470(1)
Function Definition
471(1)
Function Call
471(1)
Return Keyword
472(1)
Matching Arguments and Parameters
473(1)
A.10 Visibility of Function Arguments
474(4)
A.10.1 Using External Variables
474(1)
A.10.2 Passing Data by Reference
475(1)
Pointers and Functions
475(1)
Passing Array Variables
476(1)
A.10.3 Function-Like Macros
477(1)
Macro Argument
477(1)
A.11 Structures, Bit Fields, and Unions
478(13)
A.11.1 Structure Declaration
478(1)
Structure Type Declaration
479(1)
Structure Variable Declaration
479(1)
A.11.2 Accessing Structure Elements
480(1)
Initializing Structure Variables
481(1)
Manipulating a Bit Field
482(2)
Type Casting
484(1)
A.11.3 Unions
484(1)
A.11.4 Structures and Functions
485(1)
Pointers to Structures
485(1)
Pointer Member Operator
485(1)
Passing Structures to Functions
486(1)
A.11.5 Structures and Unions in MPLAB C18
487(4)
Appendix B Debugging 18F Devices
491(42)
B.1 Art of Debugging
491(2)
B.1.1 Preliminary Debugging
492(1)
B.1.2 Debugging the Logic
492(1)
B.2 Software Debugging
493(23)
B.2.1 Debugger-Less Debugging
493(1)
B.2.2 Code Image Debugging
493(1)
B.2.3 MPLAB SIM Features
494(1)
Run Mode
494(1)
Step Mode
494(1)
Animate
494(1)
Mode Differences
494(1)
Build Configurations
495(1)
Setting Breakpoints
495(1)
B.2.4 PIC 18 Special Simulations
495(1)
Reset Conditions
495(1)
Sleep
495(1)
Watchdog Timer
496(1)
Special Registers
496(1)
B.2.5 PIC 18 Peripherals
496(1)
B.2.6 MPLAB SIM Controls
497(1)
B.2.7 Viewing Commands
498(1)
Dissasembly Listing
498(1)
File Registers
499(1)
Hardware Stack
500(1)
Locals
500(1)
Program Memory
500(1)
Special Function Registers
501(1)
Watch
502(2)
Watch Window in C Language
504(1)
B.2.8 Simulator and Tracing
504(1)
Setting Up a Trace
505(1)
Trace Menu
506(1)
B.2.9 Stimulus
507(1)
Stimulus Basics
508(1)
Using Stimulus
509(1)
Asynch Tab
510(1)
Message-Based Stimulus
510(1)
Pin/Register Actions Tab
510(2)
Advanced Pin/Register Tab
512(1)
Clock Stimulus Tab
513(1)
Register Injection Tab
514(1)
Register Trace Tab
515(1)
B.3 Hardware Debugging
516(10)
B.3.1 Microchip Hardware Programmers/Debuggers
516(1)
MPLAB ICD2
516(1)
MPLAB ICD3
517(1)
MPLAB ICE 2000
517(1)
MPLAB ICE 4000
518(1)
MPLAB REAL ICE
519(1)
MPLAB PICkit 2 and PICkit 3
519(1)
B.3.2 Using Hardware Debuggers
519(1)
Which Hardware Debugger?
520(1)
ICSP
520(1)
B.3.3 MPLAB ICD2 Debugger Connectivity
521(1)
Connection from Module to Target
522(1)
Debug Mode Requirements
523(1)
Debug Mode Preparation
523(1)
Debug Ready State
524(1)
Breadboard Debugging
525(1)
B.4 MPLAB ICD 2 Tutorial
526(7)
B.4.1 Circuit Hardware
526(1)
B.4.2 LedFlash_Reloc Program
527(1)
B.4.3 Relocatable Code
527(1)
Header Files
527(1)
Program Memory
527(1)
Configuration Requirements
528(1)
RAM Allocations
528(1)
LedFlash_Reloc.asm Program
529(2)
B.4.4 Debugging Session
531(2)
Appendix C Building Your Own Circuit Boards
533(6)
C.1 Drawing the Circuit Diagram
533(2)
C.2 Printing the PCB Diagram
535(1)
C.3 Transferring the PCB Image
535(1)
C.4 Etching the Board
536(1)
C.5 Finishing the Board
536(1)
C.6 Backside Image
536(3)
Appendix D PIC 18 Instruction Set
539(94)
Appendix E Number Systems and Data Encoding
633(20)
E.1 Decimal and Binary Systems
633(1)
E.1.1 Binary Number System
633(1)
E.1.2 Radix or Base of a Number System
634(1)
E.2 Decimal versus Binary Numbers
634(2)
E.2.1 Hexadecimal and Octal
635(1)
E.3 Character Representations
636(3)
E.3.1 ASCII
636(2)
E.3.2 EBCDIC and IBM
638(1)
E.3.3 Unicode
639(1)
E.4 Encoding of Integers
639(7)
E.4.1 Word Size
640(1)
E.4.2 Byte Ordering
641(1)
E.4.3 Sign-Magnitude Representation
642(1)
E.4.4 Radix Complement Representation
643(2)
E.4.5 Simplification of Subtraction
645(1)
E.5 Binary Encoding of Fractional Numbers
646(7)
E.5.1 Fixed-Point Representations
647(1)
E.5.2 Floating-Point Representations
648(1)
E.5.3 Standardized Floating-Point
649(1)
E.5.4 Binary-Coded Decimals (BCD)
650(1)
E.5.5 Floating-Point BCD
650(3)
Appendix F Basic Electronics
653(18)
F.1 Atom
654(1)
F.2 Isotopes and Ions
654(1)
F.3 Static Electricity
655(1)
F.4 Electrical Charge
656(2)
F.4.1 Voltage
656(1)
F.4.2 Current
656(1)
F.4.3 Power
657(1)
F.4.4 Ohm's Law
657(1)
F.5 Electrical Circuits
658(2)
F.5.1 Types of Circuits
658(2)
F.6 Circuit Elements
660(7)
F.6.1 Resistors
661(1)
F.6.2 Revisiting Ohm's Law
661(1)
F.6.3 Resistors in Series and Parallel
662(2)
F.6.4 Capacitors
664(1)
F.6.5 Capacitors in Series and in Parallel
665(1)
F.6.6 Inductors
666(1)
F.6.7 Transformers
667(1)
F.7 Semiconductors
667(4)
F.7.1 Integrated Circuits
668(1)
F.7.2 Semiconductor Electronics
668(1)
F.7.3 P-Type and N-Type Silicon
669(1)
F.7.4 Diode
669(2)
Index 671
Julio Sanchez, Maria P. Canton