offbeatmammal 0 Posted January 8, 2016 Share Posted January 8, 2016 I am using a CC3200 LaunchPadXL and want to control the green and orange LEDs as well as access the on-board temperature sensor. It appeared not possible, if I2C is used. In LAUNCHXL LEDs are wired to the same lines as onboard jumpers for I2C SCL and SDA lines. I found a reference that seemed to indicate on a CC3200 other pins can be used for I2C and in the example they edited the file pinmux.c MAP_PinTypeI2C(PIN_05, PIN_MODE_5); //I2C SCL MAP_PinTypeI2C(PIN_04, PIN_MODE_5); //I2C SDA I tried adding those lines to my Energia setup() {...} but it didn't seem to help I tried removing the jumpers (J2 and J3) as per another suggestion but then the code appears not to run on the device at all Quote Link to post Share on other sites
chicken 630 Posted January 8, 2016 Share Posted January 8, 2016 Did you already check out the Wire.SetModule() command? This should allow you to select between the two I2C channels (pins 9/10 or 39/40 according to the pin map). offbeatmammal 1 Quote Link to post Share on other sites
offbeatmammal 0 Posted January 8, 2016 Author Share Posted January 8, 2016 Ah, there seems to be no mention of that in the Wire library reference - http://energia.nu/reference/wire/- can you point me to the parameter I would need to swap them (meantime I will go trawling Bing some more...) Thanks! Quote Link to post Share on other sites
chicken 630 Posted January 8, 2016 Share Posted January 8, 2016 Seems to be a gap in the documentation of both Energia and the CC3200 pin map ( @@energia ). The parameter n for setModule(n) is the module number, starting at 0. I'd try the numbers of the serial port (RX/TX) that share pins with I2C. offbeatmammal 1 Quote Link to post Share on other sites
offbeatmammal 0 Posted January 8, 2016 Author Share Posted January 8, 2016 hmmm. adding a Wire.setModule(0); to my setup() gives the following error: obm_01.cpp.o: In function `setup': obm_01.cpp:(.text.setup+0x6): undefined reference to `TwoWire::setModule(unsigned long)' collect2: error: ld returned 1 exit status looking at the source in https://github.com/energia/Energia/tree/master/libraries/Wire there doesn't appear to be a setModule function defined, and there was a discussion (back in 2013) that didn't seem to go anywhere - https://github.com/energia/Energia/issues/285 am I missing something obvious (see "noob class" label!) or should I file a bug and hope we can get a fix (cc @@energia )? Quote Link to post Share on other sites
energia 485 Posted January 8, 2016 Share Posted January 8, 2016 setModule is not available for CC3200. There is only one I2C peripheral. Below is the answer to your question I just posted on e2e: "Unfortunately there are not a lot of options here. The is only 1 I2C peripheral and not all pins are brought out to the LaunchPad headers. 1: pin 1/2 are the default and routed to pins 9/10 of the BoosterPack header. 2: pin 3/4 are already connected to TX/RX of the UART which is pins 3/4 of the BoosterPack header and connected to the FTDI chip. You could potentially give up the UART (Serial) and use these pins for I2C. Energia however is not setup to use these pins for I2C and you would have to modify the Wire library to enable them. 3: pin 5/6 could be an option but then you would give up SPI since SPI CLK is on pin 7 of the BoosterPack header. Same as 2, this would require modification of the Wire library. 4: pin 16/17 are JTAG" Robert offbeatmammal 1 Quote Link to post Share on other sites
offbeatmammal 0 Posted January 8, 2016 Author Share Posted January 8, 2016 Thanks (for reply here and on e2e). So essentially I am out of luck... Either the LEDs keep glowing, or I have to use an off-board temp sensor and pull the jumpers? If there is a way to do it with Energia just while I am playing around D it would be great, as then I can actually use the three lights in a more meaningful way... Quote Link to post Share on other sites
energia 485 Posted January 11, 2016 Share Posted January 11, 2016 Unfortunately there is no way to use the onboard sensors and the LED's at the same time. Quote Link to post Share on other sites
offbeatmammal 0 Posted January 11, 2016 Author Share Posted January 11, 2016 thanks guess it's time to work out how to attach something to the Launchpad so I can control my own LEDs Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.