STM32F4 Discovery board - Keil 5 IDE with CubeMX: Tutorial 5 ADC TIM Trigger - Updated Nov 2017

  Рет қаралды 31,997

Mutex Embedded

Mutex Embedded

Күн бұрын

Пікірлер: 36
@linghaozhou4695
@linghaozhou4695 5 жыл бұрын
Thank you very much for uploading the video, it is very helpful! I do have a question though - what are the differences between using TIM to setup the real ADC sampling rate, or using continuous ADC mode but set the sampling cycles? If they are the same then which one do you recommend or prefer? Thanks!
@kaaneren4996
@kaaneren4996 6 жыл бұрын
Hey! thanks for this perfect tutorial. I have question. You are defining (copying) the callback function in the main.c but never use it in the infinite loop. Is it becouse it's a interrupt service subroutine? hımm. its running in the back and adc value updates itselft automatically in every 100ms (thanks to timer int.) I think i figured it out when i am asking you :) thank you anyway :)
@mutexembedded2206
@mutexembedded2206 6 жыл бұрын
Kaan EREN Nice one.
@serkansonel1242
@serkansonel1242 4 жыл бұрын
Hey! Thank you for tutorial. I just want to ask can we use input capture as a trigger ? Because in video you are saying we can use output compare with no out and basic time elaps for trigger. I confused there, can i use input capture too ?
@AshokRajpilli
@AshokRajpilli 5 жыл бұрын
Hi @MYaqoobEmbeed, What is the need of setting sampling time to 28 cycles when you are configuring ADC with Timer?
@rashmiiyer7078
@rashmiiyer7078 5 жыл бұрын
Thank you for some great stuff. However, I am looking to generate audio using PWM using the STM32F103. I would like to generate 125 kHz PWM using the Timer 1. A buffer from the SDcard will be loaded and then, using the Timer2, would like to trigger the DMA to transfer data from the buffer to the Duty cycle register of the Timer1 at 44.1 kHz. Can you please help me in this?
@mutexembedded2206
@mutexembedded2206 5 жыл бұрын
Interesting! I have not done this implementation before, but seems feasible to me.
@googlable
@googlable 5 жыл бұрын
Thanks, great video! I have a problem though, that changing the Counter Period affects only the first callback time... After that it becomes 100-200 ms. I'm using DMA though not an interrupt, and my ADC has 3 channels. Can you assist?
@babotvoj
@babotvoj 4 жыл бұрын
is ti possible to use timer 6, because there is no timer 6 out event option to be selected
@mutexembedded2206
@mutexembedded2206 4 жыл бұрын
Yes you can use other timers for ADC, you can find those in CubeMX as options
@ferdinvivian9336
@ferdinvivian9336 6 жыл бұрын
Hello sir, I'm learning to program from your videos.. Really very helpful.. Thanks a lot for your work.. Can you please tell me, How to filter the required steps to program... For example, in this example you are using ADC.int and ADC.channel for ADC and Timer.Init and Timer.master For Timer.. How are you using only these 2 functions.. Which manual you are using sir. Or you are using CubeMx 1st and decoding the required steps(FUNCTIONS) from cubeMx for programming using CMSIS
@mutexembedded2206
@mutexembedded2206 6 жыл бұрын
Ferdin Vivian Hi, Not entirely sure if I got ur question, but my set up is using HAL library + CubeMX
@ferdinvivian9336
@ferdinvivian9336 6 жыл бұрын
Sir, My question is, Under Timer Config function some features for Timer has been enabled manually in 2nd method using CMSIS.. How do you know to enable those features sir.. for example: TIMER.Init, Timer.clocksource, Timer.Mastermode .. Why cant you enable any one.. How do you know if you enable all 3 then only we will get our required output sir..
@totomanrecai
@totomanrecai 6 жыл бұрын
Is there any diffrence between IN0 and IN1 in ADC1?
@mutexembedded2206
@mutexembedded2206 6 жыл бұрын
Furkan Smg Basically, IN0 is channel 0 IN1 is channel 1.. but both can be part of ADC1
@hussienkazan2590
@hussienkazan2590 6 жыл бұрын
THANKS FOR THE VIDEOS, WHAT IS THE LED ROLL HERE?
@baptistecadenel9496
@baptistecadenel9496 5 жыл бұрын
Hi, I'm trying to use a PWM as a trigger of my adc but it's doesn't work at all.. Can you help me pls ? Thanks a lot ! Your video are very helpful !
@sagarchavanr
@sagarchavanr 5 жыл бұрын
Hello Sir, Thanks for the wonderful tutorial. I have been following your tutorial from last month and it really helpful for me. As I am working on STM32F334 Nucleo board I am facing some problems while implementing same steps using STM32CubeMX. In my project, I am using PA0(Analog In), PC13 (GPIO EXTI to start A to D conversion), TIM2 (to get adc values after every 1ms delay), PB5 (GPIO EXTI to stop A to D conversion and Display sum of collected analog values) and USART2 (in asynchronous mode) Sir, Delay between PC13(Start ADC) and PB5(Stop ADC) is 5ms. But I must get 5 analog values after every 5ms. But I am not getting the values. Please guide me regarding that. As such tutorial is not available I am facing difficulties in it. I can send you my code files to you. Please help...
@tailordhaval
@tailordhaval 4 жыл бұрын
Hello Sir. Very nice tutorial. In my application, I call timer subroutine at every 1ms and during that time I have to take the ADC sample. Then how I can do these.
@gmmaia11
@gmmaia11 6 жыл бұрын
Hey again! I am following your previous sugestion and I am using the Timer like you explain in this video. It´s working fine for now, thanks! 3 questions about this video: - How does the timer works? It counts a certain number of clock cycles (in this case 100, right) and the creates an interrupt to make the ADC start converting? - Why do you have to copy the HAL_ADC_ConvCpltCallback to the main? And where is this function called? - In this example, why do you need to increase the sampling time in the ADC? Thank you in advance, and again, great video!
@mutexembedded2206
@mutexembedded2206 6 жыл бұрын
Hi Maia, First of all, good to know you're finding the videos helpful. For the timer Interrupt working principle, we control the timer using 2 main parameters; 1) Prescalar, 2) Period -The prescalar scale the clock down by APB_ClkFreq/ (Prescalar + 1) -Period, is just a counter, it counts for 0 to Period And when the period ARR counter finishes, it call the period elapsed callback function "HAL_ADC_ConvCpltCallback", which is pre-defined in the HAL library as __weak so that you can re-write it in your application (e.g. main.c). So, if APB clock Frequency is 16Mhz. -> Prescalar = 2 - 1; Timer_Freq = 16/(Prescalar+1) = 16/2 = 8MHz -> Period = 100-1; Timer Freq = 8M/(Period + 1) = 8M/100 = 80Khz
@gmmaia11
@gmmaia11 6 жыл бұрын
Also, I came across one problem. Everything inside the while(1) in the main does not accur, and I cannot understand why? Does the program get there at all?
@gmmaia11
@gmmaia11 6 жыл бұрын
MYaqoobEmbedded sorry to botter you so much, but do you have any ideia why is this happening? Why my program never gets to the infinite while(1) in my main? I did a prigram just like your using Cube MX. Thanks again!
@imranekibria8374
@imranekibria8374 4 жыл бұрын
Asalam o Alikum. I am trying to configure timer triggered dual regular simultaneous adc with dma double buffer as part of my university project. Will you be willing to provide me some guidance?
@kenwallace6493
@kenwallace6493 4 жыл бұрын
I can't help but think how useful these videos would be if direct register writes were used instead of HAL. Yes, an intimate relationship with the device spec and reference manual are required but it's better, in my opinion than second-guessing hundreds of HAL functions and wondering exactly what's going on.
@mutexembedded2206
@mutexembedded2206 4 жыл бұрын
Hi Ken, Agree to many extent, especially for Students
@rohitpatil4785
@rohitpatil4785 6 жыл бұрын
Hello bro, thanks for this tutorial, I have try to read this adc value using UART. So it is possible for this timer trigger using adc tutorial.let me know thanks .
@David-nk7pv
@David-nk7pv 5 жыл бұрын
Hi, great tutorial but I don't understand why you defined the function HAL_ADC_ConvCpltCallback but then it's never called in Main? can anyone explain
@David-nk7pv
@David-nk7pv 5 жыл бұрын
@Ananda V T Padmanabhan Thank you :)
@eamonhannon1103
@eamonhannon1103 3 жыл бұрын
Really good !
@pranken90
@pranken90 3 жыл бұрын
이 아자씨 개 유익함
@mohamadali6174
@mohamadali6174 5 жыл бұрын
Great
龟兔赛跑:好可爱的小乌龟#short #angel #clown
01:00
Super Beauty team
Рет қаралды 67 МЛН
兔子姐姐最终逃走了吗?#小丑#兔子警官#家庭
00:58
小蚂蚁和小宇宙
Рет қаралды 9 МЛН
Fake watermelon by Secret Vlog
00:16
Secret Vlog
Рет қаралды 26 МЛН
Hands-On with STM32 Timers: Trigger Periodic ADC Conversions
13:27
STMicroelectronics
Рет қаралды 28 М.
Why Agent Frameworks Will Fail (and what to use instead)
19:21
Dave Ebbelaar
Рет қаралды 75 М.
龟兔赛跑:好可爱的小乌龟#short #angel #clown
01:00
Super Beauty team
Рет қаралды 67 МЛН