The 9S12 in Expanded Mode - How to get into expanded mode Huang Chapter 14

Similar documents
EE 308 Spring 2011 The MC9S12 in Expanded Mode How to get into expanded mode

The 9S12 in Expanded Mode - How to get into expanded mode Huang Chapter 14

The 9S12 in Expanded Mode - Using MSI logic to build ports Huang Chapter 14

The MC9S12 in Expanded Mode Using MSI logic to build ports Using MSI logic to build an output port Using MSI logic to build an input port

Using MSI Logic To Build An Output Port

A Simple Parallel Input Port

The MC9S12 address, data and control buses The MC9S12 single-chip mode memory map Simplified write/read cycle. Address, Data and Control Buses

Using the MC9S12 in Expanded Mode External Ports S12CPUV2 Reference Manual Multiplexed External Bus Interface (MEBI) Module V3 Block User Guide

MC9S12 has 16 bit address and 16 bit data buses. Not enough pins on MC9S12 to allocate 35 pins for buses and pins for all other functions

PRINCETON (VON NEUMAN) ARCHITECTURE MICROPROCESSOR

EE 308 Spring Lecture 28 March 30, 2012 Review for Exam 2. Introduction to the MC9S12 Expanded Mode

EE 308 Spring Lab on IIC Bus

MC68HC12 Parallel I/O

Review for Exam III. Analog/Digital Converters. The MC9S12 has two 10-bit successive approximation A/D converters - can be used in 8-bit mode

The 9S12 in Expanded Mode - External Ports Huang Chapter 14

HCS12. Microcontrollers. Multiplexed External Bus Interface (MEBI) Module V3. Block User Guide

Interfacing HCS12 Microcontrollers to the MFR4310 FlexRay Controller David Paterson MCD Applications, East Kilbride

EE4390 Microprocessors. Lessons 2, 3 68HC12 Hardware Overview, Subsystems, and memory System

Input and Output Ports. How do you get data into a computer from the outside?

Review for Exam 3. Write 0x05 to ATD0CTL4 to set at fastest conversion speed and 10-bit conversions

Introduction. ECE/CS 5780/6780: Embedded System Design. Memory-Mapped I/O. Isolated I/O. Expanded Mode. Multiplexed Address and Data Lines

Introduction: - Page 1 -

Microcontroller Systems. ELET 3232 Topic 11: General Memory Interfacing

HC12 Built-In Hardware

UNIVERSITY OF HONG KONG DEPARTMENT OF ELECTRICAL AND ELECTRONIC ENGINEERING

Developing HC11 systems for RAM memory areas:

3. The MC6802 MICROPROCESSOR

General Purpose Programmable Peripheral Devices. Assistant Professor, EC Dept., Sankalchand Patel College of Engg.,Visnagar

Roberto Muscedere Images and Text Portions 2003 Prentice Hall 1

Lab 25 Solid-State Disk

Chapter 2 68HC11 Based Temperature Monitoring Board

Introduction to the MC9S12 Hardware Subsystems

Examples of HCS12 External Bus Design A Companion Note to AN2287/D

Interfacing HCS12 Microcontrollers to the MFR4200 FlexRay Controller

1. Internal Architecture of 8085 Microprocessor

8255 Programmable Peripheral Interface Architecture MCT/UNIT III/NARASIMHARAJ/LECTURE NOTES /IV MECH A

Architecture of 8085 microprocessor

UNIVERSITY OF HONG KONG DEPARTMENT OF ELECTRICAL AND ELECTRONIC ENGINEERING. Principles of Computer Operation

Basic I/O Interface

VMEbus Vertical Interconnect Alan Jones

8 MEMORY INTERFACE. Overview. Program Memory and Data Memory. Figure 8-0. Table 8-0. Listing 8-0.

Lecture 15 February 20, 2012 Introduction to the MC9S12 Timer Subsystem What Happens when you Reset the MC9S12. Introduction to Interrupts

