Microcontrollers in Practice



Similar documents
8051 MICROCONTROLLER COURSE

Microtronics technologies Mobile:

Atmel Norway XMEGA Introduction

Chapter 13. PIC Family Microcontroller

2.0 Command and Data Handling Subsystem

Lab Experiment 1: The LPC 2148 Education Board

Embedded Systems on ARM Cortex-M3 (4weeks/45hrs)

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING Question Bank Subject Name: EC Microprocessor & Microcontroller Year/Sem : II/IV

Instrumentação Suportada em Computadores Pessoais Instrumentation

Serial port interface for microcontroller embedded into integrated power meter

Display Message on Notice Board using GSM

A 5 Degree Feedback Control Robotic Arm (Haptic Arm)

Serial Communications

Freescale Semiconductor, Inc. Product Brief Integrated Portable System Processor DragonBall ΤΜ

ET-BASE AVR ATmega64/128

Fondamenti su strumenti di sviluppo per microcontrollori PIC

CGI-based applications for distributed embedded systems for monitoring temperature and humidity

Operating Systems. Lecture 03. February 11, 2013

Introduction the Serial Communications Huang Sections 9.2, 10.2 SCI Block User Guide SPI Block User Guide

Tutorial for MPLAB Starter Kit for PIC18F

Virtual KNX/EIB devices in IP networks

DS1104 R&D Controller Board

Palaparthi.Jagadeesh Chand. Associate Professor in ECE Department, Nimra Institute of Science & Technology, Vijayawada, A.P.

Programming Flash Microcontrollers through the Controller Area Network (CAN) Interface

Freescale Semiconductor, I

Computer and Set of Robots

The I2C Bus. NXP Semiconductors: UM10204 I2C-bus specification and user manual HAW - Arduino 1

Ingar Fredriksen AVR Applications Manager. Tromsø August 12, 2005

Implementing MOD bus and CAN bus Protocol Conversion Interface

Implementing a Digital Answering Machine with a High-Speed 8-Bit Microcontroller

AND8336. Design Examples of On Board Dual Supply Voltage Logic Translators. Prepared by: Jim Lepkowski ON Semiconductor.

DATA LOGGER AND REMOTE MONITORING SYSTEM FOR MULTIPLE PARAMETER MEASUREMENT APPLICATIONS. G.S. Nhivekar, R.R.Mudholker

USB OTG and Embedded Host Microchip Technology Incorporated. All Rights Reserved. Slide 1

HMI EMBEDDED SYSTEM DESIGN AS A FUNCTION OF TECU

The Programming Interface

Operating Systems 4 th Class

ontroller LSI with Built-in High- Performance Graphic Functions for Automotive Applications

Wireless Microcontrollers for Environment Management, Asset Tracking and Consumer. October 2009

Building Blocks for PRU Development

Location-Aware and Safer Cards: Enhancing RFID Security and Privacy

Serial Communications

COMPUTER HARDWARE. Input- Output and Communication Memory Systems

Chapter 1 Lesson 3 Hardware Elements in the Embedded Systems Chapter-1L03: "Embedded Systems - ", Raj Kamal, Publs.: McGraw-Hill Education

Block 3 Size 0 KB 0 KB 16KB 32KB. Start Address N/A N/A F4000H F0000H. Start Address FA000H F8000H F8000H F8000H. Block 2 Size 8KB 16KB 16KB 16KB

PROJECT PRESENTATION ON CELLPHONE OPERATED ROBOTIC ASSISTANT

CPU ARM926EJ-S, 200MHz. Fast Ethernet 10/100 Mbps port. 6 digital input 2 digital open-drain alarm output

Automating witfi STEP7 in LAD and FBD

Automating with STEP7 in LAD and FBD

System Design Issues in Embedded Processing

STK User Guide

Computer-System Architecture

Using the HT46R46 I/O Ports to Implement Half-Duplex SPI Communication

INDUSTRIAL CONTROL TECHNOLOGY. A Handbook for Engineers and Researchers. Peng Zhang. Beijing Normal University, People's Republic of China

Simplifying Embedded Hardware and Software Development with Targeted Reference Designs

7a. System-on-chip design and prototyping platforms

Am186ER/Am188ER AMD Continues 16-bit Innovation

