The Art of Assembly Language Programming Using PIC® Technology - 1st Edition - ISBN: 9780128126172, 9780128126189

The Art of Assembly Language Programming Using PIC® Technology

1st Edition

Core Fundamentals

0.0 star rating Write a review
Authors: Theresa Schousek
Paperback ISBN: 9780128126172
eBook ISBN: 9780128126189
Imprint: Newnes
Published Date: 25th April 2019
Page Count: 458
Sales tax will be calculated at check-out Price includes VAT/GST

Institutional Subscription

Secure Checkout

Personal information is secured with SSL technology.

Free Shipping

Free global shipping
No minimum order.

Description

The Art of Assembly Language Programming using PIC® Technology thoroughly covers assembly language as used in programming the PIC® Microcontroller (MCU). Using the minimal instruction set, characteristic of most PIC® products, the author elaborates on the nuances of how to execute loops. Fundamental design practices are presented based on Orr’s Structured Systems Development using four logical control structures. These control structures are presented in Flowcharting, Warnier-Orr® diagrams, State Diagrams, Pseudocode, and an extended example using SysML®. Basic math instructions of Add and Subtract are presented, along with a cursory presentation of advanced math routines provided as proven Microchip® utility Application Notes.

Appendices are provided for completeness, especially for the advanced reader, including several Instruction Sets, ASCII character sets, Decimal-Binary-Hexadecimal conversion tables, and elaboration of ten ‘Best Practices.’ Two datasheets (one complete datasheet on the 10F20x series and one partial datasheet on the 16F88x series) are also provided in the Appendices to serve as an important reference, enabling the new embedded programmer to develop familiarity with the format of datasheets and the skills needed to assess the product datasheet for proper selection of a microcontroller family for any specific project.

The Art of Assembly Language Programming Using PIC® Technology is written for an audience with a broad variety of skill levels, ranging from the absolute beginner completely new to embedded control to the embedded C programmer new to assembly language.

With this book, you will be guided through the following areas:

  • Symbols and terminology used by programmers and engineers in microcontroller applications
  • Programming using assembly language through examples
  • Familiarity with design and development practices
  • Basics of mathematical knowledge in hexadecimal
  • Resources for advanced mathematical functions

Approaches to locate resources

Key Features

  • Teaches how to start writing simple code, e.g., PICmicro® 10FXXX and 12FXXX
  • Offers unique and novel approaches on how to add your personal touch using PICmicro® ‘bread and butter’ enhanced mid-range 16FXXX and 18FXXX processors
  • Teaches new coding and math knowledge to help build skillsets
  • Shows how to dramatically reduce product cost by achieving 100% control
  • Demonstrates how to gain optimization over C programming, reduce code space, tighten up timing loops, reduce the size of microcontrollers required, and lower overall product cost

Readership

Electrical, Mechanical, Industrial engineers. Software Programmers trained in a higher level language, with no electrical engineering or embedded control background; Embedded/Firmware or Hardware designers, and Undergraduate Engineering students

Table of Contents

Preface

    • Purpose
    • Scope
    • Author’s Note
    • Dare we call it fun?

Chapter F1:

INTRODUCTION

    • Practical Applications
    • Why Assembly?
    • Core Families (‘Baseline,’ ‘ Midrange,’ enhanced ‘Midrange’)
    • Data Sheet Walk Through
    • Straightline Program Implementation
    • Practice Exercise – Walk Through
    • Microchip Microcontroller Course Information
    • Jargon Introduction – italics
    • Further Reading

Chapter F2:

MICROCHIP 8-BIT ARCHITECTURE

    • The Microprocessor
    • System Clock
    • Bus for Data and Program
    • Hardware Interfaces
    • Hardware Organization of Memory Address Space
    • Memory Interface
    • Program Data Storage Memory Circuits
    • Input/output Interface
    • Further Reading

Chapter F3:

INSTRUCTION SETS

    • Fields of an Instruction (See Table 2-1 in 6809)
    • Instruction Set for PICmicro® Controllers
    • General Purpose Registers
    • Special Function Registers
    • Addressing: Direct, Indirect, Indexed, and Relative
      • Compare and Status Flags
      • Calculating Relative Offsets
      • Conditional Branches

    • Code Example
    • Further Reading

Chapter F4:

BEGINNING CODE

    • 8-bit Data Transfer
    • 8-bit Addition
    • 8-bit Subtraction
    • Shift left 1 bit (Multiply by two)
    • Shift left 2 bits (Multiply by four)
    • Clear a Memory Location
    • Set a Memory Location to All Ones
    • Find Larger of Two Numbers
    • Find Smaller of Two Numbers
    • Further Reading