CHAPTER 5 : Introduction to Intel 8085 Microprocessor Hardware BENG 2223 MICROPROCESSOR TECHNOLOGY

EE 308 Spring A software delay

Chapter Operation Pinout Operation 35

8/26/2010. Introduction to 8085 BLOCK DIAGRAM OF INTEL Introduction to Introduction to Three Units of 8085

EE 308 Spring A software delay. To enter a software delay, put in a nested loop, just like in assembly.

MICROPROCESSOR MICROPROCESSOR. From the above description, we can draw the following block diagram to represent a microprocessor based system: Output

MICROPROCESSOR AND MICROCONTROLLER BASED SYSTEMS

12-Dec-11. Gursharan Singh Maninder Kaur. Introduction to 8085 BLOCK DIAGRAM OF INTEL Introduction to Introduction to 8085

Chapter 8 Summary: The 8086 Microprocessor and its Memory and Input/Output Interface

EE 308 Spring Hello, World!

Memory Controller. Speaker: Tzu-Wei Tseng. Adopted from National Taiwan University SoC Design Laboratory. SOC Consortium Course Material

Z Z-280 MT8930, MT8992/3/4/5 MT8880 MT8888 MT8889 MT8980/1 MT8985, MT8986 (DIP-40) MT8986 (PLCC-44) MT8920B MT8952B

EE251: Thursday November 15

Lab 2 Part 3 Assembly Language Programming and 9S12 Ports

Allmost all systems contain two main types of memory :

Introduction read-only memory random access memory

University of Florida EEL 4744 Spring 2012 Dr. Eric M. Schwartz Department of Electrical & Computer Engineering 22 February Jun-12 4:55 PM

Concept of Memory. The memory of computer is broadly categories into two categories:

Control Unit: The control unit provides the necessary timing and control Microprocessor resembles a CPU exactly.

2. List the five interrupt pins available in INTR, TRAP, RST 7.5, RST 6.5, RST 5.5.

Pin Description, Status & Control Signals of 8085 Microprocessor

Problem Set 10 Solutions

1 MALP ( ) Unit-1. (1) Draw and explain the internal architecture of 8085.

EET2411 DIGITAL ELECTRONICS. A device or electrical circuit used to store a single bit (0 or 1) Ex. FF.

TPMC815 ARCNET PMC. User Manual. The Embedded I/O Company. Version 2.0. Issue 1.2 November 2002 D

Chapter TEN. Memory and Memory Interfacing

Understanding the basic building blocks of a microcontroller device in general. Knows the terminologies like embedded and external memory devices,

PIN DIAGRAM. Richa Upadhyay Prabhu. NMIMS s MPSTME January 19, 2016

Chapter 1: Basics of Microprocessor [08 M]

INTERFACING THE ISCC TO THE AND 8086

Basic Organization Memory Cell Operation. CSCI 4717 Computer Architecture. ROM Uses. Random Access Memory. Semiconductor Memory Types

Address connections Data connections Selection connections

8051 INTERFACING TO EXTERNAL MEMORY

A+3 A+2 A+1 A. The data bus 16-bit mode is shown in the figure below: msb. Figure bit wide data on 16-bit mode data bus

PIO 8255 (cont..) M Krishna kumar MAM/M3/LU9e/V1/2004 1

Summer 2003 Lecture 18 07/09/03

Central Processing Unit. Steven R. Bagley

Microcomputer Architecture and Programming

Appendix XII The Hardware.

Interfacing Memory Chips on the 6812 Processor Bus. Student's name & ID: Partner's name & ID: Your Section number / TA's name

CMD711-EX Development Board

HI-WAVE. Serial Debug Interface SDI target. Copyright 1997 HIWARE HI-WAVE

SECTION 5 RESETS AND INTERRUPTS

1. Internal Architecture of 8085 Microprocessor


The Memory Component

Interfacing Memory Chips on the 6812 Processor Bus. Student's name & ID (1): Partner's name & ID (2): Your Section number & TA's name

Microprocessors/Microcontrollers

