Set the function generator to generate 0-3V peak-to-peak (positively shifted 1.5V DC) sinusoidal

signal with the frequency 0.01fs (fs - specified sampling rate). Before connecting a function
generator to your development kit, connect the output of the function generator directly to
the oscilloscope and verify your signal. Demonstrate your signal to instructor.
Configure the ADC in 12-bit right-aligned, single-channel, continuous conversion mode. Enable
channel 2 of the microcontroller DAC. Configure timer TIM7 to generate interrupts with the
specified sampling rate fs.
In TIM7 period elapsed ISR implement the specified moving average filter (get the sample from the
ADC, compute filter output, and update DAC data register with the result using 12-bit right-aligned
mode).
Connect the output of the function generator to the ADC input via 1k resistor. Run your program
and observe the DAC output with an oscilloscope. Increase the frequency of the input signal with
0.01fs increment and complete Table 1 for 16 input frequency values starting from fin = 0.01fs.

fs= 10000hz
filter: 10-point

To set up the given scenario, follow the steps below:

1. Connect the function generator output directly to the oscilloscope to verify the signal. Adjust the settings of the function generator to generate a sinusoidal signal with a peak-to-peak amplitude of 0-3V (positively shifted 1.5V DC) and a frequency of 0.01fs, where fs is the specified sampling rate.

2. Configure the ADC (Analog-to-Digital Converter) in the microcontroller to operate in 12-bit right-aligned, single-channel, continuous conversion mode. This mode ensures that the ADC continuously samples and converts the analog input signal.

3. Enable channel 2 of the microcontroller DAC (Digital-to-Analog Converter). This will allow the DAC to generate the filtered output signal.

4. Configure timer TIM7 to generate interrupts with the specified sampling rate fs. This timer will trigger an interrupt periodically to initiate the sampling and filtering process.

5. In the TIM7 Period Elapsed interrupt service routine (ISR), implement the moving average filter. This involves obtaining a sample from the ADC, computing the filter output using a 10-point moving average, and updating the DAC's data register with the filtered result. Make sure to use the 12-bit right-aligned mode for the DAC.

6. Connect the output of the function generator to the ADC input via a 1k resistor. This resistor acts as a voltage divider to protect the microcontroller from potential damage due to excessive input voltages.

7. Run your program and observe the DAC output with an oscilloscope. The DAC will generate the filtered output signal. By increasing the frequency of the input signal with a 0.01fs increment, complete Table 1 for 16 input frequency values, starting from fin = 0.01fs. This table will contain the input frequency values and the corresponding filtered output signals obtained from the DAC.

Remember to follow proper safety precautions and consult the documentation of your specific microcontroller and function generator for detailed instructions on configuring and connecting the devices.