Everything seem to be working but the value is all the time around 500 and changing a little bit all the time but not connected to potentiometer at all. Any ideas?
It may be due to non-original STM32 chip If you use ADC stop and start for each reading, it will work as shown below. Thanks HAL_ADC_Start(&hadc1); HAL_ADC_PollForConversion(&hadc1,1000); readValue = HAL_ADC_GetValue(&hadc1); HAL_ADC_Stop(&hadc1);
Hello, i did the same as you but instead of showing the pot value i recieve this error : Polling target STM32F103C8Tx.cpu failed, trying to reexamine Examination failed, GDB will be halted. Polling again in 6300ms
Sir nice video i like it so much. One question. The value that displayed ini live expression, what kind of value is that? Is the same with PWM? Or it is actual analog? Can we use it to control PWM for any motors? Thankyou
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.
You can create a timer interrupt every 100 milli seconds. It is very simple I have created a video ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-OSVffISU7DQ.html In that video I created three interrupts every 200, 300 and 700 ms As I understand you may need only one interrupts similar to that
Hello sir. I'm trying to interface an twist throttle with this microcontroller. It gives output values from 0.8V to 4.3V. Also, I want to generate a PWM signal of 10kHz and change the duty cycle through twist throttle. How should I proceed with this one? Can you please guide me with this?
Thanks for this.. Unfortunately, I only get one static figure in live expressions after following this step by step and double checking everything. continuous mode is enabled but my figures don't change with adjustment of the potentiometer. I've also checked that the potentiometer is working fine What could be the problem?
Some microcontrollers don't allow auto conversions. You may need to stop and start ADC every time HAL_ADC_Start(&hadc1); HAL_ADC_PollForConversion(&hadc1,1000); readValue = HAL_ADC_GetValue(&hadc1); HAL_ADC_Stop(&hadc1);
@@NizarMohideen Thanks for such a prompt response. I am using the waveshare Xnucleo-411re board, it has an stm32411ret6 chip. If this board does not allow auto conversion, how can I execute the stop/start to generate readings, also is it possible to Transmit them to the serial. I had similar challenges when I followed your other tutorial that monitors potentiometer readings through SWV. I got no results at all in the graph Thanks again
Hi Nizar I'm tried to implement this code potentiometer ADC on blackpill f401 and so far the readings are static, only change by push reset button. I put clock on 8 MHz just like on BluePill but the results are the same. I noticied that appears on IDE a file 0x0 that says on context 'source not found'? Can you help me? Thank you
If the board has clone STM32 chip on it, the ADC does not continuously converts. We can stop and start ADC for each conversion as shown below Thanks HAL_ADC_Start(&hadc1); HAL_ADC_PollForConversion(&hadc1,1000); readValue = HAL_ADC_GetValue(&hadc1); HAL_ADC_Stop(&hadc1);
@@NizarMohideen I also have the same problem, My problem is that the value displayed in live expression is the breakpoint value,and the above two possible problems have been confirmed, is there any other problem? Thanks
I like this question. Short answer. This is a beginner video, I wanted to make it as simple as possible. Long Answer. STM32F103C8T6 has an internal clock which run at 8MHz. If we enable RCC, we can set the speed to different value up to maximum of 72MHz. The best part of STM32 and CubeIDE at least for me is very simple to learn an get started with many projects easily using HAL ( Hardware abstraction layer) and minimum settings. When the project uses more resources with many devices connected to it, we may need to optimise clock speed, interrupt, direct memory access. Also we can use low layer codes and direct register manipulation.