- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Cypress community.
I'm making a little robot that will use a MPU9250 for balance purposes, the brain of the robot is a CY8CKIT-059.
They communicate by using SPI, the PSoC being the master and the MPU9250 the slave.
I made some functions to write and read registers on the MPU9250, and they work fine, but only if I call them from the main infinite loop.
I put a timer to dictate the sampling rate of the system, and I am using the terminal count interruption to call the functions in the correct amount of time.
The problem is that the values of the accelerometers (x, y and z), and gyroscopes (planes xy, xz and yz), are all wrong, like all over the place, if they are read from the interrupt, but are totally OK if they are read from the infinite loop.
What would be the cause or a possible solution?
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quite difficult to guess the cause.
Can you please post your complete project or a shortened version that shows the error so that we all can have a look at all of your settings. To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the reply Bob, I will do it later today, but I found a workaround, instead of executing the functions call from the interrupt, I raise a flag and execute them from the main loop.