This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MPU-6050 sensor with Simulink on F28335

Other Parts Discussed in Thread: TMS320F28335

Hello everyone,


i'm trying to read data from MPU-6050 Accel/gyro to my TMS320F28335. I read a lot of datasheats about I2C communication, but I'm not clear on how to set I2C communication via Simulink.

1. How to setup SCL frequency in Target preferences -> Peripherals -> I2C to work on 400kHz which is the clock frequency of MPU-6050 sensor (specially Module clock prescaller value, Master clock Low and High-time divider values).

2. How to configure I2C XMT and I2C RCV blocks to recieving the data from accelero/gyro.

I'm reading the data via RTDX.


Thx

  • Hi Juraj,

    Matlab based support on this forum is very limited and I would request you to check with the Matlab forums.

    Regards,

    Gautam

  • Hi Gautam,

    thanks for your advice. I have one more question, no related to the matlab. How to calculate Master clock frequency on I2C SCL. I mean I have read some stuff in the TMS I2C reference guide. I need some explanation about relationship between device input clock and I2C SCL output clock frequency.

    Thank you in advance

    Juraj

  • HI Juraj,

    Check the same in SPRUG03B Pg. No. 14

    Regards,

    Gautam

  • Dear Juraj,

    I'm new to this community, so I don't know exactly how to properly contact you. I was wondering if you'd managed to get the MPU 6050 to work with the TMS320F28335. I'd like to do exactly the same (as I am developing an experimental setup for a project for 2nd year bachelor students). 

    Please contact me if you've achieved some progress with your problem.

    Cheers,

    Tijs Donkers

    Assist. Professor

    Dept. Electrical Engineering

    Eindhoven University of Technology, Netherlands

  • Hi Tijs,


    I just tried some basic communication operations with the MPU 6050 via I2C, for example WHO_AM_I function, which sends you slave address of the MPU sensor. But the whole communication it's a little bit difficult, when you are trying get a 16bit data from the accelero or gyro registers in two 8bits packages. It is a lot of documents for this sensor, but everything is for ARDUINO or C code. My student is now working on the program in simulink for communication with F28335 MCU. If it is possible give me your email address or contact me juraj.madaras [at] stuba.sk

    Juraj

  • Dear Juraj,

    Thank you very much for the quick reply. Indeed, most of the available information on the internet is tailored for the Arduino (we got the sensor to work on the Arduino, but we want to work now with the F28335).

    In case your student already has something that will allow communication through I2C between the MPU6050 and the F28335, I would like to get in touch with him/her and perhaps exchange/discuss ideas or even Simulink files. You can contact me via "m.c.f.donkers [at] tue [dot] nl". 

    Looking forward to be hearing from you. Thanks!

    -Tijs

  • Dear Juraj Madaras,
    Hi, Do you make I2C communication successfully with Simulink and DSP28335 for MPU6050? I encountered the same problem and found a lot unuseful information until I found your post. Can you give me some help? Thank you very much! My email is jifengrgj@126.com.
  • donde escribiste ADDRESS que tipo de dato es , es que estoy haciendo algo similar y me quiere apoyar de su esquema
  • Dear Eder, I guess you have also tried to directly contact me using some personal message, but I have not clue how to reply to that message. I also cannot read your message as I don't understand Spanish(?). Can you please send me an email? The address is somewhere above.

    -Tijs
  • Juraj Madaras


    can you write to me to my email? is alfregomezdelga@hotmail.com
     im trying to do the same, read an mpu6050 using simulink


    someone have the email of juraj madaras?