Fundamentals of Computer Engineering

Slides:



Advertisements
Similar presentations
MC68HC11 System Overview. System block diagram (A8 version)
Advertisements

EXTERNAL COMMUNICATIONS DESIGNING AN EXTERNAL 3 BYTE INTERFACE Mark Neil - Microprocessor Course 1 External Memory & I/O.
Industrial Automation and Control
1 Boe-Bot Parts BOE-BOT Lecture #1b DE - Digital Electronics.
Introduction of Holtek HT-46 series MCU
Basic Stamp II is kinda cool Bytes of EEPROM(non-volatile) - Clock speed of 20 MHz. - Holds 600 lines of code in EEPROM - executes an average of.
Railway Foundation Electronic, Electrical and Processor Engineering.
1 ECE 263 Embedded System Design Lessons 2, 3 68HC12 Hardware Overview, Subsystems, and memory System.
Railway Foundation Electronic, Electrical and Processor Engineering.
Digital Outputs 7-Segment Display
Dr. Hoganson CSIS HC11 Demo Program This is our first lab using the 68HC11 microcontroller. We will “talk” to the microcontroller from a PC, run.
Microcontroller Architecture PIC18F Family
Microcontroller: Introduction
Working with Arduino: Lesson #1: Getting Acquainted with the Kit EGN1007.
Microprocessor Block Diagram
1 © Unitec New Zealand Embedded Hardware ETEC 6416 Date: - 10 Aug,2011.
Atmega32 Architectural Overview
Dr. Hoganson CSIS Segment Display and Count by 16 This is our third lab using the 68HC11 microcontroller. We will write a program that counts by.
Objectives How Microcontroller works
Introduction to Computing: Lecture 4
CPU (CENTRAL PROCESSING UNIT): processor chip (computer’s brain) found on the motherboard.
A Simple Tour of the MSP430. Light LEDs in C LEDs can be connected in two standard ways. Active high circuit, the LED illuminates if the pin is driven.
COMPUTER SYSTEM ARCHITECTURE By Sohaib.  The digital computer is a digital system that performs various computational tasks.  The word digital implies.
Computers Are Your Future Eleventh Edition Chapter 2: Inside the System Unit Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall1.
Microcontroller Presented by Hasnain Heickal (07), Sabbir Ahmed(08) and Zakia Afroze Abedin(19)
Chapter 2 Introducing the PIC Mid-Range Family and the 16F84A The aims of this chapter are to introduce: The PIC mid-range family, in overview The overall.
George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 ME 4447/6405 Microprocessor Control of Manufacturing Systems and Introduction.
July 7, 2003 Slide 1 of 6 Automation, Robotics and Mechatronics Lab, SUNY at Buffalo Introduction To Programming Chetan Jadhav Talib Bhabharawala Seung-Kook.
Programmable Logic Controllers LO1: Understand the design and operational characteristics of a PLC system.
Computer Hardware – System Unit
THE MICROPROCESSOR A microprocessor is a single chip of silicon that performs all of the essential functions of a computer central processor unit (CPU)
George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 ME 4447/6405 Microprocessor Control of Manufacturing Systems and Introduction.
Submitted by:.  Project overview  Block diagram  Power supply  Microcontroller  MAX232 & DB9 Connector  Relay  Relay driver  Software requirements.
George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 ME 4447/6405 Microprocessor Control of Manufacturing Systems and Introduction.
ENERGY METER TO INDICATE BILLING IN RUPEES FOR LOAD WISE OR DAY WISE
Introduction to Microcontroller Technology
Arduino.
Scrolling LCD using Arduino.
ECE 3430 – Intro to Microcomputer Systems
Arduino Based Industrial appliances control system by decoding dual tone multi frequency signals on GSM / CDMA network. Submitted by:
The first change to your project files that is needed is to change the device to the correct FPGA. This is done by going to the Assignments tab on the.
The 8085 Microprocessor Architecture
Atmega32 Architectural Overview
Computer Hardware – System Unit
UTA010 : Engineering Design – II
PC Mouse operated Electrical Load Control Using VB Application
UNIT – Microcontroller.
General Purpose I/O.
DIGITAL CALCULATOR USING 8051
An Introduction to Microprocessor Architecture using intel 8085 as a classic processor
EET 2261 Unit 11 Controlling LCD and Keypad
ARDUINO     What is an Arduino? Features 14 Digital I/O pins 6 Analogue inputs 6 PWM pins USB serial 16MHz Clock speed 32KB Flash memory 2KB SRAM.
Introduction to Microprocessors and Microcontrollers
Interfacing Memory Interfacing.
Number Representations and Basic Processor Architecture
AT91RM9200 Boot strategies This training module describes the boot strategies on the AT91RM9200 including the internal Boot ROM and the U-Boot program.
EET 2261 Unit 11 Controlling LCD and Keypad
Microcontrollers and Microprocessors
Working with Arduino: Lesson #1: Getting Acquainted with the Kit
Logic Gates Practical Objective: to develop an understanding of logic circuits and truth tables.
Introducing the PIC Mid-Range Family and the 16F84A
EET 2261 Unit 8 Seven-Segment Displays
MICROPROCESSOR MEMORY ORGANIZATION
The 8085 Microprocessor Architecture
2.C Memory GCSE Computing Langley Park School for Boys.
8051 Micro Controller.
ME 4447/6405 Microprocessor Control of Manufacturing Systems and
Overview 1. Inside a PC 2. The Motherboard 3. RAM the 'brains' 4. ROM
Chapter 4: Hardware for Educators
Computer components.
Presentation transcript:

