Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

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

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

Is there anyone out there that can right a program like this in Assembly code in Keil. Not in C language but actual assembly language for the stm32f407 discovery board?? Assembly is for keil. Righting it in C (.c file ) will not be helpful it has to be in Assembly (asm.s file)

Thanks in advance!

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image
Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Excel As Your Database

Authors: Paul Cornell

1st Edition

1590597516, 978-1590597514

More Books

Students explore these related Databases questions