Microcontroller Theory and Applications; HC12 and S12

Other Format
from $0.00

Author: Daniel J Pack

ISBN-10: 0136152058

ISBN-13: 9780136152057

Category: Circuits - Computer Hardware

This book provides readers with fundamental assembly language programming skills, an understanding of the functional hardware components of a microcontroller, and skills to interface a variety of external devices with microcontrollers. Chapter topics cover an introduction to the 68HC12, 68HC12 assembly language programming, advanced assembly programming, fuzzy logic, hardware configuration, exception—resets and interrupts, the 68HC12 clock module and standard timer module (TIM), the 68HC12...

Search in google:

This book provides readers with fundamental assembly language programming skills, an understanding of the functional hardware components of a microcontroller, and skills to interface a variety of external devices with microcontrollers.Chapter topics cover an introduction to the 68HC12, 68HC12 assembly language programming, advanced assembly programming, fuzzy logic, hardware configuration, exception—resets and interrupts, the 68HC12 clock module and standard timer module (TIM), the 68HC12 memory system, analog-to-digital (ATD) converter, and 68HC12 communications system—multiple serial interface.For electrical and computer engineers.

CONTENTS1 Introduction To The HC 12 Microcontrollers1.1 Brief History of Computers1.2 Computers and Embedded Controllers1.3 Applications of Embedded Controllers1.4 Overview of the HC121.4.1 Software Instruction Set1.4.2 Hardware1.5 Overview of the S121.5.1 Software Instruction Set1.5.2 Hardware1.6 Summary1.7 Further Reading2 HC12 And S12 Assembly Language Programming2.1 Programmer’s Model2.2 Freescale Assembly Language2.3 Instruction Execution Cycle2.4 Instruction Set2.4.1 Data Transfer and Manipulation Instructions2.4.2 Arithmetic Operations2.4.3 Logical and Bit Operations2.4.4 Data Test Instructions2.4.5 Optional: Fuzzy Logic Instructions2.5 Addressing Modes2.5.1 Inherent Addressing Mode2.5.2 Immediate Addressing Mode2.5.3 Direct Addressing Mode2.5.4 Extended Addressing Mode2.5.5 Index Addressing Mode2.5.6 Relative Addressing Mode2.6 Branch Instructions2.7 Directives (pseudo-op code) and a Good Programming Approach2.7.1 Directives2.7.2 A Good Programming Approach2.8 Laboratory Applications2.9 Summary2.10 Chapter Problems3 Advanced Assembly Programming3.1 Assembly Process3.2 Loops3.3 Stack3.3.1 Definition of Stack3.3.2 Use of a Stack3.3.3 Access to a Stack3.4 Subroutines3.4.1 Subroutine Calls and Returns3.4.2 Parameter-Passing Techniques3.5 68HC12 D-Bug12 Utility Subroutines3.6 Programming Modules3.6.1 Programming Techniques3.7 Applications3.8 Laboratory Applications3.9 Summary3.10 Further Reading3.11 Chapters Problems4 Fuzzy Logic 4.1 Conventional Controller versus Fuzzy Logic Controller4.2 Fuzzy Logic Controller for a Balancing Robot4.2.1 Background4.2.2 Optional: Dynamic Model for the Robot4.2.3 Fuzzy Logic Controller4.3 The 68HC12 Fuzzy Logic Operations4.3.1 Membership Function Design Process4.3.2 FuzzyRule Implementation4.3.3 68HC12 Fuzzification Process4.3.4 Unweighted Rule Evaluation (REV) and Weighted Rule Evaluation (REVW)4.3.5 68HC12 Defuzzification Process4.3.6 Other Fuzzy Logic Controller-Related Instructions4.4 Application4.5 Some Comments on Fuzzy Logic Controller Design4.6 Laboratory Application4.7 Summary4.8 Further Reading4.9 Chapter Problems5 HC12 and S12 Hardware Configuration 5.1 The Maze Following Robot5.2 The HC12 Hardware System5.3 The S12 Hardware System5.4 Modes5.4.1 Normal Operating Modes5.5 Hardware Pin Assignments5.6 HC12 Subsystems5.6.1 Register Block5.6.2 Port System5.6.3 A Few More Details on Ports5.6.4 The Timing System-The Standard Timer Module5.6.5 The Memory System5.6.6 Interrupts5.6.7 Clock Functions5.6.8 Serial Communications-The Multiple Serial Interface5.6.9 The Data Conversion-The Analog-to-Digital Converter5.7 S12 Subsystem5.7.1 S12 Register Block5.7.2 S12 Memory System5.7.3 S12 Port System5.7.4 S12 Interrupts5.8 Application-Switches, Keypads, Indicators-Oh My!5.8.1 HC12 Electrical Compatibility5.8.2 Input Switches5.8.3 Switch Bank5.8.4 Keypads5.8.5 Indicators-Light Emitting Diodes5.8.6 Indicators-Seven-Segment Displays5.8.7 Programming Switches and Indicators5.8.8 Interfacing High Power AC and DC Devices5.8.9 Optical Isolation5.8.10 H-bridge5.9 Application-Wall Following Robot5.10 Laboratory Application5.11 Summary5.12 Chapter Problems6 Exceptions-Resets and Interrupts 6.1 Overview6.2 What Is an Interrupt6.3 General Interrupt Response6.4 Reset and Exception Systems Aboard the HC126.4.1 HC12 Resets6.4.2 HC12 Interrupts6.4.3 HC12 Exception Vector6.4.4 HC12 Exception Priority6.4.5 HC12 Interrupt Systems-Associated Registers6.5 Reset and Exception Systems Aboard the S12 Microcontroller6.6 How Does HC12 Respond to an Interrupt?6.7 Writing Interrupt Service Routines6.7.1 ISRs with the 68HC812A4 EVB RAM-Set User Vector Technique6.7.2 The S12 RAM based ISR-Set User Vector Technique6.7.3 How to Program an HC12 ISR-An Example for Flash EEPROM6.7.4 Programming the HC12 Real-Time Interrupt (RTI) System6.7.5 The S12 Real-Time Interrupt (RTI)6.7.6 Another RAM Based Method of Initializing the Interrupt Vector Table6.8 A Few More Details6.9 Advanced Interrupt Topics6.10 Laboratory Application6.11 Summary6.12 Further Reading6.13 Chapter Problems7 The HC12 and S12 Clock and Timer System7.1 Overview7.2 Background Theory7.3 The HC12 Clock Module7.4 HC12 Clock Divider Chain Serving the TIM7.5 The HC12 Timer Module7.6 Components of the HC12 Timer Module7.6.1 HC12 Free-Running Counter7.6.2 HC12 Free-Running Counter-Associated Registers7.6.3 Input Capture/Output Compare Channels7.6.4 The HC12 Pulse Accumulator7.7 The HC12 Real-Time Interrupt7.8 Programming the HC12 Input Capture, Output Compare, and the Pulse AccumulatorFeatures of the TIM7.8.1 Programming the Input Capture System7.8.2 Programming the Input Capture System with an Interrupts7.8.3 Programming the Output Compare System7.8.4 Programming the Output Compare System with Interrupts7.8.5 Programming the CH12 Pulse Accumulator System7.9 The HC12 Pulse Width Modulation System (PWM) System7.9.1 Fundamentals and Features7.9.2 PWM Channel Alignment7.9.3 PWM Clock System7.9.4 PWM Registers7.9.5 Programming the PWM7.10 The S12 Clock and Timing System7.11 The S12 Clock and Reset Generator7.12 The Enhanced Capture Timer7.12.1 S12 Timer Related Registers7.12.2 Enhanced Capabilities of the ECT System7.12.3 Non-Buffered Input Capture Channels7.12.4 Buffered Input Capture Channels7.12.5 Pulse Accumulator Features7.12.6 ECT Related Registers7.13 The S12 Pulse Width Modulation System7.14 Example: An S12 Based Maze Navigating Robot7.14.1 The Robot Platform7.14.2 Motor Control7.14.3 IR Sensor7.14.4 Interface Electronics7.14.5 Power Subsystems7.14.6 S12 Evaluation Board-the Minidragon+7.14.7 Motor Control Using the S12 PWM System7.15 Applications7.16 Laboratory Applications7.17 Summary7.18 References7.19 Chapter Problems8 The HC12 and S12 Memory System8.1 Overview8.2 Background8.2.1 HC12 Memory Variants8.2.2 S12 Memory Variants8.3 Basic Memory Concepts8.3.1 Memory Capacity and Control Signals8.3.2 Memory Buses8.3.3 Memory Technologies: ROM versus RAM8.3.4 Memory Map8.3.5 The A4 Memory System8.4 Linear Memory Expansion: HC12 Case Study8.4.1 Memory Layout Design8.4.2 68HC12 and Memory Chip Control Signal Connections8.4.3 Timing Analysis of Basic Memory Operations8.4.4 Electrical Compatibility8.4.5 HC12 Memory Paging8.4.6 EEPROM Modification8.5 S12 Memory System8.5.1 The S12 Paged Memory System8.5.2 Programming Flash and Paged Memory8.6 Applications8.7 Case Study: and 671GST LCD Character Display Interface8.7.1 Hardware Interface8.7.2 Timing Interface8.7.3 Software Interface8.8 Further Reading8.9 Summary8.10 Chapter Problems9 Analog-to-Digital (ATD) Converter9.1 Overview9.2 Transducer Interface Design9.3 Analog-to-Digital Conversion Background Theory9.3.1 Sampling Rate9.3.2 Transducer Interface Design9.3.3 Quantizing and Resolution9.3.4 Data Rate9.4 Analog-to-Digital Converter Technologies9.4.1 Successive-Approximation Converters9.4.2 Integration-Based Converters9.4.3 Counter-Type Converters9.4.4 Parallel Converters9.5 The HC12 Analog-to-Digital (ATD) Conversion System9.5.1 HC12 ATD System9.5.2 HC12 ATD System Control Registers9.5.3 Programming the HC12 ATD System9.5.4 Programming the HC12 ATD System using Interrupts9.6 S12 Analog-to-Digital (ATD) Conversion System9.6.1 Selectable 8 or 10 Bit Resolution9.6.2 Lest/Right Justified and Signed/Unsigned Result Data9.6.3 External Trigger Control9.6.4 Flexible 1 to 8 Conversion Sequence Length Configuration9.6.5 Multiple ATD Channels9.6.6 S12 ATD Registers9.6.7 Programming the S12 ATD System9.7 HC12 Application9.8 Laboratory Application9.9 Summary9.10 Further Reading9.11 Chapter Problems10 Microcontroller Communication Systems10.1 Need for Serial Communication Features10.2 Fundamentals of Serial Communication10.2.1 Serial Communication Terminology10.2.2 Serial Communication Signals10.3 Multiple Serial Interface10.4 The Serial Communication Interface10.4.1 Hardware Description-The SCI Transmitter10.4.2 Hardware Description-The SCI Receiver10.4.3 SCI Registers10.4.4 SCI Transmitter and Receiver Operation10.4.5 Programming the Serial Communication Interface10.5 HC12 and S12 SPI-Serial Peripheral Interface10.5.1 SPI Concepts10.5.2 SPI General Description10.5.3 HC12 SPI Registers10.5.4 S12 SPI System10.5.5 Programming the HC12 SPI10.5.6 Programming the S12 SPI System10.5.7 SPI Applications10.6 Inter-IC Communication: The I2C Bus10.6.1 I2C Bus Configuration10.6.2 I2C Basic Protocol10.6.3 I2C Registers10.6.4 Key Activity Description10.6.5 I2C Related Interrupts10.6.6 Assembly Language Code Examples10.6.7 I2C Configured Devices10.7 Controller Area Networks10.7.1 Computer Networks10.7.2 Controller Area Network10.8 Laboratory Application10.9 Summary10.10 Further Reading10.11 Chapter ProblemsA HC12 / S12 Instruction SetB 68HC812A4 Register SetC MC9S12DP256 Register SetD Number Systems and Number ArithmeticD.1 Number RepresentationsD.2 Binary Number ArithmeticD.2.1 The 2’s Complement Number RepresentationD.2.2 ArithmeticD.3 Changing the Base of NumbersD.4 Summary and Further ReadingsE Digital Logic FundamentalsE.1 OverviewE.2 Basic Combinational LogicE.2.1 Medium-Scale Integration Combinational CircuitsE.3 Sequential Logic Circuit ComponentE.3.1 Flip-FlopsE.3.2 MSI Sequential Circuit ComponentsE.4 SummaryF Mobile Robot and Related Products For The HC12/S12F.1 Building Your Own Mobile RobotF.2 68HC12-Related Hardware and Software ProductsF.2.1 HardwareF.2.2 SoftwareINDEX