Lab3: I/O Port Expansion

Similar documents
Lab3: I/O Port Expansion

7 8 9 C. PRELAB REQUIREMENTS You must adhere to the Lab Rules and Policies document for every lab.

Lab 5: EBI and ADC: Digital Voltmeter

Lab 5: LCD and A/D: Digital Voltmeter

Lab 5: LCD and A/D: Digital Voltmeter

REQUIRED MATERIALS Reread Lab Rules and Policies document EEL 3744 (upad and upad Proto Base) DAD/NAD Analog Discovery board PRELAB REQUIREMENTS

REQUIRED MATERIALS Reread Lab Rules and Policies document EEL 3744 (upad and upad Proto Base) Digilent Analog Discovery (DAD) PRELAB REQUIREMENTS

REQUIRED MATERIALS Reread Lab Rules and Policies document EEL 3744 (upad and upad Proto Base) Digilent Analog Discovery (DAD) PRELAB REQUIREMENTS

University of Florida EEL 4744 Drs. Eric M. Schwartz, Karl Gugel & Tao Li Department of Electrical and Computer Engineering

University of Florida EEL 3701 Dr. Eric M. Schwartz Department of Electrical & Computer Engineering Revision 0 12-Jun-16

Lab 16: Data Busses, Tri-State Outputs and Memory

Finite State Machine Lab

REQUIRED MATERIALS Epiphany-DAQ board Wire Jumpers Switch LED Resistors Breadboard Multimeter (if needed)

Sidewinder Development Board rev 1.0

Lab 3: Building a Power Supply and a Stereo Amplifier

YOU WILL NOT BE ALLOWED INTO YOUR LAB SECTION WITHOUT THE REQUIRED PRE-LAB.

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

Pridgen Vermeer Robotics Xmega128 Manual

Arduino Uno. Arduino Uno R3 Front. Arduino Uno R2 Front

Terasic DE0 Field Programmable Gate Array (FPGA) Development Board

ENEE245 Digital Circuits and Systems Lab Manual

EE 231 Fall EE 231 Lab 2

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

Last Updated May 11, Electronics and Robotics LLC. ootbrobotics.com

YOU WILL NOT BE ALLOWED INTO YOUR LAB SECTION WITHOUT THE REQUIRED PRE-LAB.

ENEE245 Digital Circuits and Systems Lab Manual

QuartusII.doc 25/02/2005 Page 1

VLSI AppNote: VSx053 Simple DSP Board

utinkerer v1.1 User s Manual

Building the FlipChip Tester

UF-3701 Power Board Construction Guide

May the Schwartz be with you!

Standard Logic Chips and National Instruments ELVIS Breadboarding for Combinational Logic Circuits

ootbrobotics.com Electronics and Robotics LLC

Lab 16: Tri-State Busses and Memory U.C. Davis Physics 116B Note: We may use a more modern RAM chip. Pinouts, etc. will be provided.

4.1 Design Concept Demonstration for Altera DE2-115 FPGA Board Demonstration for Cyclone III Development Board...

ootbrobotics.com Electronics and Robotics LLC

University of Florida EEL 4744 Summer 2014 Dr. Eric M. Schwartz Department of Electrical & Computer Engineering 1 July Oct-14 6:41 PM

Good Evening! Welcome!

Maxim Integrated Products 1

University of Florida EEL 3744 Spring 2018 Dr. Eric M. Schwartz. Good luck!

EE 231 Fall Lab 1: Introduction to Verilog HDL and Altera IDE

ARDUINO UNO REV3 Code: A000066

University of California at Berkeley College of Engineering Department of Electrical Engineering and Computer Sciences. EECS 150 Spring 2000

ARDUINO UNO REV3 SMD Code: A The board everybody gets started with, based on the ATmega328 (SMD).

University of Florida EEL 3701 Dr. Eric M. Schwartz Madison Emas, TA Department of Electrical & Computer Engineering Revision 1 5-Jun-17

EEL4744 Summary of Lab Tips. Mauricio J. Vacas EEL4744 Spring 2008 TA May 23, 2008

Proto-DB (#28310): Prototyping Daughterboard

Physics 120/220 Lab Equipment, Hints & Tips

Laboratory 10. Programming a PIC Microcontroller - Part II

Breakout Card For Z50Bus User Guide

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

Pmod modules are powered by the host via the interface s power and ground pins.

ARDUINO MINI 05 Code: A000087

Lab 0: Wire Wrapping Project: Counter Board

February 28,

Arduino ADK Rev.3 Board A000069

Lab #12: ArithmeticLogic Unit

ECE 354 Computer Systems Lab II. Memory and Indirect Addressing

ECE 372 Microcontroller Design

ARDUINO MEGA 2560 REV3 Code: A000067

ST SPC58 B Line Emulation Adapter System

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Introductory Digital Systems Laboratory

Implementing LVDS in Cyclone Devices

ONYX-MM-XT PC/104 Format Counter/Timer & Digital I/O Module

Version 02 Mezzanine on the 16MB board

Homework 5: Theory of Operation and Hardware Design Narrative

PSIM Tutorial. How to Use SPI in F2833x Target. February Powersim Inc.

ARDUINO MEGA ADK REV3 Code: A000069

CHAPTER 1 Introduction of the tnano Board CHAPTER 2 tnano Board Architecture CHAPTER 3 Using the tnano Board... 8

ECE 270 Lab Verification / Evaluation Form. Experiment 1

GEORGIA INSTITUTE OF TECHNOLOGY School of Electrical and Computer Engineering ECE 2020 Fall 2017 Lab #1: Digital Logic Module

EECS 140 Laboratory Exercise 4 3-to-11 Counter Implementation

Pmod I2S2 Reference Manual

MB68k-100 Assembly and Bench Check, A

Dwarf Boards. DB021 : L298 dual motor driver

MICROPROCESSOR LAB PROJECT EC 316 MADE BY:-

University of Florida EEL 3744 Spring 2017 Dr. Eric M. Schwartz Department of Electrical & Computer Engineering 22 February Mar-17 1:44 PM

Lab Overview. Lab Details. ECEN 4613/5613 Embedded System Design Week #1 Fall 2008 Lab #1 8/27/2008

Breeze Board. Type A. User Manual.

Goal: We want to build an autonomous vehicle (robot)

EK307 Lab: Microcontrollers

PART 1. Simplification Using Boolean Algebra

Post Tenebras Lab. Written By: Post Tenebras Lab

Boson Development Board <9hz Boson

Experiment # 5 Debugging via Simulation using epd

Laboratory 4 Design a Muti-bit Counter and Programming a FPGA

KNJN I2C bus development boards

USB RELAY MODULE WITH ANALOG AND GPIO INTERFACE

Introduction Testing analog integrated circuits including A/D and D/A converters, requires a special digital interface to a main controller. The digit

Digital Circuits. Page 1 of 5. I. Before coming to lab. II. Learning Objectives. III. Materials

Colecovision 5v Memory Mod Installation

4X4 Driver Shield Manual

Using MSI Logic To Build An Output Port

EET 1131 Lab #7 Arithmetic Circuits

Lab 2: Introduction to Verilog HDL and Quartus

Microprocessor Architecture. mywbut.com 1

MICROPROCESSOR B.Tech. th ECE

Tutorial for Altera DE1 and Quartus II

Transcription:

Page 1/5 Revision 2 6-Oct-15 OBJECTIVES Explore and understand the implementation of memory-mapped I/O. Add an 8-bit input port and an 8-bit output port. REQUIRED MATERIALS EEL 3744 (upad and upad Proto Base) Board kit and tools 1-74HC574 8-bit 3-state D Flip Flop 1-74HC573 8-bit 3-state transparent latch From a previous lab: 1-8-bit LED switch circuit 1-8-bit switch circuit XMEGA documents doc8331, doc8385, doc0856 upad Proto Base Schematics (on our website) Digilent Analog Discovery (DAD) kit YOU WILL NOT BE ALLOWED INTO YOUR LAB SECTION WITHOUT THE REQUIRED PRE-LAB. PRELAB REQUIREMENTS REMEMBER: You must adhere to the Lab Rules and Policies document for every lab. Read the ENTIRE lab handout before starting this Lab. Study the examples on our website, especially Input_Port.asm. For this lab and many future labs, you will need to create a Quartus schematic (bdf) file or VHDL file. Include Quartus files in your lab document as described in the Lab Rules and Policies. You can modify the Quartus schematic files to create complete wiring schematic (with pin numbers shown) for the designs described in this lab document. INPUT/OUTPUT PORTS The XMEGA has several input/output (I/O) ports (A-F, H, J, K, Q, and R). The upad Proto Base makes access to GPIO ports E and F efficient by supplying labeled headers for each. Each of the I/O pins on all the ports have additional features, some of which will be used in labs later in the semester. Therefore, we can free up these ports for their special use by adding additional memory-mapped I/O ports. The XMEGA s External Bus Interface (EBI) system gives access to the XMEGA s address, data, and control busses. In this lab, the EBI system and some external components will be used to create one memory-mapped 8-bit input port and one memory-mapped 8-bit output port (instead of using an additional XMEGA input and output port, i.e., PORTx_IN and PORTy_OUT, respectively). 1. Carefully read through the EBI section in the XMEGA AU Manual (doc8331, section 27). Make sure you understand the configuration registers, the chip select register, and how it generates the appropriate chip selects. In this lab we will configure XMEGA s CS0 (chip select 0) to enable external devices at addresses that will be specified later. In addition, we will use the Altera MAX 3000A EPM3064ALC44-10 CPLD to generate control signals for a tristate buffer chip and D Flip-Flop (register) chip. These chips are used for input and output ports, respectively. 2. Your upad Proto Base was designed to work with an SRAM 3-PORT ALE1 EBI interface (see doc8331, Section 27.5.2 [and Figure 27-4] and Section 27.9 [and Table 27-4]). This means that address bytes 0 and 1 are time-multiplexed, i.e., they share the same pins. There is an 8-bit latch, already soldered to your board (just beside the CPLD), that allows address latching using the ALE1 signal. Also see doc8385, Tables 33-7, 33-8, 33-9, for the port locations of the address, data, and control bus pins (in the columns marked SRAM ALE1). You must set EBI_CTRL accordingly.

Page 2/5 Revision 2 6-Oct-15 3. In this lab you will configure the EBI and generate the necessary chip-enable/clock equations to implement one 8-bit input port and one 8-bit output port both mapped to address $8000 and mirrored at all addresses from $8001 to $9FFF in data memory. Tristate buffers must be used for input ports and flip-flop registers should be used for output ports. 4. How many addresses is $8000 - $9FFF? You will select this as the SRAM address size in the EBI chip select register (EBI_CS0_CTRLA). You must also set the base address appropriately in the base address register (EBI_CS0_BASEADDR). You do not need to worry about wait states or other advanced features of the EBI. NOTE: There are 24 address lines (A23:0) in the data memory of the processor. However, your board only has access to address lines A15:0. As a result, for this and all future labs, you will only have to take address lines A15:0 into account when generating decode equations on your CPLD. MAX 3064 CPLD (Hint: In this lab, you will NOT need to use address A15-A0 in any CPLD address decoding. All of the address decoding for this lab is done in the XMEGA s CS0.) 5. After CS0 has been properly configured, use Quartus to generate the combinatorial circuits for the input and output ports. Set /WE, /RE, /CS0 as inputs to the CPLD. Use /WE along with /CS0 to drive an output port and use /RE along with /CS0 to read from an input port. Take note of the activation levels in the XMEGA A1U Manual (doc8385, Table 33-7) when designing your equations. HINT: The output port device s /OE signal can be tied to GND and input port device s LE can be tied to 3.3V. 6. If you have not already done so, solder a double row header into the J1 slot, inserting this header from the top of the board and soldering it on the bottom of the board. It is located at the top of the Proto Base, above the CPLD. The header will have the long legs facing up. The Altera USB Blaster will be connected to this header to program the CPLD, just as was done in EEL 3701. 7. Use jumpers on the double row header below and to the right of the reset switch. The jumpers are used to connect required signals (/WE, /RE, etc) to the CPLD. Figure 1 is an excerpt from the upad Proto Base schematic document (available on our website). The numbers boxed in red correspond to the PIN_# on the CPLD. These are the pins that you need to select in the Quartus pin planner so that the desired jumpered signals are connected to the CPLD. Once these pins are verified, program the CPLD. If you start encountering issues with the processor while programming or with various code that worked previously, double check both your wiring and the Quartus design. If there is a problem, it is likely caused by a data bus or address bus conflict, which interferes with the processor s normal operation. NOTE: Figure 1: CPLD pins utilized to connect to XMEGA. (See also the upad Base Board schematics.)

Page 3/5 Revision 2 6-Oct-15 Make sure you set the default value of the pins as input tri-stated before you program the CPLD. INPUT PORT 8. After the CPLD is programmed, use the 74HC573 datasheet to create a wiring schematic (by hand or with Quartus) for the input port using the 74HC573 8-bit 3-state transparent latch (acting as an 8-bit 3-state device). Use labels instead of wires to show connections. (I encourage you to make a computer-generated schematic that you can add to in subsequent labs.) The schematic should show connections to the data bus header and the CPLD header. Do not draw wires. Use pin labels instead. Include all pin numbers. You can add the pin numbers by hand on your printouts. (Note: The 74573 is not available in Quartus, but the operation of the 74373 is identical and can be used. The 74373 can be found in the parts library under others maxplus2. The pinouts of the 74 373 and the 74 573 are different.) 9. Wire the input port using your wiring schematic. a. If you have not already done so, you must solder the 74 573 surface mount chip into place. Place the 74 573 in the middle SOIC island surface mount position just above your switch bank, as shown in Figure 2. The placement of the 74 574 is shown in Figure 3. Begin by Figure 3: Placement of 74 574 (even though the picture shows a 74 573). soldering the two corner pins to chip in place. Add two single row 8-pin headers on each side of (above and below) the 74 573. You will wire wrap to these header pins. Solder a 0.1 F bypass capacitor in the designated SOIC bypass capacitor location (which are shown in Figure 4). See the upad Proto Base schematic for the pin connections between 74 573 s SOIC island and J14 and J24, respectively. b. Finally, wire wrap the signals as shown on your circuit diagram. Note: Power and ground signals are usually distributed using a bus to every chip. In future courses and in future projects (ECE Design 2, for example) you should solder power bus lines or make wide traces and NOT use wire wrap. In 3744, you should use two wire wrap wires for power and ground signals (although using one at the speeds we run should work fine). 10. Once the input port is finished, verify that your board still programs via the Atmel ICE PDI connection. If AVR Studio cannot Figure 2: Locations (from left to right) of the 74 574, 74 573, and 32k 8 SRAM on upad Proto Base. Figure 4: Locations of bypass capacitors.

Page 4/5 Revision 2 6-Oct-15 properly read the signature with the programmer, there may be a crossed or loose connection. Verify all of your connections using your multimeter. 11. Now that the board programs with the newly wired input port, remove the wire wrap from the switch bank from a previous lab and wire-wrap it to your new input port. 12. Verify that your board still programs. If the board does not boot, check the switch bank connections using a digital multimeter. 13. Write a short test program to read the value of the port and write it to the LEDs from Lab 2. (Submission of this program is not required, but you will likely utilize this code again later.) If the input port does not work, review the above steps. OUTPUT PORT 14. Once the input port works, use the 74HC574 datasheet to create a Quartus design for the output port using this 8-bit 3-state D flipflop. Add your circuit diagram to the one with the input port. (As the semester continues, we will add to this schematic many times, so I suggest that you generate this with a computer.) The schematic should show connections to the data bus header and the CPLD header. Do not draw wires. Use pin labels instead. Include all pin numbers. You can add the pin numbers by hand on your printouts. (Note: The 74574 is not available in Quartus, but the operation of the 74374 is identical and can be used. The 74374 can be found in the parts library under others maxplus2. The pinouts of the 74 374 and the 74 574 are different.) 15. Wire the output port using your schematic. In lab 2, you should have already soldered the 74 574 and capacitor in the appropriate location, as repeated in part a below. a. Place the 74 574 surface mount chip in the left surface mount position (to the left of your 74 573). Solder the 74 574 as described above for the 74 573. After the chip is in place, solder a 0.1 F bypass capacitor in the proper bypass capacitor location. b. Finally, wire wrap the remainder of the signals as shown on your circuit diagram. 16. Once the output port is finished, verify that your board still programs via Atmel Ice PDI. If it does not, verify your connections for the output port. 17. If the output port does not work, review the above steps. 18. Disconnect the LED bank circuit from lab 2 and connect it to your new output port. 19. Verify that your board still programs after moving the LEDs. The port can be tested further by writing a value to the output port with a short program. The output should appear on the LED bank. I/O SOFTWARE 20. Write a program that reads the input port, places the input port contents on the output port, then shift the bits on the output port right the output port contents once every two seconds (approximately). After shifting 8 times, read the input port again and repeat the shifting process. Repeat this forever. This is the only program you must submit for this lab. PRE-LAB QUESTIONS 1. What is the advantage of mirroring the input and output ports to $8000 - $9FFF (also known as partial address decoding)? What would be necessary if you wanted to only place the ports at 0x8000 and no place else? 2. Write the address decode equation to put the input and output ports at addresses 0x1000-0x7FFF. 3. What is the complete range of external memory on the XMEGA? 4. The upad Proto Base is configured to use the EBI in SRAM ALE1 mode, which does not give us address bits A23:16. Which

Page 5/5 Revision 2 6-Oct-15 mode(s) can be used to access these higher address bits? Describe the change(s) necessary to use one of these modes. What additional hardware is needed, if any? PRE-LAB REQUIREMENTS 1. Answer all of the pre-lab questions. 2. Configure EBI for 0x8000 0x9FFF memory range. 3. Determine the chip-enable equations for the input and the output ports. 4. Program the CPLD. 5. Build the 8-bit input port on your board 6. Build the 8-bit output port on your board 7. Write and debug the required program. 8. Submit the required documents through Canvas as specified in the document Lab Rules and Policies. IN-LAB REQUIREMENTS 1. Demonstrate that the input port works using the switches. 2. Demonstrate that the output port works using the LEDs. 3. Demonstrate the proper functioning of your I/O Software program. Preparation for Future Labs: If you have not already done so, solder the 32k x 8 SRAM on the right SOIC location, as shown in Figure 2. DEBUGGING TIPS: 1. You will not able to use the multimeter (as a voltmeter) to measure signals on the memory bus. They are changing too quickly. The voltmeter will show the average value. This can be utilized for debugging as follows. a) Write a very short program segment that modifies the desired bus appropriately. b) Run this program in a continuous loop. c) The average voltage of the particular pin will appear on meter. This will be different than the voltage when the bus is not being utilized. 2. Connect the pin to your analog discovery board to observe the waveform using the DAD oscilloscope function. In lab 4, you will learn how to use the DAD LSA (logic state analyzer) function. The LSA can view the logical value of up to 16 pins at the same time 3. Make sure that you set all unused pins in Quartus to be tri-stated input. If you connect signals with jumpers and the do not use them, your program may not work. 4. Make sure you understand the required PORT direction bits settings. If they are not set correctly, your code will not work. 5. The following signals are active low: /WE, /RE; while ALE1 is active-high (even though it is shown in some of the manuals as /ALE1). See Figure 27-4 in doc8331. 6. Read the EBI documentation regarding I/O pins (section 27.9). It explains how to handle active low and active high signals.