cancel
Showing results for 
Search instead for 
Did you mean: 

Sending UART issue

FLine.1
Associate II

Hello

I wrote UART sending command. I use cp210x from Silicon labs.

But i didnt see numbers in putty or termite .

Please tell me what is wrong ?

[url=https://hizliresim.com/dABfK1[/url]

My code:

My code:

#include "string.h"

char com_giden[50];

int ix = 0;

 sprintf(com_giden,"merhaba dunya : %d\r\n",ix++);

    HAL_UART_Transmit(&huart1,(uint8_t*)com_giden,strlen(com_giden),10);

my usb ttl:

https://www.gittigidiyor.com/ev-elektronigi/cp2102-usb-to-ttl-com-cevirici-adaptor-5124p-seri-donusturucu-karti-arduino-rs232-convertor_pdp_501510386

    HAL_Delay(500);

[url=https://hizliresim.com/evmd6T[/url]

[url=https://hizliresim.com/5q35Sh[/url]

3 REPLIES 3
TDK
Guru

The most common issues with UART not working are probably incorrect clock settings and uninitialized or incorrectly initialized pins.

I don't see anything wrong with the code you posted. A logic probe can help debug things immensely.

If you feel a post has answered your question, please click "Accept as Solution".
FLine.1
Associate II

Dear TDK

You are right. I had mistake in clock configuration.

I think that I dont find out how i have to set clock configuration.

Please see tthose pictures. and pls tell me what is wrongin clock settings. about pll clock.

This pic is sample setting for STM32F103C8T6:

[url=https://hizliresim.com/Pex4Ts[/url]

This picture UART is not working via clock configuration:

[url=https://hizliresim.com/OuI[/url]

This pictre UART is working perfectly:

[url=https://hizliresim.com/zC5ml9[/url]

Please advice me how can i set clock configuration .

sincerely.

TDK
Guru

Your images do not show up.

STM32CubeMX can be used to generate clock settings for you.

If you feel a post has answered your question, please click "Accept as Solution".