AN4646 Application note

Secure My-d TM and Mifare TM RFID reader system by using a security access module Erich Englbrecht (info@eonline.de) V0.1draft

Open Architecture Design for GPS Applications Yves Théroux, BAE Systems Canada

C8051F020 Utilization in an Embedded Digital Design Project Course. Daren R. Wilcox Southern Polytechnic State University Marietta, Georgia

Develop a Dallas 1-Wire Master Using the Z8F1680 Series of MCUs

AN736. An I 2 C TM Network Protocol for Environmental Monitoring THE I 2 C BUS SPECIFICATION INTRODUCTION

Implementing SPI Master and Slave Functionality Using the Z8 Encore! F083A

Atmel s Self-Programming Flash Microcontrollers

M68EVB908QL4 Development Board for Motorola MC68HC908QL4

Windows8 Internals, Sixth Edition, Part 1

Design of a High Speed Communications Link Using Field Programmable Gate Arrays

Hello, and welcome to this presentation of the STM32L4 reset and clock controller.

Vehicle Tracking and Monitoring By ARM7

AVR1309: Using the XMEGA SPI. 8-bit Microcontrollers. Application Note. Features. 1 Introduction SCK MOSI MISO SS

Raspberry Pi. Hans- Petter Halvorsen, M.Sc.

Using Xbee in Serial Communication

The modular concept of the MPA-3 system is designed to enable easy accommodation to a huge variety of experimental requirements.

International Journal of Research in Advent Technology Available Online at:

All Programmable Logic. Hans-Joachim Gelke Institute of Embedded Systems. Zürcher Fachhochschule

DEVELOPMENT OF PC BASED HOME ENERGY MANAGEMENT SYSTEM MUHAMAD KHAIRI BIN CHE YUSOFF UNIVERSITI MALAYSIA PAHANG

Von der Hardware zur Software in FPGAs mit Embedded Prozessoren. Alexander Hahn Senior Field Application Engineer Lattice Semiconductor

INFORMATICA INDUSTRIALE

COMPUTER BASED REMOTE CONTROL FOR LAYOUT OF SCALED MODEL TRAINS

Performance Evaluation of Software Architectures

JTAG ICE.... User Guide

Bluetooth Audio Data Transfer between Bluetooth chipset (PMB6752&PMB6625) and TriCore Host TC1920

Data Transfer between Two USB Flash SCSI Disks using a Touch Screen

Lecture N -1- PHYS Microcontrollers

Concept Engineering Adds JavaScript-based Web Capabilities to Nlview at DAC 2016

STEPPER MOTOR SPEED AND POSITION CONTROL

AC/DC Power Supply Reference Design. Advanced SMPS Applications using the dspic DSC SMPS Family

Microcontroller Based Low Cost Portable PC Mouse and Keyboard Tester

Self-Evaluation Configuration for Remote Data Logging Systems

SKP16C62P Tutorial 1 Software Development Process using HEW. Renesas Technology America Inc.

Microcontroller Basics A microcontroller is a small, low-cost computer-on-a-chip which usually includes:

C Programming. for Embedded Microcontrollers. Warwick A. Smith. Postbus 11. Elektor International Media BV. 6114ZG Susteren The Netherlands

A Master-Slave DSP Board for Digital Control

AN141 SMBUS COMMUNICATION FOR SMALL FORM FACTOR DEVICE FAMILIES. 1. Introduction. 2. Overview of the SMBus Specification. 2.1.

Microcontrollers A Brief History of Microprocessors

I2C PRESSURE MONITORING THROUGH USB PROTOCOL.

Building A RISC Microcontroller in an FPGA

Computer Organization and Components

Definitions and Documents

Microprocessor or Microcontroller?

Transcription:

M. Mitescu I. Susnea Microcontrollers in Practice With 117 Figures, 34 Tables and CD-Rom 4y Springer

