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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

10.1 OBJECTIVE<br />

10.2 THE LAB<br />

<strong>Lab</strong> 10. Project<br />

Simulate a real embedded system.<br />

10.2.1 Objective<br />

LABS<br />

Use the I/O of the MX PIC24F EDU Module and the MX Educational Target <strong>to</strong> simulate<br />

a real-life system. Write a specification that defines which I/O is used <strong>to</strong> simulate the<br />

environment and then write the code <strong>to</strong> control the system accordingly.<br />

Use at least 5 of the lab <strong>to</strong>pics in the system.<br />

10.2.2 Eleva<strong>to</strong>r Control Example<br />

10.2.2.1 SYSTEM OVERVIEW<br />

The system <strong>to</strong> be developed is a 4-floor eleva<strong>to</strong>r controller. These will be called Level<br />

1-Level 4. Each level will have a request but<strong>to</strong>n that users would press <strong>to</strong> request service<br />

from the eleva<strong>to</strong>r. Each level will also have an indica<strong>to</strong>r <strong>to</strong> display that service has<br />

been requested. Once the request is serviced, the indica<strong>to</strong>r will be turned off.<br />

Inside the eleva<strong>to</strong>r, a character display will inform the occupants of the floor that the<br />

eleva<strong>to</strong>r cart is approaching.<br />

10.2.2.2 I/O MAPPING<br />

The 4 push but<strong>to</strong>ns on the MX Educational Target will represent the request but<strong>to</strong>ns for<br />

each level of the building. The 4 LEDs on the MX Educational Target will represent the<br />

current location of the eleva<strong>to</strong>r.<br />

The UART will be used <strong>to</strong> output the text <strong>to</strong> a terminal emula<strong>to</strong>r running on an external<br />

PC. The terminal emula<strong>to</strong>r should be set <strong>to</strong> 9600 baud 8-N-1 <strong>to</strong> display the text properly.<br />

The UART will also be used <strong>to</strong> input the destination floor for the user.<br />

The timer interrupt will be used <strong>to</strong> simulate the time it takes for the eleva<strong>to</strong>r cart <strong>to</strong> go<br />

from one floor <strong>to</strong> the next. This time will be set <strong>to</strong> 3 seconds from one floor <strong>to</strong> the next<br />

floor.<br />

10.2.2.3 TOPICS COVERED<br />

1. I/O port control from <strong>Lab</strong> 0<br />

2. UART control from <strong>Lab</strong> 3<br />

3. Timers from <strong>Lab</strong> 1<br />

4. Interrupts from <strong>Lab</strong> 2<br />

5. Power-saving features from <strong>Lab</strong> 9<br />

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

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

Saved successfully!

Ooh no, something went wrong!