Workings of ADC with HAL | VIDEO 24

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

Matej Blagšič

Matej Blagšič

Күн бұрын

Пікірлер: 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.
@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 !
@hcovic
@hcovic 4 жыл бұрын
Hvala
@mursalaboobacker3593
@mursalaboobacker3593 2 жыл бұрын
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
2 жыл бұрын
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,1 М.
DMA on STM32 HAL with 2 example projects | VIDEO 36
1:03:17
Matej Blagšič
Рет қаралды 19 М.
小丑教训坏蛋 #小丑 #天使 #shorts
00:49
好人小丑
Рет қаралды 54 МЛН
Cheerleader Transformation That Left Everyone Speechless! #shorts
00:27
Fabiosa Best Lifehacks
Рет қаралды 16 МЛН
Что-что Мурсдей говорит? 💭 #симбочка #симба #мурсдей
00:19
Using I2C for any device on STM32 with HAL | VIDEO 26
37:51
Matej Blagšič
Рет қаралды 82 М.
How to use an ADC (embedded example in C)
14:56
Jacob Sorber
Рет қаралды 31 М.
STM32CubeIDE basics - 10 ADC DMA TIM HAL lab
31:32
STMicroelectronics
Рет қаралды 61 М.
Renesas RL78 ADC Coveter in CS+ IDE PART1
20:38
Shaan's TechByte Embedded Solution
Рет қаралды 1,7 М.
Turn your Pico into a 400MHz 24 Channel Logic Analyser
25:26
Happy Little Diodes
Рет қаралды 73 М.
3 engineers race to design a PCB in 2 hours | Design Battle
11:50
Predictable Designs
Рет қаралды 576 М.
小丑教训坏蛋 #小丑 #天使 #shorts
00:49
好人小丑
Рет қаралды 54 МЛН