Chapter F5:

LOOPING CODE

    • 8-bit Sum of Data
    • 16-bit Sum of Data
    • Maximum Value
    • Minimum Value
    • Check-sum of Data
    • Number of Zero, Positive, and Negative Numbers
    • Count ‘1’ Bits
    • Further Reading

Chapter F6:

EMBEDDED CONTROL FUNDAMENTALS

    • Electrical Wiring Diagrams (how to read diagrams)
    • Breadboards (how to use standard breadboards)
    • Basic GPIO I/O
    • Specialized I/O
    • Timer Modules and Registers
    • Comparator Module
    • Paging Consideration
    • Evaluation Boards
    • Further Reading

Chapter F7:

FUNDAMENTALS of GOOD PRACTICE

Program Development

    • Structured Programming
    • Concept of Design Patterns and Interfaces
    • Pseudocode
    • Using Include files to Create Reusable Code

Program Design and Documentation

    • Programming Flow Charts
    • Warnier-Orr Diagrams

Systems Development

    • State Machine Diagrams
    • SYSML Systems Definition Language
    • Further Reading

Chapter F8:

PROGRAMMING DATA STRUCTURES

Assembly Language Concepts

    • Arrays: String Handling and Character Operations
    • Pointer Constructs
    • Procedures
    • Functions

Assembly Language Basics

    • Simple Instructions
    • Config Word
    • Flags
    • Subroutines
    • Indexing

Assembly Language Advanced

    • Interrupts
    • Jump tables
    • Stack processing
    • Using DEFINE
    • Creating MACROS
    • Further Reading

Chapter F9:

BOOLEAN LOGIC and NUMBERING SYSTEMS

Logical Operators

    • Sets and Truth Tables
    • AND
    • OR
    • Exclusive OR
    • Mask Off Most Significant 4 bits
    • Mask Off Least Significant 4 bits
    • Conditional functions (>,<,=,!=,>=,<=)
    • Complementing

Mathematical Numbering Systems

    • Binary, Hex and Decimal (with a mention of the existence of octal)
    • Multi-byte Integer Types
    • Signed Integers – cover 2s compliment extensively, but mention 1s compliment and sign-magnitude, because these still come out of some sensors and FPGAs.
    • Unsigned Integers
    • Floating Point (I doubt many people will want to use it in a PIC, but they may be given it and need to deal with it.)
    • BCD as a Type
    • Further Reading

Chapter F10:

MATHEMATICAL OPERATIONS

    • Arithmetic Operations on Bytes
    • Arithmetic Operations on Multi-byte Numbers (Using carry properly, detecting overflow, how to treat signed and unsigned differently)
    • 16-bit Data Transfer
    • 16-bit Addition
    • 16-bit Ones Complement
    • 16-bit Twos Complement

Advanced Mathematical Operations

    • Shifting and Rotating, and How to Use Instructions in a Multi-Byte Shift
    • Application Notes Review:

            • Multiplication Algorithms, Both Signed and Unsigned
            • Division Algorithms
            • Floating Point

    • Further Reading

Appendices:

A: Instruction Set Reference Tables

B: Datasheet for PICmicro 10F

C: Decimal-Hexadecimal-Binary Tables

D: ASCII Table

Details

No. of pages:
458
Language:
English
Copyright:
© Newnes 2019
Published:
25th April 2019
Imprint:
Newnes
Paperback ISBN:
9780128126172
eBook ISBN:
9780128126189

About the Author

Theresa Schousek

Theresa Schousek has been a Microchip (R) Design Partner for 20 years as President, Chief Engineer, and Owner of Vital Innovations LLC. She began her work with computers in 1983 with a Commodore (R) 64. Prior to working as an independent design consultant, she worked for nearly 10 years in the automotive industry for General Motors Delphi Delco Electronics. She thrives on innovative design and has three process and sensor patented designs, plus one international patent. She is the sole inventor of General Motor's first infant seat and occupant detection system to inhibit airbag deployment. This system, and its derivatives, have 223 citations and is currently in production, 22 years later. Theresa earned a BSCEE from Purdue University, a dual accredited degree in Electrical Engineering and Computer Engineering. She earned a Master of Business Administration, with a practicum in operational process design, from University of Wisconsin, River Falls, in 2011.

Affiliations and Expertise

Vital Innovations LLC

Ratings and Reviews