Microcontroller Digital I/O Interface Assignment for ECE 4510/5530 - Prof. Janos L. Grantn, Assignments of Microcomputers

A homework assignment for ece 4510/5530 microcontroller applications course in fall 2008. Students are required to implement a digital i/o signal interface using output compare tc7 interrupts and pwm channel 2 to generate output signals based on the status of two input signals. Details on the input signal designations, timing requirements, and conditions for generating output signals.

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 #8
Total: 60 pts.
Due 3:30pm, Monday, November 10, 2008
You are to implement a digital I/O signal interface as follows. There are two input
signals that should be monitored by the microcontroller system. The designated input
port bits are PH.3 and PH.2, respectively. The status of the input signals should be read
at approx. 15ms intervals.The15ms timing should be generated by Output Compare
TC7 interrupts. The output signal should be generated using PWM Channel 2.The
conditions are as follows:
- if PH.3 is High and PH.2 is Low, then the output signal frequency is approx.
9KHz with 35% duty cycle,
- if PH.3 is Low and PH.2 is High, then the output signal frequency is approx.
18KHz with 65% duty cycle,
- if PH.3 = PH.2, then the PWM function should be disabled and the output
signal level may stay at either Low, or High.
1. Explain your approach for the solution to the problem by means of a flow chart. That
should include considerations to meet the timing requirements. (10pts.)
2. Develop a syntactically correct C program segment for this interface (embedded
assembly code is only allowed for masking off and enabling interrupts). The program
should run in an infinite cycle. You may assume that initially the two input signals are
at the same level and your program will have sufficient time to set signal PP.2 to low
level before the input signals may change. Choose 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 .c and .lst files, respectively, and comment on your
code for full credit. (50pts.)

Partial preview of the text

Download Microcontroller Digital I/O Interface Assignment for ECE 4510/5530 - Prof. Janos L. Grantn and more Assignments Microcomputers in PDF only on Docsity!

ECE 4510/5530 Microcontroller Applications

Fall 2008 Homework Assignment # Total: 60 pts. Due 3:30pm, Monday, November 10, 2008

You are to implement a digital I/O signal interface as follows. There are two input signals that should be monitored by the microcontroller system. The designated input port bits are PH.3 and PH.2 , respectively. The status of the input signals should be read at approx. 15ms intervals. The 15ms timing should be generated by Output Compare TC7 interrupts. The output signal should be generated using PWM Channel 2. The conditions are as follows:

  • if PH.3 is High and PH.2 is Low , then the output signal frequency is approx. 9KHz with 35% duty cycle ,
  • if PH.3 is Low and PH.2 is High , then the output signal frequency is approx. 18KHz with 65% duty cycle , - if PH.3 = PH.2 , then the PWM function should be disabled and the output signal level may stay at either Low , or High. 1. Explain your approach for the solution to the problem by means of a flow chart. That should include considerations to meet the timing requirements. (10pts.) 2. Develop a syntactically correct C program segment for this interface (embedded assembly code is only allowed for masking off and enabling interrupts). The program should run in an infinite cycle. You may assume that initially the two input signals are at the same level and your program will have sufficient time to set signal PP.2 to low level before the input signals may change. Choose 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 .c and .lst files, respectively, and comment on your code for full credit. (50pts.)