cancel
Showing results for 
Search instead for 
Did you mean: 

Reason for stopping receiving data through USART

Posted on January 01, 2017 at 11:34

I am reading some values from MPU6050 throught I2C and sending data through UART to my pc. sometimes it stops receiving after a while. what might be the reason ??

4 REPLIES 4
Seb
ST Employee
Posted on January 01, 2017 at 14:44

The description is too vague to give any hints.

First, is I2C still alive? An oscilloscope on SDA and SCL would help.

How are the data sent by RS232? Is it a rolling buffer which might get full?

Increase RS232 speed and make sure the plumbing is correct. How long to send an RS232 message vs the frequency of data coming from the MEMs. It's really in the source code that things must be checked.

Good luck!

Posted on January 01, 2017 at 15:04

I will check it and update you.

Posted on January 01, 2017 at 17:13

Scope the USART TX pin to confirm you are actually still sending. Toggle an LED for every 100 bytes you send to confirm it is alive.

The PC USART could get out of sync, or not be clocked properly (bad USB-to-serial adapter/crystal). Check serial bit timing with a scope, use multiple stop bits, or increase the inter-symbol gap periodically so it can sync. Make sure your receiver software isn't buggy. Seen issues with Prolific VCP drivers before, insure current drivers are in use.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on January 02, 2017 at 05:51

i changed my pins and it worked. dont know what caused this problem.