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 ??
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.
I will check it and update you.
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.
i changed my pins and it worked. dont know what caused this problem.
Retrieving data ...