energia

Members
  • Content count

    1,104
  • Joined

  • Last visited

  • Days Won

    47

energia last won the day on July 18

energia had the most liked content!

About energia

  • Rank
    Level 4

Contact Methods

  • Website URL
    http://www.energia.nu
  1. Happy to hear you got it working and thanks for reporting back.
  2. I am actually looking into this CCS issue right now. This issue will be fixed with a new msp432r-core update early next month. Below is how to work-around it with the current core: Assuming you know where to find the msp432r core on your system. Replace the existing boards.txt file with the one attached. Edit msp432r/4.9.1/cores/msp432/ti/runtime/wiring/WMath.cpp and comment out: // extern long random(void); // extern void srandom(unsigned long __seed); Rename msp432r/4.9.1/cores/msp432/ti/runtime/wiring/msp432/wiring_analog.c to msp432r/4.9.1/cores/msp432/ti/runtime/wiring/msp432/wiring_analog_msp432.c Delete msp432r/4.9.1/cores/msp432/ti/runtime/wiring/random.c You might have to delete any existing MSP432 cores from the CCS project explorer. When doing so, make sure that you tick the box in the remove dialog to remove it from disk. Reimport your Sketch into CCS. You might have to remove your existing project so that CCS does not complain about it already existing. Robert boards.txt
  3. Unfortunately this is a know issue and there is currently no work-around for it. It will be fixed in CCS 7.3.
  4. Thanks for the detailed report. I am not sure if I can relate any of these to the way we have implemented analogRead() since it is pretty straight forward and pretty much copies how the ADC driverlib examples configure the ADC. Of course, we could have a bug somewhere that I missed during review/testing. If you have a simple example Sketches that I can use to reproduce issues, then please attach them and I'll look into them. One thing to note is that to be "Arduino compatible" we have set the default ADC resolution to 10 bits as per Arduino API specification (https://www.arduino.cc/en/Reference/AnalogRead). We do set the resolution of the conversion to 14 bit and then shift the result to be 10 bits. You can change the "shift" and therefor the resolution of what analogRead() returns by calling analogReadResolution() e.g. analogReadResolution(14) to have analogRead() return the full 14 bit result. Hope this helps. Robert
  5. Thank you for the feedback! I just realized that this entire page is quite out of date and needs to be updated. Robert
  6. What is the oddness that you were seeing that led you to this investigation? The datasheet indeed states that the ADC14CLK should not exceed 25 MHz. With that knowledge, the implementation of analogWrite() is indeed wrong. Instead it should be set to ADC_CLOCKSOURCE_ADCOSC which is MODCLK with a 25-MHz typical frequency. With that said, the msp432r core (which is for the RED LaunchPad only) uses the TI-RTOS ADC driver. That driver sets it to ADC_CLOCKSOURCE_ADCOSC/1/1 correctly. I will look into getting a fix out for the legacy msp432 core. To solve your issue, the question is if you have a RED or BLACK board. If you have a RED board, then I would advice to get the MSP432 EMT RED Board package using the board manager. If you have the BLACK board then I advice to work-around it until the update is release by replacing ADC_CLOCKSOURCE_MCLK with ADC_CLOCKSOURCE_ADCOSC. Robert
  7. Please also see the comment here I posted here on github here: https://github.com/energia/Energia/issues/569#issuecomment-316120507 Copy of that post: "VLO has a typical frequency of 12kHz hence this is the value used in the code for vlo_freq. With that said, VLO, as per datasheet, has a minimal value of 4kHz and a maximum value of 20kHz. The frequency it settles on varies by part, temperature, power supply, etc. Hence it can end up anywhere between 4 kHz and 20 kHz. Unfortunately there is no way to measure the VLO Freq. on startup. If you would like accurate sleep times then I suggest that you install the 32kHz watch crystal that came with the LaunchPad in the box. Also see this thread for additional information about the sleep() and sleepSeconds() implementation: http://forum.43oh.com/topic/4571-building-low-power-into-energia/?page=2#comment-46495"
  8. I would suggest to create your own variant in the variant directory. Then add that variant to board.txt which will make it available in the Energia boards menu. Be carful with directly modifying the core. If you install a core update through the board manager, you will loose all your modifications. A better way but more complex would be to create your own installable light weight package. Here is an example of a lightweight TivaC package that I put together a while ago. The downside is that you will have to be able to host the .json file somewhere so that you can point Energia to it in the preferences->Additional Boards Manager URLs. http://energia.nu/packages/package_wrigley_index.json Robert
  9. Thanks @Clavier for the explanation.To add to this. The VLO is only used if the startup code does not detect an external crystal to source ACLK from. @tapasxplore Note that the MSP430 max VCC is rated @ 3.6. Robert
  10. Below is a guide to get up and running with Energia BLE / Evothings Evothings for controlling your LaunchPad over BLE with a custom app on your mobile device: I have put together an app that allows to control of the RGB LED and Buttons exposed in the BLEInputOutput Sketch running on the MSP432 LaunchPad. At this moment it only runs on an MSP432 LaunchPad. Other LaunchPad's have bot been tested. To run the APP and control the LaunchPad follow the instructions below. You might have to upgrade the BoosterPack’s firmware. The firmware on my BoosterPack was not the right one so yours might not be as well. If you have issues running the app, then refer to updating the BoosterPack section below. Below is a screenshot of the app that I put together using Evothings to control the BLEInputOutput Sketch running on iOS. Running the APP on your mobile device: 1: Seat the CC2650 BoosterPack on the MSP432 LaunchPad 2: You will need the latest BLE library for crucial updates and new example Sketches. Get it from: https://github.com/ti-simplelink/ble_energia 3: Put the BLE folder in your person Energia/libraries directory just as you would install any other library. 4: Run Energia and open the example BLE->BLEInputOutput Sketch. 5: Verify and upload the Sketch 4: On your phone, download the Evothings Viewer from the app store. There is one for iOS and Android. 5: Open the app and then in the “Enter connect key” enter http://energia.nu/ble/bleinputoutput/ 6: Click connect. 7: The Energia BLE app should now open in the viewer. 8: Click he start button and the status should change to “Status: Connected” 9: You can now change the RGB sliders and you should see the LED’s on the LP match 10: Pressing the buttons will change the text for each button from “released” to “pressed”. Upgrading the CC2650 BoosterPack: The firmware on your BoosterPack might not be the right one. If you are experiencing issues with running the app, you might have to upgrade the firmware on your CC2650 BoosterPack. We are working on making this cross platform and to accomplish for Energia users. For now Smart RF Flash Programmer 2 has to be used on a windows PC. 1: Download Smart RF Flash Programmer 2 2: Remove JTAG headers from MSP432 LP (TDI, TDO, TCK, TMS) 3: Remove the BoosterPack from the LaunchPad (you will need a RED MSP432 LaunchPad) 4: Attach 10 pin ARM ribbon cable (included in the BoosterPack box) to XDS110 header on the emulation side of the MSP432 LaunchPad. Attach other end to CC2650 BP. It is keyed so there is only one way to attach it. 5: Get the SNP images from this link: http://software-dl.ti.com/dsps/forms/self_cert_export.html?prod_no=ble_2_02_simple_np_setup.exe&ref_url=http://software-dl.ti.com/lprf/BLE-Simple-Network-Processor-Hex-Files 6: Once installed, find the image simple_np_cc2650bp_uart_pm_xsbl.hex 7: Plug the LP into your computer. 8: Launch Smart RF Flash Programmer 2. 9: The CC2650 should show up in the left pane titled “Connected Devices” 10: Right click the CC2650 and select connect. The status bar should say “Success!” when finished connecting. 11: On the “Main” tab, in the “Flash Image” field select single and then browse to the simple_np_cc2650bp_uart_pm_xsbl.hex image. 12: Still on the main tab, under the header “Actions” check “Erase”, “Program” and “Verify”. 13: Then click the Green Arrow image on the right bottom to program the image. 14: Remove the ribbon cable, replace the JTAG headers and reseat the BoosterPack. You are now good to go to run the Sketch/App.
  11. I replied to your post on e2e here: https://e2e.ti.com/support/wireless_connectivity/simplelink_wifi_cc31xx_cc32xx/f/968/p/609092/2243042#2243042
  12. Energia does not implement an API for UART TX/RX interrupt callback. You could however easily modify HardwareSerial.cpp/.h and insert an optional hardware callback. I would add a function e.g. HardwareSerial::attachTxInterrupt(void (*userFunc)(void)) / HardwareSerial::attachRxInterrupt(void (*userFunc)(void)). Use attachInterrupt(void (*userFunc)(void)) in WInterrupts.c as an example. Add the TX and RX userFunc as a private member in HardwareSerial.h. Then in the tx/rx ISR check if the a function has been registered, if so call it.
  13. Try Wire.setModule(0) before calling Wire.begin(). Reason is that the standard changed for the wire pins from ping 14/15 to pin 9/10 a while back. You are better off using pins 14/15 on the G2553 though since Wire on pins 9/10 is a software implementation. So use Wire.setModule() before Wire.begin() to allocate Wire to the hardware supported I2C pins.
  14. Not sure what Arduino / Wiring's behaviour is but the MSP430 and other cores should match that. For that reason I have filed a bug / question to keep track of this: https://github.com/energia/msp430-lg-core/issues/42
  15. The PWM frequency is fixed at 490 Hz as per Wiring / Arduino spec. It is not possible to change that frequency through an API. The MSP430 does implement analogResolution() but this is not an official API and hence not available for the MSP432 nor TivaC boards.