Introductory Programs with the 32-bit PIC Microcontroller: A Line-by-Line Code Analysis and Reference Guide for Embedded Programming in C

  • 8h 53m
  • Hubert Ward
  • Apress
  • 2023

Embark on a journey into the world of embedded programming. This book introduces you to the 32bit PIC and will teach you how the main functions of C programming work and can be used with a PIC micro.

A one-stop reference for the would-be embedded programmer, you'll explore the electronics needed for a variety of programs as well as how to use different devices with the PIC. The book starts with downloading the environment and creating a simple project, one that uses different oscillators, Phase Lock Loop, and circuitry needed to create the different system clocks—an easy entry point to this exciting environment. You'll also review the MPLABX integrated development environment (IDE) and see how to program the 32Bit PIC, which can be adapted to different PICs.

Throughout subsequent chapters, you’ll learn how to use a range of programs that use PIC modules such as the SPI, I2C, UART communication modules, the ADC module, the Capture, Compare, and Pulse Width Modulation module, and the RTCC, Real Time Clock and Calendar Module.

What You'll Learn

  • Create a project in MPLABX
  • Configure the different clock frequencies that are used in the 32bit PIC
  • Build a variable delay subroutine to be used in a simple traffic lights program
  • Use the MAX 7219 driver IC to control the 8by8 matrix display
  • Program an I2C expander module to control the display on a LCD

Who This Book Is For

Readers who want to try their hand at embedded programming, newcomers to programming the PIC 32, programmers who want to look into using MPLAB Harmony 3, and programmers who want to understand how C instructions work with respect to 32bit PIC. Also students who are studying for an engineering qualification.

About the Author

Hubert Ward has nearly 25 years of experience as a college lecturer delivering the BTEC, and now Pearson's, Higher National Certificate and Higher Diploma in Electrical & Electronic Engineering. Hubert has a 2.1 Honours Bachelor's Degree in Electrical & Electronic Engineering. Hubert has also worked as a consultant in embedded programming. His work has established his expertise in the assembler and C programming languages, within the MPLAB X IDE from Microchip, as well as designing electronic circuits, and PCBs, using ECAD software. Hubert was also the UK technical expert in Mechatronics for three years, training the UK team and taking them to enter in the Skills Olympics in Seoul 2001, resulting in one of the best outcomes to date for the UK in Mechatronics.

In this Book

  • The Aims and Objectives of the Book
  • Introduction
  • Creating Our First C Program
  • Header Files and Delays
  • The Seven-Segment Display
  • The LCD
  • The Dot Matrix Display
  • Communication
  • The I2C Communication
  • Interrupts
  • The Real-Time Clock
  • The Real-Time Clock and the DS3231
  • The RTCC Module
  • The Real Analog World
  • The DHT11 Transducer
  • Creating a Square Wave
  • Appendix
  • Appendix 1: Data Types
  • Appendix 2: Some Useful Definitions
  • Appendix 3: Mathematical and Logic Operators
  • Appendix 4: Keywords
  • Appendix 5: Numbering Systems Within Microprocessor-Based Systems
  • Appendix 6: The ASCII Character Set
  • Appendix 7: The LCD Instruction Set
SHOW MORE
FREE ACCESS