CS-424/580A Microcontrollers and Robotics



Similar documents
Chapter 13. PIC Family Microcontroller

Computers. Hardware. The Central Processing Unit (CPU) CMPT 125: Lecture 1: Understanding the Computer

ADVANCED PROCESSOR ARCHITECTURES AND MEMORY ORGANISATION Lesson-17: Memory organisation, and types of memory

Microprocessor or Microcontroller?

Chapter 2 Logic Gates and Introduction to Computer Architecture

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

CHAPTER 4 MARIE: An Introduction to a Simple Computer

EMBEDDED SYSTEM BASICS AND APPLICATION

Logical Operations. Control Unit. Contents. Arithmetic Operations. Objectives. The Central Processing Unit: Arithmetic / Logic Unit.

8051 MICROCONTROLLER COURSE

Fondamenti su strumenti di sviluppo per microcontrollori PIC

AUTOMATIC NIGHT LAMP WITH MORNING ALARM USING MICROPROCESSOR

An Introduction to MPLAB Integrated Development Environment

Tutorial for MPLAB Starter Kit for PIC18F

2.0 Command and Data Handling Subsystem

Microtronics technologies Mobile:

Management Challenge. Managing Hardware Assets. Central Processing Unit. What is a Computer System?

Chapter 6. Inside the System Unit. What You Will Learn... Computers Are Your Future. What You Will Learn... Describing Hardware Performance

MICROPROCESSOR AND MICROCOMPUTER BASICS

Memory Basics. SRAM/DRAM Basics

Microcontrollers A Brief History of Microprocessors

COMPUTER HARDWARE. Input- Output and Communication Memory Systems

A+ Guide to Managing and Maintaining Your PC, 7e. Chapter 1 Introducing Hardware

Microprocessor and Microcontroller Architecture

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

Computer Performance. Topic 3. Contents. Prerequisite knowledge Before studying this topic you should be able to:

Computer System: User s View. Computer System Components: High Level View. Input. Output. Computer. Computer System: Motherboard Level

Handout 17. by Dr Sheikh Sharif Iqbal. Memory Unit and Read Only Memories

Microcontrollers in Practice

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

CHAPTER 2: HARDWARE BASICS: INSIDE THE BOX

The Central Processing Unit:

CHAPTER 6: Computer System Organisation 1. The Computer System's Primary Functions

Central Processing Unit (CPU)

Module 2. Embedded Processors and Memory. Version 2 EE IIT, Kharagpur 1

Lab Experiment 1: The LPC 2148 Education Board

CSE2102 Digital Design II - Topics CSE Digital Design II

Software engineering for real-time systems

RAM & ROM Based Digital Design. ECE 152A Winter 2012

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

DsPIC HOW-TO GUIDE Creating & Debugging a Project in MPLAB

MX PIC24F Educational Module User Manual

Computer Automation Techniques. Arthur Carroll

Chapter 2 Features of Embedded System

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

Lecture N -1- PHYS Microcontrollers

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

Byte code Interpreter for 8051 Microcontroller

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

Hardware: Input, Processing, and Output Devices. A PC in Every Home. Assembling a Computer System

Memory. The memory types currently in common usage are:

Discovering Computers Living in a Digital World

Chapter 4 System Unit Components. Discovering Computers Your Interactive Guide to the Digital World

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

Processor Architectures

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

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

Microcontrollers Figure 26-1 Objectives Key Words and Terms 26.1 OVERVIEW OF THE MICROCONTROLLER microcontroller

ADVANCED PROCESSOR ARCHITECTURES AND MEMORY ORGANISATION Lesson-12: ARM

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

Embedded Software Development: Spottbillige Hardware + OSS = Zum Spielen zu Schade!

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

Am186ER/Am188ER AMD Continues 16-bit Innovation

Computer and Set of Robots

ELEC 5260/6260/6266 Embedded Computing Systems

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

A N. O N Output/Input-output connection

THE TRANSITION FROM THE 8085 TO THE MODERN WORLD

