The Art of Assembly Language Programming Using PICmicro Technology - 1st Edition - ISBN: 9780128126172

The Art of Assembly Language Programming Using PICmicro Technology

1st Edition

Core Fundamentals

Authors: Theresa Schousek
Paperback ISBN: 9780128126172
Imprint: Newnes
Published Date: 1st March 2018
Page Count: 300
Tax/VAT will be calculated at check-out Price includes VAT (GST)

Institutional Access

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 PICmicro® Technology: Core Fundamentals thoroughly covers assembly language as used in programming the PIC Microcontroller (MCU.) Using the minimal instruction set characteristic of all PICmicro® products, the author elaborates on how to execute loops, control timing and disassemble code from C mnemonics. Detailed memory maps assist the reader with tricky areas of code. Math routines are carefully dissected to enhance understanding of minute code changes. Appendices are provided on basic math routines to supplement the readers’ background. In depth coverage is further provided on paging techniques, unique to the PICmicro® 16C57 series controller.

This book is written for an audience with a broad range of skill levels, relevant to both the absolute beginner and the skilled C embedded programmer. A supplemental appendix on ‘Working with a Consultant’ provides advice on working with consultants, in general, and on selecting an appropriate consultant within the microchip design consultant program. With this book you will learn: the symbols and terminology used by programmers and engineers in microprocessor applications; how to program using assembly language through examples and applications; how to program a microchip microprocessor, selecting the processor with minimal memory, and therefore minimal cost options; how to locate resources for more in-depth material content; and how to convert higher level language ICs to a lower level language.

Key Features

  • Teaches how to start writing simple code, e.g., PICmicro® 10FXXX and 12FXXX
  • Offers unique and novel approaches 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 your skill sets
  • 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:
300
Language:
English
Copyright:
© Newnes 2018
Published:
Imprint:
Newnes
Paperback ISBN:
9780128126172

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