Workings of ADC with HAL | VIDEO 24

  Рет қаралды 3,484

Matej Blagšič

Matej Blagšič

Күн бұрын

If you want to skip to hardware initialization: 22:00
If you want to skip to code: 29:40
In this video I explain the workings of ADC along with all the settings and code to make use of this peripheral. All the code is available in the Github link below:
github.com/prtzl/Embedded_vid...

Пікірлер: 8
@malehakim248
@malehakim248 Жыл бұрын
very good and informative. i wish i came across this video when i was a newbie. I figured out though that one thing that was worth mentioning is the Nyquist theorem, especially when adc'ng waveforms. It literally is a determining factor on which micro-controllers to use or avoid due to their maximum functionality of the ADC sampling capability. But am late on this and perhaps someone can find it on another video on youtube
Жыл бұрын
Yes, I agree that signal processing and analysis is an important subject that in university is covered by a few electronics and math courses as well, if we want to go into the details of why certain theorems and practical advices hold true. The software implementation is also connected to the hardware frontend, like the kind of filters you use on the input of the adc. I would recommend finding content on signal processing and analysis on youtube, which can be adapted to the STM32 adc quite easily. We're just talking about sampling time, sampling period and adc resolution and reference voltage. With these you're basicaly set. I would like to do some practical demonstration with some theory, but currently I'm limited with the gear down to a dev board and a pc. Maybe someday. Thanks for watching.
@hcovic
@hcovic 3 жыл бұрын
Hvala
@kiausiniukova2842
@kiausiniukova2842 3 жыл бұрын
Hey, thank you for this video. I have a question, so this code basically reads analog voltage and writes to an integer and next cycle it will overwrite old value. But if i want to store all data or just have all ADC readings, should i use an array instead of integer? Lets say i want to measure Sin wave for 5 sec and see all the values, is it possible with this code or should i use an array instead of your adcval integer?
3 жыл бұрын
You should create an array of (uint16_t) elements of maximum size that you need. First you need to figure out your sample rate, which has to be larger than 2 times the maximum frequency that you want to capture. This is important, or else you will not get a perfect sine wave. If your maximum frequency is 1kHz, you should sample with at least 2kHz. You can sample with interrupt using a timer which triggers one at 2kHz and read from ADC and put a value into the array, remembering your current write position, or you can connect timer to trigger ADC to perform a conversion. Then you can configure ADC to trigger interrupt when its done and do the same as before. The most elegant solution would be to have same thing as in second case, but instead of interrupt, ADC would issue DMA request. DMA would copy value to that array without disturbing you. After it's done copying a number of samples set (for 5 seconds at 2kHz sample rate is 10k samples) DMA can trigger interrupt that it's done and you can read the data. You can also make things continuous with cyclic buffer with two parts along with DMA. There are still a lot of things to think about when sampling a signal. For data flow check out my DMA video. I will make a video about sampling in the future and all the things you need to think about. Stay tuned.
@kiausiniukova2842
@kiausiniukova2842 3 жыл бұрын
@ thank you very much. Waiting for new tutorials !
@mursalaboobacker3593
@mursalaboobacker3593 Жыл бұрын
you really did the external adc with spi , can you make a video about that, it is usefull for me and others, sorrry for my poor language
Жыл бұрын
I'll find a few external ADCs around the shop. I'll make it just like the i2c example video.
Workings of GPIO with HAL | VIDEO 23
33:12
Matej Blagšič
Рет қаралды 1 М.
DMA on STM32 HAL with 2 example projects | VIDEO 36
1:03:17
Matej Blagšič
Рет қаралды 17 М.
ОСКАР vs БАДАБУМЧИК БОЙ!  УВЕЗЛИ на СКОРОЙ!
13:45
Бадабумчик
Рет қаралды 6 МЛН
Slow motion boy #shorts by Tsuriki Show
00:14
Tsuriki Show
Рет қаралды 7 МЛН
39kgのガリガリが踊る絵文字ダンス/39kg boney emoji dance#dance #ダンス #にんげんっていいな
00:16
💀Skeleton Ninja🥷【にんげんっていいなチャンネル】
Рет қаралды 8 МЛН
Measuring Signal Period With Timers | VIDEO 35
30:59
Matej Blagšič
Рет қаралды 2,2 М.
Interrupts on Cortex M - NVIC (demonstrated on STM32) | VIDEO 34
34:24
Matej Blagšič
Рет қаралды 16 М.
I Melted Wood With Friction
8:44
The Action Lab
Рет қаралды 974 М.
How Do ADCs Work? - The Learning Circuit
10:13
element14 presents
Рет қаралды 126 М.
Top Fifteen Mistakes People Make When Designing Prototype PCBs
12:26
Cosplay Light and Sound
Рет қаралды 138 М.
STM32CubeIDE basics - 10 ADC DMA TIM HAL lab
31:32
STMicroelectronics
Рет қаралды 58 М.
How input buffering works
20:25
Ben Eater
Рет қаралды 169 М.
The Rise of Unix. The Seeds of its Fall.
16:51
Asianometry
Рет қаралды 480 М.
Отдых для геймера? 😮‍💨 Hiper Engine B50
1:00
Вэйми
Рет қаралды 1,3 МЛН
EXEED VX 2024: Не өзгерді?
9:06
Oljas Oqas
Рет қаралды 48 М.
Kumanda İle Bilgisayarı Yönetmek #shorts
0:29
Osman Kabadayı
Рет қаралды 620 М.
Худшие кожаные чехлы для iPhone
1:00
Rozetked
Рет қаралды 1 МЛН
Easy Art with AR Drawing App - Step by step for Beginners
0:27
Melli Art School
Рет қаралды 15 МЛН