Contents Resources of Microcontrollers, 1 1.1 In this Chapter 1 1.2 Microcontroller Architectures 1 1.3 The Memory Map 3 1.4 CPU Registers 5 1.4.1 The CPU Registers of HC11 5 1.4.2 The CPU Registers of AVR 6 1.4.3 The CPU Registers of 8051 7 1.5 The Peripheral Interfaces 8 1.6 The Interrupt System 9 1.6.1 General Description of the Interrupt System 9 1.6.2 Distinctive Features of the Interrupt System of HC 11 11 1.6.3 Distinctive Features of the Interrupt System of AVR 12 1.6.4 Distinctive Features of the Interrupt System of 8051 12 1.7 Expanding the Resaurces of Microcontrollers 12 1.7.1 HC11 Operating with External Bus 13 1.7.2 AT90S8515 Operating with External Bus 14 1.7.3 8051 Operating with External Bus 14 1.8 Exercises 15 Using the Digital I/O Lines 19 2.1 In this Chapter 19 2.2 Overview of the Parallel I/O System 19 2.3 Electrical Characteristics of the I/O Lines 21 2.4 Controlling the I/O Lines by Software 23 2.5 Exercises 24 Using the Asynchronous Serial Interface 27 3.1 In this Chapter 27 3.2 Synchronous vs. Asynchronous Communication 27

XII Contents 3.3 Error Detection in Asynchronous Communication 29 3.4 The General Structure of the Asynchronous Serial Communication Interface 30 3.5 The Serial Communication Interface of 68HC11F1 30 3.6 The Asynchronous Serial Communication Interface of AVR Microcontrollers 35 3.7 The Asynchronous Serial Interface of 8051 36 3.8 Programming the Asynchronous Serial Interface 37 3.8.1 Programming the SCI of HC 11 38 3.8.2 Programming the UART of AT90S8535 40 3.8.3 Programming the UART of 8051 41 3.9 Hardware Interfaces for Serial Communication 42 3.9.1 The RS232 Interface 42 3.9.2 Differential Communication. The Interfaces RS422 and RS485 43 3.9.3 The Current Loop Interface 44 3.10 Basic Principles of Networking with Microcontrollers, Using the Asynchronous Serial Interface 45 3.11 Exercises 46 4 Using the Synchronous Serial Interface SPI 49 4.1 In this Chapter 49 4.2 General Description of the SPI 49 4.3 The SPI of HC11 Microcontrollers 50 4.4 The SPI of the AVR Microcontrollers 53 4.5 Examples of Using The SPI 55 4.5.1 Using the SPI To Connect Two Microcontrollers 55 4.5.2 Expanding the I/O Space Using the SPI 56 4.6 Exercises 59 5 Using The I2C Bus 61 5.1 In this Chapter 61 5.2 The Principles of Implementation of the I2C Bus 61 5.2.1 The Start Transfer Condition 62 5.2.2 The Data Transfer on the I2C BuS 62 5.2.3 The ACK Bit 62 5.2.4 The STOP Condition 63 5.3 A Software Implementation of the I2C Protocol 63 5.4 Accessing 24C256 Memory Devices 64 5.5 Exercises 66 6 Using the MCU Timers 67 6.1 In this Chapter 67 6.2 The General Structure and Functions of the Timer System 67

Contents XIII 6.3 Distinctive Features of the General-Purpose Timer of HC11 69 6.3.1 The Control and Status Registers of the HC11 Timer 69 6.3.2 Exercises Regarding the Use of the General-Purpose Timer of HC11 73 6.4 Distinctive Feature of the Timer of the AVR Microcontrollers 75 6.4.1 The 8-Bit Timer/Counter TimerO 76 6.4.2 The 16-Bit Timer/Counter Timerl 76 6.4.3 Synopsis of the Timer I/O Registers of AT90S8115 78 6.4.4 Summary of the Unique Features of the AVR Timer 79 6.4.5 Exercises Regarding the Use of AVR Timers 79 6.5 Distinctive Features of the Timer System of the 8051 Microcontrollers 81 6.5.1 The Control and Status Registers of the Timer 82 6.5.2 Description of the Timer Operating Mode 0.' 83 6.5.3 Description of the Timer Operating Mode 1 83 6.5.4 Description of the Timer Operating Mode 2 84 6.5.5 Description of the Timer Operating Mode 3 84 6.5.6 Using Timerl as a Baud Rate Generator 85 6.5.7 Exercises for Programming the 8051 Timer 85 6.6 PWM Timers. Principles of Operation 87 6.7 Watchdog Timers 89 6.7.1 The Watchdog of HC11 89 6.7.2 The Watchdog of AT90S8515 90 Interfacing to Analog Signals 93 7.1 In This Chapter 93 7.2 The Analog Comparator.' 93 7.3 The General Structure of the A/D Converter Subsystem 95 7.4 The A/D Converter of the HC11 Family of Microcontrollers 96 7.5 Exercises on Programming the A/D Converter of HC11 98 7.6 The A/D Converter of the AVR Microcontrollers 100 7.7 Exercises on Programming the A/D Converter AT90S8535 101 7.8 Digital-to-Analog Converters 102 7.8.1 The Principles of the D/A Conversion 102 7.8.2 Exercise on Using MX7224 104 Using the Internal EEPROM Memory 107 8.1 In this Chapter 107 8.2 Overwiew of the EEPROM Subsystem 107 8.3 The EEPROM Memory and the CONFIG Register of HC11 107 8.3.1 The Registers Controlling the EEPROM of HC11 108 8.3.2 Software Routines to Erase and Write the EEPROM 109 8.3.3 The CONFIG Register 110 8.4 The EEPROM Memory of the AVR Microcontrollers Ill 8.4.1 The Registers of the Interface with the EEPROM Memory..111 8.4.2 Software Routines to Read and Write EEPROM 112

