board_android-IoT/STM32F 2024. 6. 29. 15:10

https://stackoverflow.com/questions/57752689/how-to-use-the-vrefint-in-stm32f103-bluepill

 

How to Use the VREFINT in stm32f103 bluepill?

I'm not able to understand the use of VREFINT in stm32f103 board. Can anyone explain me how to get adc value in stm32f103 using VREFINT? if(HAL_ADC_PollForConversion(&hadc1, 100) == HAL_OK) ...

stackoverflow.com

  if(HAL_ADC_PollForConversion(&hadc1, 100) == HAL_OK)
  {
      adcVrefInt = HAL_ADC_GetValue(&hadc1);
      vdd = 4095.0 * 1.20 / (float)adcVrefInt;
      vdd += 0.61; // .61 is the difference i'm getting in VDD
      sprintf(buffer, "VREFINT: %ld\tVDD: %.2f\t", adcVrefInt, vdd);
      HAL_UART_Transmit(&huart1, (uint8_t *)buffer, strlen(buffer), 100);

      if(HAL_ADC_PollForConversion(&hadc2, 100) == HAL_OK)
      {
          adcValue = HAL_ADC_GetValue(&hadc2);
          adcVoltage = (vdd/4095.0) * adcValue;
          sprintf(buffer, "ADC_PA0: %ld\tVoltage-PA0: %.2f\n", adcValue, adcVoltage);
          HAL_UART_Transmit(&huart1, (uint8_t *)buffer, strlen(buffer), 100);
      }
  }

 

 

- https://community.st.com/t5/stm32-mcus-products/vrefint-cal-on-stm32f103/td-p/433268

 

Vrefint _Cal on stm32f103

Posted on July 12, 2016 at 11:42 Hi  I faced with a problem for read the Vrefint_Cal in stm32f103 I dont find  Its address  in flash,I read  datasheet and also I searched in the internet but I cant find it can you help me for sovling this problem??? th

community.st.com

 

The data sheet also says Vrefint should be 1.20V

You'd sample this, get a value and then extrapolate that for a 4095 value, which would reflect the VREF being used. Simple math, right? VREF = (1.20 / (double)VrefintSample) * 4095.0; You'd then use this VREF value when doing your other ADC conversions.

 

'board_android-IoT > STM32F' 카테고리의 다른 글

ADC interrupt reading  (0) 2024.07.02
STM32F, STM32F103 ADC reading , multiple reading  (0) 2024.07.01
Boot mode Pin  (1) 2024.02.16
STM32F103Cx MCU major(timer, UART, EXTI) function entry names  (1) 2024.01.05
ILI1934 한글폰트 출력  (0) 2024.01.04
posted by cskimair
:
board_android-IoT/STM32F 2024. 2. 16. 16:17

 

- Boot Mode핀 스위치 설계

https://m.blog.naver.com/sohnet/222627505207

 

10.[실습][회로 설계] Boot Mode 핀 스위치 설계

"규칙으로 배우는 임베디드 시스템-회로 설계 및 PCB 설계 규칙" -회로 설계 규칙 편을 읽고 ...

blog.naver.com

 

posted by cskimair
:
board_android-IoT/STM32F 2024. 1. 5. 15:52

STM32F103Cx MCU  major(timer, UART, EXTI) function entry names

-STM32F103Cx MCU 주요 함수 시작점 및 KEYPAD용 GPIO port 

<pre> 
1. timer - automatic generated function called in every 1 milisec 
SysTick_Handler() //stm32f1xx_it.c, 
|
+-> HAL_IncTick();
+-> HAL_SYSTICK_IRQHandler() 
    |
+-> HAL_SYSTICK_Callback() ; //main.c  weak void HAL_SYSTICK_Callback() 

2. UART RECV callback - Rx Transfer completed callbacks.
//  * @param  huart  Pointer to a UART_HandleTypeDef structure that contains
//  *                the configuration information for the specified UART module.
__weak void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)  //stm32f1xx_hal_uart.c
--> void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart) //main.c 

3. EXTI(external interrupt) callback 
EXTI0_IRQHandler()//stm32f4xx_it.c
|
+->HAL_GPIO_EXTI_IRQHandler() //stm32f1xx_hal_gpio.c 
   +-> HAL_GPIO_EXTI_Callback()  // main.c 


