Lab 9: Basic Memory Interfacing and Access Protocol | ECE 331, Lab Reports of Electrical and Electronics Engineering

Material Type: Lab; Professor: Mason; Class: Microprocessors & Digital Sys; Subject: Electrical & Computer Egr; University: Michigan State University; Term: Spring 2009;

Typology: Lab Reports

Pre 2010

Uploaded on 08/18/2009

koofers-user-a82
koofers-user-a82 šŸ‡ŗšŸ‡ø

9 documents

1 / 7

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
ECE 331 Spring 2009
p. 1
Lab 9: Basic Memory Interfacing and Access Protocol
Summary:
Construct a functional interface between the 68HC12 MCU and an external EPROM.
To between
Learning Objectives:
• Introduce a basic, but representative, microcontroller-to-memory interface
• Review EPROM specifications and operation
• Demonstrate the use of MON12 utility subroutines
Resources and Supplies:
• CML12S-DP256 development board
• 27512 EPROM
• PC with text editor, 68HC12 assembler, and MON12 monitor program
• CML12S-DP256 MON12 Manual
• 27512 data sheet
Important Reminders:
• It is your responsibility to save the programs you create.
• Pre-lab assignments must be completed before coming to the lab.
Background:
27512 EPROM.
The 27512 is a 512kbit (64K x 8) EPROM. Read through the data sheet to become familiar with the
information available so you can refer to it as needed. This 64k-byte EPROM has 16 address bits.
In this lab, you will only need to access addresses $FF00 and $FF1F (32 locations) using only 6
address signals from the MCU. You will need to determine how to wire the EPROM address signals
to the appropriate MCU address pins and hardwired ground (0V) or power (5V) connections. You
will also need to study the rest of the pins on the EPROM and determine the proper signal values
for each input. Be sure to connect power and ground to the EPROM also.
ASCII Codes & MON12 OUTA Utility
The American Standard Code for Information Interchange (ASCII) specifies a correspondence
between digital bit patterns and character symbols including 52 upper/lower case alphabetic
characters, 10 numerical digits, and special graphic symbols. Each 7-bit ASCII code represents a
character symbol, with codes 0-31 reserved for control codes. For example, 1000001 = 6510 = 4116
represents ā€˜A’. A complete list can be found at en.wikipedia.org/wiki/ASCII. Using ASCII codes, a
text string can be represented by a series of coded bytes. Note that character codes sent to the
LCD display are also represented in ASCII.
The MON12 monitor program installs a variety of utility subroutines which can be accessed
between $FF10 and FF67 (see MON12 Manual). One of these utilities is called OUTA and can be
accessed by jumping to the subroutine at $FF4F. This subroutine will display the ASCII character
represented by the value stored in accA. You will call this subroutine within your program to display
ASCII codes read from the EPROM. Notice, your program will not know what ā€˜OUTA’ is, so you’ll
need to equate it to the address $FF4F.
pf3
pf4
pf5

Partial preview of the text

Download Lab 9: Basic Memory Interfacing and Access Protocol | ECE 331 and more Lab Reports Electrical and Electronics Engineering in PDF only on Docsity!

Lab 9: Basic Memory Interfacing and Access Protocol

Summary:

Construct a functional interface between the 68HC12 MCU and an external EPROM. To between

Learning Objectives:

  • Introduce a basic, but representative, microcontroller-to-memory interface
  • Review EPROM specifications and operation
  • Demonstrate the use of MON12 utility subroutines

Resources and Supplies:

  • CML12S-DP256 development board
  • 27512 EPROM
  • PC with text editor, 68HC12 assembler, and MON12 monitor program
  • CML12S-DP256 MON12 Manual
  • 27512 data sheet

Important Reminders:

• It is your responsibility to save the programs you create.

• Pre-lab assignments must be completed before coming to the lab.

Background:

27512 EPROM.

The 27512 is a 512kbit (64K x 8) EPROM. Read through the data sheet to become familiar with the information available so you can refer to it as needed. This 64k-byte EPROM has 16 address bits. In this lab, you will only need to access addresses $FF00 and $FF1F (32 locations) using only 6 address signals from the MCU. You will need to determine how to wire the EPROM address signals to the appropriate MCU address pins and hardwired ground (0V) or power (5V) connections. You will also need to study the rest of the pins on the EPROM and determine the proper signal values for each input. Be sure to connect power and ground to the EPROM also.

ASCII Codes & MON12 OUTA Utility The American Standard Code for Information Interchange (ASCII) specifies a correspondence between digital bit patterns and character symbols including 52 upper/lower case alphabetic characters, 10 numerical digits, and special graphic symbols. Each 7-bit ASCII code represents a character symbol, with codes 0-31 reserved for control codes. For example, 1000001 = 65 10 = 41 16 represents ā€˜A’. A complete list can be found at en.wikipedia.org/wiki/ASCII. Using ASCII codes, a text string can be represented by a series of coded bytes. Note that character codes sent to the LCD display are also represented in ASCII.

The MON12 monitor program installs a variety of utility subroutines which can be accessed between $FF10 and FF67 (see MON12 Manual). One of these utilities is called OUTA and can be accessed by jumping to the subroutine at $FF4F. This subroutine will display the ASCII character represented by the value stored in accA. You will call this subroutine within your program to display ASCII codes read from the EPROM. Notice, your program will not know what ā€˜OUTA’ is, so you’ll need to equate it to the address $FF4F.

