sweesineng / STM32_DS18B20

STM32 I2C HAL & LL library for the 1-Wire DS18B20
9 stars 4 forks source link

uart stm32l0 #1

Open HomayoonAAhmad opened 11 months ago

HomayoonAAhmad commented 11 months ago

how can i display the temperature value via uart on stm32l010k8t6 please help thanks

sweesineng commented 10 months ago

There is quite number of example in google. You can take any of them to implement. like this example:

define PUTCHAR_PROTOTYPE int __io_putchar(int ch)

PUTCHAR_PROTOTYPE { HAL_UART_Transmit(&huart?, (uint8_t *)&ch, 1, HAL_MAX_DELAY); return ch; }

printf("Temperature 0 : %0.4f Temperature 1 : %0.4f\n", Temperature[0], Temperature[1]);

HomayoonAAhmad commented 10 months ago

Fact is we use l0 series and we use LSE clock with 32khz value and i dont know that we can make "us delay" in this situation or not We can't use pll because of some issues we have

HomayoonAAhmad commented 10 months ago

I will try this code with your library thanks though

sweesineng commented 10 months ago

Fact is we use l0 series and we use LSE clock with 32khz value and i dont know that we can make "us delay" in this situation or not We can't use pll because of some issues we have

I'm not familiar with L0, but think you can try this: https://community.st.com/t5/stm32-mcus-wireless/micro-sec-delay-with-stm32l0/td-p/271000

HomayoonAAhmad commented 10 months ago

There is quite number of example in google. You can take any of them to implement. like this example:

define PUTCHAR_PROTOTYPE int __io_putchar(int ch)

PUTCHAR_PROTOTYPE { HAL_UART_Transmit(&huart?, (uint8_t *)&ch, 1, HAL_MAX_DELAY); return ch; }

printf("Temperature 0 : %0.4f Temperature 1 : %0.4f\n", Temperature[0], Temperature[1]);

can you help me about this code wanna know in which header file should i define and declare functions?