writing assembly code

profileparedan
SP.pdf

ECE362 Final Project Remote Subway Monitoring System Objective: You are tasked to create a remote subway monitoring system that controls the trains in the subway system designed at your place of choice. You are responsible for the locations of stations and how they connect to each other. The monitoring system is able to display values such as the train speed, door operation, train location, and send emergency stop command remotely to the trains. Assume that there are only two towns, A and B, and N number of stations connected between them. Peripheral Simulations:

1. Stepper Motor: Every time the train moves from one station to another, the stepper motor simulates the speed and direction of the train. This includes the acceleration, cruise, and deceleration of the train. The speed is controlled by the switches. The train moves clockwise if it starts from Town A, and counterclockwise from Town B. For simplicity, the journey time is the same between any two adjacent stations.

2. DC Motor: When arriving at each station, the DC motor drives the door to open and close. It takes 3 seconds to either open or close the door. The DC motor drives the door at 90% duty cycle during the first 2 seconds, and 30% duty cycle during the last second to reduce impact.

3. Keypad: The keypad mainly allows the user to interact with the system. It allows:

a. System login and authentication. The login system has a two-step authentication to prevent access by unauthorized personnel. The first step is the 4-digit password. The second step requires both keypad and potentiometer to gain access.

b. Selecting departing and destination station/town. c. Navigating and displaying route information at certain screens.

4. Potentiometer: For the second part of the two-step authentication, the authorized user must pre-define the range of values of the potentiometer that allows access to the system. The system will prompt user to enter a key to proceed, but it will deny the input until the potentiometer is twisted to the right position.

5. LCD The LCD mostly display the status and alerts from the system. It will be used to display texts/prompts for login, route information, selecting departure and destination location, door motion animations, emergency brake alert, arrival and departure alert. When the train is in motion, the LCD should display the speed of the train in real-time while

showing the name of the next station. It should also display the top speed set by the switches on the same screen.

6. Push Button: The user may use the push button to stop the train. This will cause the train to decelerate, and system alerts, which are the LED and LCD, notifies the user of the emergency stop. After that, the workers will take care of the stopped train and the system will bring back the user to the main menu for the next testing with another train.

7. Switches: Four switches control the top speed of the train, which is represented by the stepper motor. Each switch represents 25% of the max possible speed, so if the user wishes the train to go the fastest, all switches related to speed control are turned on. You may specify any value for the max speed. The speed change will not override the max speed of the train immediately during motion. You may assume acceleration and deceleration is constant, hence the time taken to accelerate to a higher speed is longer and so on.

8. Speaker (Port T): The speaker sounds for each of these events: train departure from stations, train arrival at stations, doors opening, doors closing, and emergency stop. Each event must have different sounds.

9. LEDs: The LED indicates the number of stations left before destination. When travelling from one station to another, the LED of the next station blinks. The blinking will stop after the doors are fully closed before departure.

10. IRQ: The IRQ displays the route information from two places in the system. Both menu should be written within the IRQ_ISR subroutine.

a. Main menu: The user will be able to view all route information in a separate menu accessed using IRQ button. The stations information can be navigated by using keypad. Make sure the user can go back to the main menu.

b. During motion: The user will be able to view the information of the current route in a separate menu accessed using IRQ button. Note that during this time, the train still runs in the background. So, both the information screen and the train are running in parallel. Make sure the user can go back to the train status.

11. Three extra items: Your group should come up with three extra features, simple or complex.

12. RTI controls the timing of the simulation.

Requirements: 1. The railway network must have at least 4 routes, and each route must have 5 to 8 stations (because that is the number of LEDs we have). You must also have at least 5 intersections between routes. Refer appendix to see how the routes work.

2. The monitoring system must be able to dispatch a train at any station and travel anywhere.

3. Each station/town must be named.

4. No delay loops are allowed, you must utilize the Real Time Interrupt (RTI). DELAY LOOPS ARE ONLY ALLOWED FOR HEX KEYPAD DE-BOUNCE.

Note: You are encouraged to be creative and make this project your own. You can make reasonable assumptions in the development of this project, but keep in mind that the assumptions must make sense to the user (and to the Lab TAs). FOR YOUR PROJECT 10% OF THE GRADE WILL BE BASED ON EXTRAS THAT YOU WILL CREATE ON YOUR OWN. YOUR ARE ENCOURAGED TO BE CREATIVE THE MORE COMPLEX THE EXTRA THE MORE POINTS ARE EARNED. If you have any questions pertaining to this project, please discuss it with your Lab TAs as early as possible. You may use any C code provided through the lab but all other code must be written in assembly.

Appendix The figure on the right is an example of the railway map. The letters represent the line. The numbers are just a convenient way to identify the “location” of the train. This map has 6 routes. There are at least 4 stations in a route, and at most 6 stations in a route. There are a total of 5 intersections in this map. The 6 routes are:

1. A0-A1-A2-A3-A4-A5 2. A0-A1-A2-A3-B4-A5 3. A0-A1-C2-A3-A4-A5 4. A0-A1-C2-A3-B4-A5 5. A0-B1-B3-B4-A5 6. A0-B1-B3-A4-A5

The direction is bi-directional as long as the train follows a route. You are encouraged to design your own railway map and determine how the stations should be placed and how many you need. Remember to satisfy the requirements.

  • ECE362 Final Project
  • Remote Subway Monitoring System
  • Peripheral Simulations:
  • Requirements:
  • Note:
  • Appendix