وبلاگ بلیان

Programming PIC Microcontrollers with XC8

معرفی کتاب «Programming PIC Microcontrollers with XC8» نوشتهٔ Armstrong Subero (auth.)، منتشرشده توسط نشر Apress : Imprint : Apress در سال 2018. این کتاب در فرمت pdf، زبان انگلیسی ارائه شده است.

اگر از کپی‌کردن و چسباندن کد در پروژه‌های تعبیه‌شده (Embedded) خسته شده‌اید و می‌خواهید کدهای خود را از ابتدا بنویسید و درک کنید که دقیقاً چه اتفاقی در حال رخ دادن است، کتاب Programming PIC Microcontrollers with XC8 نوشتهٔ آرمسترانگ سوبرو (Armstrong Subero) دقیقاً همان راهنمایی است که به آن نیاز دارید. این کتاب با رویکردی کاملاً عملی، شما را قدم‌به‌قدم با توسعهٔ سیستم‌های تعبیه‌شده با استفاده از میکروکنترلرهای ۸ بیتی PIC و کامپایلر XC8 آشنا می‌کند و پلی استوار برای حرکت از سطح آردوینو به دنیای حرفه‌ای‌تر میکروکنترلرها فراهم می‌آورد.

دربارهٔ کتاب —

کتاب *Programming PIC Microcontrollers with XC8* که در سال ۲۰۱۸ توسط انتشارات معتبر اسپرینگر-نیچر (Apress) منتشر شده است، یک منبع جامع و عملی برای یادگیری برنامه‌نویسی میکروکنترلرهای PIC به شمار می‌رود. این کتاب بر خلاف بسیاری از متون نظری، بر جنبهٔ عملی و ملموس موضوع تأکید دارد و با زبانی ساده و ساختاری گام‌به‌گام، شما را با مفاهیم کلیدی و تکنیک‌های پیشرفته آشنا می‌سازد. نویسنده با فرض این که خواننده آشنایی مقدماتی با زبان برنامه‌نویسی C و مبانی الکترونیک دیجیتال دارد، مباحث را از راه‌اندازی محیط توسعه (MPLAB X) و کامپایلر XC8 آغاز کرده و تا مباحث پیشرفته‌تری مانند ارتباطات بی‌سیم و تکنیک‌های بهینه‌سازی مصرف انرژی پیش می‌برد. جوهرهٔ اصلی این کتاب، رویکرد «بدون حاشیه و ریاضیات پیچیده» (without all the frills and math) آن است. سوبرو به جای درگیر کردن خواننده با فرمول‌های سنگین، با ارائهٔ کدهای کاربردی، شماتیک‌های مدار و تصاویر متعدد، مفاهیم را به شکلی ملموس و قابل فهم منتقل می‌کند. این کتاب برای کسانی طراحی شده که به دنبال پلهٔ بعدی پس از آردوینو هستند؛ جایی که کنترل بیشتری روی سخت‌افزار و کد خود دارند و می‌خواهند درک عمیق‌تری از نحوهٔ کار میکروکنترلرها به دست آورند.

دربارهٔ نویسنده

آرمسترانگ سوبرو (Armstrong Subero) یک مهندس خودآموخته و نویسندهٔ پرکار در حوزهٔ سیستم‌های تعبیه‌شده است که علاقهٔ خود به الکترونیک را از هشت سالگی آغاز کرد. او مدرک خود را در علوم کامپیوتر از دانشگاه توماس ادیسون دریافت کرده و در حال حاضر به عنوان متخصص در وزارت امنیت ملی کشور ترینیداد و توباگو مشغول به کار است. سوبرو نویسندهٔ کتاب‌های دیگری همچون *Codeless Data Structures and Algorithms* و *Programming Microcontrollers with Python* نیز هست و در وب‌سایت‌های معتبری مانند Free Code Camp به عنوان نویسندهٔ مشارکتی فعالیت دارد. تجربهٔ عملی و اشتیاق او به تکنولوژی میکروکنترلرها در نگارش این کتاب به وضوح مشهود است و او را به یک راهنمای قابل اعتماد برای ورود به دنیای PIC تبدیل می‌کند.

