Hi,
HAL delay is not the way to go. It consumes all processing power and in case you want to process something you cause the sampling frequency to jitter and to get unprecise.
I think I never used this or similar method in the past 30 years...
In an project we do:
* 8 ch ADC sampling, continously and precise, 8 channels FIR filtering, storing, and displaying
* 115kbaud full duplex communication on one UART with PC
* 1MBaud sensor bus on another UART
* slow bus on a third UART communiating with several devices
* continously communicating with PLD, 3 IO extenders, 2 Flash memories, RTC, NVRam, display via one SPI bus
* software clock, a control loop, runing every 10ms, other jobs every ms
* calculations, plausibility checks,
Mind: all at the same time, not missing a single bit at each bus or ADC...
On an STM32F107, 72MHz
All this with just 5% processing power! 95% of time the microcontroller is in sleep mode to save power.
There's no need for you to do the same. I just want to give you an idea how powerful nowadays microcontrollers are....when you use the features.
Klaus