Multiple Choice Questions(Computer)

8-Bit Flash Microcontroller for Smart Cards. AT89SCXXXXA Summary. Features. Description. Complete datasheet available under NDA

Keywords ATM Terminal, Finger Print Recognition, Biometric Verification, PIN

S7 for Windows S7-300/400

Freescale Semiconductor, I

CHAPTER 7: The CPU and Memory

Atmel Norway XMEGA Introduction

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

The Motherboard Chapter #5

Digital Signal Controller (DSC) Development Tools

Chapter 3: Computer Hardware Components: CPU, Memory, and I/O

Building Blocks for PRU Development

Computer Organization and Components

Digitale Signalverarbeitung mit FPGA (DSF) Soft Core Prozessor NIOS II Stand Mai Jens Onno Krah

Introduction to Microcontrollers

A 5 Degree Feedback Control Robotic Arm (Haptic Arm)

EMBEDDED C USING CODEWARRIOR Getting Started Manual

Soft processors for microcontroller programming education

Spacecraft Computer Systems. Colonel John E. Keesee

Chapter 1 Computer System Overview

Advanced Computer Architecture-CS501. Computer Systems Design and Architecture 2.1, 2.2, 3.2

Machine Architecture and Number Systems. Major Computer Components. Schematic Diagram of a Computer. The CPU. The Bus. Main Memory.

OVERVIEW OF MICROPROCESSORS

ELE 356 Computer Engineering II. Section 1 Foundations Class 6 Architecture

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

Display Message on Notice Board using GSM

Computer Systems Design and Architecture by V. Heuring and H. Jordan

Chapter 2 Basic Structure of Computers. Jin-Fu Li Department of Electrical Engineering National Central University Jungli, Taiwan

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

Microprocessor & Assembly Language

Chapter 12. Development Tools for Microcontroller Applications

Transcription:

CS-424/580A Microcontrollers and Robotics CS-424/580A Microcontrollers & Robotics Professor Richard R. Eckert EB-N6, 777-4365 Office hours: W 10-11:30 A.M., R 1-2:30 P.M. Email: reckert@binghamton.edu Web Page: www.cs.binghamton.edu/~reckert/ Link to CS-424/580A Class listserv CS424-L@listserv.binghamton.edu To be activated soon CA: Ryan Zielinski Email: rzielin1@binghamton.edu Office hours: TBA

Course Content Microcontrollers Architectures, instruction sets, and programming Microchip Technology s PIC microcontrollers PIC18F452 Control of alphanumeric LCD displays Digital and analog I/O ports External memory interface A/D, D/A conversion, sensors Motor control, PWM Timers Interrupts Serial I/O USARTs Robotics LEGO Mindstorms RCX Programming the RCX with NQC Motor/sensor control, Sound, Multitasking, Timers, IR communication, Data logging Behavior architectures Robot navigation Robot vision control Programming with Lejos Java Open-Robot Telerobotics Interfacing with Microsoft.NET Modifying firmware with PIC C Compiler and ICD Robot communications Robot competition

Lab Most important part of course Every Friday, 1:10-4:10 P.M., LNG-210 We will meet this Friday Students work in teams of three One report per team for lab experiments 1 st half of course: Microcontroller experiments QuikFlash & QuikProto boards PIC 18F452 microcontroller 2 nd half, robot experiments LEGO Mindstorms RCX Open-Robot The Microcontroller Common component in modern electronic systems Computer on a single chip Microprocessor-based device (the core ) Completely self contained with memory and I/O on chip Primary role: Provide inexpensive, programmable logic control and interfacing to external devices Monitor external input, receive input from sensors Regulate and turn devices on or off Very commonly used in robots Usually embedded in the systems they control