Fundamentals of Computer Engineering Lab #8 EGR 270 – Fundamentals of Computer Engineering EGR 270 Fundamentals of Computer Engineering Presentation for Lab #8 Introduction to the MicroStamp11 and 68HC11 Assembly Language Programming Instructor: Paul Gordy Office: H-115 Phone: 822-7175 Email: PGordy@tcc.edu

Lab #8 EGR 270 – Fundamentals of Computer Engineering MicroStamp11 The MicroStamp11 is a microcontroller or microprocessor. It is built by Technological Arts and is based on the Motorola 68HC11 microcontroller. Technological Arts states that the MicroStamp11 is the world’s smallest microcontroller module. The MicroStamp11 is about the size of a postage stamp!

USB-to-MCU Interface Module Lab #8 EGR 270 – Fundamentals of Computer Engineering MicroStamp11 Breadboard Setup The MicroStamp 11 is easily used on a breadboard with two modules: MicroStamp11 Module – fitted with a 20-pin connector that plugs into a breadboard USB-to-MCU Interface Module – allows for serial communication using a USB port on a computer. The USB connection can also be used to provide power (5V) to the breadboard. A few wires are required as shown below. MicroStamp11 Module USB-to-MCU Interface Module

Lab #8 EGR 270 – Fundamentals of Computer Engineering MicroStamp11 Features (reference: www.technologicalArts.com)

The MicroStamp11 used in EGR 262 is the Turbo version with 32k of ROM Lab #8 EGR 270 – Fundamentals of Computer Engineering Memory There are two types of memory: ROM (Read-Only Memory) – used to store permanent programs and data. Data stored in ROM is not erased when the MicroStamp11 is powered down, so programs that you save will still be in memory the next time you use the device. The MicroStamp11 has either 8k, 32k, or 64k of ROM, depending on the version of the MicroStamp11 purchased. RAM (Random Access Memory) – used as a scratchpad to store variables during the execution of a program. Data stored in RAM is lost when the MicroStamp11 is powered down. The MicroStamp11 has only 256 bytes of RAM. Clock and Data Transfer Rate The MicroStamp11 is a digital synchronous device, meaning that all instructions are executed in synchronization with a hardware clock. The MicroStamp11 is available with either 8MHz or 9.8304 MHz (Turbo version) clock. Data can be transferred to the MicroStamp11 via the serial cable at either 9600 baud (bytes/second) or 38400 baud (Turbo version). The MicroStamp11 used in EGR 262 is the Turbo version with 32k of ROM

Lab #8 EGR 270 – Fundamentals of Computer Engineering Power Source The 68HC11 is powered by a 5V DC source. If a voltage of greater than 5V was connected to the microcontroller, it might be destroyed. The MicroStamp11 has a voltage regulator on the board to protect it. Operational Modes (sliding switches) The MicroStamp11 has two modes of operation. The modes are selecting by using the sliding switches on the side of the MicroStamp11 module. The modes are: Boot mode – used when programs are downloaded to the MicroStamp11. Slide the two switches together to place the MicroStamp11 in boot mode. Run mode – used when programs are run by the MicroStamp11. Slide the two switches apart to place the MicroStamp11 in run mode.

Lab #8 EGR 270 – Fundamentals of Computer Engineering MicroStamp11 Module Slide switches used to put the MicroStamp11 into boot mode or run mode 68HC11 microcontroller 5V regulator Crystal - 8MHz or 9.834 MHz (looks like a silver cylinder) 20 pins connected to the breadboard via the ribbon cable Assembler and Simulator We will program the MicroStamp11 using 68HC11 assembly language. Refer to class notes for details on assembly language programming. We will assemble programs using the Mini IDE assembler. We can also simulator programs using the Wookie simulator. Refer to the handout “Example: Mini IDE Assembler and Wookie Simulator” available on the instructor’s web page.

