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 1 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 2 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 3 Lab 8 EGR 270 Fundamentals of Computer Engineering MicroStamp11 Features reference www technologicalArts com 4 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 5 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 6 Lab 8 EGR 270 Fundamentals of Computer Engineering MicroStamp11 Module Crystal 8MHz or 9 834 MHz looks like a silver cylinder 5V regulator Slide switches used to put the MicroStamp11 into boot mode or run mode 68HC11 microcontroller 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 7 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 8 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 9 Lab 8 EGR 270 Fundamentals of Computer Engineering Logical Value and Direction The pins on each port have two distinct states 1 Logical State A B Logical 0 or LOW 0V Logical 1 or HIGH 5V 2 Direction the pin might be used as an input or as an output A B 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 10 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 Bi directional input or output Bit 1 of DDRD 18 PD2 Bi directional input or output Bit 2 of DDRD 17 PD3 Bi directional input or output Bit 3 of DDRD 16 PD4 Bi directional input or output Bit 4 of DDRD 15 PD5 Bi directional input or output Bit 5 of DDRD 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 Example DDRD bit5 bit0 1 0 0 1 0 0 PORTD bit5 bit0 Result PD0 PD1 PD3 PD4 are inputs PD2 PD5 are outputs 11 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 Input only 8 PA2 Input only 5 PA3 Bi directional input or output Bit 3 of PACTL 4 PA4 Output only 3 PA5 Output only 2 PA6 Output only 1 PA7 Bi directional input or output Bit 7 of PACTL PORTA and PACTL Addresses see Table 4 1 PORTA address 0000 PACTL address 0026 Example PACTL bit7 bit0
View Full Document
Unlocking...