ledflash.c - The First C Program for PIC24HJ32GP202 Startup
Clock Configuration
Flasing the LED
An Improved LED Flash Program
echo.c - Testing the Serial Link
asm_echo.s - Implementing Echo in Assembly
Datasheet Reading - A Critical Skill
Configuration Bits
Clock Generation
Setting Clock Options Using C
Power-on Reset Behavior and Reset Sources
Watchdog Timer, Sleep, Idle, Doze
The reset.c Test Program
Parallel Port Operation
Tristate Drivers
Schmitt Trigger Input
Open-drain Output
Internal Weak Pull-ups
Digital versus Analog Inputs
PIO Configuration Macros/Functions
LED/Switch I/O and State Machine Programming
State Machine I/O Programming
A More Complex LED/Switch I/O Problem
Interfacing to an LCD Module
3.3 V to 5 V Interfacing
LCD Commands
LCD Code Example
The PIC24H versus the PIC24F Family
Review Problems
Interrupts and a First Look at Timers
Interrupt Basics
PIC24 Microcontroller Interrupt Details
Vector Table
Interrupt Priorities
Traps
Interrupt Latency
ISR Overhead
ISR Functions in C
The Default Interrupt Handler
An Example ISR
Change Notification Interrupts
Wake from Sleep/Idle
Using a Change Notification Interrupt to Measure Interrupt Latency
INTx External Interrupts, Remappable Pins
Switch Inputs and Change Notification/INTx Interrupts
Periodic Timer Interrupts
Timer Macros and Support Functions
Square Wave Generation
Input Sampling
Filtering Noisy Interrupts
LED/Switch I/O and Semaphores
A Rotary Encoder Interface
A Keypad Interface
On Writing and Debugging ISRs
Review Problems
Asynchronous and Synchronous Serial I/O
I/O Channel Basics
Synchronous, Asynchronous Serial I/O
Asynchronous Serial I/O Using NRZ Encoding
The PIC24 UART
UARTx Transmit Operation
UARTx Receive Operation
Baud Rate Configuration
Using the PIC24 UART with C
<stdio.h> Library Functions
Interrupt-Driven I/O with the PIC24 UART
Interrupt-driven UART Receive
Interrupt-driven UART Transmit
The RS-232 Standard
The Serial Peripheral Interface (SPI)
SPI Example: The MCP41xxx Digital Potentiometer
SPI Example:PIC24 Microcontroller Master to DS1722 Thermometer
SPI Example:PIC24 Microcontroller Master to PIC24 Microcontroller Slave
The I2C Bus
I2C on the PIC24 Microcontroller
I2C Example: PIC24 Microcontroller Master to DS1631 Thermometer
I2C Example: PIC24 Microcontroller Master to 24LC515 Serial EEPROM
Ping-Pong Buffering for Interrupt-driven Streaming Data
Review Problems
Data Conversion
Data Conversion Basics
Analog-to-Digital Conversion
Counter-Ramp ADC
Successive Approximation ADC
Flash ADC
Sample and Hold Amplifiers
The PIC24 Analog-to-Digital Converter
PIC24 ADC Configuration
PIC24 ADC Operation: Manual
PIC24 ADC Operation: Automatic and Scanning with Interrupts
PIC24 ADC Operation: Automatic Using Timers
PIC24 ADC Operation: Recap
Digital-to-Analog Conversion
Flash DACs
Resistor String Flash DACs
R-2R Resistor Ladder Flash DAC
External Digital-to-Analog Converter Examples
DAC Example: The Maxim 548A
DAC Example: The Maxim 5353
DAC Example: The Maxim 518
Review Problems
Timers
Pulse Width Measurement
Using a 32-bit Timer
Pulse Width, Period Measurement Using Input Capture
The Input Capture Module
Pulse Width Measurement Using Input Capture
Period Measurement Using Input Capture
Application: Using Capture Mode for an Infrared Decoder
The Output Compare Module
Square Wave Generation
Pulse Width Modulation
A PWM Example
PWM Application: DC Motor Speed Control and Servo Control
DC Motor Speed Control
Hobby Servo Control
PWM Control of Multiple Servos
A PWM DAC
Time Keeping Using Timer1, RTCC
The Real-Time Clock Calendar Module
Review Problems
Advanced Hardware Topics
Direct Memory Access (DMA)
Using the PIC24 Microcontroller as an I2C Slave
Bus Arbitration for the I2C Bus
The Controller Area Network (CAN)
The PIC24 ECAN(TM) Module
Using an ECAN RX FIFO
Using an Extended Data Frame
The Universal Serial Bus (USB)
Run-Time Self-Programming
A Sample Flash Application
Comparator Module
Parallel Master Port and CRC Generator
Review Problems
Operating Systems for Embedded Systems
Operating System Concepts
Tasks
Multitasking and Schedulers
Semaphores and Inter-task Coordination
OS Services
Embedded Systems Operating System (ESOS) for the PIC24 Microcontroller
Overview
User Tasks
Our First ESOS Program
ESOS Communication Services
ESOS Timer Services
ESOS Semaphore Services
ESOS User Flags
ESOS Child Tasks
ESOS Interrupt Services
Design: Adding an ESOS Service for I2C
I2C Operations Under ESOS
I2C Transactions Under ESOS
Application Using the ESOS I2C Service
Review Problems
Capstone Projects
Design of an Audio Record/Playback System
Implementation of an Audio Record/Playback System
Audio Data Compression
Audio Application ISR and Configuration
An MP3 to FM Radio Playback System
A Solder Reflow Oven
Solder Reflow Background
High Temperature Sensing
AC Power Control
Reflow Oven Control Implementation
A Small, Autonomous Robot
Other Microcontroller Families from Microchip
A Brief Survey of Non-PIC Microcontrollers
Suggested Survey Topics
Appendix A - PIC24 Architecture and Instruction Set Summary
Appendix B - Software Tools Overview
MPLAB Introduction
PIC24 C Compiler Introduction
The PICkit(TM)2 Programmer
The PIC24 Bully Bootloader
Appendix C - Suggested Laboratory Exercises
Lab Setup
Experiment 1: A Stored Program Machine (Chapters 1, 2)
Experiment 2: PIC24 Assembly and MPLAB Introduction (Chapter 3)
Experiment 3: Unsigned 8/16-bit Operations in Assembly Language (Chapter 4)
Experiment 4: 8/16/32-bit Signed Operations in Assembly Language (Chapter 5)
Experiment 5: Pointers, Subroutines in Assembly Language (Chapter 6)
Experiment 6: PIC24 System Startup (Chapter 8)
Experiment 7: LED/Switch I/O (Chapter 8)
Experiment 8: Interrupts and Timer Introduction (Chapter 9)
Experiment 9: Interrupt-driven Asynchronous Serial I/O andan I2C Serial EEPROM (Chapter 10)
Experiment 10: ADC, DAC Experiments (Chapter 11)
Experiment 11: PWM for DC Motor Control (Chapter 12)
Hardware Debugging Checklists
Appendix D - Notes on the C Language and the Book's PIC24 Library Functions
Appendix E - Circuits 001
Appendix F - References
Appendix G - Problem Solutions to odd numbered end-of-chapter exercises (even-numbered solutions are available by email request of instructor to the authors).