0% found this document useful (0 votes)
242 views

Final Project

The document outlines requirements for a semester design project to create a programmable function generator using an STM32F4 microcontroller board. The function generator must generate sawtooth and triangle waveforms at 7 selectable frequencies from 0.5s to 3.5s. The user button cycles through frequencies and toggles waveform type. An interrupt handler responds to button presses. The waveform is output through DAC conversion to pin PA4 and displayed in a debugger window. Students must submit code, screenshots, and demonstrate their working project for grading based on requirements satisfaction, design quality, and documentation.

Uploaded by

api-272316183
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
242 views

Final Project

The document outlines requirements for a semester design project to create a programmable function generator using an STM32F4 microcontroller board. The function generator must generate sawtooth and triangle waveforms at 7 selectable frequencies from 0.5s to 3.5s. The user button cycles through frequencies and toggles waveform type. An interrupt handler responds to button presses. The waveform is output through DAC conversion to pin PA4 and displayed in a debugger window. Students must submit code, screenshots, and demonstrate their working project for grading based on requirements satisfaction, design quality, and documentation.

Uploaded by

api-272316183
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

ELEC 2220 Semester Design Project

Due at time of last class: Friday, July 25


Using the STM32F4-Discovery Board, you are to design a Programmable Function Generator
(PFG) capable of producing two different electrical signal waveforms at seven different
frequencies. The PFG is to meet the following requirements.
1. Two different waveforms are to be generated, as selected by the user.
a. Sawtooth the signal is to rise linearly from 0 volts to 3 volts during each time
period of length T.
(This is the default waveform after the system is reset.)
b. Triangle the signal is to rise linearly from 0 volts to 3 volts in the first half of
each period T, and then decrease linearly from 3 volts to 0 volts in the second
half of each period T.
2. Each period of the waveform is to comprise 100 data points, spaced evenly across the
period. The data are to be 12-bit unsigned numbers, ranging from 0 to 4095. These
correspond to voltages from 0v to 3v, respectively.
3. There is to be an off condition (no generated waveform) plus seven user-selectable
waveform periods: [OFF, 0.5s, 1.0s, 1.5s, 2.0s, 2.5s, 3.0s, 3.5s]. These periods must be
accurate to the nearest microsecond (thus requiring the use of a programmable timer.)
4. All timing is to be produced by periodic interrupts from Timer 6 on the microcontroller.
5. The waveform period and type are to be selected with the User Button on the board as
follows.
a. The PFG is to initially be off.
b. Each push of the button selects the next period in the list:
[OFF, 0.5s, 1.0s, 1.5s, 2.0s, 2.5s, 3.0s, 3.5s]
c. Allow time for the period to be examined before pressing the button again.
d. However - if the button is pressed twice within a 2-second interval, the
waveform type is to be changed to the other format (Sawtooth to Triangle, or
vice-versa).
6. The User Button is to trigger an interrupt each time it is pressed all responses to the
User Button should be done by an interrupt handler. If necessary, the User Button
should be debounced, to prevent more than one action per button press.
7. The blue LED is to blink at the rate of the selected waveform period.
8. LEDs 4-3-5 (green-orange-red) are to display a 3-bit binary number, indicating which of
the 8 waveform periods (OFF through 3.5s) is currently selected.

9. The digital data values of the waveform are to be converted to analog voltages by the
microcontrollers digital-to-analog converter (DAC). The DAC output to be connected to
GPIOA pin PA4.
10. The data written to the DAC is also to be written to a global variable named DACvalue,
which is to be displayed in the Logic Analyzer window of the Keil debugger. This will
show the generated waveform, including both magnitude and frequency.
For extra credit replace the triangular waveform with a sinusoidal waveform, oscillating
between 0 and 4095.

=========================================================================
In the final class period of the semester, you are to submit a one to two-page description of
your program design, a printout of the assembly language source file, and screen captures of
the logic analyzer window, showing at least two frequencies for each waveform.
Also, email me an electronic copy of your program(s).
Finally, bring the programmed board to my office for a demonstration. I will have the Logic
Analyzer open to display variable DACvalue (therefore I will need to compile your source
program before connecting to your board). I will also have an oscilloscope connected to pin PA4
to view the generated waveform.

Your design will be graded against three criteria.


1. The degree to which the program satisfies the above requirements. (Partial credit will
be given, as appropriate, in the event that the design does not meet all requirements.)
2. The quality of the design, including such factors as modular design and effective use of
ARM assembly language features.
3. Documentation, including effective use of comments throughout the program and a
block diagram or flow chart describing the basic system design.

You might also like