Use of Microcontrollers Greatly outnumber conventional CPUs used in PCs Used in a wide variety of electronic systems: Automobile systems PC keyboards and printers Electronic measurement instruments Mobile phones TV, radio, CD/DVD players, tape recording equipment Hearing aids Security alarm systems Microwave ovens Remote controllers Food dispensers Many, many more Microprocessor Programmable device that integrates many useful functions into a single IC package The CPU of a computer on a chip Some functions: Execute a stored set of instructions to carry out user-defined tasks Access external memory and I/O chips to read/write data from/to memory and I/O devices

Organization of a Microprocessorbased Microcomputer System Microprocessor-based Computer System Details

Input/Output Digital I/O Ports Serial vs. Parallel Asynchronous vs. Synchronous Programmable Parallel Ports (e.g., Intel 8255 PPI) Direction, handshaking conventions, etc. Serial Interface (e.g., Intel 8251 USART) Analog I/O A/D, D/A Converters (e.g., 804, 1408) Timers (e.g., Intel 8254 PIT) Programmed vs. Interrupt-driven I/O Interrupt Controllers (e.g. Intel 8259 PIC) Memory In order of increasing writeability and volatility ROM PROM EPROM EEPROM Flash (non-volatile read/write memory) Static RAM Dynamic RAM

Basic Microcontroller Integrates most of the components of a microcomputer system onto a single chip Just need to add power and clocking Following components usually included: CPU Core I/O Memory PROM, EPROM, or Flash for programs and nonvolatile data RAM for volatile data

More Complete Microcontroller CPU, I/O, Memory Timer module perform tasks for specified time periods, output pulses of determined length, measure time intervals Digital I/O Serial I/O (USART) Analog I/O (D/A, A/D) e.g. to receive data from sensors and control motors and other analog devices Interrupt controller External memory interfaces to expand on-chip memory Built- in monitor/debugger program Support for external peripherals e.g., I/O and bus extenders Often other support devices often used with them In-circuit debuggers and emulators

Differences between Microprocessors and Microcontrollers Design: mc: Designed to control I/O devices mp: Designed to process large amounts of data fast in large computer systems Instruction Sets: mp: processing intensive Powerful, complex instructions w/ many addressing modes Large instruction size mc: Instructions to control I/O Small instruction sets, set/clear bits, Boolean operations Compact instructions Control program must fit in small on-chip PROM Hardware and Instruction Set Support: mc: Built-in I/O operations, event timing, interrupt priority schemes mp: Requires external support (programmable controller chips) for these activities Bus Widths: mp: Very wide Large memory address spaces wide Address Bus e.g., 4 Gigabyte memory 32 bit wide Address Bus Lots of data transferred very fast wide Data Bus (32, 64, 128 bits common) mc: Relatively narrow Memory size: kilobytes 8/16 bit Address Bus Data Bus typically 4, 8, 16 bits wide

Clock Rates mp: Very fast for fast processing of large amounts of data Typically > 1 GigaHertz mc: Relatively slow to control slow I/O devices Typically 10 KHz -10 MHz Cost mp: High Typically > $100.00 mc: Low 4 Bit: < $1.00 8 Bit: $1.00 to $10.00 16 Bit: $10.00 to $20.00 Even less in bulk quantities Microcontroller Software Programming Usually in core CPU s native assembly language Sometimes HLL support available (C, Basic) Assemblers/Linkers often provided by mfg. C Compilers: Sometimes free tend to be buggy Better ones are expensive Programming environments Often very unfriendly (not Microchip s MPLAB) Powerful IDE for assembly lang. pgm. development MPLAB SIM simulator for debugging

Microcontroller Pgm. Downloading Program Development usually done on a PC SW tools must produce a file that can be downloaded to the mc s PROM or Flash memory Several standard formats Intel Hex format most common EEPROM burner often needed Expensive quartz glass window UV EPROM eraser required If mc has Flash memory, it s much easier Can be reprogrammed with resident monitor program Often on-chip USART to communicate w/ the PC In-circuit debuggers and emulators can be used Monitor Program On-chip program that communicates with PC software Typically uses a serial port to talk to PC terminal emulation program Capabilities vary Used to download programs, but often includes a debugger Examine/change registers, memory Single step, set break points We ll be using the TeraTerm Pro Terminal program on a PC to communicate with the QuikBug monitor burned into the PIC18F452 mc on our QuikFlash microcontroller boards