Interface DAC to a PC. Control Word of MC1480 DAC (or DAC 808) 8255 Design Example. Engineering 4862 Microprocessors

Background Debug Module (BDM) V4 HCS12. Microcontrollers. S12BDMV4/D Rev /2004 MOTOROLA.COM/SEMICONDUCTORS

BV4205. I2C-10 Channel A to D. Product specification. January 2008 V0.a. ByVac Page 1 of 10

CPE/EE 421/521 Fall 2004 Chapter 4 The CPU Hardware Model. Dr. Rhonda Kay Gaede UAH. The CPU Hardware Model - Overview

QUESTION BANK. EE 6502 / Microprocessor and Microcontroller. Unit I Processor. PART-A (2-Marks)

Microprocessors and Microcontrollers (EE-231)

Chapter 19. Floppy Disk Controller Discussion. Floppy Disk Controller 127

TPMC310. Conduction Cooled PMC Isolated 2 x CAN Bus. Version 1.1. User Manual. Issue June 2014

FIGURE Three EPROMs interfaced to the 8088 microprocessor.

COMP3221: Microprocessors and. and Embedded Systems. Overview. Lecture 23: Memory Systems (I)

Transcription:

The 9S2 in Expanded Mode - How to get into expanded mode Huang Chapter 4 Getting into expanded mode The HCS2 can operate in several modes: Normal Single-Chip Mode (the way we have been using the HCS2) Normal Expanded Wide (6-bit address bus, 6-bit data bus) Normal Expanded Narrow (6-bit address bus, 8-bit data bus) Special Single Chip Mode, Special Test Mode, Emulation Expanded Wide Mode, Emulation Expanded Narrow Mode, Special Peripheral Mode How does the HCS2 know what mode to run in? There are two ways: When you reset the HCS2 it looks at the state of three external pins: MODA, MODB and MODC (BKGD) Based on the logic levels on these three pins the HCS2 goes into one of the eight possible modes: MODC MODB MODA Mode Special Single Chip Emulation Expanded Wide Special Test Emulation Expanded Wide Normal Single Chip Normal Expanded Narrow Peripheral Normal Expanded Wide You can write to the MODE register to change the mode In Normal modes you can switch operating modes once by writing to the MODE register In Normal modes the MODE register is a write-once register

Coming out of reset the HC2 checks the state of the following three pins, and starts in one of several modes: BKGD MODB MODA Special Single Chip Emulation Expanded Wide Special Peripheral Emulation Expanded Wide Normal Single Chip (Flash EEPROM on) Normal Expanded Narrow Peripheral Normal Expanded Wide (Flash EEPROM off) On the EVBU, the HC2 starts in Normal Single Chip After reset, can change modes by writing to MODE register

In normal modes can change MODE once. To switch from Normal Single Chip to Normal Expanded Wide, write to MODC:MODB:MODA. Also turn on internal visibility by setting IVIS bit to IVIS = tells the HC2 to display internal bus cycles on the external bus BSET $B,#$E8 Setting Up the HCS2 for expanded mode We will start the HCS2 in Normal Single Chip Mode, and write to the MODE register to switch it into Normal Expanded Wide Mode In Normal Expanded Mode the HCS2 uses the E-clock, the R/W and LSTRB lines for control of the external bus In Normal Single Chip Mode, the HCS2 does not use these control lines, so it sets up their pins for general purpose I/O You need to tell the HCS2 to drive these signals onto external pins When enabled these signals, they are driven onto Port E in order to use the HCS2 in expanded mode You do this by writing to PEAR (Port E Assignment Register) PEAR is a write-once register In Normal Single Chip mode, the E Clock, LSTRB, and R_W lines are set up as general purpose I/O lines. When switched to Normal Expanded Wide need to use these control lines for expanded mode. Write to PEAR register:

