


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A laboratory exercise for creating an atm model using the spartan 3e board. Students will write software to operate the atm using rotary dials and directional pushbuttons. The project aims to help students gain experience in writing assembly-language and c/c++ code for the microblaze processor and performing simple input/output operations.
Typology: Lab Reports
1 / 4
This page cannot be seen from the preview
Don't miss anything!



In this laboratory exercise, you will write software to use the Spartan3E board to create a model of an ATM. You will use the rotary dial and the directional pushbuttons to operate the ATM model. Completing this project will help you gain experience in writing assembly-language and C/C++ code for the MicroBlaze processor and in performing simple input/output operations using the rotary dial, the directional pushbuttons, and the LCD. Design Specification This section of the specification describes the ATM interface in terms of the aspects that the user can manipulate and view. On start-up or after a reset, the LCD should welcome the user using the status message shown in Figure 1. On the second line of the display, the letters “NNN” represent the initials of your name. W e l c o m e t o t h e N N N B a n k Figure 1: Initial status message on the LCD. (for all messages, the grid is a representation of the 16 character-by-2 line LCD) Your bank has only two customers with accounts 0x01 and 0x02. The pin number for account 0x01 is 1928. The pin number for account 0x02 is 09XX, where XX are the last two digits of your Student ID Number. You will use the slide switches to enter the account number prior to entering your pin. Switching on SW0 with other switches in the off position selects account 0x01. Setting SW1 on with all other switches off selects account 0x02. The start-up message of Figure 1 should appear on the LCD when the program starts and should remain in the LCD until the user presses the North pushbutton to simulate the insertion of the ATM card. Upon insertion of the ATM card the program will request a 4 digit pin number. Figure 2 shows the message used to request the pin number. The user will use the rotary switch to select the correct number. As shown in Figure 2, the first PIN entry location should display a zero that blinks twice a second. To enter her PIN the user will move the rotary switch clockwise to increment the numbers and counter-clockwise to decrement the numbers circling through zero. Moving the rotary switch one position should increment or decrement the number by one number. To select a number the user should press the rotary switch push button. Once the pin digit is entered a “#” should be displayed to hide the user entry and the cursor should move to the next digit displaying a “0” that blinks twice per second. E n t e r Y o u r P I N 0 _ _ _ Figure 2: PIN entering prompt on the LCD.
When the final PIN Digit is entered, your program should check for a valid pin for the given account. If the Pin is invalid the message in Figure 3 should be displayed for 5 seconds and the program should then return to the PIN entry menu shown in Figure 2. If the user enters an invalid pin three times in a row the message in Figure 4 should be displayed and your program should go into an infinite loop requiring a reset to re-start the program. I N V A L I D P I N Figure 3: Invalid Pin Number Message A C C E S S D E N I E D Figure 4: Message Displayed after 3 Invalid Pin Numbers For a valid pin number the message in Figure 5 should be displayed. The user will use the rotary switch to select between the given options. When the windows first appear the word “CHECKING” should be blinking once a second. Moving the rotary switch one detent in either direction should select the “SAVINGS” word and make it blink once a second while the word “CHECKING” stops blinking. If the user pushes the rotary push button switch the blinking account should be selected and the LCD display should show the Menu in Figure 6. S e l e c t A c c o u n t C H E C K I N G S A V I N G Figure 5: Account selection Message For either account, the user will be given the options to Withdraw, Deposit or request Balance for the account. The interface menu is shown in Figure 6. Blinking once a second will again be used to indicate the selected option and the rotary push button will be used to enter the desired option. To change an option the rotary switch will be used to move through the three options (clockwise sequence: WITHDRAW, BALANCE, DEPOSIT; counter-clockwise sequence: WITHDRAW, DEPOSIT, BALANCE). W I T H D R A W D E P O S I T B A L A N C E Figure 6: Account selection Message For the Withdraw option the user will be allowed to withdraw fixed amounts as shown in Figure 7. Your program should keep track of the original balances and should not allow the user to withdraw more than the available funds. If the funds requested exceed the available amount the message in Figure 8 should be displayed for 5 seconds. After 5 seconds, the user should be taken to the Account selection Menu. S e l e c t A m o u n t 2 0 4 0 6 0 8 0 1 0 0 Figure 7: Amount selection Message
Technical Merit Grade The following criteria will be used to evaluate the technical portion of this project. Your instructor will provide specific grading guidelines concerning the weighting of these criteria. Successful operation of the program : Designs that work in part may receive partial credit. Technical description of your software design : Give a general discussion of your software structure and a high-level description of the algorithms and data structures that you use. Programming style : Make sure that your source files are readable, that your comments are sufficiently descriptive, and that you use instructions and data structures appropriately. The code should be reasonably subdivided into subroutines. Your code should be reasonably efficient in terms of memory usage and computational speed. The compiler/assembler should not generate any warnings. Your TA will look at the subroutines you use to handle the display of the different menus and the selection (blinking) options. Submitting Your Work Prior to the due date, submit your source file(s) using Blackboard. Follow the submission instructions that your instructor provides. To evaluate your design, your GTA may build your program and run it on a Spartan3E. Because the GTA needs to assemble/compile your program, it is essential that you provide all of the information that he will need for this purpose. A makefile must be provided ECE 2534 students should follow your instructor’s guidance in submitting a report for this assignment. The conclusion of your report should state the degree to which your design successfully met the requirements. Honor Code Requirements You must complete this project individually. It is an Honor Code violation to discuss your design with any other student or to release any element or result of your design to another student. It is an Honor Code violation to share computer files, including leaving design files on computers where other students can gain access to them. You may consult with other students about features of the Spartan3E board if you can do so without discussing details of your design. You may ask lab GTAs for assistance in debugging your code, but not other students. Please direct any questions concerning the Honor Code to your instructor.