Microcontroller Architectures Princeton (Von Neumann) Architecture All memory space on same bus Instructions and data treated in same way Possible bottleneck between instruction fetches and data fetches Simple processor design Only one memory interface More reliable since fewer things can fail RAM used for both data ans instructions greater flexibility in SW/OS design Intel 80x86 (Pentium) mp, Motorola 68HC11 mc are examples Princeton Architecture

Harvard Architecture Code and data memory storage areas are on different busses Potentially more efficient Instructions execute in fewer cycles Instructions and data can be fetched simultaneously Greater instruction parallelism More complex processor design Example: Microchip s PIC microcontrollers Harvard Architecture

CISC CISC vs. RISC Complex Instruction Set Computer RISC Reduced Instruction Set Computer

CISC Many instructions in the instruction set Can be very powerful and serve very special purposes Many addressing modes Can do complex operations with one instruction But many are used very infrequently Many are very long (many bytes) and require many clock cycles Example: Intel 80X86 Control Unit (Instruction Decoder) must be very complex, occupying much of chip area Less space for registers More access to memory required Slower RISC Few instructions in the instruction set Simple instructions Short and fast Often instructions are orthogonal All access registers in same way Few addressing modes Example: PIC and many other microcontrollers Some mps and mcs offer both CISC and RISC features Simpler (smaller) control unit More space for more registers Less access to memory Faster

Internal Organization of a Computer s Control Unit Hardwired Control signals required to execute instructions generated by logic gates in a control matrix Faster, but less flexible Microprogrammed A processor within the processor causes control words to be fetched from a control ROM Bits are control signals Greater flexibility in instruction set design Easier to design (SW vs. HW) But slower Computer with Hardwired Control Unit

A Hardwired Computer Control Unit Microprogrammed Computer Control Unit

Intel 8051 Some Examples of Microcontrollers Microchip s PICmicro We ll use the PIC18F452 in first half of course Motorola 68HC11 Hitachi H8 Microcontroller in the LEGO MindStorms RIS RCX used in the second half of the course Intel 8051 Family Introduced in late 1970s At the heart of biggest variety of micros on earth CISC with Harvard Architecture Some Pros: Powerful bit manipulation instructions Part of RAM & many registers bit-addressable Multiply/divide instructions At least two 16-bit timers UART capable of 500 kb/s at 16 MHz Lots of internal RAM Straightforward code addressing always starts at 0 Bidirectional I/O easy Excellent free assembler and C compiler available

Intel 8051 Some Cons: Quirky instruction set Confusing variety of internal/external memory spaces I/O design prevents true floating inputs Not very fast due to clock division Access to external data very weak Single pointer register only Watchdog timer and Brownout Reset not standard Microchip s PICmicros Modern PIC18F452 is the mc on the QuikFlash board used in first half of the course RISC with Harvard Architecture Some Pros: Simple instruction set Robust hardare Lots of devices incorporated on chip Excellent support Microchip s MPLAB free development environment Wide range of sizes and peripheral choices Many language and tool choices

Some Cons: PICmicros 4 times slower at any given clock speed Relatively weak instruction set Limited code and data addressing Complex banked addressing Accumulator-based data processing Single working accumulator Motorola 68HC11 Some Pros: Competitive with Intel 8051 Princeton architecture is easy to understand Powerful, easy-to-use instruction set Popular parts are available and cheap Good support for C compilers Good support from Motorola Some Cons: Weak timers Old technology Evaluation board (EVB) expensive and unreliable Not price-competitive Slow

Hitachi H8 Used in LEGO MindStorms RCX Similar in architecture to the 68HC11 Some Pros: Flash memory Powerful instruction set HLL suport: C, Java, Forth, other language compilers free Wide range of 8 and 16 bit devices Nice evaluation/programming boards available Abundant timers Some Cons: Fairly expensive