Lab #8 EGR 270 – Fundamentals of Computer Engineering Downloader A program named MicroLoad is provided with the MicroStamp11 in order to download compiled C programs (S19 files) into the MicroStamp11.

Lab #8 EGR 270 – Fundamentals of Computer Engineering Input/Output Ports on the MicroStamp11 The majority of the pins on the MicroStamp11 (see diagram below) are used for input and output so that we can communicate with the microcontroller. The input/output pins are arranged into two ports with the names: PORTA (8 pins: PA0 through PA7 corresponding to pins 1-8) PORTD (6 pins: PD0 through PD5 corresponding to pins 15-20)

Lab #8 EGR 270 – Fundamentals of Computer Engineering Logical Value and Direction The pins on each port have two distinct states: Logical State Logical 0 or LOW (0V) Logical 1 or HIGH (5V) Direction (the pin might be used as an input or as an output) IN (0) OUT (1) If a pin is configured as an output, then it acts like a 0V or 5V source (depending on the logical state) that can be applied to external circuits or devices connected to the pin. If a pin is configured as an input, then it acts like a HIGH resistance load and the MicroStamp11 can read the logical state of the pin applied by external circuits or devices connected to the pin.

Direction controlled by Bi-directional (input or output) Lab #8 EGR 270 – Fundamentals of Computer Engineering PORTD PORTD is a bi-directional register, so each pin may be configured as an input or as an output. The direction is controlled by the direction register DDRD. Hardware Pin PORTD bit Direction Direction controlled by 20 PD0 Bi-directional (input or output) Bit 0 of DDRD 19 PD1 Bit 1 of DDRD 18 PD2 Bit 2 of DDRD 17 PD3 Bit 3 of DDRD 16 PD4 Bit 4 of DDRD 15 PD5 Bit 5 of DDRD Example: DDRD (bit5 … bit0): 1 PORTD (bit5 … bit0): Result: PD0, PD1, PD3 & PD4 are inputs. PD2 & PD5 are outputs. PORTD and DDRD Addresses (see Table 4-1): In assembly language, we can set or clear bits in DDRD and PORTD by storing values at their memory addresses. For the MicroStamp11: PORTD address: $0008 DDRD address: $0009

Direction controlled by Bi-directional (input or output) Lab #8 EGR 270 – Fundamentals of Computer Engineering PORTA PORTA has only two pins (PA3 and PA7) that are bi-directional. It also has three pins (PA0-PA2) that are always configured as inputs and three pins (PA5-PA7) that are always configured as outputs. Two bits in the hardware control register PACTL are used to control the direction of PA3 and PA7. Hardware Pin PORTA bit Direction Direction controlled by 6 PA0 Input only - - - 7 PA1 8 PA2 5 PA3 Bi-directional (input or output) Bit 3 of PACTL 4 PA4 Output only 3 PA5 2 PA6 1 PA7 Bit 7 of PACTL Example: PACTL (bit7 … bit0): - 1 PORTA (bit7 … bit0): Result: PA7: set as an input. PA4-PA6: always outputs. PA3: set as an output. PA0-PA2: always inputs. PORTA and PACTL Addresses (see Table 4-1): PORTA address: $0000 PACTL address: $0026

