cancel
Showing results for 
Search instead for 
Did you mean: 

How to generate timer in STM32

kritika_sinha
Associate

Hello! Recently I have been working on ADC, where I connect a potentiometer to a bread board and by using jumper wires I  connect it with ARM Cortex M4, STM32G491. Thankfully I have received the outputs too. But the challenge is, I have to include timer along with the voltage output. I did watch many tutorials available on internet, added few codes in it. The moment I run my code, It just shows the voltage reading not the timer reading. The code shows 0 error, I was wondering where I have mistaken, I was hoping if somebody  could help me out with this challenge. I hereby attach my code in text form. Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
JTP1
Lead

Hello. Seems that you are sending time/date to other uart than the adc result. Is it on purpose ?

HAL_UART_Transmit(&huart3,(uint8_t*)date,sizeof(date),300);
HAL_UART_Transmit(&huart3,(uint8_t*)time,sizeof(time),300);
HAL_UART_Transmit(&hlpuart1,(uint8_t*)msg,strlen(msg),HAL_MAX_DELAY);

 You could also use strlen on all transmittings, not sizeof.

View solution in original post

1 REPLY 1
JTP1
Lead

Hello. Seems that you are sending time/date to other uart than the adc result. Is it on purpose ?

HAL_UART_Transmit(&huart3,(uint8_t*)date,sizeof(date),300);
HAL_UART_Transmit(&huart3,(uint8_t*)time,sizeof(time),300);
HAL_UART_Transmit(&hlpuart1,(uint8_t*)msg,strlen(msg),HAL_MAX_DELAY);

 You could also use strlen on all transmittings, not sizeof.