چه کسانی این کتاب را می‌خوانند

دانشجوعلاقه‌مند یادگیری
کتابخوان حرفه‌ایلذت مطالعه
نویسندهالهام‌گیری

C Programming for the PIC Microcontroller : Demystify Coding with Embedded Programming

Donald E Breyer، Kelly E Cobeen، Zeno Martin، Hubert Henry Ward

قیمت نهایی

۴۴٬۰۰۰ تومان۴۹٬۰۰۰ تومان۱۰٪ تخفیف
  • تخفیف زمان‌دار−۵٬۰۰۰ تومان

۵٬۰۰۰ تومان صرفه‌جویی نسبت به قیمت اصلی

نسخه اصلی و اورجینال

بلافاصله پس از خرید، فایل کتاب روی دستگاه شما آمادهٔ دانلود است.

تحویل فوری
پرداخت امن
ضمانت فایل
پشتیبانی

مشخصات کتاب

سال انتشار
۲۰۲۰
فرمت
PDF
زبان
انگلیسی
حجم فایل
۴٫۷ مگابایت
شابک
9781260128673، 9781260128680، 1260128679، 1260128687، 9781484255247، 9781484255254، 9781484255261، 1484255240، 1484255259، 1484255267

دربارهٔ کتاب

Go beyond the jigsaw approach of just using blocks of code you don’t understand and become a programmer who really understands how your code works. Starting with the fundamentals on C programming, this book walks you through where the C language fits with microcontrollers. Next, you'll see how to use the industrial IDE, create and simulate a project, and download your program to an actual PIC microcontroller. You'll then advance into the main process of a C program and explore in depth the most common commands applied to a PIC microcontroller and see how to use the range of control registers inside the PIC. With __C Programming for the PIC Microcontroller__ as your guide, you’ll become a better programmer who can truly say they have written and understand the code they use.**What You’ll Learn** * Use the freely available MPLAX software * Build a project and write a program using inputs from switches * Create a variable delay with the oscillator source * Measure real-world signals using pressure, temperature, and speed inputs * Incorporate LCD screens into your projects * Apply what you’ve learned into a simple embedded program **Who This Book Is For** Hobbyists who want to move into the challenging world of embedded programming or students on an engineering course. Table of Contents 5 About the Author 12 About the Technical Reviewer 13 Introduction 14 Chapter 1: Introduction 18 Programmable Industrial Controllers 18 Programming Languages 20 Machine Code 20 Assembler Language 22 C Programming Language 22 Different Programming Languages 23 The IDE 24 Summary 25 Chapter 2: Our First Program 26 The PORTS of the PIC 26 Good Programming Practice 27 The Algorithm 27 The Flowchart 28 The Program Listing 28 Using MPLABX IDE 29 Creating the Project in MPLABX 30 The First Program Turning On and Off an Output 40 The Main Aspects of a ‘C’ Program 40 The Comments and PIC Configuration 40 The TRISA and TRISB 46 A TRIS Example 48 Exercise 2-1 48 Setting the PORTS 48 The ADC (Analogue to Digital Converter) 50 Setting Up the Oscillator 53 Exercise 2-2 56 Waiting for an Input 56 Waiting to Turn the LED Off 59 Exercise 2-3 68 Comments 69 Testing the Program 69 Compiling and Running the Program 73 Testing the Program Practically 76 Summary 79 Exercise Answers 80 Chapter 3: Updating the Program 81 If This Then Do That 81 Saving the Old Program 82 Labels and the Goto Instruction 85 Exercise 3-1 85 While vs. If Then 85 Slowing the Micro Down 86 T0CON Register 87 Adding a One-Second Delay 90 Exercise 3-2 91 Delaying the Turn Off 93 Using Subroutines 95 Defining and Calling a Subroutine 95 The delay Subroutine 96 Calling the Subroutine from Within the Main Program 96 The Variable Delay and the For Do Loop 98 Local and Global Variables and Data Types 101 Type Char 101 Type Unsigned char 102 Type int 102 Local Variables 103 Global Variables 103 Exercise 3-3 106 Summary 107 Exercise Answers 107 Chapter 4: Applying What We’ve Learned 108 Controlling a Single Set of Traffic Lights 108 The Algorithm 109 The Configuration Words 115 The Analysis of the Program 116 Downloading the Program to a Prototype Board 121 Extending the Program to the Crossroads Traffic Lights 124 The Algorithm 125 The Program Analysis 132 Summary 133 Chapter 5: Real-World Inputs 134 Using Analogue Inputs 134 The ADCON0 Control Register 135 The ADCON1 Register 137 The ADCON2 Register 139 Creating the Required Acquisition Time 143 Example 1 144 Example 2 144 Changing the ADC Input Channels 145 A Basic Setup for the ADC 146 A Basic Program for the ADC 147 The Algorithm 147 Analysis of the Program 149 Summary 150 Chapter 6: Using the LCD 151 The LCD Controller 151 Instruction or Command Mode 151 Data Mode 152 Initializing the LCD 156 The Subroutine lcdOut () 173 The Subroutine sendInfo () 173 The New Aspects to PIC Programming in This LCD Program 176 Arrays 176 Using Pointers 177 Connecting the LCD in 8-Bit Mode 179 The Volt Meter Program 189 The Algorithm 189 The New Aspects of the Program 199 The gohome Subroutine 199 The sysVoltage Subroutine 200 The displayVoltage Subroutine 201 Changing the Main Part of the Program 202 Creating Special Characters on the LCD 204 Summary 225 Chapter 7: Creating a Header File 226 Header Files 226 Creating a Header File 226 Including the Header File into Your Program 230 The Global Header File 231 Creating a Header File for Your Configuration Instructions 232 Summary 234 Chapter 8: Understanding Some Useful Code 235 The Trace Table 236 The Process 236 Lines 1–6 243 Line 7 unsigned char ∗listpointer; 243 Line 10 number1++; 244 Line 11 number1 = number1 + 2; 244 Line 12 number2 = number1 - 2; 244 Line 13 number2 = 0b1111111111110000; 244 Line 17 z = ++y; 245 Line 18 z = y++; 245 Line 19 z = (unsigned char) u; 245 Line 21 y = ~y; 245 Line 23 z = y< >1; 246 Line 26 y=(a>0) ? a : -1; 247 Line 27 y=(a==0) ? a : -1; 247 Line 28 y=(a>0) ? z: -1; 247 Line 29 listpointer = list; 248 Line 30 ∗listpointer =2; 248 Line 31 listpointer ++; 248 Line 32 ∗listpointer = 5; 248 Line 33 listpointer = list; 249 Line 34 a = a & 0xF0; 249 Line 37 if ( t && 7 == t)m = 5; 250 Line 38 else m = 9; 250 Line 39 n = 0b00001000; 250 Line 40 if (n & 0b00001000)m = 5; 251 Line 41 else m = 3; 251 Line 42 if (n & 0b00000001)t = 4; 251 Line 43 else t = 2; 251 Line 44 n = 10; 251 Line 45 for (a = 0, a < 5, a++;) 251 Line 47 ∗listpointer = n; 252 Line 48 listpointer ++; 252 Line 49 n = n +2; 252 Line 51 while (1); 253 Debugging the Program 253 Compiling the Completed Program 254 Summary 261 Appendix: Additional Resources 262 Useful Definitions 262 Mathematical and Logic Operators 263 Keywords 264 Data Types 264 Functions 265 Loops 267 Numbering Systems Within Microprocessor-Based Systems 267 Binary Numbers 268 Converting Decimal to Binary 268 Adding and Subtracting Binary Numbers 272 Subtracting Binary Numbers 274 The Hexadecimal Number System 275 Index 278 Go beyond the jigsaw approach of just using blocks of code you don’t understand and become a programmer who really understands how your code works. Starting with the fundamentals on C programming, this book walks you through where the C language fits with microcontrollers. Next, you'll see how to use the industrial IDE, create and simulate a project, and download your program to an actual PIC microcontroller. You'll then advance into the main process of a C program and explore in depth the most common commands applied to a PIC microcontroller and see how to use the range of control registers inside the PIC. With C Programming for the PIC Microcontroller as your guide, you’ll become a better programmer who can truly say they have written and understand the code they use. What You’ll Learn Use the freely available MPLAX software Build a project and write a program using inputs from switches Create a variable delay with the oscillator source Measure real-world signals using pressure, temperature, and speed inputs Incorporate LCD screens into your projects Apply what you’ve learned into a simple embedded program Who This Book Is For Hobbyists who want to move into the challenging world of embedded programming or students on an engineering course. Go beyond the jigsaw approach of just using blocks of code you don't understand and become a programmer who really understands how your code works. Starting with the fundamentals on C programming, this book walks you through where the C language fits with microcontrollers. Next, you'll see how to use the industrial IDE, create and simulate a project, and download your program to an actual PIC microcontroller. You'll then advance into the main process of a C program and explore in depth the most common commands applied to a PIC microcontroller and see how to use the range of control registers inside the PIC. With C Programming for the PIC Microcontroller as your guide, you'll become a better programmer who can truly say they have written and understand the code they use. You will: Use the freely available MPLAX software Build a project and write a program using inputs from switches Create a variable delay with the oscillator source Measure real-world signals using pressure, temperature, and speed inputs Incorporate LCD screens into your projects Apply what you've learned into a simple embedded program "Go beyond the jigsaw approach of just using blocks of code you don't understand and become a programmer who really understands how your code works. Starting with the fundamentals on C programming, this book walks you through where the C language fits with microcontrollers. Next, the author will take you through how to use the industrial IDE, create and simulate a project, and download your program to an actual PIC microcontroller. This book then advances into the main process of a C program and goes in depth on the most common commands applied to a PIC microcontroller and how to use the range of control registers inside the PIC. Through C programming for the PIC microcontroller, you'll become a better programmer who can truly say they have written and understand the code they use."-- Provided by publisher Front Matter ....Pages i-xx Introduction (Hubert Henry Ward)....Pages 1-8 Our First Program (Hubert Henry Ward)....Pages 9-63 Updating the Program (Hubert Henry Ward)....Pages 65-91 Applying What We’ve Learned (Hubert Henry Ward)....Pages 93-118 Real-World Inputs (Hubert Henry Ward)....Pages 119-135 Using the LCD (Hubert Henry Ward)....Pages 137-211 Creating a Header File (Hubert Henry Ward)....Pages 213-221 Understanding Some Useful Code (Hubert Henry Ward)....Pages 223-249 Back Matter ....Pages 251-271

قیمت نهایی

۴۴٬۰۰۰ تومان