Microcontroller Applications - Assignment 7 | ECE 4510, Assignments of Microcomputers

Material Type: Assignment; Professor: Grantner; Class: Microcontroller Applications; Subject: Electrical & Computer Engineer; University: Western Michigan University; Term: Fall 2008;

Typology: Assignments

Pre 2010

Uploaded on 07/23/2009

koofers-user-mlf-1
koofers-user-mlf-1 🇺🇸

1

(1)

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
ECE 4510/5530 Microcontroller Applications
Fall 2008
Homework Assignment #7
Total: 100 pts.
Due 3:30pm, Friday, October 31, 2008
You are to design all of the hardware and develop a C program necessary to control the
system depicted on Page 2. Assume the Adapt9S12DP512 Board that is being used in the
Lab (the CPU clock is set to 8MHz). The system consists of a vat, two pumps (P1 and P2),
two digital sensors (SD1 and SD2), one analog sensor (SA), and a filter unit (F). SD1
and SD2 indicate whether the vat is full or empty, respectively. SA measures a particular
property of the chemical in the vat. The system is controlled by repetitively executing the
following 5 steps (steps 2-5 are included in the cycle):
1. Initialize the system with P1, P2 and F off.
2. Turn on P1 to fill the vat with a chemical. Monitor SD1 to determine when the
vat is full and then turn P1 off. Turn off P1 after 25s no matter what.
3. Turn on F until SA reads 4.1 - 4.3V, or for 55s max., and then turn it off.
4. Turn on P2 to empty the vat. Monitor SD2 to determine when the vat is empty
and then turn P2 off. Turn off P2 after 20s no matter what.
5. Wait for 15s and then go to Step 2.
Sensors SD1and SD2 provide TTL voltage and current levels. Status of SD1 (SD2) is logic
1 when the vat is full (empty) and logic 0, otherwise. P1, P2, and F require 24VDC @ 0.04
A to turn them on, 0VDC to turn them off. The range for the analog signals produced by SA
is 0 -5V. The output of SA should be read once every 20ms.
Tasks
1. Explain your design approach. That includes the mapping of the signals to port bits, the
use of various function modules, and your algorithm to tackle this problem. (20 pts.)
2. Draw a detailed schematic diagram for the hardware part of this interface. Your
schematics should include H1 (or H2) connector, and chip pin numbers, respectively. All
signal lines should be labeled. All port pins of the 9S12D512 microcontoller that are used in
your solution should be buffered. (16 pts.)
3. Develop a syntactically correct C program that will run in an infinite cycle to control
the system. Only commands “sei” and “cli” are permitted as embedded assembly
instructions. You may assume that your program will have sufficient time to initialize the
system before the first cycle begins. Choose the code, data, and variable locations for
your program such that it could run on the system in the Lab but you are not required to
prove that it has actually run. Turn in your compiled .lst file and your C source code
along with comments for full credit. (64 pts.)

Partial preview of the text

Download Microcontroller Applications - Assignment 7 | ECE 4510 and more Assignments Microcomputers in PDF only on Docsity!

ECE 4510/5530 Microcontroller Applications

Fall 2008 Homework Assignment # Total: 100 pts. Due 3:30pm, Friday, October 31, 2008

You are to design all of the hardware and develop a C program necessary to control the system depicted on Page 2. Assume the Adapt9S12DP512 Board that is being used in the Lab (the CPU clock is set to 8MHz ). The system consists of a vat , two pumps ( P1 and P2 ), two digital sensors ( SD1 and SD2 ), one analog sensor ( SA ), and a filter unit ( F ). SD and SD2 indicate whether the vat is full or empty, respectively. SA measures a particular property of the chemical in the vat. The system is controlled by repetitively executing the following 5 steps (steps 2-5 are included in the cycle):

  1. Initialize the system with P1, P2 and F off.
  2. Turn on P1 to fill the vat with a chemical. Monitor SD1 to determine when the vat is full and then turn P1 off. Turn off P1 after 25s no matter what.
  3. Turn on F until SA reads 4.1 - 4.3V , or for 55s max., and then turn it off.
  4. Turn on P2 to empty the vat. Monitor SD2 to determine when the vat is empty and then turn P2 off. Turn off P2 after 20s no matter what.
  5. Wait for 15s and then go to Step 2.

Sensors SD1and SD2 provide TTL voltage and current levels. Status of SD1 (SD2) is logic 1 when the vat is full (empty) and logic 0, otherwise. P1, P2, and F require 24VDC @ 0. A to turn them on, 0VDC to turn them off. The range for the analog signals produced by SA is 0 -5V. The output of SA should be read once every 20ms.

Tasks

1. Explain your design approach. That includes the mapping of the signals to port bits, the use of various function modules, and your algorithm to tackle this problem. (20 pts.) 2. Draw a detailed schematic diagram for the hardware part of this interface. Your schematics should include H1 (or H2) connector, and chip pin numbers, respectively. All signal lines should be labeled. All port pins of the 9S12D512 microcontoller that are used in your solution should be buffered. (16 pts.) 3. Develop a syntactically correct C program that will run in an infinite cycle to control the system. Only commands “sei” and “cli” are permitted as embedded assembly instructions. You may assume that your program will have sufficient time to initialize the system before the first cycle begins. Choose the code, data, and variable locations for your program such that it could run on the system in the Lab but you are not required to prove that it has actually run. Turn in your compiled .lst file and your C source code along with comments for full credit. (64 pts.)