21.07.2013 Views

Introduction to Microcontrollers Lab Manual - Microchip

Introduction to Microcontrollers Lab Manual - Microchip

Introduction to Microcontrollers Lab Manual - Microchip

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

LABS<br />

10.2.2.4 FUNCTIONAL DESCRIPTION<br />

The system will power up and assume that it is on level 1. The service request indica<strong>to</strong>rs<br />

on each level will be turned off. The state will default <strong>to</strong> Idle Request.<br />

The eleva<strong>to</strong>r cart controller has four states: Idle Request, Moving Request, Idle Target,<br />

and Moving Target. The Request states are a result of the service request but<strong>to</strong>ns, and<br />

the Target states are a result of the target being entered from the terminal emula<strong>to</strong>r over<br />

the UART.<br />

When a request but<strong>to</strong>n is pressed, the service request indica<strong>to</strong>r will be turned on. When<br />

in Idle state, a request from any level (except the current level) will cause the state <strong>to</strong><br />

change <strong>to</strong> the Moving Target state. The eleva<strong>to</strong>r will move in the correct direction given<br />

its current location and the location of the service request. The eleva<strong>to</strong>r will move <strong>to</strong> the<br />

level of the requested level, turn off the service requested indica<strong>to</strong>r, and then move <strong>to</strong><br />

the Idle Target state. Subsequent but<strong>to</strong>n presses on service request but<strong>to</strong>ns will be<br />

ignored until the current service is completed.<br />

When in Idle Target state, the system is waiting for the user <strong>to</strong> enter the desired target<br />

level. When a valid number is entered, the system will then move <strong>to</strong> the desired level.<br />

When this movement is completed, the system will return <strong>to</strong> Idle Request, at which time<br />

subsequent service requests will be processed.<br />

At all times the level display on the terminal emula<strong>to</strong>r will indicate the current level (if in<br />

Idle Request or Idle Target state), or the level that is being approached during movement.<br />

10.2.2.5 POSSIBLE ENHANCEMENTS TO FUNCTIONALITY<br />

There are many ways this system could be made better. Consider adding these functional<br />

enhancements:<br />

• Queueing of service requests<br />

• Simulating ramping up and down speed of the eleva<strong>to</strong>r cart<br />

• Blinking level indica<strong>to</strong>r when that level is the target level and the cart is<br />

approaching<br />

• ...<br />

DS51963A-page 70 2011 <strong>Microchip</strong> Technology Inc.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!