Jump to content
43oh

Frans

Members
  • Content Count

    3
  • Joined

  • Last visited

Reputation Activity

  1. Like
    Frans got a reaction from altineller in MPU9150 working* with MSP430 and Tiva-C (almost)   
    Hello altineller,
    I've tested your code by hooking up a 9150 module (similar to the one you connected to the Nano) to Tiva C. I had to add Wire.setModule(1) to the setup function of the Energia9150.ino file and then it worked, but as you said quite slowly.
    The slow speed is probably related to the problem addressed by this pull request for the energia wire library: https://github.com/energia/Energia/pull/343
    In the energia-0101E0012/hardware/lm4f/libraries/Wire/Wire.cpp file the TwoWire::getRxData and TwoWire::sendTxData both have a delay of 1ms build in. This is probably the cause of the delay you are seeing in the SCL of the Tiva. Moreover, the TwoWire::begin method limits the I2C speed to 100kbps.
    I've tested your code also with a modified Wire.cpp file, forcing the speed to 400kbps and removing the delay(1) statements from the getRxData and sendTxData methods. This improved speed a lot, but wasn't stable (communictation with the module stopped at random times). To get it stable I had to add 10micro second delays (delayMicroseconds(10)) to the getRxData and sendTxData methods instead of the delay(1). With this change I could increase the MPU_UPDATA_RATE to 200 and the MAG_UPDATE_RATE to 100, resulting in an average sample time of less then 6ms.
  2. Like
    Frans reacted to altineller in [Energia Library] MPU9150 working* with MSP430 and Tiva-C (almost)   
    @@Frans I have tested your fix and it works. Making this faster than the arduino. (with a nano i was able to go 120hz max)
     
    I have not seen any problems or glitches at 200hz.
     
    Here are two graphs I made, one at 80hz, other at 200hz averaging 6ms per read.
     
    Look at those periodic spikes in the 200hz test. It is probably some fifo problem.
     
    However it works now, and I will soon make this into a library and post it on github.
     
    Best regards,
    C.A.
     
     


  3. Like
    Frans got a reaction from altineller in [Energia Library] MPU9150 working* with MSP430 and Tiva-C (almost)   
    Hello altineller,
    I've tested your code by hooking up a 9150 module (similar to the one you connected to the Nano) to Tiva C. I had to add Wire.setModule(1) to the setup function of the Energia9150.ino file and then it worked, but as you said quite slowly.
    The slow speed is probably related to the problem addressed by this pull request for the energia wire library: https://github.com/e...nergia/pull/343
    In the energia-0101E0012/hardware/lm4f/libraries/Wire/Wire.cpp file the TwoWire::getRxData and TwoWire::sendTxData both have a delay of 1ms build in. This is probably the cause of the delay you are seeing in the SCL of the Tiva. Moreover, the TwoWire::begin method limits the I2C speed to 100kbps.
    I've tested your code also with a modified Wire.cpp file, forcing the speed to 400kbps and removing the delay(1) statements from the getRxData and sendTxData methods. This improved speed a lot, but wasn't stable (communictation with the module stopped at random times). To get it stable I had to add 10micro second delays (delayMicroseconds(10)) to the getRxData and sendTxData methods instead of the delay(1). With this change I could increase the MPU_UPDATA_RATE to 200 and the MAG_UPDATE_RATE to 100, resulting in an average sample time of less then 6ms.
×
×
  • Create New...