Search the Community

Showing results for tags 'I2C'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • News
    • Announcements
    • Suggestions
    • New users say Hi!
  • Spotlight!
    • Sponsor Spotlight
    • Sponsor Giveaways
  • Energia
    • Energia - MSP
    • Energia - TivaC/CC3XXX
    • Energia - C2000
    • Energia Libraries
  • MSP Technical Forums
    • General
    • Compilers and IDEs
    • Development Kits
    • Programmers and Debuggers
    • Code vault
    • Projects
    • Booster Packs
    • Energia
  • Tiva-C, Hercules, CCXXXX ARM Technical Forums
    • General
    • SensorTag
    • Tiva-C, Hercules, CC3XXX Launchpad Booster Packs
    • Code Vault
    • Projects
    • Compilers and IDEs
    • Development Kits and Custom Boards
  • Beagle ARM Cortex A8 Technical Forums
    • General
    • Code Snippets and Scripts
    • Cases, Capes and Plugin Boards
    • Projects
  • General Electronics Forum
    • General Electronics
    • Other Microcontrollers
  • Connect
    • Embedded Systems/Test Equipment Deals
    • Buy, Trade and Sell
    • The 43oh Store
    • Community Projects
    • Fireside Chat
  • C2000 Technical Forums
    • General
    • Development Kits
    • Code Vault
    • Projects
    • BoosterPacks

Calendars

There are no results to display.


