EmbeddedRelated.com
Books

PIC Microcontroller and Embedded Systems: Using Assembly and C for PIC18

Mazidi, Muhammad Ali, Causey, Danny, McKinlay, R 2016

The PIC microcontroller from Microchip is one of the most widely used 8-bit microcontrollers in the world. In this book, the authors use a step-by-step and systematic approach to show the programming of the PIC18 chip. Examples in both Assembly language and C show how to program many of the PIC18 features such as timers, serial communication, ADC, and SPI.


Why Read This Book

You will get a hands-on, example-driven introduction to the PIC18 family that teaches both Assembly and C so you can read, write, and optimize real firmware. The book walks you through timers, ADC, serial protocols, SPI and peripheral interfacing with clear worked examples and lab-style projects so you can apply techniques to real embedded designs.

Who Will Benefit

Engineers and hobbyists with some programming/electronics background who want to learn practical PIC18 firmware development and peripheral interfacing using Assembly and C.

Level: Intermediate — Prerequisites: Basic C programming and familiarity with digital electronics (logic levels, I/O), plus a general understanding of microcontroller concepts such as registers and interrupts.

Get This Book

Key Takeaways

  • Write and debug PIC18 firmware in both Assembly and C using common toolchains.
  • Configure and use timers, interrupts, PWM and capture/compare modules for real-time control.
  • Implement ADC, SPI, I2C and UART peripherals and integrate sensors and serial devices.
  • Design interrupt-driven, register-level device drivers and understand the hardware/software interface.
  • Apply memory, EEPROM and data-storage techniques for persistent embedded data.
  • Translate hardware datasheet details into working code and example projects for PIC18 parts.

Topics Covered

  1. Introduction to PIC Microcontrollers and the PIC18 Family
  2. Assembly Language Basics and the PIC18 Instruction Set
  3. C Programming for PIC18 — Toolchain and Compiler Usage
  4. I/O Ports and Digital Interfacing
  5. Interrupts and Real-Time Control
  6. Timers, Counters and PWM
  7. Analog-to-Digital Conversion and Sensor Interfacing
  8. Serial Communication: USART (UART)
  9. Synchronous Protocols: SPI and I²C
  10. Capture/Compare/PWM (CCP/Enhanced CCP) Modules
  11. EEPROM, Data Memory Organization and Stack Management
  12. Mixed Assembly/C Projects and Optimizations
  13. Practical Applications and Example Projects
  14. Appendices: Assembler Directives, Instruction Summary, and Datasheet Notes

Languages, Platforms & Tools

AssemblyCPIC18 (Microchip 8-bit PIC family)Generic 8-bit PIC microcontrollersMPLAB / MPLAB X IDEXC8 C CompilerMPASM (assembler)PICkit / ICD programmers & debuggersProteus (simulation) / other circuit simulators

How It Compares

Compared with Myke Predko's 'Programming and Customizing the PIC Microcontroller', Mazidi's book is more structured as a step-by-step tutorial for PIC18 with extensive assembly and C examples; compared to Tim Wilmshurst's texts, Mazidi is more code-centric and lab-oriented while Wilmshurst emphasizes system-level design and modern toolchains.

Related Books

Bryant, Randal, O'Hallaron,...