Write to NECLK (no external E clock) to enable E Clock on external pin Write to LSTRE (Low strobe Enable) to enable LSTRB on external pin Write to RDWE (Read/Write Enable) to enable R_W on external pin MOVB #$C,,$A The MISC (Miscellaneous) register needs to be set up to allow the HCS2 to operate properly in Expanded Mode The MISC register allows you to change the number of clock stretches used by the HCS2 The MISC register allows you to disable the Flash EEPROM The MISC register allows you to move the Flash EEPROM to address block x to x7fff When reset the HCS2 forces three E-clock stretches to external data accesses This is useful when using slow memory and peripheral devices We will use a fast peripheral device, so we will speed up external data accesses by forcing the HCS2 to not to use E-clock stretches We will leave the Flash EEPROM enabled at its normal address block of x8 to xffff

Change EXSTR:EXSTR (external access stretch) from to to change from three E clock stretches to no E clock stretch. Change ROMHM (ROM in second half of memory map) to to turn off Flash EEPROM from x4 to x7fff Leave ROMON (enable ROM) at to have DBug2 at x8 xffff MOVB #$3,$3 Putting the HCS2 into normal expanded wide mode To put the HCS2 into Normal Expanded Wide you must write to the MODE, PEAR and MISC registers When D-Bug2 runs, it writes to these registers as part of its start-up code Because these three registers are write-once, you must write to them before DBug-2 does In order to switch to Normal Expanded Wide mode, we will put code to write to these registers in EEPROM and set the jumpers on the EVBU to run out of EEPROM In addition, it is necessary to do some setup which DBug-2 normally does disable the COP (Computer Operating Properly) monitor, and set the bus clock to 24 MHz.

One-Byte and Two-Byte data accesses in normal expanded wide mode In Normal Expanded Wide Mode the HCS2 can access one byte or two bytes in a single memory cycle A single byte can be located at an even address or an odd address The data lines for bytes at even addresses are connected to AD5-8 lines Because the data for even bytes are accessed through the upper 8 bits of the data bus, these are called Upper Bytes (or High Bytes) The data lines for bytes at odd addresses are connected to AD7- lines Because the data for odd bytes are accessed through the lower 8 bits of the data bus, these are called Low Bytes The HCS2 can access a High Byte and the following Low Byte in one memory access - For such a 6-bit access the 5 upper address lines are the same; only the lower line is different.

The HCS2 cannot access a Low Byte and the following High Byte - The 5 upper address bits are different for these bytes, and it would be difficult to build a decoder which could deal with this - For example, the address of the bytes at x7fff and x8 are: x7fff x8 To determine whether the HCS2 is trying to access a single High Byte, a single Low Byte, or two bytes (High Byte and following Low Byte) the HCS2 uses the A address line and the LSTRB control line LSTRB = means access low (odd) byte A = means access high (even) byte LSTRB A Access Type 8-bit access of even address (high byte) 8-bit access of odd address (low byte) 6-bit access of even address (high and low byte) Cannot occur Note: LSTRB = and A = would imply access of low (odd) byte and following high (even) byte. This will not occur for external data accesses on the HCS2 If the HCS2 needs to access a 6-bit number from an odd address, it will do this in two memory cycles it will access the 8-bit number at the odd address, followed by the 8- bit number at the even address For example the instruction movw #$55aa,$8ff will write the x55 to memory location x8ff on one memory cycle, and the xaa to memory location x9 on the next memory cycle. The HCS2 in expanded wide mode In expanded mode the HCS2 can communicate with external memory and devices over the multiplexed address/data bus To connect an external device to the HCS2 bus you need to identify an unused region of memory

By turning off some of the flash EEPROM, the region from address x4 to address x7fff is available. We will map an output port to address x4 Need decoder to demultiplex address from data, and to generate control lines needed by output port Output Ports for Lab 5 Writing to address x4 will bring CS_W low. On the high-to-low transition of E, CS_W will go high, latching the data into the flip-flops Reading from address x4 will bring CS_R low This will drive the data from the flip-flops onto the data bus The HCS2 will read the data on the flip-flops on the high-to-low transition of the E-clock