Found 84 results

  1. Hello everyone, I'm trying to use I2C0 on tm4c1294 to communicate with rtc ds1307/ am2315 but it doesn't work. I was tried read many threads about i2c issue on tiva c with no luck. Here are one of them: Have anyone successful using I2C on tiva C (tm4c1294ncpdt)? Guide me, pls.
  2. So, this is partly for me, and partly for others who need a refresher, or just do not know how. But I will be making several post here over time on how to write very simply code, to do one thing, or another. These, used in conjunction with a shell script could be very useful / flexible. After several long talks with many people, including some here on these very forums. I've decided that using C, to communicate with hardware, or hardware interfaces is best as can be for many situations. However, when you need to run several tools all at once, and have output formatted in some fashion, or easily modified. Shell scripts are very good at that sort of thing. Read from a real-time clock This post I will make about reading from a real-time clock. I spent hours messing around code related to I2C communications, and could never get exactly what I wanted. Plus, I wanted something that output date / time that looked very similar to the date Linux command. This could definitely been done using a shell script, but code size would probably be a lot larger. Additionally, a shell script would very likely be a lot slower, as with a script, one would have to be calling external cmdline tools to perform various operations. This example code is very fast, and prints to screen immediately after issuing the command. Since this command is very simple, and only prints the formatted date / time to screen. This could very easily be called from a shell script, and formatted further if need be. The real-time clock I'm using for this demonstration is a Maxim DS3232 real-time clock which is very accurate, and also very expensive compared to other real-time clocks. At $7 + US each, it's not cheap. I also had to write my own device tree overlay for this RTC, which strictly speaking is not necessary. One can set the device up from the command line manually as demonstrated for many different RTC's on the web. In fact, all the device tree overlay that I wrote does, is set all this automatically up at boot. As far as teh actual overlay it's self. All I did was modify an existing overlay from the "official" bb-overlays repo on github. https://github.com/beagleboard/bb.org-overlays/blob/master/src/arm/BB-RTC-01-00A0.dts To look something like this: /* * Copyright (C) 2015 Robert Nelson <robertcnelson@gmail.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ /dts-v1/; /plugin/; #include <dt-bindings/board/am335x-bbw-bbb-base.h> #include <dt-bindings/gpio/gpio.h> #include <dt-bindings/pinctrl/am33xx.h> / { compatible = "ti,beaglebone", "ti,beaglebone-black", "ti,beaglebone-green"; /* identification */ part-number = "BB-RTC-01"; version = "00A0"; fragment@2 { target = <&i2c2>; __overlay__ { status = "okay"; /* shut up DTC warnings */ #address-cells = <1>; #size-cells = <0>; /* MCP79410 RTC module */ rtc@68 { compatible = "maxim,ds3232"; reg = <0x68>; }; }; }; }; On our cape, the RTC is on bus I2C-2, which is already enabled by default for capemgr. The rest of the above just means that status is okay(load the device ), the kernel module to load is called "ds3232", and the device address on the bus is 0x68. Now on to the actual C code for reading from /dev/rtc1: #include <stdio.h> #include <stdlib.h> #include <linux/rtc.h> #include <sys/ioctl.h> #include <sys/time.h> #include <sys/types.h> #include <fcntl.h> #include <unistd.h> #include <errno.h> void display_date_time(void) { struct rtc_time rtc_tm; int fd = open("/dev/rtc1", O_RDONLY); if(fd == -1){ perror("/dev/rtc"); exit(errno); } /* Read the RTC time/date */ int retval = ioctl(fd, RTC_RD_TIME, &rtc_tm); if (retval == -1) { perror("ioctl"); exit(errno); } int d = rtc_tm.tm_mday; int m = rtc_tm.tm_mon + 1; int y = rtc_tm.tm_year + 1900; const char *wdays[] = {"Sun","Mon","Tues","Wed","Thur","Fri","Sat"}; const char *mnths[] = {"Jan","Feb","Mar","Apr","May","June","July","Aug","Sept","Oct","Nov","Dec"}; int wday = (d += m < 3 ? y-- : y - 2, 23*m/9 + d + 4 + y/4- y/100 + y/400)%7; fprintf(stdout, "%s %s %02d %02d:%02d:%02d %d UTC\n", wdays[wday], mnths[rtc_tm.tm_mon], rtc_tm.tm_mday, rtc_tm.tm_hour, rtc_tm.tm_min, rtc_tm.tm_sec, y); } int main( int argc, char **argv ) { display_date_time(); return 0; } As one can see, most of this code is for formatting the output in a specific way. In this case, the output will look exactly like the output one might expect to see after issuing the command "date". However, this output is fixed to output the date / time in the UTC time zone. As for one of the projects I'm using this in is for devices spread out all over the US, in 3 different time zones, and we do not care so much what the local time zone of that system so much, as much as knowing a given time "standard". e.g. if something fails, and we need to tell a customer what failed, and what time it failed, we can, Then if we need to convert that time to their time zone, easy. Notice that the read() is handled by ioctl(). . . Output: root@wgd:~/# gcc -Wall -o read_rtc read_rtc.c root@wgd:~/# ./read_rtc Tues May 09 23:08:49 2017 UTC
  3. Hi, I have this MOSFET Power Circuitry connected to LIS3DH Accelerometer. The LIS3DH Accelerometer is connected to TI BLE CC2640R2F. The expected behaviour is if ACC_VCC is 0, it will power on the LIS3DH Accelerometer, and if ACC_VCC is 1, it will turn off the LIS3DH Accelerometer. However, if I initialize the open the I2C pins at program initialization by calling SensorI2C_open();. This is the behavior below. By normal knowledge The I2C pins connected to the LIS3DH Accelerometer should not affect the MOSFET Power Circuitry. I suspect the MOSFET Power Circuitry is wrong. Can anyone here give me tips what could be wrong. 1. Set ACC_VCC to 1, to turn off accelerometer. 2. VACC is measured at 3.2 V, which should not be. 3. Set ACC_VCC to 0, to turn on accelerometer. 4. VACC is measured at 3.2V, which is correct. Attached is the Accelerometer Circuitry..
  4. I am interfacing msp430 with rtc using i2c protocols.here is the program: WDTCTL = WDTPW + WDTHOLD; P1SEL |= BIT6 +BIT7; P1SEL2|= BIT6 +BIT7; UCB0CTL1 |= UCSWRST; UCB0CTL0 = UCMST + UCMODE_3 + UCSYNC;// I2C Master, synchronous mode UCB0CTL1 = UCSSEL_2 ; UCB0BR0 = 12; UCB0BR1 = 0; UCB0I2CSA = 0x34; UCB0CTL1 &= ~UCSWRST ; //everythingis fine upto here.scl is high here. UCB0CTL1 |= UCTR + UCTXSTT; /// here scl clock goes low. uctr=1 but uctxstt=0. any suggestions??
  5. I was wondering if anyone knows of a good read concerning implementing an I2C slave device. What I'm looking for, is something that covers kind of a high level discussion of what needs doing. Without a bunch of specification, or physical characteristic discussion. Meaning, I do not care about the electrical / physical characteristics of such a device, and I have a hard time digesting specification type books. Mostly, what I really need to know is a processor / language agnostic view of how to implement the slave addressing stuff. Such as device addresses, and register addressing. Code examples would be cool, in any language, but are not strictly speaking, necessary. Additionally, I'm also interested in implementing a slave device using the 1-wire protocol too. EDIT: Additional information, which may help someone else help me. As a hobby project, for the purpose of learning, I'm attempting to turn an MSP430G2553 into a slave device that could potentially be used as an I2C slave device that could possibly be an ADC, PWM, GPIO expander, or a combination of all mentioned plus more. However, the reading material does not necessarily have to be specific to the MSP430G2553, or any MSP430 for that matter.
  6. Hello, I am attempting to run an Arduino project on on of my TI boards. I have a Maxim 1-Wire demo board that uses an Arduino for as its platform, not having one I decided to try a TI board. I load the required Libraries but I get an interesting issue. Even though there are two OneWire and I point it to the one I want to use it only finds some header files and not others. I have tried pointing to teh needed files with exact paths with no luck. To be sure I tried complaining teh same project in the Arduino IDE and there are no issues at all, include the needed libraries and it compiles. If someone could help explain what I am missing and why it finds some library files and not others that would be great. Thanks Kas C:\Users\Kas\Desktop\energia-1.6.10E18\arduino-builder -dump-prefs -logger=machine -hardware "C:\Users\Kas\Desktop\energia-1.6.10E18\hardware" -hardware "C:\Users\Kas\AppData\Local\Energia15\packages" -tools "C:\Users\Kas\Desktop\energia-1.6.10E18\tools-builder" -tools "C:\Users\Kas\Desktop\energia-1.6.10E18\hardware\tools\msp430" -tools "C:\Users\Kas\AppData\Local\Energia15\packages" -built-in-libraries "C:\Users\Kas\Desktop\energia-1.6.10E18\libraries" -libraries "C:\Users\Kas\Documents\Energia\libraries" -fqbn=energia:msp430:MSP-EXP430F5529LP -ide-version=10610 -build-path "C:\Users\Kas\AppData\Local\Temp\builda12a5302e2fbcba7b0882b591878e19b.tmp" -warnings=default -prefs=build.warn_data_percentage=75 -verbose "C:\Users\Kas\AppData\Local\Temp\arduino_modified_sketch_976722\MAXREFDES131_GUI_Firmware.ino" C:\Users\Kas\Desktop\energia-1.6.10E18\arduino-builder -compile -logger=machine -hardware "C:\Users\Kas\Desktop\energia-1.6.10E18\hardware" -hardware "C:\Users\Kas\AppData\Local\Energia15\packages" -tools "C:\Users\Kas\Desktop\energia-1.6.10E18\tools-builder" -tools "C:\Users\Kas\Desktop\energia-1.6.10E18\hardware\tools\msp430" -tools "C:\Users\Kas\AppData\Local\Energia15\packages" -built-in-libraries "C:\Users\Kas\Desktop\energia-1.6.10E18\libraries" -libraries "C:\Users\Kas\Documents\Energia\libraries" -fqbn=energia:msp430:MSP-EXP430F5529LP -ide-version=10610 -build-path "C:\Users\Kas\AppData\Local\Temp\builda12a5302e2fbcba7b0882b591878e19b.tmp" -warnings=default -prefs=build.warn_data_percentage=75 -verbose "C:\Users\Kas\AppData\Local\Temp\arduino_modified_sketch_976722\MAXREFDES131_GUI_Firmware.ino" Using board 'MSP-EXP430F5529LP' from platform in folder: C:\Users\Kas\Desktop\energia-1.6.10E18\hardware\energia\msp430 Using core 'msp430' from platform in folder: C:\Users\Kas\Desktop\energia-1.6.10E18\hardware\energia\msp430 Detecting libraries used... "C:\Users\Kas\Desktop\energia-1.6.10E18\hardware\tools\msp430/bin/msp430-g++" -c -g -O2 -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -E -CC -mmcu=msp430f5529 -DF_CPU=16000000L -DARDUINO=10610 -DENERGIA=10610 -DENERGIA_MSP-EXP430F5529LP -DENERGIA_ARCH_MSP430 -IC:\Users\Kas\Desktop\energia-1.6.10E18\hardware\tools\msp430/include "-IC:\Users\Kas\Desktop\energia-1.6.10E18\hardware\energia\msp430\cores\msp430" "-IC:\Users\Kas\Desktop\energia-1.6.10E18\hardware\energia\msp430\variants\MSP-EXP430F5529LP" "C:\Users\Kas\AppData\Local\Temp\builda12a5302e2fbcba7b0882b591878e19b.tmp\sketch\MAXREFDES131_GUI_Firmware.ino.cpp" -o "nul" "C:\Users\Kas\Desktop\energia-1.6.10E18\hardware\tools\msp430/bin/msp430-g++" -c -g -O2 -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -E -CC -mmcu=msp430f5529 -DF_CPU=16000000L -DARDUINO=10610 -DENERGIA=10610 -DENERGIA_MSP-EXP430F5529LP -DENERGIA_ARCH_MSP430 -IC:\Users\Kas\Desktop\energia-1.6.10E18\hardware\tools\msp430/include "-IC:\Users\Kas\Desktop\energia-1.6.10E18\hardware\energia\msp430\cores\msp430" "-IC:\Users\Kas\Desktop\energia-1.6.10E18\hardware\energia\msp430\variants\MSP-EXP430F5529LP" "C:\Users\Kas\AppData\Local\Temp\builda12a5302e2fbcba7b0882b591878e19b.tmp\sketch\MAXREFDES131_GUI_Firmware.ino.cpp" -o "nul" Generating function prototypes... "C:\Users\Kas\Desktop\energia-1.6.10E18\hardware\tools\msp430/bin/msp430-g++" -c -g -O2 -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -E -CC -mmcu=msp430f5529 -DF_CPU=16000000L -DARDUINO=10610 -DENERGIA=10610 -DENERGIA_MSP-EXP430F5529LP -DENERGIA_ARCH_MSP430 -IC:\Users\Kas\Desktop\energia-1.6.10E18\hardware\tools\msp430/include "-IC:\Users\Kas\Desktop\energia-1.6.10E18\hardware\energia\msp430\cores\msp430" "-IC:\Users\Kas\Desktop\energia-1.6.10E18\hardware\energia\msp430\variants\MSP-EXP430F5529LP" "C:\Users\Kas\AppData\Local\Temp\builda12a5302e2fbcba7b0882b591878e19b.tmp\sketch\MAXREFDES131_GUI_Firmware.ino.cpp" -o "C:\Users\Kas\AppData\Local\Temp\builda12a5302e2fbcba7b0882b591878e19b.tmp\preproc\ctags_target_for_gcc_minus_e.cpp" In file included from C:\Users\Kas\Documents\Energia\libraries\OneWire-master\src\OneWire.h:37:0, from C:\Users\Kas\AppData\Local\Temp\arduino_modified_sketch_976722\MAXREFDES131_GUI_Firmware.ino:40: C:\Users\Kas\Documents\Energia\libraries\OneWire-master\src\/Masters/Masters.h:38:42: fatal error: Masters/DS248x/DS2484/DS2484.h: No such file or directory compilation terminated. exit status 1 Error compiling for board MSP-EXP430F5529LP.
  7. i'have hooked up a bme280 sensor to msp430. I have tried serveral libraries, https://github.com/finitespace/BME280/ and https://github.com/adafruit/Adafruit_BME280_Library. Though am running into the same error. error: 'NAN' has not been declared error: 'NAN' has not been declared What could be the issue? Regards.
  8. Dear 43Oh, First post in 43Oh. Please point out mistakes. I am creating sample applications for a MSP430F5538 board in Energia environment. pins_energia.h has been suitably modified and board integrated into Energia (Version 18 at this time). Sample code to get I2C working (on MPL3115A2 Pressure sensor) has been tested on the ESP12 using Arduino environment . The same code fails in Energia. Code uses only wire.h (i.e., no device specific libraries included). The code is posted below: #include <Wire.h> // for IIC communication #define WHO_AM_I 0x0C #define MPL3115A2_ADDRESS 0x60 // 7-bit I2C address void setup() { int nDevices = 0; byte error,address; Wire.begin(14,2); // Mispod-ESP 12E ///Wire.begin(); // Mispigy F5538 Serial.begin(115200); Serial.println("MPL3115A2 IIC Tester"); Serial.println("Scanning..."); address = 96; ///for(address = 1; address < 127; address++ ) { Wire.beginTransmission(address); error = Wire.endTransmission(); if (error == 0) { Serial.print("I2C device found at address 0x"); if (address<16) Serial.print("0"); Serial.print(address,HEX); Serial.println(" !"); nDevices++; } } if (nDevices == 0) Serial.println("No I2C devices found"); else Serial.println("Scan done"); } void loop() { if(IIC_Read(WHO_AM_I) == 196) { Serial.println("MPL3115A2 online!"); } else { Serial.println("No response - check connections"); } delay(3000); } byte IIC_Read(byte regAddr) { // This function reads one byte over IIC Wire.beginTransmission(MPL3115A2_ADDRESS); Wire.write(regAddr); Wire.endTransmission(false); Wire.requestFrom(MPL3115A2_ADDRESS, 1); return Wire.read(); } void IIC_Write(byte regAddr, byte value) { // This function writes one byte over IIC Wire.beginTransmission(MPL3115A2_ADDRESS); Wire.write(regAddr); Wire.write(value); Wire.endTransmission(true); } Only change in the code for the two platforms is the pin allocation (See comments in code). Address detection works fine as per code in setup(). Logic analyzer results below: ESP12E Scan Result - Mispigy F5538 Scan Result - Multibyte read fails. Results : ESP 12E Who Am I Result - Mispigy F5538 Who Am I Result - As seen, the I2C communication is different for the Energia wire library. Can someone throw some light on this behaviour? Our intent is to use the sketch transparently between the Energia based Mispigy and Arduino based ESP12E, with no tweaking of either environment. Thanks.
  9. Hello, I am having a problem using the the Wire examples in energia, master_writer and slave_receiver. I have not modified the code in the examples and just want it to transfer the information across, so that I can work on from there. The two boards are connected together with sda to sda and scl to scl, it shares a common ground and both boards have a 5V supply to the 5V pins However, every time i connect the boards and check the serial monitor on the slave board, all i see is weird unique characters. When i press reset button on the slave board, it will repeat and print the same weird character. I'm fairly new to i2c communication and would appreciate any help provided here, Thank you, Danial.
  10. Seems to me that I2C is a fairly commonly used way to communicate between MSP430G2553 and various sensors. However, I cannot seem to find a standard library that implements it. There are many home spun implementations and there doesn't seem to be a standard I2C Library. I'm VERY NEW to the embedded development world, but have been a windows programmer for 20 years. I'm used to having standard reusable libraries that do the grunt work for me so I don't have to re-invent something that has been done by others 100 times already... Am I just missing something or are all embedded developers just masochists?? Surely not.. So, does anybody know where I can find a simple I2C library that works with my MSP430G2553 in Code Composer Studio 7? Any reason why it isn't just built in? Or is it? This is a huge paradigm shift for me, so please be patient. Any help would be appreciated.
  11. I'm writing my own i2c library and need to be able to simultaneously change PinMode on 2 pins. One for SCL and one for SDA. Is there a way to change PinMode on 2 pins simultaneously? I want the behavior of the follwing: PinMode(14,OUTPUT); PinMode(15,INPUT); without the 2.5microsecond delay between the 2 calls above.
  12. So, I'm using Energia and getting frustrated with Wire.h. I need to do some i2c communications and figured it would be fairly easy to write my own Bit-Bang implementation of i2c. I got started and things seem to be working pretty well. However, I discovered the concept of OpenCollector. It seems that OpenCollector means that the pin is set to High by default with a Pullup Resister and you just set it to LOW and then it goes back to high when you're not setting it to LOW. It also goes to low when a slave i2c device sets it to LOW. Question is how the heck do we do this with Energia?? Does pinMode(INPUT) set a pin to OpenCollector mode? Does pinMode(INPUT_PULLUP) set a pin to OpenCollector mode? If either of these do, what does digitalWrite(LOW) do on that pin? It sets it to LOW, but for how long? Do you have to set it back to HIGH, or does it get pulled back up to HIGH, or does setting it to HIGH, just release the LOW pull-down? This behavior doesn't seem to be documented anywhere that is easy to find. Perhaps it's not intended to be used that way, but I don't know how a person would implement i2c correctly without being able to set the SCL and the SDA to OpenCollector mode and to be able to pulse the clock. Speaking of pulsing the clock, how is that to be accomplished? Seems like you should be able to pull it LOW and then let it go, but I'm not sure how to 'let it go' back to its HIGH state without just calling digitalWrite(HIGH) on that pin.. But then aren't I holding it high? Anyway, if somebody has a good explanation around this, I would LOVE to hear it. I found some hints about it at the following location http://energia.nu/Constants.html But it didn't use the term OpenCollector anywhere...
  13. I'm attempting to get as close to an OpenCollector PIN as I can with the MSP430G2553 Launchpad and a sensor. SCL is P1.6 and SDA is P1.7. I digital write both pins LOW and then set the PinMode on both to INPUT which should allow both pins to float HIGH. I have a 4.7K pullup resistor on each pin connecting it to 3.55v (HIGH). Is my code wrong, or is the sensor that I'm using pulling the line low? The sensor says it operates at a max of 3.7 volts. I'm using the Launchpad which measures 3.55v. Am I overloading the sensor and causing it to pull SDA to low? #define SDA P1_7 #define SCL P1_6 void setup() { Serial.begin(9600); Serial.println("Starting..."); digitalWrite(SDA, LOW); digitalWrite(SCL, LOW); pinMode(SDA, INPUT); pinMode(SCL, INPUT); delay(50); Serial.print("SDA pin - "); Serial.print(SDA); Serial.print(" - "); Serial.println(digitalRead(SDA)); Serial.print("SCL pin - "); Serial.print(SCL); Serial.print(" - "); Serial.println(digitalRead(SCL)); }
  14. So, I've read the threads and have made things work once, but now, without seeming to have changed anything, I'm getting code that goes into never-never land.. In twi.c, around line 607 in Energia version 17, I get a lockup in the first while statement: #if defined(__MSP430_HAS_USCI__) || defined(__MSP430_HAS_USCI_B0__) || defined(__MSP430_HAS_USCI_B1__) /* Ensure stop/start condition got sent before we exit. */ if(sendStop) { while (UCBxCTL1 & UCTXSTP); // end with stop condition } else { while (UCBxCTL1 & UCTXSTT); // end with (re)start condition } #endif I've been trying different recommended suggestions all over the place and had it working about 60 minutes ago, but then I tried and moved some code around and now I can't get it to work anymore... I put all the code back the way it was, and NADA... still not working... Is it just a time of day thing or am I the only one who can't seem to have any consistency in the I2C behavior...? By the way, I'm using an MSP430G2553 chip with 32 pins in the QFN configuration. I really did have this working an hour ago and cannot for the life of me figure out why it stopped working. Any hints would be GREAT.. By the way, the reason I'm not using Energia Version 18 is because it isn't supported in Code Composer Studio yet.. Anybody know when that support will appear? Thanks for any help you might have to offer, Curtis Please see my Pins_energia.h file below: /* ************************************************************************ * pins_energia.h * * Energia core files for MSP430 * Copyright
  15. Ok, so I've changed over to an MSP430G2553IRHB32R Controller. This is in the QFN 32 pin package. According to it, P1.6 is for SCL I2C and P1.7 is for SDA I2C. On the 20 pin board, they are pins 14 and 15. On the 28 pin board they are pins 22 and 23. On the 32 pin board they are pins 21 and 22. So, I'm trying to use the simple I2C Scanner and get nothing. I have 2 I2C devices attached, but cannot see either of them. There have been many posts about inserting a Wire.write(1); command and copying updated files into the system. I'm using the latest Energia 18 on a Windows 10 machine. I'm using LaunchPad 430 to program my custom board which has the MSP430G2553IRHB32R controller on it. Seems like any time I attempt to use a different board, I have problems with the Wire library. It seems to hang up during the endTransmission call. I've tried 'SetModule(0)' and that doesn't work either. I've checked the Pins_Energia.h file to make sure the pins were correct. So, all that being said, Should I keep up the battle with Wire.h, use a different I2C library, or just write my own I2C library? As I work with firmware more and more, I have a growing respect for those of you who live in that world. You guys are amazing !!! I appreciate any help you are able to offer to get the I2C working on my custom board. Thanks, Curtis
  16. I have a project using an MLX90614 that I have prototyped on an Arduino. Now I want to move to the CC3200 to add WiFi support. I've been fighting with the I2C for a few days now and could use some help. A few notes: The built-in I2C sensors (BMA222 and TMP006) work fine in the default configuration. The max speed for the MLX90614 is 100 KHz, but the default for the CC3200 is 400 KHz The MLX90614 is technically SMBus, but it works flawlessly with the Wire library on a standard Arduino. I have modified the Wire library in the hardware/cc3200 folder to call MAP_I2CMasterInitExpClk(I2C_BASE, F_CPU, false) instead of MAP_I2CMasterInitExpClk(I2C_BASE, F_CPU, true). According to the code in driverlib/i2c.c, this should cause the bus to run at 100 KHz. This change does not make the MLX90614 work, but it does cause the other two sensors (BMA222 and TMP006) stop functioning properly. (The TMP006 fails to be recognized, and the BMA222 returns incorrect data - x, y, and z all seem to show the x value or the y value... not sure which.) After searching the web and this forum, this I've gotten this far but now run into a dead end. Does anybody have experience with I2C on the CC3200 with Energia and a slower-speed bus? I'd like to avoid rewriting my project in CCS if possible. Thanks much! -Nathan
  17. Hello, I am trying to interface mlx90614 IR temperature sensor with MSP430f5529. Initially i interfaced this sensor with arduino uno without any problem. I could even fetch object and ambient temperature. But when it came to interfacing with MSP430 board using i2c. Kindly guide me for this. Regards.
  18. Hey guys. I'm learning I2C protocol and practicing with LM4F120 board, I'm using DS1307 as the I2C device. I tried to scan for the I2C device first but found I2C device at any address. I did checked my wire connection, my I2C setModule(), etc but still. This does not happen with Arduino Please help me out. Thank you Here's the code. I use Energia. i2c_scanner.ino
  19. I've been playing with Adafruit's ADXL345 accelerometer BOB and was able to import and run the Adafruit library code without any edits. Sweet...
  20. I am using the latest version: energia-0101E0017. I just reloaded it from Energia's website this morning. It is their December 2015 version. I am using the latest CCS version 6.1.3. I installed a fresh version of that a couple days ago and have applied all the updates I could find. Using the very popular I2C_Scan tool, I get bad results. I either get all addresses telling me there's a device there, or if I do a write(0); between begin and end transmission, I get no devices... See brief code snip below: void findAddress(int fromAddress, int toAddress) { for (int a = fromAddress; a < toAddress; a++) { Wire.beginTransmission(a); Wire.write(0); int endStatus = Wire.endTransmission(); if (endStatus == 0) { Serial.print("Found device at: 0x"); Serial.println(a, HEX); } } } When using Arduino with the same I2C_Scan tool, I can quickly discover my i2c device. So, can somebody let me know why this isn't working, and/or perhaps point me to a work-around? I've read many of the postings about this and have done the following: Removed jumper from LED for P1_6 Used resisters to give step-up or whatever you call it Tried it with and without the Write(0) between the begin and end transmission code above Anyway, just a bit frustrated today. I'm a spoiled Software Engineer, not used to the pain that is endured each day by firmware developers as they fight as hard against the development tools as they do against the code they write :-) Thanks, Curtis
  21. Good morning everybody, I'm Curtis, Fairly new to the world of MSP430, but VERY HAPPY that this forum exists. Energia has made my life much easier. I was about to make a hole in my wall by repeatedly bashing my head against it, but Energia removed a bunch of the minutia and provides a great abstraction layer and way of programming the MSP4230G2553 controller. See ya 'round, Curtis
  22. I have a Spikenzie Labs LCD screen with an interface (screen utilizes the HD44780 chipset). I have it connected to an MSP-EXP432P401R (Rev 1.0). I have finally got code working that allows me to write to the LCD screen through the serial monitor, however I can only write to the screen for a short but varying amount of time. Sometimes I can print to the screen for 5 seconds, sometimes only for 1 second before communication cuts out. Here is the code I am using: #include <Wire.h> #include <LiquidCrystal.h> #define addr 0x40 >> 1 void setup() { Wire.begin(); Serial.begin(9600); } void loop() { Wire.beginTransmission(addr); Wire.write(Serial.read()); Wire.endTransmission(); } My connections are as follows: LCD screen -> MSP432 VCC -> 5V GND -> GND SDA -> pin 10 SCL -> pin 9 I have also tried using a level shifting circuit on the data lines with no effect. Does anyone know what's going on and what I can do to fix this? Thank you
  23. Hello, I'm trying to get a standard 1602 LCD (16x2 from Raystar) connected to MSP432 with the I2C interface. Are there any existing libraries which could help me out? I've found some I2C libraries for Arduino but naturally they're not compatible, and the only existing Energia examples deal with CogLCD which uses a SPI interface (emerging question: is there a way to make SPI and I2C compatible?) or standard 16 pin connection. MSP432 is still a relatively fresh chip, so I can't find any examples whatsoever. Thanks!
  24. I am failing to compile some legacy Arduino projects that call Wire.setClock() (or Wire.setSpeed()). Are these unsupported in the Energia IDE library implementations? I looked but didn't find them in $\hardware\cc3200\libraries\Wire\Wire.c or Wire.h. How else to set 400kHz I2C operation (vs default 100 kHz)? --Don
  25. Hi,guys!This is my first time here.This forum seems like a very active MSP430 community.Glad to find so many MSP430 lovers. I would like to share a project I did a month ago,which is about evaluating TI's Senshub board with MSP430F5529.Well this board has lots of sensors on it,such as BMP180,MPU9150,TMP006,SHT21,ISL29023.On TI