Memory Interface Rather than using the expanded mode of operation for the 68HC12, an interface to external memory can be constructed using general purpose I/O ports. In this lab, Port A will be used as the 8-bit data bus, which for this lab will serve as an input port, receiving data from the external EPROM. 6 bits of Port K will be used as the address bus, to output to the EPROM the address that will be read.

Hardware and Connection Information The EPROM will be inserted into the protoboard area on the AXM-0295 project board. To connect EPROM pins to the microcontroller, wires must be connected to wiring ā€œheadersā€ (connection points) on the project boards. Port A can be connected to through the BUS-PORT on the CML12S- DP256 development board. Port K is connected to the project board through the big ribbon cable (where it is wired to the LEDs & other components) and can be accessed through the AUX1 and AUX2 ports on the AXM-0295 project board. Diagrams of these wiring headers are given below.

MCU Registers The relevant MCU registers for this lab are: $0000 Port A data register $0002 Port A data direction register $0032 Port K data register $0033 Port K data direction register

Wire Connection Header Pin Descriptions

BUS_PORT of the CML12S-DP256 development board.

Header Pin

PortA Pin 2 PA 3 PA 4 PA 5 PA 6 PA 7 PA 8 PA 10 PA

Most of the information you need to complete this project is contained in the Background section. Here are a few additional important notes.

  • Store your program beginning at $1000. $4000 to $7FFF is not available due to the changes you will make in hardware settings on the development board.
  • Check the read access time on the EPROM data sheet and ensure your loop has sufficient delay between the time the address is set and when data is read. A simple delay loop of ~1msec should solve any problems.
  • Notice that the message can be read with only 5 address bits. The 6th^ Port K bit (PK5) can be left unconnected (in which case you’ll have to hardwire the corresponding address pin on the EPROM). Alternatively, since PK5 is connected to a buzzer on the project board, you can use it as an indicator that your program loop has reached the end. That way, if you design everything properly, you can have the buzzer go off when your message is ready to be read from the monitor.

Preparation -Hardware:

Based on your wiring diagram from the Prelab, insert the EPROM into the protoboard on the project board and wire it correctly. Do not forget to connect the EPROM to power and ground, either from the power supply or from the AUX1-PORT.

By default, the CML12S-DP256 development board uses and external ā€œjumperā€ that sets the 68HCS12 in an expanded operating mode. This permits the board to access external RAM at addresses $4000 to $7FFF. To use Port A as a general purpose I/O port, this hardware setting must be changed by completing the following steps.

  1. Turn off the power to the 68HC12 development board.
  2. Remove the MEM_EN jumper from the DP256 development board. So the jumper does not get lost, insert it back with only one side connected to one pin and the other side dangling.
  3. Restore power to the 68HC12 development system.

Making this change will means the external RAM is not available, so you can not store any code between $4000 and $7FFF.

At the end of this lab you will need to replace the MEM_EN jumper (with the power off) to return the development board to its default configuration.

Preparation -Software:

  1. Using any text editor, write the assembly code for the counter program described above and save it as a .asm file in your secure programs directory.
  2. Launch the AsmIDE utility from the 68HC12 program folder under the ā€˜Start’ menu.
  3. Within AsmIDE, select File  Open to open your .asm file.
  4. From the Build menu, select Assemble. to assemble your program and generate the .lst .s19 files. A complete .s19 file is only produced when the assembly proceeds to conclusion with no errors.
  5. Remove any syntax errors that are indicated by the assembler until you obtain an error free assembly. Print your final .lst file using the text editor and include this in your lab report.

Testing:

  1. Connect the CML12S-DP256 board to power and to your computer using the wiring bundle attached to your computer. Press the reset button on the development board. You should see a message to ā€œPRESS KEY TO START MONITORā€¦ā€ in your terminal window. Press the ENTER key and you should see: a. Axiom MON12 - HC12 Monitor / Debugger V256. b. Type "Help" for commands. c. >_
  2. Type ā€˜ load ’ at the prompt and press the ENTER key.
  3. Select the ā€˜ Upload ’ option. Then click on the ā€˜ Browse ’ button and select the .s19 file that was created from the assembly process. Once you have selected the file, click ā€˜OK’.
  4. Use the ā€˜Modify CPU Register Contents’ command ( RM ) to set the Program Counter to point at address $1000. To do this type RM press enter, and then enter the address.
  5. Type G , and press Enter to start the program execution.
  6. If your program is correct you should now see the message displayed on the monitor. If not, debug your program and repeat. Once your program is correctly displaying the message, record the message in the check off sheet.
  7. When you are satisfied that the program is operating correctly, ask the TA to check a demonstration of your program. Ask the TA to check off on your lab check-off sheet.

Final Tasks

  • Turn off the power supply and anything else that you might have turned on.
  • Replace the MEM_EN jumper (with the power off) to return the development board to its default configuration.
  • Disconnect and return the microcontroller interface board to the lab closet.
  • Return the EPROM to the TA.

Discussion Points

As explained in the Lab Report Guide , you should address these discussion points in a designated section of your report.

  1. What is the maximum message length that can be stored in the EPROM and displayed correctly using 6 bits of Port K?

LAB 9 CHECK-OFF SHEET

Student Name: ___________________________ Lab. Section (time): __________

Complete this sheet as you complete the lab. Remember to have the TA check off each

section of the assignment. This sheet must be included in your lab report.

Part 1: EPROM interfacing and access.

Step 11. What is the displayed EPROM message?

___________________________________________________________

Part 1: TA sign off

Part 1: EPROM interfacing and access. Initial________