Table 4-1: Register and Control Bit Assignments (reference: MC68HC11D3 Table 4-1: Register and Control Bit Assignments (reference: MC68HC11D3.pdf) The table below is used to determine memory address and bit positions for various 68HC11 registers. Some key items are highlighted.

Table 4-1: Register and Control Bit Assignments (continued)

Table 4-1: Register and Control Bit Assignments (continued)

Lab #8 EGR 270 – Fundamentals of Computer Engineering Example: Set PD2 (Perhaps to turn ON an LED connected to pin 18 on the MicroStamp11). Note that the memory addresses for PORTD and DDRD from Table 4-1 are used. LDAA #$04 ;Set the direction of PD2 to output (i.e., DDRD bit 2 = 1) * ; (Note that this also configures all other PORTD pins as inputs) STAA $09 ;Store value at address for DDRD ($09) LDAA #$04 ;Set the value of PD2 to 1 (HIGH) STAA $08 ;Store value at address for PORTD ($08) MicroStamp11 1 20 2 3 4 5 6 7 8 9 10 19 18 17 16 15 14 13 12 11 PA7 PA6 PA5 PA4 PA3 PA2 PA1 PA0 PD0 PD1 PD2 PD3 PD4 PD5 + _ 5V LED lights Equivalent to

Lab #8 EGR 270 – Fundamentals of Computer Engineering Memory When working with microcontrollers and their limited memory, it is important to be aware what memory addresses are available for: 68HC11 registers Storing data Storing programs A memory map is often used to illustrate different sections of memory. Different microcontrollers have different amounts of memory. Note that some memory addresses are used to access RAM and others are used to access ROM. RAM (Random Access Memory) Used for temporary storage of program data and register contents This information is lost when power is turned off to the MicroStamp11 Most MicroStamp11’s have only 256 bytes of ROM, although the 64K Max MicroStamp11 is available with an additional 32kB of external RAM. ROM (Read-Only Memory) or EEPROM (Electrically Erasable Programmable ROM) Used to store programs (i.e., S19 files that are downloaded). This information is NOT lost when power is turned off to the MicroStamp11 The MicroStamp11 is available with 8kB, 32kB, or 64kB of EEPROM. The MicroStamp11’s to be used in lab have 32kB of EEPROM.

Lab #8 EGR 270 – Fundamentals of Computer Engineering Memory Map for the MicroStamp11 (32k Turbo) 32kB EEPROM ($8000 to $FFFF) 32kB External RAM ($0100 to $7FFF) (64k MAX version only) (unused in other versions) 192 bytes Internal RAM ($0040 to $00FF) 64 bytes Internal Register Block ($0000 to $003F) $FFFF $8000 $7FFF $0100 $00FF $0040 $003F $0000 Used to store programs (S19 files) (Ex: Begin a program with ORG $8000) Extra RAM for data storage (Not available with our MicroStamp11) Used to store data (Ex: STAA $0040 ;Save count Used for register contents (Ex: LDAA #$04 STAA $09 ; Set PD2 as an output)

Lab #8 EGR 270 – Fundamentals of Computer Engineering MicroStamp11 Sample Program #1 – Turn on an LED connected to PA6: Note that classroom examples often ignore some of the practical issues that must be covered in lab, such as knowing specific memory addresses for a given microcontroller, setting reset vectors, etc. Discuss the example below in detail.

Lab #8 EGR 270 – Fundamentals of Computer Engineering MicroStamp11 Sample Program #2 – Blink an LED connected to PA6 on and off:

Lab #8 EGR 270 – Fundamentals of Computer Engineering 7-segment displays A 7-segment display is made up of seven LED’s configured to display the decimal digits 0 through 9. There are two types of 7-segment displays: 1) common anode (all anodes at +5V) 2) common cathode (all cathodes at ground) Common cathode displays Common cathode displays require active-HIGH outputs. When the output of the decoder or MicroStamp11 is HIGH for one segment, 5V is connected to the anode. Since all cathodes are grounded, the segment lights. a b c d e f g Common - cathode 7 segment display 7-segment decoder/driver IC or MicroStamp11 anode Typical segment

Lab #8 EGR 270 – Fundamentals of Computer Engineering Common anode displays Common anode displays require active-LOW outputs. When the output of the decoder or MicroStamp11 is LOW for one segment, 0V is connected to the cathode. Since all anodes are connected to 5V, the segment lights. a b c d e f g Common - anode 7 segment display cathode Typical segment +5V 7-segment decoder/driver IC or MicroStamp11 A “bubble” is sometimes used to indicate an active-LOW output

Lab #8 EGR 270 – Fundamentals of Computer Engineering Common-anode 7-segment display Lab #8 EGR 270 – Fundamentals of Computer Engineering Truth table for common anode displays For a common anode display: (0 – segment ON, 1 – segment OFF) Fill out the binary value for each segment Determine the corresponding values for PORTD and PORTA Digit a PD0 b PD1 c PD2 d PD3 e PD4 f PD5 g PA6 PORTD (binary) PORTD (hex) PORTA (binary) PORTA (hex) 1 00000000 $00 01000000 $40 2 3 4 5 6 7 8 9

Lab #8 EGR 270 – Fundamentals of Computer Engineering The primary tasks in Lab #8 are: Program #1: Connect a current-limiting resistor and an LED to PA6. Enter, assemble, download, and run MicroStamp11 Sample Program #2 (shown earlier in this presentation) which will cause the LED connect to PA6 to blink on and off. Program #2: Connect a common-anode 7-segment display (with 7 current-limiting resistors) to the outputs PD0-PD5 and PA6 as illustrated below. Write a program to count out the digits of your SSN or EmplID in a continuous loop with about a 1 second delay between counts. See next page for more details. a b c d e f g Common-anode 7-segment display (see data sheet for pinout) MicroStamp11 32k Turbo 1 20 2 3 4 5 6 7 8 9 10 19 18 17 16 15 14 13 12 11 PD0 PA6 220  +5V PD1 PD2 PD3 PD4 PD5 (Discuss the details of Program #2 in lab)