چرا باید *Programming PIC Microcontrollers with XC8* را بخوانید؟

مطالعهٔ این کتاب، دریچهای به سوی درک عمیق و عملی از سیستم‌های تعبیه‌شده می‌گشاید و مزایای متعددی برای مخاطبان خود دارد: رویکرد کاملاً عملی: این کتاب بر پروژه‌های واقعی و کاربردی متمرکز است و با تأکید بر کدنویسی، شماتیک و تصاویر، شما را برای مواجهه با چالش‌های دنیای واقعی آماده می‌سازد. آموزش گام‌به‌گام از پایه: فرآیند یادگیری با نصب و راه‌اندازی محیط توسعه (MPLAB X) و کامپایلر XC8 شروع شده و تا مباحث پیشرفته‌ای مانند ارتباطات سریال (EUSART و Software UART) و پروتکل‌های SPI و I2C پیش می‌رود. پوشش تکنولوژی‌های روز: شما با قابلیت‌های مدرن میکروکنترلرهای PIC نظیر مصرف انرژی بسیار پایین (XLP) و ارتباطات بی‌سیم (Wi-Fi و بلوتوث) آشنا خواهید شد. پر کردن فاصله بین آردوینو و دنیای حرفه‌ای: این کتاب پلی است برای کسانی که از محدودیت‌های آردوینو فراتر رفته و به دنبال درک و کنترل عمیق‌تر بر روی میکروکنترلرها هستند.

این کتاب برای چه کسانی مناسب است؟

*Programming PIC Microcontrollers with XC8* برای طیف وسیعی از مخاطبان، از مبتدیان تا علاقه‌مندان حرفه‌ای، منبعی ارزشمند محسوب می‌شود. این کتاب به‌ویژه برای کسانی نوشته شده که با مفاهیم پایه‌ای زبان C و الکترونیک دیجیتال آشنایی دارند و قصد دارند این دانش را در عمل به کار گیرند. دانشجویانی که به دنبال یک نمای کلی و عملی از میکروکنترلرها خارج از فضای آکادمیک هستند، و همچنین توسعه‌دهندگانی که می‌خواهند پروژه‌های خود را به سطح بالاتری ببرند، از خواندن این کتاب سود زیادی خواهند برد. حتی یک تازه‌کار کامل نیز با کمی پشتکار می‌تواند مفاهیم را دنبال کند، هرچند پیش‌نیازهای ذکر شده، مسیر یادگیری را هموارتر می‌سازند.

سوالات متداول

آیا برای استفاده از این کتاب، به تجهیزات گران‌قیمتی نیاز دارم؟

نویسنده سعی کرده است با معرفی ابزارهای در دسترس و مقرون‌به‌صرفه، مسیر یادگیری را برای همه هموار کند. با تهیه‌ی یک میکروکنترلر PIC و یک برنامه‌نویس ساده، که در فصل اول کتاب نیز به آن‌ها اشاره شده است، می‌توانید تمام پروژه‌های کتاب را دنبال کنید.

سبک نگارش کتاب چگونه است و آیا برای یک مبتدی مناسب است؟

کتاب با زبانی بسیار روان، ساده و خودآموز نوشته شده است. تمرکز اصلی بر روی «چگونگی» انجام کارها است و از درگیر شدن با مباحث انتزاعی و ریاضیات پیچیده پرهیز می‌کند، که این ویژگی آن را برای مبتدیانی که پیش‌زمینه‌ی نظری قوی ندارند نیز مناسب می‌سازد.

آیا کتاب منحصراً بر روی یک خانواده‌ی خاص از میکروکنترلرهای PIC متمرکز است؟

این کتاب به طور خاص بر روی میکروکنترلرهای ۸ بیتی PIC متمرکز است، اما مفاهیم و تکنیک‌های ارائه‌شده در آن به‌حدی بنیادین هستند که برای کار با بسیاری از اعضای این خانواده‌ی بزرگ، کاربردی و قابل استفاده‌اند.

