2020-03-09 12:16 AM
sprintf(buffer,"Hello\r\n");
len=strlen(buffer);
HAL_UART_Transmit(&huart1,(uint8_t *)buffer,strlen(buffer), 0xFFFF);
HAL_Delay(100); // just in case required delay is given
2.
ch=83;
HAL_UART_Transmit(&huart1, &ch, 1, 50);
HAL_Delay(1);
ch=87;
HAL_UART_Transmit(&huart1, &ch, 1, 50);
HAL_Delay(1);
ch=73;
HAL_UART_Transmit(&huart1, &ch, 1, 50);
HAL_Delay(1);
ch=84;
HAL_UART_Transmit(&huart1, &ch, 1, 50);
HAL_Delay(1);
ch=67;
HAL_UART_Transmit(&huart1, &ch, 1, 50);
HAL_Delay(1);
ch=72;
HAL_UART_Transmit(&huart1, &ch, 1, 50);
HAL_Delay(1);
ch=49;
HAL_UART_Transmit(&huart1, &ch, 1, 50);
HAL_Delay(1);
If multiple single decimal's/char's were transmitted delay is required minimum 1 ms.
Kindly help me on this!!!!!!!!!!!!!!!
2020-03-09 12:32 AM
sprintf(buffer,"Hello\r\n");
HAL_UART_Transmit(&huart1,(uint8_t*)buffer,strlen((const char*)buffer),10);
just try this..
2020-03-09 05:00 AM
Hello,
The string that you are looking to send contain 7 characters, Kindly verify the size of the buffer, and reduce the delay from 0xFFFF.
char buffer [10] = "hello\r\n";
HAL_UART_Transmit(&huart1,(uint8_t *)buffer,strlen(buffer), 10);
Hope that will help!
2020-03-09 06:10 AM
This is not working...Only first character is getting transmitted followed by garbage value
2020-03-09 06:10 AM
Same with this.......Only first character is getting transmitted followed by garbage value
2020-03-09 06:12 AM
2020-03-09 06:44 AM
What receiver are you using?
What is the hardware connection between the STM32 and receiver?
What are the baudrate etc. settings?
Do you use a crystal/HSE on the STM32?
Have you observed the waveforms using oscilloscope/logic analyzer?
JW
2020-03-10 04:18 AM
Not working ...
2020-03-10 04:22 AM
I am reading it through max3232 . Connection was done through jumper cable.
Baud Rate is 9600, Word length is 8 bit with non parity bit, Stop bit is 1, I am using HSI with x12 PLL,sysclk is 48MHz.
I did not observed waveforms yet...