4. Timer callback  - custom timer period timer 
HAL_TIM_IRQHandler(TIM_HandleTypeDef *htim)//stm32f1xx_hal_tim.c
|
+-> HAL_TIM_PeriodElapsedCallback() // main.c 


A. KEYPAD CFG 
const KEYPAD_CfgType KEYPAD_CfgParam[KEYPAD_UNITS] =
{
// KeyPAD Unit 1 Configurations
    {
     /* ROWs Pins Info */
    {GPIOB, GPIOB, GPIOB, GPIOB},
{GPIO_PIN_4, GPIO_PIN_5, GPIO_PIN_6, GPIO_PIN_7},  // input pin

/* COLs Pins */
{GPIOB, GPIOB, GPIOB, GPIOB},
{GPIO_PIN_12, GPIO_PIN_13, GPIO_PIN_14, GPIO_PIN_15} // output pin
}
};

</pre> 

posted by cskimair
:
board_android-IoT/STM32F 2024. 1. 4. 11:59

 

https://www.youtube.com/watch?app=desktop&v=k4WlAfVuXqk

 

> 구글검색:

https://www.google.com/search?q=SPI+TFT+LCD+%2C+ILI9341%2C%ED%95%9C%EA%B8%80+%EC%B6%9C%EB%A0%A5%2C++korean+character&tbm=isch&ved=2ahUKEwjx3tzJ2MCDAxVjc_UHHZ3SBTMQ2-cCegQIABAA&oq=SPI+TFT+LCD+%2C+ILI9341%2C%ED%95%9C%EA%B8%80+%EC%B6%9C%EB%A0%A5%2C++korean+character&gs_lcp=CgNpbWcQA1CdLVjcQWDfQ2gAcAB4AIABjgGIAZEOkgEEMC4xNpgBAKABAaoBC2d3cy13aXotaW1nwAEB&sclient=img&ei=LwyVZbGLPOPm1e8PnaWXmAM&bih=921&biw=1748&client=firefox-b-d#imgrc=jRQqkAhRg48tWM

 

SPI TFT LCD , ILI9341,한글 출력, korean character - Google 검색

아두이노#227] LCD화면(SPFD5408,... m.youtube.com

www.google.com

 

posted by cskimair
:
board_android-IoT/STM32F 2023. 11. 18. 11:39

https://controllerstech.com/send-and-receive-data-to-pc-without-uart-stm32-usb-com/

 

Send and Receive data to PC without UART (STM32 USB COM)

This tutorial will show you how can we use the STM32 USB to send and receive data from the computer, just like we did using the UART

controllerstech.com

 

posted by cskimair
:
board_android-IoT/STM32F 2023. 11. 18. 11:36

CubeIDE , Keil have different requirement for Serial Wire Viewer

 

- CubeIDE :

> _write() redefinition is required

//in CubeIDE, redefinition of _write is ncessary

int _write(int file, char *ptr, int len)

{

for(int i = 0; i < len; i++)

{

ITM_SendChar(*ptr++);

}

return len;

}

https://embedblog.eu/?p=673

 

Using Serial Wire Trace with CubeIDE (aka a new level of debugging) – EmbedBlog

I’ve been developing for STM32’s for a couple of years now, and I did a lot of different projects – from large powersupplies to small headlamps – but on 95 % of them, I used two connectors: SWD (Serial Wire Debug), used to program and debug the chi

embedblog.eu

 

- Keil : 

> fputc() redefinition is required

int fputc(int ch, FILE *f)
{
ITM_SendChar(ch);
return(ch);
}

https://community.st.com/t5/stm32-mcus-products/getting-printf-on-stm32f407-discovery-board/td-p/438840

 

Getting printf on STM32F407 Discovery board

Posted on June 11, 2015 at 13:14 Hi i am new to embedded system programming and stumbled upon this basic problem of re-directing output to the ITM Port0. I read multiple posts on the same but sadly I cant get it to work. I shall try to be as descriptive as

community.st.com

- Tutorial for Keil, serial wire viewer

https://www.keil.com/appnotes/files/discovery_m4_lab.pdf

 

posted by cskimair
: