2023-10-10 06:06 AM
Hallo!
I am trying to calculate and display the temperature measurement of 2 NTC thermistor's using STM32F103RBT6. I have done the ADC conversion and hardware connections correct. I was able to get continuous values with a delay of 1 second before using input commands. Now, however the measurement and display of output in PuTTY is not continuous. I programmed the mcu to start temperature measurement when the input is '1' and stop it when input is '2'. But I have to press '1' each time to obtain a measurement , even though I used the same HAL_UART_Transmit(&huart2, (uint8_t*)buffer, strlen(buffer), HAL_MAX_DELAY) . Is it a problem in my code or can we not continously transmit data in this case?
2023-10-10 06:58 AM
> Is it a problem in my code or can we not continously transmit data in this case?
The hardware is able to transmit continuously, so it must be a code issue. Debug your code, hit "pause" when you think it should be sending but isn't, and figure out where the code is at and correct it.
2023-10-11 01:37 AM
This is how my while loop looks currently, I thought it should be continuously transmitting data with this, but it isn't.
2023-10-11 07:10 AM
You're calling HAL_UART_Receive with HAL_MAX_DELAY every loop. The system is waiting for a character to come in. If you don't want it to wait, use a timeout here and handle HAL_TIMEOUT appropriately.