Learn how to use microcontrollers without all the frills and math. This book uses a practical approach to show you how to develop embedded systems with 8 bit PIC microcontrollers using the XC8 compiler. It's your complete guide to understanding modern PIC microcontrollers. Are you tired of copying and pasting code into your embedded projects? Do you want to write your own code from scratch for microcontrollers and understand what your code is doing? Do you want to move beyond the Arduino? Then __Programming PIC Microcontrollers with XC8__is for you! Written for those who want more than an Arduino, but less than the more complex microcontrollers on the market, PIC microcontrollers are the next logical step in your journey. You'll also see the advantage that MPLAB X offers by running on Windows, MAC and Linux environments. You don't need to be a command line expert to work with PIC microcontrollers, so you can focus less on setting up your environment and more on your application. **What You’ll Learn** * Set up the MPLAB X and XC8 compilers for microcontroller development * Use GPIO and PPS * Review EUSART and Software UART communications * Use the eXtreme Low Power (XLP) options of PIC microcontrollers * Explore wireless communications with WiFi and Bluetooth **Who This Book Is For** Those with some basic electronic device and some electronic equipment and knowledge. This book assumes knowledge of the C programming language and basic knowledge of digital electronics though a basic overview is given for both. A complete newcomer can follow along, but this book is heavy on code, schematics and images and focuses less on the theoretical aspects of using microcontrollers. This book is also targeted to students wanting a practical overview of microcontrollers outside of the classroom. Table of Contents 4 About the Author 12 Introduction 13 Chapter 1: Preparing for Development 18 Gathering Your Hardware 18 Microcontroller 19 Programmer 21 Gathering the Software 23 MPLAB® X IDE 23 XC Compilers 24 Setting Up Shop 25 Multimeter 25 Oscilloscope 25 Power Supply 25 Shopping for Supplies 26 Conclusion 30 Chapter 2: The C Programming Language 31 C 31 C Programming 31 C Program Structure 32 Comments 33 Variables and Constants 33 Arrays, Pointers, and Structures 35 Arrays 35 Pointers 36 Structures 37 Operators 38 Controlling Program Flow 39 if Statement 39 else Statement 40 else if Statement 40 switch statement 41 for Loop 42 while Loop 42 do Loop 43 break Statement 43 continue Statement 43 goto Statement 44 Preprocessor Directives 44 #define 45 #if, #ifdef, #ifndef, #elif, and #else 46 #pragma 47 Assembly vs. C 47 Conclusion 48 Chapter 3: Basic Electronics for Embedded Systems 49 Electronics 49 Resistors 49 Potentiometer 52 Digital Potentiometer 53 Photoresistor 54 Capacitor 55 Inductor 57 Transformers 58 Diode 59 Zener Diode 60 Light Emitting Diode 61 Laser Diode 62 Transistors 63 Bipolar Junction Transistors 63 Darlington Transistor 65 Field Effect Transistor 67 Metal Oxide Semiconductor Field Effect Transistor (MOSFET) 67 Junction Field Effect Transistor 68 Operational Amplifier 69 Digital Electronics 70 The AND Gate 70 The OR Gate 71 The NOT Gate 71 The NAND Gate 72 The NOR Gate 72 The Buffer Gate 73 The XOR Gate 73 Logic-Level Conversion 74 Run the Entire System on 3.3v 75 Use a Voltage Divider 75 Use a Bi-Directional Logic Level Shifter 76 Conclusion 77 Chapter 4: PIC® Microcontrollers 78 PIC® Microcontrollers Overview 78 Baseline PIC® Microcontrollers 78 Mid-Range PIC® Microcontrollers 79 Enhanced Mid-Range PIC® Microcontrollers 79 High-Performance PIC® Microcontrollers 79 PIC® 16F1717 Block Diagram 80 Program Flash Memory 81 Random Access Memory 81 Timing Generation 82 !MCLR 83 Ports 83 Onboard Peripherals 83 Analog to Digital Converter 83 Digital to Analog Converter 84 Capture/Compare/Pulse Width Modulation Module 84 Pulse Width Modulation Module 84 Timers 85 Comparators 85 Fixed Voltage Reference 85 Temperature Indicator 85 EUSART 86 CLC 86 MSSP 86 NCO 86 ZCD 86 COG 87 Operational Amplifiers 87 High Endurance Flash Block 87 The Enhanced Mid-Range CPU Core 87 Power-Up Timer 89 Oscillator Start-Up Timer 89 Power-On Reset 89 Watchdog Timer 89 Brown-Out Reset 90 Conclusion 90 Chapter 5: Connecting and Creating 91 Let’s Get Started 91 A Look at Programmers 91 A Look at Programming 95 Traps for Beginners 100 Additional Information 101 Conclusion 101 Chapter 6: Input and Output 102 Let’s Begin I/O 102 TRIS Register 102 PORT Register 104 Output Latch Registers 104 Analog Select Registers 104 Weak Pull-Up 105 Making an LED Blink 105 Using a Pushbutton 123 Seven Segment Displays 132 Seven Segment Display Multiplexing 138 Project: Countdown Timer 145 Peripheral Pin Select 154 Conclusion 155 Chapter 7: Interfacing Actuators 156 Introducing Actuators 156 DC Motor 156 Servo Motor 161 Stepper Motor 170 Conclusion 177 Chapter 8: Interrupts, Timers, Counters, and PWM 178 Introduction to Interrupts 178 Using Timers 185 Timer 0 in Timer Mode 185 Timer 0 in Counter Mode 190 Timer 0 with Interrupts 196 Using the CCP Module 202 Understanding PWM 202 Using PWM 202 Project: Using PWM with a Motor Driver 207 Project: Using CCP and Dedicated PWM with RGB LED 213 Conclusion 220 Chapter 9: USART, SPI, and I2C: Serial Communication Protocols 221 Using USART (Universal Synchronous Asynchronous Receiver Transmitter) 221 Serial Character LCD 222 USART to PC Communication 231 Text to Speech 231 Using GPS (Global Positioning Systems) 236 NMEA Commands 236 Software USART 245 GSM Module 245 AT Commands 246 Using SPI (Serial Peripheral Interface) 254 Digital Potentiometer 256 Character Display 261 Character: The Hitachi HD44780 LCD 261 The Samsung KS0066U 275 Using the I2C (Inter-Integrated Circuit) Protocol 275 EEPROM 276 Conclusion 288 Chapter 10: Interfacing Displays 289 Displays 289 OLED Displays 290 Touch Screen LCD 307 Resistive Touch 308 Capacitive Touch 309 Selecting a Touch Screen LCD 309 Using the Touch LCD 310 Creating a Layout 310 Adding Widgets 311 Adding Code 311 Reading on the Microcontroller 313 Conclusion 322 Chapter 11: ADC and DAC 323 Data Conversion 323 ADC (Analog to Digital Conversion) 323 Project: Digital Thermometer 328 DAC (Digital to Analog Converter) 334 Conclusion 337 Chapter 12: NCO, Comparator, and FVR 338 CLC (Configurable Logic Cell) 338 NCO (Numerically Controlled Oscillator) 341 Comparator 344 FVR (Fixed Voltage Reference) 349 Conclusion 353 Chapter 13: Wi-Fi and Bluetooth 354 Low-Cost Wireless Connectivity 354 Integrating Wi-Fi 354 Using the ESP8266 355 Testing the ESP8266 355 Project: Wi-Fi Data Logger 356 Integrating Bluetooth 370 Using the HC05 Bluetooth Module 370 AT Mode 371 Communicating via Bluetooth 371 Conclusion 376 Chapter 14: Watchdog Timer and Low Power 377 Low Power 8-Bit vs 32-Bit 377 Sleep Mode 378 Watchdog Timer 383 Other Ways to Conserve Power 388 Reduce the Clock Frequency 389 Reduce the Operating Voltage 389 Power External Devices from I/O Lines 389 Conclusion 390 Chapter 15: PIC® Microcontroller Projects 391 Project: Temperature Controlled Fan 391 Project: Touch Screen Clock 400 Conclusion 432 Appendix A: Resources 433 Appendix B: Making Your Own PCBs and Schematics 435 Fritzing 435 Altium Circuit Maker 435 Scheme-it 436 Index 437 Learn how to use microcontrollers without all the frills and math. This book uses a practical approach to show you how to develop embedded systems with 8 bit PIC microcontrollers using the XC8 compiler. It's your complete guide to understanding modern PIC microcontrollers. Are you tired of copying and pasting code into your embedded projects? Do you want to write your own code from scratch for microcontrollers and understand what your code is doing? Do you want to move beyond the Arduino? Then Programming PIC Microcontrollers with XC8 is for you! Written for those who want more than an Arduino, but less than the more complex microcontrollers on the market, PIC microcontrollers are the next logical step in your journey. You'll also see the advantage that MPLAB X offers by running on Windows, MAC and Linux environments. You don't need to be a command line expert to work with PIC microcontrollers, so you can focus less on setting up your environment and more on your application. What You’ll Learn Set up the MPLAB X and XC8 compilers for microcontroller development Use GPIO and PPS Review EUSART and Software UART communications Use the eXtreme Low Power (XLP) options of PIC microcontrollers Explore wireless communications with WiFi and Bluetooth Who This Book Is For Those with some basic electronic device and some electronic equipment and knowledge. This book assumes knowledge of the C programming language and basic knowledge of digital electronics though a basic overview is given for both. A complete newcomer can follow along, but this book is heavy on code, schematics and images and focuses less on the theoretical aspects of using microcontrollers. This book is also targeted to students wanting a practical overview of microcontrollers outside of the classroom. Front Matter ....Pages i-xvii Preparing for Development (Armstrong Subero)....Pages 1-13 The C Programming Language (Armstrong Subero)....Pages 15-32 Basic Electronics for Embedded Systems (Armstrong Subero)....Pages 33-61 PIC® Microcontrollers (Armstrong Subero)....Pages 63-75 Connecting and Creating (Armstrong Subero)....Pages 77-87 Input and Output (Armstrong Subero)....Pages 89-142 Interfacing Actuators (Armstrong Subero)....Pages 143-164 Interrupts, Timers, Counters, and PWM (Armstrong Subero)....Pages 165-207 USART, SPI, and I2C: Serial Communication Protocols (Armstrong Subero)....Pages 209-276 Interfacing Displays (Armstrong Subero)....Pages 277-310 ADC and DAC (Armstrong Subero)....Pages 311-325 NCO, Comparator, and FVR (Armstrong Subero)....Pages 327-342 Wi-Fi and Bluetooth (Armstrong Subero)....Pages 343-365 Watchdog Timer and Low Power (Armstrong Subero)....Pages 367-380 PIC® Microcontroller Projects (Armstrong Subero)....Pages 381-422 Back Matter ....Pages 423-434 Learn how to use microcontrollers without all the frills and math. This book uses a practical approach to show you how to develop embedded systems with 8 bit PIC microcontrollers using the XC8 compiler. It's your complete guide to室erstanding modern PIC microcontrollers. Are you tired of copying and pasting code into your embedded projectsDo you want to write your own code from scratch for microcontrollers and understand what your code is doingDo you want to move beyond the ArduinoThen Programming PIC Microcontrollers with XC8 is for you! 粩tten for those who want more than an Arduino, but less than the more complex microcontrollers on the market, PIC microcontrollers are the next logical step in your journey. You'll also see the advantage that MPLAB X offers by running on Windows, MAC and Linux environments. You don't need to be a command line expert to work with PIC microcontrollers, so you can focus less on setting up your environment and more on your application
دانلود کتاب Programming PIC Microcontrollers with XC8