DOC PREVIEW
UW-Madison ECE 353 - HOMEWORK ASSIGNMENT #4

This preview shows page 1 out of 4 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 4 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 4 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

ECE 353 Introduction to Microprocessor Systems Spring 2008 (Schulte) 1 HOMEWORK ASSIGNMENT #4 Due Friday, April 4th, 2008 Note: For the required schematic diagrams, you must use a CAD package of some type (i.e. Electronic Workbench, ExpressPCB, Eagle, OrCad, Design Architect, Visio, etc.) to create the diagrams. (No hand-drawn schematic diagrams!) 1. (10 points) I/O Address Decoding Given the somewhat unusual decoding logic shown below, draw the byte-wide system memory map showing where the I/O devices are present. The I/O devices are 8-bits wide, and the external memory interface bus is configured for 8-bit operations. Label the starting and ending addresses of each device and any images, and any unpopulated areas. Be sure to look carefully at which signals are used in each decoder. Note the memory select 0 (/MS0) is active over the address range 0x10000000-0x1001FFFF, and only address lines A16-A0 are available in the external interface. Do not draw any other system memory or I/O in the memory map. /MS0BUFFEROEB7B0D7D0A14A15/MS0FFD7D0D7D0A15Q7Q0A7A0D QIO7IO0/RS/WSA13 2. (10 points) Selecting a Microprocessor Supervisor You are tasked with selecting a microprocessor supervisor that will be used on an ADuC7026 system. Fortunately, your possible selection universe has been narrowed significantly for you by a management decision to use one of the Microchip parts from the MCP-100 through MCP-131 series of microprocessor supervisors. You also learn that you can find information on these parts at http://www.microchip.com/ParamChartSearch/chart.aspx?branchID=9008&mid=11&lang=en&pageId=79. Select a suitable microprocessor supervisor (and any required components) for use with an ADuC7026 system operating on +3.3V. Although the ADuC7026 has an internal POR circuit, we want an external supervisor. Complete the following: a) Specify the smallest surface mount package possible for the part that you select. Minimize the need for additional external components. You will need to select the reset threshold voltage as appropriate for the ADuC7026. Be sure to specify the part number completely (for example, MCP100T-460I/TT). b) Draw a schematic diagram showing the required connections to the selected microprocessor supervisor and its connection(s) to the ADuC7026, and any required support components.ECE 353 Introduction to Microprocessor Systems Spring 2008 (Schulte) 2 c) Describe the salient characteristics of the selected microprocessor supervisor that led you to make the selection that you did, including why you chose the package that you did. d) Write a brief narrative describing the functional capabilities that the selected microprocessor supervisor device gives you. 3. (20 points) Using ADuC7026 GPIO You are to write a program that will implement a simple high/low game in software. To make the game interesting, you will need to generate a random number. You will accomplish this be setting Timer0 to count as rapidly as possible, and then simply read the counter register when the user presses the start button. Since the timer register is changing too fast to possibly keep track of (for a human, anyway), the value is effectively random. The GPIO pins used by the game will be; P0.2 – input: start When this input goes high, it starts the game. If pressed in the middle of a game, the game should restart. When the game is started, store a random value between 0 and 31. Wait for P0.2 to go low again before accepting any other inputs. P0.3 – input: make a guess When this input goes high, read the value on Port1 (the user’s guess) and compare it to the random value. Set the state of Port2 appropriately, then wait for P0.3 to go low again before accepting any other inputs. P1.7-P1.3 – input: guess value (assumed to be unsigned) The user enters the value here before using P0.3 to make a guess. P2.7-P2.0 – output: game scoreboard display The game scoreboard should be set to all 0s at the start of a game. Update the scoreboard when the user makes a guess. If the guess is high, display 0x01. If the guess is low, display 0xFF. On a correct guess, display 0x77. Once the user makes a correct guess, no further guesses should be accepted until a new game is started. Your code should be added to main.s in the Kiel uVision3 sample project on the course web page. All references to the GPIO MMRs should use the definitions in aduc7026.inc. Note that the definitions are setup to include a base address for a group of registers, and smaller offsets within the groups. A typical usage of these definitions is as shown below. LDR R7, =(IRQCON_MMR_BASE) ;load base address MOV R0, #0xFFFFFFFF ;data to store STR R0, [R7, # IRQEN] ;access registers with base + offset STR R0, [R7, # FIQEN] To test your program, you should open windows to view the pin states of P0, P1 and P2 – you can do so by selecting PeripheralsGeneral Purpose Input/Output from the menu when running the debugger. By checking/unchecking the bits in the I/O Pins block for Ports 0 and 1, you can create the game inputs, even while your program is running. Important: Submit ONLY your program source code file main.s using your homework team’s dropbox in Learn@UW. Also, submit a paper copy of main.s with the rest of the assignment.ECE 353 Introduction to Microprocessor Systems Spring 2008 (Schulte) 3 4. (15 points) Using the ADuC7026 Watchdog Timer Using the sample project provided as a starting point, write code in main.s to configure the watchdog timer to give a 200ms timeout while operating with the Secure Clear Bit set. When your code starts up, check if a watchdog reset has occurred. If it has, branch immediately to the spin loop at the end of the program. Otherwise, set GPIO Port1 as all inputs, then configure and enable the watchdog timer. Use an initial seed value of 0x3C for the secure clear mode. After the watchdog timer is configured and operating, your code should enter an indefinite loop where it does the following; • If pin P1.1 is read as a 1, continue to loop checking P1.1. Note that this will eventually cause a watchdog reset since we will not reset the watchdog timer. • If pin P1.1 is read as a 0, check if the watchdog timer has counted down below one fifth (1/5) of its original load value. If it has, then reset the watchdog timer using the appropriate secure clear value (you will need to calculate it). As a suggestion for organizing your work, you may want to


View Full Document

UW-Madison ECE 353 - HOMEWORK ASSIGNMENT #4

Download HOMEWORK ASSIGNMENT #4
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view HOMEWORK ASSIGNMENT #4 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view HOMEWORK ASSIGNMENT #4 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?