2016-09-15 11:42 AM
hello everyone! i wanna know about the way i can know whether my uart is available or not like i did in case of arduino using Serial.available() function call ???
#stm32f103c8t62016-09-15 12:29 PM
The STM32 USART has no buffer depth, it has a holding register, and you can check the status of that with RXNE. Review the Reference Manual to understand the USART and it's internal registers.
You could build your own buffering around the hardware, and offer an equivalent to Serial.available(), or look directly at your own variables implementing the buffer to see the level of fullness, etc.2016-09-16 04:14 AM
@clive1: but i'm a beginner, can u tell me the whole process in short, where i can find the reference manual of USART??i'm really confused hey can i use the HAL_UART_GetState() function call to determine whether the USART1 is busy or not?? i have used CubeMX for code initialization and Keil5 Compiler for compiling !
2016-09-16 01:08 PM
You can Google the part# or the Reference Manual
I'm not using HAL/CUBE you will need to find your own tutorials, and review the examples provided under the Cube installation.The TXE, RXNE flags in the USART are similar to those methods used over several decades of serial UART designs, the methods for examining and buffering serial data will have coverage in the many micro-controller texts over that period. Most embedded systems use interrupts and ring-buffers (FIFO) to manage serial data streams.2016-09-17 10:07 AM
thank you clive1 :)