My past experience has been in electronics design, but my current role involves writing firmware for STM32 MCUs - your videos have been incredibly helpful, thank you!!
@MclarenF1rocket4 жыл бұрын
super helpful - got my ADC up and running in no time, thanks !!
@justintaylor24824 жыл бұрын
Thank you Sir for some really great building blocks!!!
@anannyaguha94876 жыл бұрын
I am so happy that I learnt a lot from it. Thank You so very much
@artsrunmargaryan29205 жыл бұрын
When you are working with cubemx, after changing something in cube and regenerating the project don't forget to delete sConfig declaration from MX_ADC1_Init function. Because even it keeps your global variable but also generating it in MX_ADC1_Init scope. So you'll have 2.
@MrVouligny2 жыл бұрын
thank you soooo much for this comment!
@silsilah-naqshband6 жыл бұрын
Very nice explanation. Please keep it up. And thank you so much for sharing your knowledge. It really helps a lot.
@mutexembedded22066 жыл бұрын
Abdul Rehman Thanks Abdul
@fxasusnotebook4 жыл бұрын
Thanks so much Mr. Muhammad you save my life by this video
@Graham19044 жыл бұрын
Audio on max, headfones on loud and it is still quiet compared to other KZfaq videos. Great what you can hear
@mc33594 жыл бұрын
At 3:17, the term "sampling time" is misleading. This is actually referring to sample & hold (S&H) time of ADC's front-end . S&H time allows the S&H circuit to charge up the internal capacitor (usually in few pf) as much as possible to minimize amplitude error. The time required is usually 10x to 20x of RC time constant, where R is the external source impedance and C is the internal S&H capacitance. Whereas the ADC Clock cycles are referring to number of cycles required for the ADC logic to convert the analog value of capacitor to digital value. For SAC (successive approximation converter) it is at least 1 cycle per bit. So, sampling time and ADC cycles are two different concepts.
@mutexembedded22064 жыл бұрын
Hi, You are correct
@rahulmoorkoth23956 жыл бұрын
Good job. keep doing!
@fabioalmeida47002 жыл бұрын
Hello, great video. Congrats.
@malikjavadov366 Жыл бұрын
this video is so crytal clear!
@jonasmenondarosa27305 жыл бұрын
Thank you very much, you help me a lot.
@RanCohenDrummer2 жыл бұрын
Thank you!!
@ElectricMilesLLC4 жыл бұрын
YOU JUST EARNED YOURSELF ANOTHER SUBSCRIBER. HAHA, IM STIL IN CAPS FROM TYPING ALL OF THE HAL_ FUNCTIONS.
@mutexembedded22064 жыл бұрын
Hi! Enjoy :)
@joshuaplank8832 ай бұрын
thanks this series has been really helpful! do you have any idea how to 'watch' variables in the new version?
@alihafiz46955 жыл бұрын
thanks for this video
@haiderattar8573 жыл бұрын
Thanks for this video. However, I believe the Joystick you used is a 5vdc. The STM32 is 3.3v. Won't this cause a damage? Have you used a voltage divider?
@mekbots76073 жыл бұрын
I did same ,first Chanel is ok ,when I add second Chanel,both Chanel get same data with first Chanel pot
@dajianghe2 жыл бұрын
STM G4 chip has OPAMP. Have you done any intro of combining OPAMP with ADC?
@shujaulhind38776 жыл бұрын
YOUR VIDEOS ARE QUITE AWESOME I LEARNED A LOT. CAN U PLEASE TELL ME WHICH PINS TO CONNECT TO JOYSTICK AND IF JOYSTICK IS NOT AVAILABLE WHAT ELSE CAN I USE IN ITS PLACE
@mutexembedded22066 жыл бұрын
Hi, You can use a Potentiometer (Variable resistor)
@ZA-fo2rn4 жыл бұрын
how did u choose the adc clock ?
@KBera6 жыл бұрын
Why 28 cycles for 8 bit resolution?
@lukaspetrikas63202 жыл бұрын
This same method does not seem to work on STM32L701
@sinha....10 ай бұрын
I am getting "target is not responding, retrying " i am using stm32cubeide and my board is stm32l152c
@monroekass6 жыл бұрын
The values that are reading from the ADC channels, where are they coming from?
@mutexembedded22066 жыл бұрын
Hi mate, Thumb Joystick Analog Input (X and Y), Mentioned that at 00:30
@artemmishenko24505 жыл бұрын
What pins do you use on the board for x and y?
@electronicsguy86093 жыл бұрын
i dont quite know which pins of the joystick is connected to which pins of the stm32 board :/
@m-jt7cd3 ай бұрын
Hey, if you dont mind, id have a question concerning this topic. Currently i am working on a project using stm32 and an ADS131 ADC (TexasInst). After developing and designing a pcb for this project i have to code the communication between ADC and MCU. I have basic C knowledge and very very basic (barely no xd) knowledge in programming MCUs. if you generate code from cubeMX, many files (main.c, stmxy.c, main.h, etc.) are created. It is pretty hard for me to see through this. I have some specific expectations for the communication (e.g. 10Hz, i want a timestamp (if possible?)). So, maybe you have any suggestions or help for me to get the software done.
@ashwin3725 жыл бұрын
can you give source code too only the main block...thanks for the tutorials
@AkbarRajaei5 жыл бұрын
excellent. please change the title name as ADC Single mode_Multiple channel
@mutexembedded22065 жыл бұрын
Will do :)
@AkbarRajaei5 жыл бұрын
@@mutexembedded2206 :-D
@Varsha_Art_craft_world5 жыл бұрын
how to connect external hx701b adc with stm32f2 nucleo board...plzz tell me
@artsrunmargaryan29205 жыл бұрын
When you are using hx7** you don't need to activate stm32 ADC. but you'll need configure two GPIO-s something like this github.com/freakone/HX711
@vishaalvishaal21182 жыл бұрын
Hello, I want 6 channels to configure can I do in single conversion mode?? and am using rtos one task will take acd0,adc1 and other task adc2,adc3 and other task for adc4,adc5 as i am using rtos, task switching takes place so can I configure randomly any channel and get the value of adc??
@sugiyartosugiyarto1587 Жыл бұрын
Sir make vidio. Input adc potensio.output pwm duty cycle..thanks
@R_M_202462 жыл бұрын
How would you convert the adc value to volts ? Having a hard time connecting a TMP36 sensor to a F4 board...
@mutexembedded22062 жыл бұрын
Hi Rayon, For 12bits adc, Volts = (value/4095) * 3.3V
@R_M_202462 жыл бұрын
@@mutexembedded2206 thanks for your quick response..Do you have any tutorial on interfacing the TMP36 temperature sensor?
@mutexembedded22062 жыл бұрын
@@R_M_20246 I don't. Shouldn't be hard
@AkbarRajaei5 жыл бұрын
I did exactly like u, for 2 channel but in my case for ADC_CHANNEL_TEMPSENSOR and another one for a potentiometer. Configs for swapping between channels is like u but, it stays on the second channel. But actually, I use the STM32F072VB. does it matter ?
@mutexembedded22065 жыл бұрын
Hi Sayed, Do you still encounter the problem? Should not matter, but the only difference is that the F072 has 1 ADC,but still 16 channels.
@AkbarRajaei5 жыл бұрын
@@mutexembedded2206 hi dude, thanks for the response. Unfortunately yes. This is my code sConfig.Channel = ADC_CHANNEL_16; HAL_ADC_ConfigChannel(&hadc, &sConfig); HAL_ADC_Start(&hadc); if (HAL_ADC_PollForConversion(&hadc, 5) == HAL_OK){ V1 = HAL_ADC_GetValue(&hadc); } sConfig.Channel = ADC_CHANNEL_10; HAL_ADC_ConfigChannel(&hadc, &sConfig); HAL_ADC_Start(&hadc); if (HAL_ADC_PollForConversion(&hadc, 5) == HAL_OK){ V2 = HAL_ADC_GetValue(&hadc); } HAL_Delay(50);
@AkbarRajaei5 жыл бұрын
@@mutexembedded2206 and the configs /* ADC init function */ static void MX_ADC_Init(void) { __HAL_RCC_ADC1_CLK_ENABLE(); /**Configure the global features of the ADC (Clock, Resolution, Data Alignment and number of conversion) */ hadc.Instance = ADC1; hadc.Init.ClockPrescaler = ADC_CLOCK_ASYNC_DIV1; hadc.Init.Resolution = ADC_RESOLUTION_12B; hadc.Init.DataAlign = ADC_DATAALIGN_RIGHT; hadc.Init.ScanConvMode = ADC_SCAN_DIRECTION_FORWARD; hadc.Init.EOCSelection = ADC_EOC_SINGLE_CONV; hadc.Init.LowPowerAutoWait = DISABLE; hadc.Init.LowPowerAutoPowerOff = DISABLE; hadc.Init.ContinuousConvMode = DISABLE; hadc.Init.DiscontinuousConvMode = DISABLE; hadc.Init.ExternalTrigConv = ADC_SOFTWARE_START; hadc.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE; hadc.Init.DMAContinuousRequests = DISABLE; hadc.Init.Overrun = ADC_OVR_DATA_PRESERVED; if (HAL_ADC_Init(&hadc) != HAL_OK) { _Error_Handler(__FILE__, __LINE__); } /**Configure for the selected ADC regular channel to be converted. */ sConfig.Channel = ADC_CHANNEL_10; sConfig.Rank = ADC_RANK_CHANNEL_NUMBER; sConfig.SamplingTime = ADC_SAMPLETIME_239CYCLES_5; //ADC_SAMPLETIME_1CYCLE_5; if (HAL_ADC_ConfigChannel(&hadc, &sConfig) != HAL_OK) { _Error_Handler(__FILE__, __LINE__); } /**Configure for the selected ADC regular channel to be converted. */ sConfig.Channel = ADC_CHANNEL_TEMPSENSOR; if (HAL_ADC_ConfigChannel(&hadc, &sConfig) != HAL_OK) { _Error_Handler(__FILE__, __LINE__); } }
@AkbarRajaei5 жыл бұрын
@@mutexembedded2206 actually, at the beginning when I execute it, it works correctly, I have two different and correct data for both channels. But the second time, when I want to read the new data, both channels have the previous data which are actually the data of channel number 2. So for me, it means that it is still on channel 2 !!!! Is it clear? Did u get what I mean?
@GD_9024 жыл бұрын
Hello MYaqoob, first of all thank you very much for this detailed tutorial. I am using a STM32 Nucleo F446RE and a joystick module to test the ADC functionality. The code works fine for me with no warnings or errors. However I have a doubt which I hope you could clarify. While debugging, I've added both adcVal0 & adcVal1 to watch windows 1 & 2 respectively. Now when I operate the thumb of the joystick both windows display the same values in whichever direction the thumb is moved. But in your case while you were demonstrating I observed that values were not the same. Why do both my Watch Windows show the same values? Thanks once again & awaiting your reply. Gautam
@mutexembedded22064 жыл бұрын
Hi Gautam, Could be channel number or GPIO setting of the other ADC input. There is a much easier way to do this too. You can to the sequencer and get two values from 2 different channels convert sequentially
@GD_9024 жыл бұрын
@@mutexembedded2206 So I must use one adc channel for the x axis and another adc channel for the y axis? And then convert the values?
@mutexembedded22064 жыл бұрын
@@GD_902 yes. If you would look at my video on ADC Multi channel ADC
@GD_9024 жыл бұрын
@@mutexembedded2206 Okay I will go through that tutorial. I'm going through your tutorials one by one and thank you for your prompt reply. I shall definitely follow up on this topic once I implement your suggestions. Best regards Gautam Dhargalkar
@mutexembedded22064 жыл бұрын
Enjoy
@kalamabidin922 Жыл бұрын
please help how to solve this STMicroelectronics ST-LINK GDB server. Version 7.0.0 Copyright (c) 2022, STMicroelectronics. All rights reserved. Starting server with the following options: Persistent Mode : Disabled Logging Level : 1 Listen Port Number : 61234 Status Refresh Delay : 15s Verbose Mode : Disabled SWD Debug : Enabled InitWhile : Enabled Target no device found Error in initializing ST-LINK device. Reason: No device found on target.
@kalamabidin922 Жыл бұрын
STMicroelectronics ST-LINK GDB server. Version 7.0.0 Copyright (c) 2022, STMicroelectronics. All rights reserved. Starting server with the following options: Persistent Mode : Disabled Logging Level : 1 Listen Port Number : 61234 Status Refresh Delay : 15s Verbose Mode : Disabled SWD Debug : Enabled InitWhile : Enabled Target no device found Error in initializing ST-LINK device. Reason: No device found on target.