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!!
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.
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.
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.
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?
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
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
@@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
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??
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
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 ?
@@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?
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.
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.