EmbeddedRelated.com
Books

Programming PIC Microcontrollers with XC8

Subero, Armstrong 2017

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.


                Why Read This Book

                You will learn to go beyond Arduino by writing clear, from-scratch firmware for 8-bit PIC microcontrollers using Microchip's XC8 toolchain, with a strong emphasis on practical, working examples. The book strips away unnecessary theory and shows you how to configure peripherals, debug, and build reliable embedded projects quickly.

                Who Will Benefit

                Hobbyists, students, and embedded engineers with some C or Arduino experience who want a hands-on, toolchain-focused path to programming 8-bit PIC microcontrollers and building real firmware.

                Level: Intermediate — Prerequisites: Basic C programming, elementary electronics (Ohm's law, basic circuits), and familiarity with microcontroller concepts or Arduino; no prior PIC experience required.

                Get This Book

                Key Takeaways

                • Set up MPLAB X and the XC8 compiler and create reliable PIC firmware projects from scratch
                • Configure and use common 8-bit PIC peripherals (GPIO, timers, ADC, PWM, EEPROM) in real applications
                • Implement interrupt-driven designs and manage timing, debouncing, and low-power modes correctly
                • Interface PIC microcontrollers with serial buses and devices (USART, SPI, I2C) and debug communications
                • Use hardware tools (PICkit/ICD) and simulator features to step through code, diagnose problems, and optimize firmware

                Topics Covered

                1. 1. Introduction to 8-bit PIC Microcontrollers
                2. 2. Getting Started: MPLAB X, XC8, and Development Boards
                3. 3. PIC Architecture, Memory Model, and Registers
                4. 4. Digital I/O and Practical Hardware Interfacing
                5. 5. Timers and Timekeeping Techniques
                6. 6. Interrupts and Event-Driven Programming
                7. 7. Analog-to-Digital Conversion and Sensors
                8. 8. Serial Communication: USART, SPI, and I2C
                9. 9. PWM, Motor Control, and Power Management
                10. 10. EEPROM, Data Storage, and Configuration
                11. 11. Debugging, Simulation, and Programming Tools
                12. 12. Design Examples and Complete Projects
                13. Appendices: Instruction Set Highlights, Common Registers, and Reference Schematics

                Languages, Platforms & Tools

                CAssembly (introductory/examples)Microchip PIC16Microchip PIC188-bit PIC microcontrollersMPLAB X IDEXC8 CompilerPICkit (programmer/debugger)MPLAB IPE/ICDProteus (simulation) — mentioned/used in examples

                How It Compares

                Covers similar applied ground to Mazidi's PIC texts but is more toolchain- and XC8-focused with practical projects rather than exhaustive instruction-set or assembly coverage.

                Related Books

                Bryant, Randal, O'Hallaron,...