STM32F4 Discovery board - Keil 5 IDE with CubeMX: Tutorial 6 ADC Multi channels - Updated Nov 2017

  Рет қаралды 38,286

Mutex Embedded

Mutex Embedded

6 жыл бұрын

This video shows how to implement ADC Multi channels mode, where you have multiple Analog inputs, using 3 different methods:
1) CubeMX
2) HAL Library
3) Direct register access
Source code for HAL + Direct register (as a text file):
drive.google.com/open?id=10bK...

Пікірлер: 50
@OhGee7809
@OhGee7809 5 жыл бұрын
Can you please do a tutorial on how to implement DSP functions (FFT, FIR filter, etc)
@Graham1904
@Graham1904 4 жыл бұрын
Great tutorial. Why declare adcValArray as 8-bit in the setup and then cast it to a 32-bit array in the HAL ADC command?
@msh6783
@msh6783 3 жыл бұрын
ممنونم محمد عزیز. بسیار آموزنده بود.
@mutexembedded2206
@mutexembedded2206 3 жыл бұрын
خواهش میکنم
@Bianchi77
@Bianchi77 2 жыл бұрын
Nice video, keep it up, thank you :)
@alvianauditio8175
@alvianauditio8175 4 жыл бұрын
Hey thanks for the tutorial, its very helpful :)). I want to ask a question though. I'm currently working on a project to drive a firing angle of 3 thyristor through 3 IC's for 3 phase project and i need the DAC to drive theese 3 IC's. Instead of using 3 DAC's port can i use just one DAC port and parallel it to create 3 more DAC output with same level of voltage?? And if not, how to add more DAC output port?? Thanks
@VishalVerma-sz2zu
@VishalVerma-sz2zu 5 жыл бұрын
can you please post a tutorial on how to interface a camera and record & playback of sound using the discovery board.
@pagedavid4344
@pagedavid4344 4 жыл бұрын
At 18:17, DMA_HandleTypeDef myDMAtypeDef; should be defined as global. Otherwise, this handle is not accessible in HAL_ADC_Start_DMA(). This is corrected in source code in description, also at 22:41 of the video.
@mesesamboby
@mesesamboby 6 жыл бұрын
Hi, I am trying to read data from 4 sensors using a 12-bit resolution, therefore my adcArray[] is of type uint16_t. Additionally, that means that my DMA reading was changed to: HAL_ADC_Start_DMA(&hadc1, (uint32_t *)adcValArray, 8); I also tried connecting only one channel, and while i was debugging, the other 3 channels had readings(erronate ones). The thing is: the reading seems to be incorrect. What can i do in this situation?
@BudiKustamtomo
@BudiKustamtomo 4 жыл бұрын
how to change resolution bit adc if i use stmcubemx 5.1
@RahulSingh-wq3sr
@RahulSingh-wq3sr 5 жыл бұрын
Great videos sir. one doubt, why don't you define dma irqHandler here as you do in Uart tutorial video.
@rohithr6462
@rohithr6462 3 жыл бұрын
Can we do ADC multi channel using interrupt (without DMA and Pol)
@gerarddonnelly5092
@gerarddonnelly5092 4 жыл бұрын
I've copied this exactly. the program compiles and downloads without errors. When I add the array to watch it doesn't give me the option to expand and when I move the POT it doesn't change the value of the visible Channel 0. Any advise? If I change the declaration from uint8_t to uint32_t it works fine but the results I get are weird...
@manjurohila4248
@manjurohila4248 4 жыл бұрын
dear yaqoob first thanks for your video . I am using stm32f030k6t6 . tried your code single Chanel is working good but multiple channel get same value on both variable . and CubeMx setting I haven't find rank1 rank2. please help me. thanx .
@user-qp4gs4ky8h
@user-qp4gs4ky8h 6 жыл бұрын
Hi Mohamed! Could you please tell me what HandleTypeDef means @13:30? I'm an MCU beginner and find your tutorials very helpful. But I still can't understand what HandleTpyeDef is. Thank you for your help!
@mutexembedded2206
@mutexembedded2206 6 жыл бұрын
邱晓杰 Hi mate, HandleTypeDef acts similar to a structure in C. It just holds values for certain fields. For example Struct student { int StudentID; int SeatNo; }; Then Student.SeatNo= 34; and so on just review Structure in C programming. A typeDef works in a similar way. Hope this clarifies it a bit more.
@cristobalcanarte7262
@cristobalcanarte7262 6 жыл бұрын
Hi, first of all excellent video, and I have a doubt, I want to know if its possible to fill up a buffer, 4095 values, variable, using just one ADC channel with the DMA, how could I configure that?
@mutexembedded2206
@mutexembedded2206 6 жыл бұрын
Hi Cristobal, Thanks! Yes, it is possible; you need to set the DMA to normal mode (i.e. not circular), enable memory increment and simply start DMA asking for 4095 data size. This will get you 4095 consecutive data points of your single channel and store them in your array/buffer. All the best :)
@aryosandi
@aryosandi 4 жыл бұрын
Exusme why not get value?
@hasanyahyaoglu9168
@hasanyahyaoglu9168 5 жыл бұрын
Hi, Is it possible to get multiple values with dma and timer? Thanks
@mutexembedded2206
@mutexembedded2206 5 жыл бұрын
yes
@bysanilikhitha4265
@bysanilikhitha4265 6 жыл бұрын
how do I just store just one adc values for 0-3v into array without cubeMX or HAL
@mutexembedded2206
@mutexembedded2206 6 жыл бұрын
bysani likhitha Hi, Did you watch the last part of Tutorial 3? There I've shown how to use ADC without CubeMX nor HAL. For 0 to 3v, you need to scale the decimal value according to resolution; for 8 bits, 0 to 255 convert it to 0 to 3 volts range. Good Luck
@coolchriss
@coolchriss 2 ай бұрын
Cool, I have the MCU stm32f030k6t6, the configuration in stm32cubemx is a little different, can you help!?😊❤
@ismailadam4505
@ismailadam4505 3 жыл бұрын
Just a general question.... What is the maximum Sampling time that is possible? I experience a nice output converted at a sampling frequency below 20kHz, but I got a pile of rubbish at a sampling frequency above that... All I work with 8-bit means the Tconv_c is around 9 Clk and APBH frequency of 84MHz...
@mutexembedded2206
@mutexembedded2206 3 жыл бұрын
You can get very fast sampling time, just need to make sure it is sufficient for Sample/Hold circuit to do its job with the given capacitance value and PCB impedance. There is a simple RC 1st order ODE that you can solve for.
@benahmedabdelmalek9008
@benahmedabdelmalek9008 Ай бұрын
how many ohms for potentiometer ?
@viveksrivastava1506
@viveksrivastava1506 4 жыл бұрын
Thank you for sharing this video. I'm using 10 bit ADC resolution but still my result is coming in 8 bit range. I'm using 16 bit variable to store the adc result: uint16_t ADC_Value[2]; and below DMA settings. myDMA.Init.MemDataAlignment = DMA_MDATAALIGN_HALFWORD; myDMA.Init.PeriphDataAlignment = DMA_MDATAALIGN_HALFWORD;
@mutexembedded2206
@mutexembedded2206 4 жыл бұрын
Alright, that could some sort of casting problem. make sure your end destination variable is uint16_t
@fehimkus5658
@fehimkus5658 5 жыл бұрын
hello mohammed I just want to ask about my problem. When I try the watch in debug session, my second and third potentiometer changing between 0-7 something like that. What should I do? Please help :)
@mutexembedded2206
@mutexembedded2206 5 жыл бұрын
Hi Fehim, Can you give me more information about your set up and some screenshots for your cubemx pinout and ADC configuration tab.
@fehimkus5658
@fehimkus5658 5 жыл бұрын
I did not use cubemx. My board is STM32F429ZIT and I used a x-y joystick you can find in file which i attach below. Main code and a screenshot also there. 1drv.ms/f/s!AhdWh9r7qarIgYZmfydJQsl-Us1FCg please ask me if something not clear for you. Thank you for all
@bysanilikhitha4265
@bysanilikhitha4265 6 жыл бұрын
Can I get the text file for the code please..
@mutexembedded2206
@mutexembedded2206 6 жыл бұрын
Just updated it,, you should see the source code down in the description. good luck :)
@arunkumarretech4983
@arunkumarretech4983 5 жыл бұрын
@MYaqoobEmbedded. I had been trying to use multichannel analog for two analog channels but in the end, I get the first channel is reaching the maximum value of 255, not the second channel. could you help me, please?
@mutexembedded2206
@mutexembedded2206 5 жыл бұрын
Hi, do you still have this issue?
@arunkumarretech4983
@arunkumarretech4983 5 жыл бұрын
@@mutexembedded2206 Yeah. I tried your code also but it's also having the same issue.
@mutexembedded2206
@mutexembedded2206 5 жыл бұрын
Can you describe the hardware and the issue in more details
@arunkumarretech4983
@arunkumarretech4983 5 жыл бұрын
@@mutexembedded2206 I'm using STM32F429 discovery board. I'm trying to read multiple analog inputs. There is no issue with code and it's flow. Everything seems to be good. The 0th index of the array shows maximum value and it varies when the pot varies but the 1tn index of the array is not showing the maximum value and doesn't vary when the pot varies.
@mutexembedded2206
@mutexembedded2206 5 жыл бұрын
First thing to check is conversion rank settings at 04:45
@WalidIssa
@WalidIssa 4 жыл бұрын
Does enabling FIFO speed it up ?
@mutexembedded2206
@mutexembedded2206 4 жыл бұрын
Yes, in the sense that you no more need to poll for each channel.
@isaaccesar8486
@isaaccesar8486 2 жыл бұрын
I know im asking the wrong place but does any of you know a method to get back into an Instagram account?? I was dumb lost the login password. I would love any tips you can give me!
@landrydominic412
@landrydominic412 2 жыл бұрын
@Isaac Cesar Instablaster :)
@isaaccesar8486
@isaaccesar8486 2 жыл бұрын
@Landry Dominic thanks so much for your reply. I got to the site through google and I'm waiting for the hacking stuff atm. Seems to take a while so I will reply here later when my account password hopefully is recovered.
@isaaccesar8486
@isaaccesar8486 2 жыл бұрын
@Landry Dominic it did the trick and I actually got access to my account again. I am so happy:D Thank you so much, you saved my ass!
@k7iq
@k7iq 5 жыл бұрын
This is kind of interesting, maybe. Working on ADCs on STM32F446 and I see this in the user manual. Do you think they made a typo error on DISABLED vs. ENABLED ? Bit 10 ADC3EN: ADC3 clock enable This bit is set and cleared by software. 0: ADC3 clock disabled 1: ADC3 clock disabled Bit 9 ADC2EN: ADC2 clock enable This bit is set and cleared by software. 0: ADC2 clock disabled 1: ADC2 clock disabled Bit 8 ADC1EN: ADC1 clock enable This bit is set and cleared by software. 0: ADC1 clock disabled 1: ADC1 clock disabled Bits 7:6 Reserved, must be kept at reset value. Bit 5 USART6EN: USART6 clock enable This bit is set and cleared by software. 0: USART6 clock disabled 1: USART6 clock enabled
@mutexembedded2206
@mutexembedded2206 5 жыл бұрын
Could be
마시멜로우로 체감되는 요즘 물가
00:20
진영민yeongmin
Рет қаралды 31 МЛН
Nutella bro sis family Challenge 😋
00:31
Mr. Clabik
Рет қаралды 14 МЛН
Heartwarming moment as priest rescues ceremony with kindness #shorts
00:33
Fabiosa Best Lifehacks
Рет қаралды 37 МЛН
아이스크림으로 체감되는 요즘 물가
00:16
진영민yeongmin
Рет қаралды 59 МЛН
STM32 ADC MULTI CHANNEL without DMA || HAL || Poll
9:22
ControllersTech
Рет қаралды 43 М.
STM32 ADC multiple channels || DMA || True studio || CubeMx
15:47
ControllersTech
Рет қаралды 67 М.
HAL #13: ADC with DMA
10:15
Web learning
Рет қаралды 40 М.
stm32 timed multichannel ADC DMA conversions on STM32F030k6
12:06
STM32 Nucleo - Keil 5 IDE with CubeMX: Tutorial 4 - ADC Multi mode
12:05
Отдых для геймера? 😮‍💨 Hiper Engine B50
1:00
Вэйми
Рет қаралды 1,2 МЛН
Top 50 Amazon Prime Day 2024 Deals 🤑 (Updated Hourly!!)
12:37
The Deal Guy
Рет қаралды 1,4 МЛН
Todos os modelos de smartphone
0:20
Spider Slack
Рет қаралды 58 МЛН
Что делать если в телефон попала вода?
0:17
Лена Тропоцел
Рет қаралды 851 М.