Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by hogemark

  1. Yes, the default is to use "module 0", so if you do not call "setModule", you will use USCI_B0, and the pins you have been using until now. Being able to use both modules at the same time requires more code changes, so I want to try the approach to get support for choosing either module first, and then proceed to add support for both modules at the same time. Regards Alf
  2. Hi If someone is interested in being able to choose between using the SPI0 and SPI1 modules on Launchpad F5529, http://energia.nu/img/LaunchPadMSP430F5529.jpg, I have attempted to make changes which allows you to do so. The code is here : https://github.com/alfh/Energia/tree/feature_spi_choose_module This is based on my work to get the two I2C modules to work, it seemed pretty easy to get the same functionality enabled for SPI modules. But my changes for SPI is fully untested, I have only tested that it compiles. The reason is that I do not have any devices to test SPI with.
  3. Hi again. I've now made a new pull request, I think it is simpler, so it should be more likely to be merged into Energia. https://github.com/energia/Energia/pull/590 With this pull request, you cannot use both modules at the same time, you have to choose which one to use. So if you want to use I2C(1), i.e. USCI_B1, then do : Wire.setModule(1); Wire.begin(); If you want to use I2C(0), just do as you always have : Wire.begin(); Regards Alf Hogemark
  4. Thanks, I've made a git pull request for this now, to get the process started to get the code incorporated into the official build, https://github.com/energia/Energia/pull/398 Regards Alf
  5. Hi I think you need to add the #include "Energia.h" at the top of your sketch, as mentioned in my previos post 10. April 2014, and confirmed 11. April 2014. Regards Alf
  6. Hi Here is the sample program I've used for testing so far, testing on a F5529 Launchpad : #include "Energia.h" #include <Wire.h> #define TMP102_ADDRESS 0x48 void setup() { Serial.begin(9600); Serial.println("ready"); delay(2000); Serial.println("go"); delay(1000); Wire1.begin(); delay(1000); Serial.println("done setup"); } void loop() { Serial.println("start reading"); Wire1.beginTransmission(TMP102_ADDRESS); Wire1.requestFrom(TMP102_ADDRESS, 2); int16_t t=(Wire1.read() << 8 | Wire1.read()) >> 4; Wire1.endTransmission(); Seri
  7. Hi Finally, I have working code that allows me to use Wire1 for using the USCI_B1 module, and Wire for using the USCI_B0 module. The code is here : https://github.com/alfh/Energia/tree/feature_i2c_uscb1 I still need to clean up the code, and do more initial testing, I have now just got it to work in my sample program, to use Wire1 for accessing the USCI_B1. I am also confident that it will work using Wire in the same sample program for accessing the USCI_B0, but I have not tested that yet. The code will also need review by experts.. I know some simple optimizations can be mad
  8. Hi again I've tried to pursue option 1. and 2. above, but the I2C code in driverlib for Tiva and MSP430 are quite different, and my driverlib and i2c skills are not good enough, so I am abandoning those options. I think I will now pursue option 4. I've come a few steps further today. I use CCSv6 for debugging, it is useful. But debugging the port mapping setting proved to be difficult. At least until I found out that when running the debugger and stepping through, the port mapping register would always turn back to read-only before the code was able to manipulate the registers
  9. Hi I have now looked into the I2C implementation for Tiva in Energia, and investigated DriverLib for MSP430, which is only supported for 5x and 6x devices as of now. The Tiva implementation seems to rely less on interrupts, and the code seems simpler and cleaner. After doing some more investigation, I see the following alternatives for implementing support for having multiple I2C modules active on the MSP430 in Energia. 1. Make a TwoWire class for MSP430, inspired by the Tiva TwoWire class in Energia, and use DriverLib for the implementation for 5x and 6x devices. Just leave the current Wi
  10. CCSv6 has two compilers, TI's own compiler and GCC 4.8.0 for MSP430, which is developed by Redhat. When you import a Energia sketch into CCS, CCS will use the gcc compiler (version 4.6) which is part of Energia to do the build. I used CCSv6 this weekend to debug my Energia sketch using I2C, and it was very helpful. But I saw some problems when using the debugger, and have posted to the CCSv6 forum at TI (http://e2e.ti.com/support/development_tools/code_composer_studio/f/81/t/329738.aspx?pi296443=1), and have some ongoing discussion there, where there are suggestions that the strangeness o
  11. Hi again I've now pushed my latest code to GitHub, https://github.com/alfh/Energia/tree/feature_i2c_uscb1. So using this code, I can use a #define to choose if I want to use USCI_B0 and USCI_B1 module. The code it still not ready to be merged. I need to figure out how to handle the "port map controller" code in wiring_digital.c, as of now I've had to comment that code out in order for my code to work. And I want to be able to use both modules at the same time, so I guess more code restructuring is needed for that. I would appreciate feedback on how you think support for more th
  12. What about Linux ? It seems like the libmsp430.so file on Energia is 64-bit, while on the CCS6beta4 that I have, it's 32-bit. ccs6/ccsv6/ccs_base/DebugServer/drivers/libmsp430.so libmsp430.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, not stripped energia-0101E0012/hardware/tools/msp430/bin/libmsp430.so libmsp430.so: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked, BuildID[sha1]=0x491eb4dd8b6126e9981db52d231815149f12a7d3, not stripped Where can I get the 64bit libmsp430.so from for CCSv6 ? Regards Alf
  13. Hi Reading http://www.ti.com/lit/ug/slau533a/slau533a.pdf should give you answers, it has some pages on power sources. I was struggling with the same issue, but got it to work. You have to remove some of the headers, I think it was the "SBW*" ones, but read the pdf, and report back exactly what pin headers you had to report. Alf
  14. Finally, got it to work ! I now have USCI_B1 working in Energia on F5529 Launchpad... The problem is actually happening in wiring_digital.c in the method "pinMode_int", and is related to the port map controller for port4. I noticed that my standalone driverlib example did not do any work against the port map controller. When debugging the energia code, I could not see that the wiring_digital made any changes to the PortMap4 controller, except for presenting the password and unlocking the port map controller for a brief moment. But it does not seem to change the config for the P4.1 and P
  15. Ok, after reading the datasheet for F5529 and the family guide, I am pretty sure I know the reason. For port 4.1 and 4.2 for USCI_B1, I have to use the port map controller to set up the ports correctly. I'll investigate more, and let you know the results. Alf
  16. Hi Some more progress. I got it to work once more in the debugger. But thereafter not. And now I notice that when it does not work, after the "Wire.begin" has been executed, the UCB1STAT says "UCBBUSY" == 1. When it worked the one time in the debugger, the "UCBBUSY" was not 0. I set the pin 9/10 (for USCI_B1) in the same way as pin 14/15 (for USCI_B0). Could it be something floating ? (I have external pullup, and the setup works fine with the standalone driverlib example). The bus is signalled as busy right after enabling by doing "UCBxCTL1 &= ~(UCSWRST)" : " UCBxBR0 = (un
  17. Hi again I've spent the day debugging this. I've used CCS6 beta4, I have imported my Energia sketch there. To me there seems to be some bugs in the i2c "state machine" implementation in Energia. When I developer a pure CCS6 project using the msp430 driverlib, I get both the USCI_B0 and USCI_B1 to work. Using the debugger in CCS6, I have learned about I2C today, and I think the debugger is showing me what happens, although I have observed some hiccups in debugger GUI, so I am not sure if I should fully trust it. I am just trying to write "0b00000000" to the TMP102 sensor, by doin
  18. Hi I've now got a working driverlib example, where I2C master send is working for both UCSI_B0 and UCSI_B1, sending data to a TMP102 temperature sensor. The code is here : https://github.com/alfh/Energia/commit/5c565e6430398633ccb436d38b01752a254f8a60 Unfortunately, I am not skilled enough to get the I2C master read, reading the temperature from the TMP102, to work, so I cannot use my driverlib example to confirm that I am able to use I2C to read temperature from TMP102. I am a bit unsure on what slave address to use when receiving data from TMP102. The problem seems to be that I never
  19. Hi, and thanks for your review. Are you referring to this construct {code} #if defined(__MSP430_HAS_USCI__) /* Set I2C state change interrupt mask */ UCB0I2CIE |= (UCALIE|UCNACKIE|UCSTTIE|UCSTPIE); /* Enable state change and TX/RX interrupts */ UC0IE |= UCB0RXIE | UCB0TXIE; #else /* Set I2C state change interrupt mask and TX/RX interrupts */ UCBxIE |= (UCALIE|UCNACKIE|UCSTTIE|UCSTPIE|UCRXIE|UCTXIE); #endif {code} As I understand it, the MSP430's having only "__MSP430_HAS_USCI__", does not have "__MSP430_HAS_USCI_B0__" or "__MSP430_HAS_USCI_B1__", at least that i
  20. Hi I want to be able to use the second I2C module on my F5529 Launchpad. My project works fine with the default module 0, USCI_B0, using Energia. But I want to also use the CC3000 Wifi module, and that seems to be using the USCI_B0 for SPI. Therefore I think the simplest thing would be to enable support for the USCI_B1 in Energia. I've spent some time now, and have done all the code changes needed, as far as I can see. I've pushed my code to https://github.com/alfh/Energia/tree/feature_i2c_uscb1, the changes are here : https://github.com/alfh/Energia/compare/feature_i2c_uscb1?exp
  21. Hi I am using both a Lanuchpad with G2553, and the new Launchpad with F5529 with the Air BoosterPack CC110L, I am using the European version, and I am using Energia 10 release. It is working fine for me. Have you tried the example provided with the library for the Air Boosterpack : https://github.com/energia/Energia/blob/master/hardware/msp430/libraries/AIR430BoostUSAFCC/examples/WirelessTest/WirelessTest.ino Note that this example has the following setup method : " void setup() { // The radio library uses the SPI library internally, this call initializes // SPI/CSn and
  22. Thank you, graham72, I've now tested your code, and it gives me the temperature 21 degC, and the room temperature is 20 degC measured by another thermometer. So using the TLV seems to give fairly correct room temperatures. I see that the header file for the 5529 has the following #define __MSP430_HAS_TLV__ /* Definition to show that Module is available */ #define TLV_START (0x1A08) /* Start Address of the TLV structure */ .. #define TLV_ADCCAL (0x11) /* ADC12 calibration */ #define TLV_ADC12CAL (0x11) /* ADC12 calibration */
  23. Hi I am trying to use Energia and the example for using the internal temperature sensor, https://github.com/energia/Energia/blob/master/examples/3.Analog/AnalogInput_InternalThermometer_430/AnalogInput_InternalThermometer_430.ino Right now, I have the example running, and the raw value I get from the ADC12 in the MPS430 5529 is about 2100, which according to the formula from http://ece.wpi.edu/courses/ece2049smj/lecture15_A12.pdf " // These steps convert the ADC reading to degrees Celsius // Sensor spec = 3.55 mV/C deg and 986 mV = 0 Celsius // There are 1.5V/4096 counts = 0.3
  • Create New...