Stm32 ADC Pt:3 Scan Continuous Conversion (multiple channel)

  Рет қаралды 16,979

Eddie Amaya

Eddie Amaya

Күн бұрын

Пікірлер: 50
@lucaswebb741
@lucaswebb741 8 ай бұрын
Never thought I’d find a video that makes DMA look easy for ADC, thanks for such a good video!
@folk_fox
@folk_fox 5 жыл бұрын
Great tutorial! It's really helping me, going from AVR Assembly World to STM. Things are much clearer when someone shows the minimum set of particular steps to implement one function or another. At this point I just cannot see how HAL or LL libraries can simplify the life of a new developer, because besides getting familiar with what each bit in registers does, one also need to skim through at least half of 4500 pages manual on HALL/LL to wrap his/her head around all the functions names and thier arguments that ST came up with. Your approach is more thrrough that most of STM tutorials on KZbin. Keep making your videos, they are really great! BIG THUMBS UP =)
@ecarvalho17
@ecarvalho17 5 жыл бұрын
sad but true. That is the reason why arduino has so much more space among embedded newbies
@gabiold
@gabiold 3 жыл бұрын
HAL is a mess in my opinion. It's simply too verbose and ugly, unreadable. Try libopencm3 if you want some wrapper, but not that much. The code actually looks way more like C, and it doesn't abstract away to much, it is like more descriptively named wrapper functions for accessing the registers. HW abstraction at deeply embedded level isn't that useful anyway.
@k7iq
@k7iq 4 жыл бұрын
Eddie !! I have been fighting a problem for a week now regarding my ADC1 converting 7 regular sequence channels through DMA and wondering WHY my ADC output array shifts the ADC results into different array indexes ! Your usage of L{3:0} showed me that a value of 000 really means ONE (1) CONVERSION !! I KNEW my problem had to be a mis-match of DMA and ADC1 conversion/transfer values. THANK YOU THANK YOU THANK YOU !!!!! boB
@UtsavShah_25
@UtsavShah_25 Жыл бұрын
Hello! I'm facing the same problem despite configuring the sequence length for 3 conversions(0010) and making the count value in DMA channel as 3 (DMA1_Channel1->CNDTR=3;). The values are not getting printed as per the array index value. Could you please help me with this?
@ayazdani88
@ayazdani88 5 жыл бұрын
Excellent video and programming style.
@EdwinFairchild
@EdwinFairchild 5 жыл бұрын
Thanks, subscribe!!
@constantinmarginean3644
@constantinmarginean3644 5 жыл бұрын
An excellent presentation, and very useful !
@clancymccoll4523
@clancymccoll4523 4 жыл бұрын
any chance you could publish the code somewhere I could look over?
@DeLaCruzer11
@DeLaCruzer11 2 жыл бұрын
Do you have the code for the projects in the video. I would like to study the code after watching the video to reenforced my understanding of the video presentation.
@EdwinFairchild
@EdwinFairchild 2 жыл бұрын
Sorry man at the time of these videos I was not saving any of it
@exosdel
@exosdel 2 жыл бұрын
Great, you saved my day;)
@MrLegitFlip
@MrLegitFlip 5 жыл бұрын
Can you show adcwatchdog with timers enabled to get the period or frequency of an analog signal. That would be helpful
@AS-zs7jw
@AS-zs7jw 3 жыл бұрын
Thank you very much for your another excellent video, i have implemented this code, its working fine. we wish that you should make more videos on this stm32f103c8 microcontroller. with different sensors and modules , like OLED with I2C , and other sensors.
@bennguyen1313
@bennguyen1313 4 жыл бұрын
If you have multiple channels in scan mode enabled, and you were to read the adc DR register, how do you know which channel that data corresponds to? BTW, any thoughts on using St's CubeMx/HAL to implement some of the code? For example, in CubeMx you can add a DMA for the ADC and enable continuous, scan mode. The user code would just be something like: HAL_ADC_Start_DMA (&hadc3, pBuff, uLen);
@EdwinFairchild
@EdwinFairchild 4 жыл бұрын
Well you as the programmer should know where your program is and what channel it is currently converting. Keep track of "end of conversion flags" but that is more of a race condition so I would most absolutely ALWAYS use DMA when scan and continuous are enabled. And as far as using HAL for some of the code it's all up to you and your programming style , that HAL function will jump to 10 other functions of error checking and other things until I finally ends up running the same exact code I am typing here, so with HAL you always end up with bigger code size but you have added security that it knows exactly what settings to do, even if you have no clue lol
@siddiqhabib9627
@siddiqhabib9627 3 жыл бұрын
Hi Eddie, is there any interrupt which can be triggered to indicate the DMA transfer is complete, before going again in circular mode. I was wondering how do we ensure the consistency of data, if we were to read it whenever we like.
@EdwinFairchild
@EdwinFairchild 3 жыл бұрын
Yes there is an interrupt for complete and half complete
@luigiizzo452
@luigiizzo452 5 жыл бұрын
hi, how can I use analog watchdog to monitore the ADC DRegister? (I'm working with stm32f303) ADC1->IER|=ADC_IER_AWD1; ADC1->CFGR|=ADC_CFGR_AWD1SGL; ADC1->CFGR|=ADC_CFGR_AWD1EN; NVIC->ISER[0]|=1
@brushhead
@brushhead 4 жыл бұрын
Hello Eddie have you done a tutorial on the DAC per chance?
@EdwinFairchild
@EdwinFairchild 4 жыл бұрын
I have not actually but i MUST!! soon!
@brushhead
@brushhead 4 жыл бұрын
@@EdwinFairchild it's really helped me but I'm sure you're busy frying other fish and have loads of other requests!
@EdwinFairchild
@EdwinFairchild 4 жыл бұрын
@@brushhead no lie I was legit making some fish tacos 😂😂
@balachander6930
@balachander6930 5 жыл бұрын
EDDIE CAN U SHOW HOW TO SEND THE ADC VALUE VIA UART? I TRIED SENDING THE ADC READ VARIABLE AND I'M JUST GETTING A BLANK SPACE DISPLAYED IN THE CONSOLE.
@EdwinFairchild
@EdwinFairchild 5 жыл бұрын
Because maybe your sending the value as an ASCII. So if the value is 65 for example is will display the letter A, so that's a fun programming exercise for you to work on lol
@balachander6930
@balachander6930 5 жыл бұрын
;)
@mohamedel-hadidy4844
@mohamedel-hadidy4844 4 жыл бұрын
If bucky roberts (the new boston) had a twin, it would have been you :D
@allexrolimmendes6295
@allexrolimmendes6295 5 жыл бұрын
how you do the printMsg stuff?? Whith USART right? By pooling or interruption?
@EdwinFairchild
@EdwinFairchild 5 жыл бұрын
Yes I have a tutorial on it on my channel you can find it if you go to my channel
@TheBlacksword999
@TheBlacksword999 4 жыл бұрын
Hey Eddie, I've been trying to replicate this on an STM23F4 nucleo board and I've been having some problems, the first value transfers and then the board writes the OVR bit and disables both the ADC and DMA? Any advice would be appreciated
@EdwinFairchild
@EdwinFairchild 4 жыл бұрын
I'll get back to you on that, I would have to check out the f4 RM and I'm not home right now
@EdwinFairchild
@EdwinFairchild 4 жыл бұрын
have you tried slowing down the conversions, is your SystemCore clock running fast enough, are other interrupts with higher priority going on etc... something is not letting the DMA service the ADC fast enough .. interesting dilemma you have let me know when you find a solution.. id like to hear it
@EdwinFairchild
@EdwinFairchild 4 жыл бұрын
there is a facebook group " STM32 developers" , i am there and a lot of smart guys too so maybe post the question there, let me know if you request admission and ill tell the admit to add you
@EdwinFairchild
@EdwinFairchild 4 жыл бұрын
been doing some research and it could be a DMA peripheral error or bug. Try a different DMA 1 or DMA2 set priority to high.. just throwing things out there at this point lol
@TheBlacksword999
@TheBlacksword999 4 жыл бұрын
@@EdwinFairchild Thanks for all the useful tips, my program is pretty barebones as I am working it up to final complexity and the sensor polling is the first part I'm working on. The ADC is running at 22.5 MHz, SystemCore at 180MHz.. I have no other interrupts (that I know of). I have been able to get the system to work using the SPL libraries but I can't see what is different between the final register settings between my two programs. I have sent an app to the facebook group, my name on facebook is Dhruv Goel
@yasirfaizahmed2003
@yasirfaizahmed2003 4 жыл бұрын
Can this(scan mode, continuous ) be done without using DMA transfers?
@EdwinFairchild
@EdwinFairchild 4 жыл бұрын
Perhaps, though I can't think of how right now. And how you would know which channel you're reading at any given time and you'd have to constant interrupt to do something with the data ... What would the excuse for not using DMA be?
@dominogolian7858
@dominogolian7858 4 жыл бұрын
next video about adc watchdog ? :D it would be very helpfull
@ajitem100
@ajitem100 6 жыл бұрын
Where is part2?
@EdwinFairchild
@EdwinFairchild 6 жыл бұрын
on my channel
@KhalidMBakhit
@KhalidMBakhit 5 жыл бұрын
@@EdwinFairchild Im new to this. Can you explain how can i set my core speed to 72MHz using PLL? because my MCU is running at 8MHz, since i didnt change it.
@EdwinFairchild
@EdwinFairchild 5 жыл бұрын
@@KhalidMBakhit go To edwinfairchild.com I have a tutorial on how to do it for stm32L0 should be similar to f1
@EdwinFairchild
@EdwinFairchild 5 жыл бұрын
@@KhalidMBakhit if you are using keil theit is a function to do it too
@KhalidMBakhit
@KhalidMBakhit 5 жыл бұрын
@@EdwinFairchild yes I am using keil.
STM32 UART Part 1: Datasheet overview
29:59
Eddie Amaya
Рет қаралды 17 М.
Stm32 ADC Pt:1 OverView
20:17
Eddie Amaya
Рет қаралды 30 М.
Chain Game Strong ⛓️
00:21
Anwar Jibawi
Рет қаралды 41 МЛН
Правильный подход к детям
00:18
Beatrise
Рет қаралды 11 МЛН
Set up multiple ADCs on STM32 microcontrollers using DMA
8:43
Random Rick
Рет қаралды 39 М.
Stm32 ADC Pt:2 Single Channel Continuous Conversion
18:26
Eddie Amaya
Рет қаралды 21 М.
Stm32 Intro To timers
24:34
Eddie Amaya
Рет қаралды 54 М.
GHIDRA for Reverse Engineering (PicoCTF 2022 #42 'bbbloat')
17:44
John Hammond
Рет қаралды 225 М.
STM32 ADC MULTI CHANNEL without DMA || HAL || Poll
9:22
ControllersTech
Рет қаралды 47 М.
Raycue Dock for 2024 Mac Mini M4 (Review)
8:23
Mr. Brown’s Basement
Рет қаралды 22 М.
OpenAI's o1 just hacked the system
26:31
AI Search
Рет қаралды 51 М.
How to use ADC in STM32 Microcontroller- Read Analog Sensor Value
17:32
Новый год 2025 на ТНТ "ComedyVision!" @ComedyClubRussia
1:16:57
Chain Game Strong ⛓️
00:21
Anwar Jibawi
Рет қаралды 41 МЛН