
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Assignment; Professor: Grantner; Class: Microcontroller Applications; Subject: Electrical & Computer Engineer; University: Western Michigan University; Term: Fall 2008;
Typology: Assignments
1 / 1
This page cannot be seen from the preview
Don't miss anything!

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):
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.)