Please check the website to get more detailed insights about programming STM32 microcontrollers:
https://www.steppeschool.com/courses/...
Source code:
https://www.patreon.com/user?u=803997...
https://www.steppeschool.com
A practical description of designing a low-pass FIR filter and implementing it within a microcontroller from scratch.
MATLAB script to design the filter:
sampling_rate = 1000;
lpFilt = designfilt('lowpassfir', 'FilterOrder', 12, ...
'StopbandFrequency', 150, 'PassbandFrequency', ...
50, 'SampleRate', sampling_rate);
fvtool(lpFilt)
lpFilt.Coefficients
The board I am using (NUCLEO-L476RG):
https://www.st.com/en/evaluation-tool...
Accelerometer (ADXL335):
https://www.analog.com/en/products/ad...
ADC configuration:
• STM32 ADC easy implementation
Timeline graph:
• STM32CubeIde: plotting data using SWV.
Timer update interrupt:
• STM32 HAL: Timer Update Interrupt
0:00 Introduction
0:25 Designing the filter in MATLAB
3:42 Implementing the algorithm
5:52 Debugging and demonstration