XIV Contents 9 HC11 Development Board 115 9.1 In this Chapter 115 9.2 Description of the Hardware Module 115 9.3 Assembling and Testing the Module 117 9.4 Description of the Software Components 119 9.5 Exercises 129 10 AVR Development Board 131 10.1 In this Chapter 131 10.2 The Hardware 131 10.3 Testing the Circuit 134 10.4 The Software,134 10.5 Exercises 144 11 8051 Development Board 145 11.1 In this Chapter.. 145 11.2 Hardware 145 11.3 The Software 148 11.3.1 Installing the Cross-Assembler 148 11.3.2 Writing and Testing Simple 8051 Programs 149 11.3.3 Loading and Executing Programs in the External Ram Memory 152 11.4 Exercises 154 12 Digital Voltmeter with RS232 Interface 157 12.1 In this Chapter 157 12.2 The Hardware 157 12.3 The Software 157 12.4 Exercises 162 13 Simple RS485 Network with Microcontrollers 163 13.1 In this Chapter 163 13.2 The Hardware 163 13.2.1 The RS232-to-RS485 Converter 164 13.2.2 The Digital Input Module 165 13.2.3 The Analog Input Module 166 13.2.4 Using the AVR Development Board to Emulate Thel SLD and SLA Modules 166 13.3 The Software, 167 13.3.1 Description of the Communication Protocol 167 13.3.2 The Software for the SLD Module 169 13.3.3 The Software for the MASTER Device 171 13.4 Exercises 172

Contents XV 14 PI Temperature Controller 173 14.1 In this Chapter 173 14.2 Basic Concepts 173 14.3 Hardware Implementation of a Microcontroller-Based Temperature Controller 177 14.4 Software Implementation of a PI Temperature Controller 179 15 Fuzzy Logic Temperature Controller 185 15.1 In this Chapter 185 15.2 The Principles of Fuzzy Control 185 15.3 A Microcontroller Implementation of a Fuzzy Controller 189 16 Remote Relay Controller over Telephone Lines 193 16.1 In this Chapter 193 16.2 Description of the Hardware Solution 193 16.3 Description of the Software '197 A.I Glossary of Terms 203 Appendix 202 A.2 Description of the Registers of 68HC11F1 213 A.3 HC11 Instruction Set 215 A.4 An Example of Expanded Structure with HC11 219 A.5 Using HC11 in Bootstrap Mode 221 A.6 The Registers of AT90S8535 224 A.7 AVR Instruction Set 225 A.8 AT90S8515 Operating with External RAM 228 A.9 In-system Programming the AVR AT90S8535 229 A.10 The Special Function Registers of 8051 232 A.I 1 8051 Instruction Set 233 A. 12 An Example of 8051 Operating with External Bus 237 A.13 Programming the Internal Memory of 8051 238 A.14 SPI Seven-Segment Display Units 240 A. 15 Description of the Software Utility ASMEDIT 243 B.I Contents of the Accompanying CD 245 B.2 Recommended Readings and Web References 247 Index 249