energia

Members
  • Content count

    1,116
  • Joined

  • Last visited

  • Days Won

    50

energia last won the day on October 26

energia had the most liked content!

About energia

  • Rank
    Level 4

Contact Methods

  • Website URL
    http://www.energia.nu
  1. The offending Sketch will compile with the latest version of the MSP430 core in Energia 18. There is an issue with the -g flag and floats. It seems to pull in extra code that causes the overflow. My advice would be to upgrade to Energia 18 and then update the core through the boardmanager to the latest version. Robert
  2. Below an example Sketch of how to use the watchdog peripheral with driverlib API calls. This example Sketch will stop feeding the watchdog and reboot the CC3200 after g_ulWatchdogCycles reaches the value of 10. This example was pieced together from the driverlib watchdog examples in the CC3200 SDK. #include "hw_wdt.h" #include "wdt.h" #include "utils.h" #include "prcm.h" #include "interrupt.h" #include "hw_ints.h" volatile unsigned long g_ulWatchdogCycles = 0; typedef void (*fAPPWDTDevCallbk)(); #define WD_PERIOD_MS 1000 #define SYS_CLK 80000000 #define MILLISECONDS_TO_TICKS(ms) ((SYS_CLK/1000) * (ms)) void setup() { boolean bRetcode; Serial.begin(115200); Serial.println("**************************************************"); Serial.println("* CC3200 Watchdog Test *"); Serial.println("**************************************************"); // // Set up the watchdog interrupt handler. // WDT_IF_Init(WatchdogIntHandler, MILLISECONDS_TO_TICKS(WD_PERIOD_MS)); bRetcode = MAP_WatchdogRunning(WDT_BASE); if (!bRetcode) { Serial.println("Watchdog failed to run. Shutting down"); WDT_IF_DeInit(); while (1); } } void loop() { Serial.print("Watchdog interrupt count: "); Serial.println(g_ulWatchdogCycles); delay(1000); } void WatchdogIntHandler(void) { // // After 10 interrupts, switch On LED6 to indicate system reset // and don't clear watchdog interrupt which causes system reset // if (g_ulWatchdogCycles >= 10) { MAP_UtilsDelay(800000); return; } // // Clear the watchdog interrupt. // MAP_WatchdogIntClear(WDT_BASE); // // Increment our interrupt counter. // g_ulWatchdogCycles++; } void WDT_IF_Init(fAPPWDTDevCallbk fpAppWDTCB, unsigned int uiReloadVal) { // // Enable the peripherals used by this example. // MAP_PRCMPeripheralClkEnable(PRCM_WDT, PRCM_RUN_MODE_CLK); // // Unlock to be able to configure the registers // MAP_WatchdogUnlock(WDT_BASE); if (fpAppWDTCB != NULL) { MAP_IntPrioritySet(INT_WDT, INT_PRIORITY_LVL_1); MAP_WatchdogIntRegister(WDT_BASE, fpAppWDTCB); } // // Set the watchdog timer reload value // MAP_WatchdogReloadSet(WDT_BASE, uiReloadVal); // // Start the timer. Once the timer is started, it cannot be disable. // MAP_WatchdogEnable(WDT_BASE); } void WDT_IF_DeInit() { // // Unlock to be able to configure the registers // MAP_WatchdogUnlock(WDT_BASE); // // Disable stalling of the watchdog timer during debug events // MAP_WatchdogStallDisable(WDT_BASE); // // Clear the interrupt // MAP_WatchdogIntClear(WDT_BASE); // // Unregister the interrupt // MAP_WatchdogIntUnregister(WDT_BASE); }
  3. I am not familiar with the NRF. Other might be able to help if you can point us to the library that you are using.
  4. Just to make sure, you got the first pair to work with Energia but the second pair does not seem to work. The only thing that I can think of is that you might have mixed examples AIR430BoostEuropeETSI vs AIRBoostUSAFCC. They are not compatible as they use different frequencies. You will be able to tell from the Sketch by the #inlcude for the library: #include <AIR430BoostETSI.h> and #include <AIR430BoostFCC.h>. Make sure that all Sketches #include the same header file. Robert
  5. Great to hear you got it working and thanks for checking back in.
  6. Please try the patch below for SPI.cpp. SPI.h remains unchanged. --- SPI.cpp 2017-01-09 14:11:47.000000000 -0800 +++ SPI.cpp 2017-10-04 12:13:48.000000000 -0700 @@ -197,6 +197,7 @@ transaction.txBuf = buffer; transaction.rxBuf = buffer; transaction.count = size; + transaction.arg = (void *)this; transferComplete = 0; /* kick off the SPI transaction */ @@ -263,6 +264,7 @@ transaction.txBuf = &data_out; transaction.rxBuf = &data_in; transaction.count = 1; + transaction.arg = (void *)this; transferComplete = 0; /* kick off the SPI transaction */ @@ -324,5 +326,7 @@ /* C type function */ void spiTransferCallback(SPI_Handle spi, SPI_Transaction * transaction) { - SPI.transferComplete = 1; + SPIClass *c = static_cast<SPIClass*>(transaction->arg); + + c->transferComplete = 1; }
  7. This is definitely an issue and I would classify it as a bug / oversight. I'll ask the msp432 maintainer to take a look and report back.
  8. Which LaunchPad are you using? Note that not all Serial ports will show with the same name on all boards. The example shows a port name just for illustration purposes.
  9. Correct. F_CPU configuration in boards.txt defines the clock speed the MSP430 runs at. With that said, reducing the clock speed to 8 MHz is probably not going to do much in term s of power consumption. In your Sketch try calling sleep() or sleepSeconds() instead of delay. This will put the MSP430 in it's lowers power mode. Also make sure that you are not driving any LED's etc that consume considerable power. Also for optimal power set al unused I/O's to OUTPUT HIGH in setup using pinMode(). Do this unless it is driving an LED or some other enable pin that turns on a high power consumer peripheral of course. Robert
  10. Please see the BoosterPack pinout here: http://energia.nu/pin-maps/guide_msp430g2launchpad/ PIN 4 is the TX of the Serial on the G2553. Hence your Serial stops working if you utilize this as a digital input. You have a small mistake in the Sketch. You set pin 4 as output yet you do a digitalRead() in loop. Set the pin to pinMode(x, INPUT) (replace x with a pin number) in setup(). Use a pin other than 3/4 e.g. 6. I would advice to set the input as INPUT_PULLUP e.g. pinMode(6, INPUT_PULLUP) to utilize the internal PULLUP resistor and remove the external PULLDOWN resistor. Robert
  11. hmm, it should not matter if there are multiple AP's with the same SSID. The CC3200 associates with the one with the strongest RSSI and will from thereon negotiate an IP address just as if there was only one AP. Curious if the AP only hands out IP addresses to know stations and rejects others. Either way, I have not seen this issue before. Your network admin will be able to look at the log of the DHCP server and from there on figure out what is going wrong.
  12. If you connect to that network with your PC, does your PC acquire an IP address? The reason that you are seeing 3 of them in the Serial terminal is that there are in fact 3 AP's with the SSID "forth public access". The CC3200 will list all AP's whereas your PC will only show it as one. Robert
  13. Happy to hear you got it working and thanks for reporting back.
  14. 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
  15. Unfortunately this is a know issue and there is currently no work-around for it. It will be fixed in CCS 7.3.