STM32 Blue Pill for intermediate Code and diagram are at www.micropeta.com/video32
Пікірлер: 15
@gabrielpimentelgomes31958 ай бұрын
It was very nice of you putting all the wires with the matching colors!
@rolandvanhall86226 ай бұрын
Your Video's are quite helpfull and thank you for that. I miss the explenation on how to select the ADC channel. It seems this is done via a structure. The structure can be displayed by selecting the "ADC_ChannelConfTypeDef" parameter and press F2. The structure than will be displayed. By setting the structures value ".Channel" a specific ADC is selected.
@maulanawahyudi7127 Жыл бұрын
Sir, why we need Timer to use multi ADC ?or that will be output for LED? and why must timer 2 ?
@Alex5566882 жыл бұрын
Спасибо !
@NizarMohideen2 жыл бұрын
Добро пожаловать
@davidkelemen3305 Жыл бұрын
Hello, I have a potentiometer and a temperature sensor. For some reason, when I turn the potentiometer all the way up, it reads 4095 (12 bit resolution) correctly, but also the ADC from the temperature sensor goes up to 4095. Also it doesn't seem to read values less than 2000, even if the potentiometer is turned all the way down.
@rolandvanhall86226 ай бұрын
You need to address the specific IO Pin before an analog to digital conversion. This is done via parameter "sConfigPrivateChannel". A two pin conversion would be something like this: sConfigPrivate.Rank = ADC_REGULAR_RANK_1; sConfigPrivate.SamplingTime = ADC_SAMPLETIME_1CYCLE_5; sConfigPrivate.Channel = ADC_CHANNEL_0; HAL_ADC_ConfigChannel(&hadc1, &sConfigPrivate); HAL_ADC_Start(&hadc1); HAL_ADC_PollForConversion(&hadc1,1000); ADC_Result_I16 = HAL_ADC_GetValue(&hadc1); HAL_ADC_Stop(&hadc1); sConfigPrivate.Channel = ADC_CHANNEL_1; HAL_ADC_ConfigChannel(&hadc1, &sConfigPrivate); HAL_ADC_Start(&hadc1); HAL_ADC_PollForConversion(&hadc1,1000); ADC_Result_I16 = HAL_ADC_GetValue(&hadc1); HAL_ADC_Stop(&hadc1);
@sagarbhoyar61762 жыл бұрын
Hi, Can you explain why did you use specific timer values
@NizarMohideen2 жыл бұрын
I set Prescaler to 127 and Counter Period to 625 because I wanted to have 100Hz PWM for LED’s. How I found 127 and 625 is as follows. Clock frequency is 8MHz (8000000Hz) I divided by 128 and then divided again by 625 8000000 / 128 = 62500 62500 / 625 = 100 Hz Prescaler is always 1 less. So it is 128-1 = 127
@sagarbhoyar61762 жыл бұрын
Thanks
@rosymelody41252 жыл бұрын
hello sir, i have stm32 and i want to use rgb led to indicate the different body temperature value, so can i work with only one potentiometer and by using only one channel. what code should i need to use
@NizarMohideen2 жыл бұрын
Hi Rosy Melody, Have a look at kzfaq.info/get/bejne/hdxxksplyuCRqqc.html Instead of internal sensor, use one potentiometer Instead of three LEDs, use one RGB LED Cheers
@NizarMohideen2 жыл бұрын
You can use one ADC only and use the code given at nizarmohideen.herokuapp.com/video33 Change 1740 and 1720 to some values which suits you if (readValue > 1740) { HAL_GPIO_WritePin(GPIOA, GPIO_PIN_7, 1); HAL_GPIO_WritePin(GPIOA, GPIO_PIN_4, 0); HAL_GPIO_WritePin(GPIOA, GPIO_PIN_1, 0); } else if (readValue > 1720 ) { HAL_GPIO_WritePin(GPIOA, GPIO_PIN_7, 0); HAL_GPIO_WritePin(GPIOA, GPIO_PIN_4, 1); HAL_GPIO_WritePin(GPIOA, GPIO_PIN_1, 0); } else { HAL_GPIO_WritePin(GPIOA, GPIO_PIN_7, 0); HAL_GPIO_WritePin(GPIOA, GPIO_PIN_4, 0); HAL_GPIO_WritePin(GPIOA, GPIO_PIN_1, 1); }