Table of Contents For Assembly Language to C Using the PIC24 Family

Detailed Table of Contents

  1. Number System and Digital Logic Review
      1. Binary Data
      2. Unsigned Number Conversion
        • Hex to Binary, Binary to Hex
      3. Binary and Hex Arithmetic
        • Binary and Hex Addition
        • Binary and Hex Subtraction
        • Shift Operations
      4. Combinational Logic Functions
        • Logic Gate CMOS Implementations
      5. Combinational Building Blocks
        • The Multiplexer
        • The Adder
        • The Incrementer
        • The Shifter
        • Memory (as a combinational lookup table)
      6. Sequential Logic
        • The Clock Signal
        • The D Flip-Flop
      7. Sequential Building Blocks
        • The Register
        • The Counter
        • The Shift Register
      8. Encoding Character Data
      9. Review Problems
  2. The Stored Program Machine
      1. Problem Solving the Digital Way
      2. Finite State Machine Design
        • Finite State Machine Implementation
      3. A Stored Program Machine
        • Instruction Set Design and Assembly Language
        • Hardware Design
      4. Modern Computers
      5. Review Problems
  3. Introduction to the PIC24 Microcontroller Family
      1. Introduction to Microprocessors and Microcontrollers
      2. The PIC24 Microcontroller Family
        • Program Memory Organization
        • Data Memory Organization
        • Arrangement of Multibyte Values in Data Memory
      3. Data Transfer Instructions and Addressing Modes
        • Register Direct Addressing
        • File Register Addressing
        • WREG - The Default Working Register
        • Immediate Addressing
        • Indirect Addressing
        • Instruction Set Regularity
      4. Basic Arithmetic and Control Instructions
        • Three-operand Addition/Subtraction
        • Two-operand Addition/Subtraction
        • Increment, Decrement Instructions
        • Program Control: goto
      5. A PIC24 Assembly Language Program
        • C-to-PIC24 Assembly Language
        • The NOP Instruction
        • 16-bit (WORD) Operations
      6. The Clock and Instruction Execution
      7. Review Problems
  4. Unsigned 8/16-bit Arithmetic, Logical, Conditional Operations
      1. Bitwise Logical Operations, Bit Operations
      2. The Status Register
      3. Shift and Rotate Operations
      4. Mixed 8-bit/16-bit Operations, Compound Operations
        • Working Register Usage
        • LSByte, MSByte Operations
      5. Conditional Execution Using Bit Tests
      6. Unsigned Conditional Tests
        • Conditional Tests in C
        • Zero, Non-zero Conditional Tests
        • Bit Tests
        • Equality, Inequality Conditional Tests
        • Conditional Tests for >=, >, <, <=
        • Comparison and Unsigned Branch Instructions
      7. Complex Conditional Expressions
      8. Looping
      9. Review Problems
  5. Extended Precision and Signed Data Operations
      1. Extended Precision Operations
        • 32-bit Assignment Operations
        • 32-bit Bitwise Logical Operations
        • 32-bit Addition/Subtraction
        • 32-bit Logical Shift Right/Shift Left Operations
        • Zero, Non-Zero Conditional Tests
        • Equality, Inequality
        • Comparisons of >, >=, <, <= on Unsigned 32-bit Operands
        • 64-bit Operations
      2. Signed Number Representation
        • Signed Magnitude
        • One's Complement
        • Two's Complement
        • Sign Extension
        • Two's Complement Overflow
      3. Operations on Signed Data
        • Shift Operations on Signed Data
        • Comparisons of >, >=, <, <= on Signed Operands
        • Sign Extension for Mixed Precision
      4. Branch Instruction Encoding
      5. Review Problems
  6. Pointers and Subroutines
      1. An Introduction to C Pointers
      2. PIC24 Indirect Addressing Modes
        • Instruction Stalls Due to Data Dependencies
      3. Arrays and Pointers in C
        • C Strings
        • The REPEAT Instruction
      4. Subroutines
      5. The Stack and Call/Return, Push/Pop
        • The Data Memory Stack
        • Call/Return and the Data Memory Stack
        • Stack Overflow/Underflow
      6. Implementing Subroutines in Assembly Language
        • Static versus Dynamic Parameter Allocation
        • Using Working Registers for Subroutine Parameters and Locals
        • Saving Register Values on the Stack
        • The Shadow Registers
        • A Subroutine with Multiple Parameters
      7. Stack Frames for Function Parameters and Local Variables
      8. Program Space Visibility and Global Variable Initialization
      9. Review Problems
  7. Advanced Assembly Language: Higher Math
      1. Multiplication
        • 64-bit Multiplication
      2. Division
      3. Fixed-Point and Saturating Arithmetic
        • Decimal to X.Y Binary Format
        • X.Y Binary Format to Decimal Conversion
        • Signed Fixed-Point
        • 0.N Fixed-Point Format and Saturating Operations
        • The dsPIC Microcontroller Family
      4. Floating-Point Number Representation
        • IEEE 754 Floating-Point Encoding
        • Floating-Point Operations
      5. BCD Arithmetic
      6. ASCII Data Conversion
        • Binary to ASCII-Hex
        • Binary to ASCII-Decimal
        • ASCII-Hex to Binary
        • ASCII-Decimal to Binary
      7. Review Problems
  8. The PIC24HJ32GP202: System Startup and Parallel Port I/O
      1. High-Level Languages versus Assembly Language
      2. C Compilation for the PIC24 Microcontroller
        • Special Function Registers and Bit References
        • PIC24 Compiler Runtime Code, Variable Qualifiers/Attributes
        • C Macros, Inline Functions
        • Conditional Compilation
      3. PIC24HJ32GP202 Startup Schematic
        • Startup Schematic: Power
        • Startup Schematic: Reset
        • Startup Schematic: PC Serial Communication Link
        • Startup Schematic: In-circuit Serial Programming
        • Startup Schematic: Application Components
      4. ledflash.c - The First C Program for PIC24HJ32GP202 Startup
        • Clock Configuration
        • Flasing the LED
        • An Improved LED Flash Program
      5. echo.c - Testing the Serial Link
        • asm_echo.s - Implementing Echo in Assembly
      6. Datasheet Reading - A Critical Skill
      7. Configuration Bits
      8. Clock Generation
        • Setting Clock Options Using C
      9. Power-on Reset Behavior and Reset Sources
      10. Watchdog Timer, Sleep, Idle, Doze
      11. The reset.c Test Program
      12. Parallel Port Operation
        • Tristate Drivers
        • Schmitt Trigger Input
        • Open-drain Output
        • Internal Weak Pull-ups
        • Digital versus Analog Inputs
        • PIO Configuration Macros/Functions
      13. LED/Switch I/O and State Machine Programming
        • State Machine I/O Programming
        • A More Complex LED/Switch I/O Problem
      14. Interfacing to an LCD Module
        • 3.3 V to 5 V Interfacing
        • LCD Commands
        • LCD Code Example
      15. The PIC24H versus the PIC24F Family
      16. Review Problems
  9. Interrupts and a First Look at Timers
      1. Interrupt Basics
      2. PIC24 Microcontroller Interrupt Details
        • Vector Table
        • Interrupt Priorities
        • Traps
        • Interrupt Latency
        • ISR Overhead
      3. ISR Functions in C
        • The Default Interrupt Handler
        • An Example ISR
      4. Change Notification Interrupts
        • Wake from Sleep/Idle
        • Using a Change Notification Interrupt to Measure Interrupt Latency
      5. INTx External Interrupts, Remappable Pins
        • Switch Inputs and Change Notification/INTx Interrupts
      6. Periodic Timer Interrupts
        • Timer Macros and Support Functions
        • Square Wave Generation
        • Input Sampling
        • Filtering Noisy Interrupts
      7. LED/Switch I/O and Semaphores
      8. A Rotary Encoder Interface
      9. A Keypad Interface
      10. On Writing and Debugging ISRs
      11. Review Problems
  10. Asynchronous and Synchronous Serial I/O
      1. I/O Channel Basics
      2. Synchronous, Asynchronous Serial I/O
        • Asynchronous Serial I/O Using NRZ Encoding
      3. The PIC24 UART
        • UARTx Transmit Operation
        • UARTx Receive Operation
        • Baud Rate Configuration
      4. Using the PIC24 UART with C
        • <stdio.h> Library Functions
      5. Interrupt-Driven I/O with the PIC24 UART
        • Interrupt-driven UART Receive
        • Interrupt-driven UART Transmit
      6. The RS-232 Standard
      7. The Serial Peripheral Interface (SPI)
      8. SPI Example: The MCP41xxx Digital Potentiometer
      9. SPI Example:PIC24 Microcontroller Master to DS1722 Thermometer
      10. SPI Example:PIC24 Microcontroller Master to PIC24 Microcontroller Slave
      11. The I2C Bus
      12. I2C on the PIC24 Microcontroller
      13. I2C Example: PIC24 Microcontroller Master to DS1631 Thermometer
      14. I2C Example: PIC24 Microcontroller Master to 24LC515 Serial EEPROM
      15. Ping-Pong Buffering for Interrupt-driven Streaming Data
      16. Review Problems
  11. Data Conversion
      1. Data Conversion Basics
      2. Analog-to-Digital Conversion
        • Counter-Ramp ADC
        • Successive Approximation ADC
        • Flash ADC
        • Sample and Hold Amplifiers
      3. 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
      4. Digital-to-Analog Conversion
        • Flash DACs
        • Resistor String Flash DACs
        • R-2R Resistor Ladder Flash DAC
      5. External Digital-to-Analog Converter Examples
        • DAC Example: The Maxim 548A
        • DAC Example: The Maxim 5353
        • DAC Example: The Maxim 518
      6. Review Problems
  12. Timers
      1. Pulse Width Measurement
        • Using a 32-bit Timer
      2. Pulse Width, Period Measurement Using Input Capture
        • The Input Capture Module
        • Pulse Width Measurement Using Input Capture
        • Period Measurement Using Input Capture
      3. Application: Using Capture Mode for an Infrared Decoder
      4. The Output Compare Module
        • Square Wave Generation
      5. Pulse Width Modulation
        • A PWM Example
      6. PWM Application: DC Motor Speed Control and Servo Control
        • DC Motor Speed Control
        • Hobby Servo Control
        • PWM Control of Multiple Servos
      7. A PWM DAC
      8. Time Keeping Using Timer1, RTCC
        • The Real-Time Clock Calendar Module
      9. Review Problems
  13. Advanced Hardware Topics
      1. Direct Memory Access (DMA)
      2. Using the PIC24 Microcontroller as an I2C Slave
      3. Bus Arbitration for the I2C Bus
      4. The Controller Area Network (CAN)
      5. The PIC24 ECAN(TM) Module
        • Using an ECAN RX FIFO
        • Using an Extended Data Frame
      6. The Universal Serial Bus (USB)
      7. Run-Time Self-Programming
        • A Sample Flash Application
      8. Comparator Module
      9. Parallel Master Port and CRC Generator
      10. Review Problems
  14. Operating Systems for Embedded Systems
      1. Operating System Concepts
        • Tasks
        • Multitasking and Schedulers
        • Semaphores and Inter-task Coordination
        • OS Services
      2. 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
      3. Design: Adding an ESOS Service for I2C
        • I2C Operations Under ESOS
        • I2C Transactions Under ESOS
        • Application Using the ESOS I2C Service
      4. Review Problems
  15. Capstone Projects
      1. Design of an Audio Record/Playback System
      2. Implementation of an Audio Record/Playback System
        • Audio Data Compression
        • Audio Application ISR and Configuration
        • An MP3 to FM Radio Playback System
      3. A Solder Reflow Oven
        • Solder Reflow Background
        • High Temperature Sensing
        • AC Power Control
        • Reflow Oven Control Implementation
      4. A Small, Autonomous Robot
      5. Other Microcontroller Families from Microchip
      6. A Brief Survey of Non-PIC Microcontrollers
      7. Suggested Survey Topics
  16. Appendix A - PIC24 Architecture and Instruction Set Summary
  17. Appendix B - Software Tools Overview
      1. MPLAB Introduction
      2. PIC24 C Compiler Introduction
      3. The PICkit(TM)2 Programmer
      4. The PIC24 Bully Bootloader
  18. Appendix C - Suggested Laboratory Exercises
      1. Lab Setup
      2. Experiment 1: A Stored Program Machine (Chapters 1, 2)
      3. Experiment 2: PIC24 Assembly and MPLAB Introduction (Chapter 3)
      4. Experiment 3: Unsigned 8/16-bit Operations in Assembly Language (Chapter 4)
      5. Experiment 4: 8/16/32-bit Signed Operations in Assembly Language (Chapter 5)
      6. Experiment 5: Pointers, Subroutines in Assembly Language (Chapter 6)
      7. Experiment 6: PIC24 System Startup (Chapter 8)
      8. Experiment 7: LED/Switch I/O (Chapter 8)
      9. Experiment 8: Interrupts and Timer Introduction (Chapter 9)
      10. Experiment 9: Interrupt-driven Asynchronous Serial I/O andan I2C Serial EEPROM (Chapter 10)
      11. Experiment 10: ADC, DAC Experiments (Chapter 11)
      12. Experiment 11: PWM for DC Motor Control (Chapter 12)
      13. Hardware Debugging Checklists
  19. Appendix D - Notes on the C Language and the Book's PIC24 Library Functions
  20. Appendix E - Circuits 001
  21. Appendix F - References
    1. Appendix G - Problem Solutions to odd numbered end-of-chapter exercises (even-numbered solutions are available by email request of instructor to the authors).