Arduino Mega i2c speed issue

1 view (last 30 days)
Dan
Dan on 1 Jul 2014
I am trying to use a S-Function Builder block to get data from an MPU9150 over i2c, which does work and gets back valid data, however it is triggering the task overrun LED no matter how simple the rest of the model is or how high I set the sample time (even as high as 1 second it still overruns).
The simplest model that has had this issue was a single S-Function block which outputs to three 3 axis scopes, initially I thought it may be because of the overhead in transferring data over serial but even when deploying to the board without external simulation the problem persists.
I have tested the Arduino and MPU without using Simulink and found no issue with either, it takes around 23ms to get data from all 3 sensors for each of the three axis.
I am using the Sparkfun library to interface with the MPU.

Answers (0)

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!