Jump to content

jcjc

Members
  • Content Count

    3
  • Joined

  • Last visited

  1. Hi everyone, my proyect its working! I followed steps of this link: https://e2e.ti.com/support/development_tools/code_composer_studio/f/81/t/529036?I2C-communication-does-not-appear-to-be-working-correctly-with-Energia-and-CCS-How-do-I-fix-it- but in addition to replacing the files in the directory mentioned in the link above, I have to remplace the files in the energia1610E181\hardware\energia\msp430\libraries\Wire\utility The files are available in the link. thanks!
  2. Hi everyone I am beginner and I want to use the adxl345 with msp430g2553 with I2C, but the example that I am using don´t working, always send 0 in the axes x,y and z. I use energia 1.6.10e18, the circuit have the pull'up resistor in SDA and SCL pines, and I remove the jumper of the green led. I used the same code but with arduino and it working but with enegia not, help me please. My launchpad is MSP-EXP430G2 rev 1.5 The SCL is connected in pin 14 and the SDA in pin 15. My OS is windows 7 When i put this function "Wire.setModule(0)" the mcu does make nothing, the uart don´t send nothing. The code is the follow: #include <Wire.h> void setup() { Serial.begin(9600); Serial.print("Iniciado"); Wire.begin(); writeTo(DATA_FORMAT, 0x01); //Put the ADXL345 into +/- 4G range by writing the value 0x01 to the DATA_FORMAT register. writeTo(POWER_CTL, 0x08); //Put the ADXL345 into Measurement Mode by writing 0x08 to the POWER_CTL register. } void loop() { uint8_t howManyBytesToRead = 6; readFrom( DATAX0, howManyBytesToRead, _buff); //read the acceleration data from the ADXL345 int X = (((int)_buff[1]) << 😎 | _buff[0]; int Y = (((int)_buff[3]) << 😎 | _buff[2]; int Z = (((int)_buff[5]) << 😎 | _buff[4]; Serial.print("x: "); Serial.print( X ); Serial.print(" y: "); Serial.print( Y ); delay(500); } void writeTo(byte address, byte val) { Wire.beginTransmission(DEVICE); // start transmission to device Wire.write(address); // send register address Wire.write(val); // send value to write Wire.endTransmission(); // end transmission } void readFrom(byte address, int num, byte _buff[]) { Wire.beginTransmission(DEVICE); // start transmission to device Wire.write(address); // sends address to read from Wire.endTransmission(); // end transmission Wire.beginTransmission(DEVICE); // start transmission to device Wire.requestFrom(DEVICE, num); // request 6 bytes from device int i = 0; while(Wire.available()) // device may send less than requested (abnormal) { digitalWrite(RED_LED,HIGH); _buff = Wire.read(); // receive a byte i++; } Wire.endTransmission(); // end transmission }
  3. jcjc

    Problems with Energia on MSP430 LaunchPad

    Hi Marlers, I am a very new in this topic and I have the same trouble : msp430-g++: error: <name>\AppData\Local\Energia15\packages\energia\tools\msp430-gcc\4.6.5/include: No such file or directory but i don't know how changue the name of the user folder D: How resolve it? do you change the name of the folder? o move the forder of energia? Thanks!.
×