Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uart stm32l0 #1

Open
HomayoonAAhmad opened this issue Jan 6, 2024 · 5 comments
Open

uart stm32l0 #1

HomayoonAAhmad opened this issue Jan 6, 2024 · 5 comments

Comments

@HomayoonAAhmad
Copy link

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

@sweesineng
Copy link
Owner

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
Copy link
Author

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
Copy link
Author

I will try this code with your library thanks though

@sweesineng
Copy link
Owner

sweesineng commented Jan 9, 2024

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
Copy link
Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants