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 signal
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 should be 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, and then decrease linearly from 3 volts to 0 volts in the second half
of each period, where the total period length is 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 output 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
a. The PFG is to initially be off (no waveform generated).
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
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. The User Button should be
“debounced”, as necessary, 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 (0 to 7), indicating
which of the 8 waveform periods (OFF through 3.5s) is currently selected.
9. The digital data values of the waveform would normally be converted to analog voltages
by the microcontroller’s digital-to-analog converter (DAC). Since you will not likely have
an oscilloscope to display the waveforms, write the data values to a global variable
named “DACvalue”, and display that value in the “Logic Analyzer” window of the Keil
debugger. This will show the generated waveform, including both magnitude and
1 freelancer is bidding on average $389 for this job
I have been working in the embedded field for last 6 years working on different boards with exposure to c, c++, python and also I have knowledge of the assembly programming and also have work experience to related it.