cancel
Showing results for 
Search instead for 
Did you mean: 

USART sometimes lost data

paker earth
Associate II
Posted on November 10, 2017 at 10:43

Hi all?

I am using F413 nucleo to acquir water level datas from aquatrak model 4110.

The sensor is 1 Hz and data is fixed length.

I use timer 6(1Hz) to process the received datas.

But I almost lost one record every 90 second.

Is there any method to resolve it?

Thank you in advance.


_legacyfs_online_stmicro_images_0690X0000060MwOQAU.png
_legacyfs_online_stmicro_images_0690X0000060MwJQAU.png

#stm32f413
3 REPLIES 3
Posted on November 13, 2017 at 21:57

The sensor is 1 Hz and data is fixed length.

I use timer 6(1Hz) to process the received datas.

There may be a slight mismatch between the sensor's clock and the mcu's clock.

You should be processing the data as they arrive, rather than based on a regular timer tick.

JW

Posted on November 13, 2017 at 22:59

Have a GPIO indicate your pacing, and review that along with the data stream on a logic analyzer. Determine if there is an issue with the data, or your handling of it.

Code seems unnecessarily convoluted, wouldn't it be better just to use an IRQ for single byte data reception?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
paker earth
Associate II
Posted on November 15, 2017 at 03:37

Thank you all for reply.

I had resolved it. It's just a timing issue.