Simple Robot Microprocessor Design

Discussion in 'Homework Help' started by jegues, Mar 31, 2011.

  1. jegues

    Thread Starter Well-Known Member

    Sep 13, 2010
    Hello all,

    I've been trying to wrap my head around how to do the following design in order to study for the final exam in my microprocessors course.


    Here's what I've got so far:

    My system will consist of:

    -1 512x8 ROM chip
    -1 64x8 RAM chip
    -1~3 PIA chips

    My main program will flow in the following fashion.

    1. It will recieve a Power ON/Hardware Reset
    2. It will execute its reset function
    3. Load the stack pointer with the starting address of the stack
    4. Initialize the PIAs according to the design requirements
    5. Wait to recieve a START signal
    Now I'm kinda confused how I should set up my PIAs to monitor these 5 devices. (Control Panel, Left/Right Motors/Sensors)

    The KP signal on the Control Panel and the W/Bn signals on the sensors should be the 3 signals that have the ability to interrupt my system.

    • KP will be the highest priority device as it should be able to stop/start the robot at any point in time.
    • While left/right sensors should have equal priority.
    So after my PIA's have been intiailized my system should wait for KP signal to be issued. If the issued KP does not correspond to CP2 = 0, CP1 = 1 my system should return to waiting for KP signals, while ignoring all others.

    When it finally recieves a START signal the system should start repeating the duty cycle routine in order to power both motors at average speed.

    Based on how my the motors are designed, they require a 50% duty cycle to run at average speed. (i.e. apply 5V to POWER pin of motor for 1ms, followed by 0V to the POWER pin for 1ms and repeat this cycle)

    What is a good way of implementing this? Should it simply be setting, delaying and clearing bits in one of the PIAs data register?

    Let's suppose my system has recieved the initial start signal and is moving forard and all of a sudden the LEFT SENSOR has interrupted the system indicating it must steer the robot to the right, how can I get it to only pulse one motor instead of two while still monitoring the the interrupted sensor so that once it is back on track it should to return to the original duty cyle routine?

    I think after I get a few things cleared up I will have a better idea of how to implement the design.

    I could really use some help!

    Thanks again!
    Last edited: Mar 31, 2011